1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef __NSGUI_H__
20 #define __NSGUI_H__
21
22
23 #ifdef __OBJC__
24
25 #ifdef NS_IMPL_COCOA
26 #ifdef Z
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."
28 #endif
29 #define Cursor FooFoo
30 #endif
31
32 #undef verify
33
34 #import <AppKit/AppKit.h>
35
36 #ifdef NS_IMPL_COCOA
37 #undef Cursor
38 #endif
39 #import <Foundation/NSDistantObject.h>
40
41 #ifdef NS_IMPL_COCOA
42 #include <AvailabilityMacros.h>
43 #endif
44
45 #endif
46
47 #undef verify
48 #undef _GL_VERIFY_H
49 #include <verify.h>
50
51
52 typedef struct _XCharStruct
53 {
54 int rbearing;
55 int lbearing;
56 int width;
57 int ascent;
58 int descent;
59 } XCharStruct;
60
61 #ifdef __OBJC__
62 typedef id Emacs_Pixmap;
63 #else
64 typedef void *Emacs_Pixmap;
65 #endif
66
67 #ifdef __OBJC__
68 typedef NSCursor *Emacs_Cursor;
69 #else
70 typedef void *Emacs_Cursor;
71 #endif
72
73 typedef int Window;
74
75 #ifndef __OBJC__
76 #if defined (__LP64__) && __LP64__
77 typedef double CGFloat;
78 #else
79 typedef float CGFloat;
80 #endif
81 typedef struct _NSPoint { CGFloat x, y; } NSPoint;
82 typedef struct _NSSize { CGFloat width, height; } NSSize;
83 typedef struct _NSRect { NSPoint origin; NSSize size; } NSRect;
84 #endif
85
86 #define NativeRectangle NSRect
87
88 #define CONVERT_TO_EMACS_RECT(xr, nr) \
89 ((xr).x = (nr).origin.x, \
90 (xr).y = (nr).origin.y, \
91 (xr).width = (nr).size.width, \
92 (xr).height = (nr).size.height)
93
94 #define CONVERT_FROM_EMACS_RECT(xr, nr) \
95 ((nr).origin.x = (xr).x, \
96 (nr).origin.y = (xr).y, \
97 (nr).size.width = (xr).width, \
98 (nr).size.height = (xr).height)
99
100 #define STORE_NATIVE_RECT(nr, px, py, pwidth, pheight) \
101 ((nr).origin.x = (px), \
102 (nr).origin.y = (py), \
103 (nr).size.width = (pwidth), \
104 (nr).size.height = (pheight))
105
106
107
108
109
110 #define ForgetGravity 0
111 #define NorthWestGravity 1
112 #define NorthGravity 2
113 #define NorthEastGravity 3
114 #define WestGravity 4
115 #define CenterGravity 5
116 #define EastGravity 6
117 #define SouthWestGravity 7
118 #define SouthGravity 8
119 #define SouthEastGravity 9
120 #define StaticGravity 10
121
122 #define NoValue 0x0000
123 #define XValue 0x0001
124 #define YValue 0x0002
125 #define WidthValue 0x0004
126 #define HeightValue 0x0008
127 #define AllValues 0x000F
128 #define XNegative 0x0010
129 #define YNegative 0x0020
130
131 #define USPosition (1L << 0)
132 #define USSize (1L << 1)
133
134 #define PPosition (1L << 2)
135 #define PSize (1L << 3)
136 #define PMinSize (1L << 4)
137 #define PMaxSize (1L << 5)
138 #define PResizeInc (1L << 6)
139 #define PAspect (1L << 7)
140 #define PBaseSize (1L << 8)
141 #define PWinGravity (1L << 9)
142
143 #endif