Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 210 lines (165 sloc) 5.43 kB
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
1 /* Definitions and headers for communication on the NeXT/Open/GNUstep API.
72fadaa @rgmorris Add 2012 to FSF copyright years for Emacs files (do not merge to trunk)
rgmorris authored
2 Copyright (C) 1995, 2005, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
3
4 This file is part of GNU Emacs.
5
58c94c2 @rgmorris Switch to recommended form of GPLv3 permissions notice.
rgmorris authored
6 GNU Emacs is free software: you can redistribute it and/or modify
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
7 it under the terms of the GNU General Public License as published by
58c94c2 @rgmorris Switch to recommended form of GPLv3 permissions notice.
rgmorris authored
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
10
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.
15
16 You should have received a copy of the GNU General Public License
58c94c2 @rgmorris Switch to recommended form of GPLv3 permissions notice.
rgmorris authored
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
18
19 #ifndef __NSGUI_H__
20 #define __NSGUI_H__
21
22 /* this gets included from a couple of the plain (non-NS) .c files */
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 /* Z */
29 #define Cursor FooFoo
30 #undef init_process
31 #endif /* NS_IMPL_COCOA */
32
33 #import <AppKit/AppKit.h>
34
5a911b5 @davidswelt Provide printing and page setup dialogs.
authored
35 #if NS_IMPL_COCOA
36 // for PDFView
37 //#import "/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/PDFKit.framework/Versions/A/Headers/PDFView.h"
38 #import <Quartz/Quartz.h>
39 #import <WebKit/WebKit.h>
40 #endif
41
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
42 #ifdef NS_IMPL_COCOA
43 #undef Cursor
44 #define init_process emacs_init_process
45 #endif /* NS_IMPL_COCOA */
46 #import <Foundation/NSDistantObject.h>
47
48 #ifdef NS_IMPL_COCOA
49 #include <AvailabilityMacros.h>
50 #endif /* NS_IMPL_COCOA */
51
52 #endif /* __OBJC__ */
53
54
55 /* menu-related */
56 #define free_widget_value(wv) xfree (wv)
57 #define malloc_widget_value() ((widget_value *) memset (xmalloc \
58 (sizeof (widget_value)), 0, sizeof (widget_value)))
59
60 /* Emulate XCharStruct. */
61 typedef struct _XCharStruct
62 {
63 int rbearing;
64 int lbearing;
65 int width;
66 int ascent;
67 int descent;
68 } XCharStruct;
69
c7f6187 Remove '23' comments that indicated code added during update from ema…
Adrian Robert authored
70 /* Fake tructure from Xlib.h to represent two-byte characters. */
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
71 #ifndef __OBJC__
72 typedef unsigned short unichar;
73 #endif
74 typedef unichar XChar2b;
75
76 #define STORE_XCHAR2B(chp, b1, b2) \
77 (*(chp) = ((XChar2b)((((b1) & 0x00ff) << 8) | ((b2) & 0x00ff))))
78
79 #define XCHAR2B_BYTE1(chp) \
80 (((*chp) & 0xff00) >> 8)
81
82 #define XCHAR2B_BYTE2(chp) \
83 ((*chp) & 0x00ff)
84
85
66b0a86 NS cleanup: change 'PENDING' to 'FIXME'/'TODO'/'XXX'
arobert authored
86 /* XXX: xfaces requires these structures, but the question is are we
87 forced to use them? */
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
88 typedef struct _XGCValues
89 {
52c184a clear warnings and clean up NS port
Adrian Robert authored
90 unsigned long foreground;
91 unsigned long background;
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
92 #ifdef __OBJC__
93 struct ns_font *font;
94 #else
95 void *font;
96 #endif
97 } XGCValues;
98
99 typedef XGCValues * GC;
100
101 #define GCForeground 0x01
102 #define GCBackground 0x02
103 #define GCFont 0x03
104
105 #ifdef __OBJC__
106 typedef id Pixmap;
107 #else
108 typedef void *Pixmap;
109 #endif
110
111 #ifdef __OBJC__
112 typedef NSCursor * Cursor;
113 #else
114 typedef void *Cursor;
115 #endif
116
117 #define No_Cursor (0)
118
119 #ifdef __OBJC__
120 typedef NSColor * Color;
121 #else
122 typedef void * Color;
123 #endif
124 typedef int Window;
125 typedef int Display;
126
127 /* Xism */
128 typedef Lisp_Object XrmDatabase;
129
130
c7f6187 Remove '23' comments that indicated code added during update from ema…
Adrian Robert authored
131 /* some sort of attempt to normalize rectangle handling.. seems a bit much
132 for what is accomplished */
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
133 typedef struct {
134 int x, y;
135 unsigned width, height;
136 } XRectangle;
137
138 #ifndef __OBJC__
f700b54 (NSPoint, NSSize) [!__OBJC__]: Define and use CGFloat.
Adrian Robert authored
139 #if defined(__LP64__) && __LP64__
140 typedef double CGFloat;
141 #else
142 typedef float CGFloat;
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
143 #endif
f700b54 (NSPoint, NSSize) [!__OBJC__]: Define and use CGFloat.
Adrian Robert authored
144 typedef struct _NSPoint { CGFloat x, y; } NSPoint;
145 typedef struct _NSSize { CGFloat width, height; } NSSize;
146 typedef struct _NSRect { NSPoint origin; NSSize size; } NSRect;
147 #endif /* NOT OBJC */
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
148
f700b54 (NSPoint, NSSize) [!__OBJC__]: Define and use CGFloat.
Adrian Robert authored
149 #define NativeRectangle NSRect
75f88b1 merging Emacs.app (NeXTstep port)
arobert authored
150
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)
156
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)
162
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))
168
169
170
171
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
184
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
193
194 #define USPosition (1L << 0) /* user specified x, y */
195 #define USSize (1L << 1) /* user specified width, height */
196
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 */
205
206 #endif /* __NSGUI_H__ */
f4ee907 @snogglethorpe Add arch tagline
snogglethorpe authored
207
208 /* arch-tag: b2af3275-62c3-45b4-9335-4c9635c67e55
209 (do not change this comment) */
Something went wrong with that request. Please try again.