1 /* Definitions and headers for communication on the NeXT/Open/GNUstep API.
2 Copyright (C) 1995, 2005, 2008 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 /* this gets included from a couple of the plain (non-NS) .c files */
27 #warning "Z is defined. If you get a later parse error in a header, check that buffer.h or other files #define-ing Z are not included."
31 #endif /* NS_IMPL_COCOA */
33 #ifdef NS_IMPL_GNUSTEP
37 #import <AppKit/AppKit.h>
39 #ifdef NS_IMPL_GNUSTEP
40 #define hash_remove emacs_hash_remove
45 #define init_process emacs_init_process
46 #endif /* NS_IMPL_COCOA */
47 #import <Foundation/NSDistantObject.h>
50 #include <AvailabilityMacros.h>
51 #endif /* NS_IMPL_COCOA */
57 #define free_widget_value(wv) xfree (wv)
58 #define malloc_widget_value() ((widget_value *) memset (xmalloc \
59 (sizeof (widget_value)), 0, sizeof (widget_value)))
61 /* Emulate XCharStruct. */
62 typedef struct _XCharStruct
71 /* 23: Fake tructure from Xlib.h to represent two-byte characters. */
73 typedef unsigned short unichar
;
75 typedef unichar XChar2b
;
77 #define STORE_XCHAR2B(chp, b1, b2) \
78 (*(chp) = ((XChar2b)((((b1) & 0x00ff) << 8) | ((b2) & 0x00ff))))
80 #define XCHAR2B_BYTE1(chp) \
81 (((*chp) & 0xff00) >> 8)
83 #define XCHAR2B_BYTE2(chp) \
86 #define FACE_DEFAULT (~0)
89 /* PENDING: xfaces requires these structures, but the question is are we
90 forced to use them? */
91 typedef struct _XGCValues
104 typedef XGCValues
* GC
;
106 #define GCForeground 0x01
107 #define GCBackground 0x02
113 typedef void *Pixmap
;
117 typedef NSCursor
* Cursor
;
119 typedef void *Cursor
;
122 #define No_Cursor (0)
125 typedef NSColor
* Color
;
127 typedef void * Color
;
133 typedef Lisp_Object XrmDatabase
;
136 /* 23: some sort of attempt to normalize rectangle handling.. seems a bit much
137 for what is accomplished */
140 unsigned width
, height
;
144 typedef struct _NSPoint
{ float x
, y
; } NSPoint
;
145 typedef struct _NSSize
{ float width
, height
; } NSSize
;
146 typedef struct _NSRect
{ NSPoint origin
; NSSize size
; } NSRect
;
149 #define NativeRectangle struct _NSRect
151 #define CONVERT_TO_XRECT(xr, nr) \
152 ((xr).x = (nr).origin.x, \
153 (xr).y = (nr).origin.y, \
154 (xr).width = (nr).size.width, \
155 (xr).height = (nr).size.height)
157 #define CONVERT_FROM_XRECT(xr, nr) \
158 ((nr).origin.x = (xr).x, \
159 (nr).origin.y = (xr).y, \
160 (nr).size.width = (xr).width, \
161 (nr).size.height = (xr).height)
163 #define STORE_NATIVE_RECT(nr, px, py, pwidth, pheight) \
164 ((nr).origin.x = (px), \
165 (nr).origin.y = (py), \
166 (nr).size.width = (pwidth), \
167 (nr).size.height = (pheight))
172 /* This stuff needed by frame.c. */
173 #define ForgetGravity 0
174 #define NorthWestGravity 1
175 #define NorthGravity 2
176 #define NorthEastGravity 3
177 #define WestGravity 4
178 #define CenterGravity 5
179 #define EastGravity 6
180 #define SouthWestGravity 7
181 #define SouthGravity 8
182 #define SouthEastGravity 9
183 #define StaticGravity 10
185 #define NoValue 0x0000
186 #define XValue 0x0001
187 #define YValue 0x0002
188 #define WidthValue 0x0004
189 #define HeightValue 0x0008
190 #define AllValues 0x000F
191 #define XNegative 0x0010
192 #define YNegative 0x0020
194 #define USPosition (1L << 0) /* user specified x, y */
195 #define USSize (1L << 1) /* user specified width, height */
197 #define PPosition (1L << 2) /* program specified position */
198 #define PSize (1L << 3) /* program specified size */
199 #define PMinSize (1L << 4) /* program specified minimum size */
200 #define PMaxSize (1L << 5) /* program specified maximum size */
201 #define PResizeInc (1L << 6) /* program specified resize increments */
202 #define PAspect (1L << 7) /* program specified min, max aspect ratios */
203 #define PBaseSize (1L << 8) /* program specified base for incrementing */
204 #define PWinGravity (1L << 9) /* program specified window gravity */
206 #endif /* __NSGUI_H__ */
208 /* arch-tag: b2af3275-62c3-45b4-9335-4c9635c67e55
209 (do not change this comment) */