Mercurial > emacs
annotate oldXMenu/XMenu.h @ 111191:ed5bac97776a
* term/ns-win.el (ns-new-frame, ns-show-prefs): Don't add to global map. * term/common-win.el (x-setup-function-keys): Remove most of the keymappings. Comment on the remaining ones.
author | Adrian Robert <Adrian.B.Robert@gmail.com> |
---|---|
date | Tue, 26 Oct 2010 16:20:00 +0300 |
parents | e5ec12c5c82f |
children | ef719132ddfa |
rev | line source |
---|---|
76174
fec5e03aaf59
Remove FSF copyright since file does not differ significantly from X11
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
1 /* Copyright Massachusetts Institute of Technology 1985 */ |
fec5e03aaf59
Remove FSF copyright since file does not differ significantly from X11
Glenn Morris <rgm@gnu.org>
parents:
75348
diff
changeset
|
2 |
25858 | 3 #include "copyright.h" |
4 | |
5 | |
6 /* | |
7 * XMenu: MIT Project Athena, X Window system menu package | |
8 * | |
9 * XMenu.h - Include file for the MIT Project Athena | |
10 * XMenu X window system menu package. | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27454
diff
changeset
|
11 * |
25858 | 12 * Author: Tony Della Fera, DEC |
13 * August, 1984 | |
14 */ | |
15 | |
16 #ifndef _XMenu_h_ | |
17 #define _XMenu_h_ | |
18 | |
109373
e5ec12c5c82f
* oldXMenu/XMenu.h: Include <stdlib.h>.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
109124
diff
changeset
|
19 #include <stdlib.h> |
25858 | 20 #include <X11/Xutil.h> |
21 #include "X10.h" | |
22 | |
23 #define FAILURE -1 | |
24 #define SUCCESS 1 | |
25 #define POST_ERROR -1 | |
26 #define NO_SELECTION -1 | |
27 | |
28 #define XM_FAILURE -1 | |
29 #define XM_SUCCESS 1 | |
30 #define XM_NO_SELECT 2 | |
31 #define XM_IA_SELECT 3 | |
32 | |
33 #define XME_CODE_COUNT 17 | |
34 | |
35 #define XME_NO_ERROR 0 | |
36 #define XME_NOT_INIT 1 | |
37 #define XME_ARG_BOUNDS 2 | |
38 #define XME_P_NOT_FOUND 3 | |
39 #define XME_S_NOT_FOUND 4 | |
40 #define XME_STYLE_PARAM 5 | |
41 #define XME_GRAB_MOUSE 6 | |
42 #define XME_INTERP_LOC 7 | |
43 #define XME_CALLOC 8 | |
44 #define XME_CREATE_ASSOC 9 | |
45 #define XME_STORE_BITMAP 10 | |
46 #define XME_MAKE_TILES 11 | |
47 #define XME_MAKE_PIXMAP 12 | |
48 #define XME_CREATE_CURSOR 13 | |
49 #define XME_OPEN_FONT 14 | |
50 #define XME_CREATE_WINDOW 15 | |
51 #define XME_CREATE_TRANSP 16 | |
52 | |
53 /* | |
54 * XMenu error code and error list definitions. | |
55 */ | |
56 extern int _XMErrorCode; | |
57 extern char *_XMErrorList[]; | |
58 | |
59 /* | |
60 * Define the XMWindow datatypes. | |
61 * | |
62 * An XMWindow is either an XMPane or an XMSelect. | |
63 * | |
64 * XMWindow is wrapper used to identify the constant window | |
65 * information that makes up XMPane and XMSelect objects. | |
66 * | |
67 * An XMPane is a menu pane made up of one or more XMSelect and a label. | |
68 * | |
69 * An XMSelect is a menu selection object with a label and a data pointer. | |
70 */ | |
71 typedef enum _xmwintype {PANE, SELECTION, PL_HEADER, SL_HEADER, SEPARATOR} XMWType; | |
72 | |
73 typedef struct _xmwindow { | |
74 struct _xmwindow *next; /* Next obj pointer (for emacs_insque). */ | |
75 struct _xmwindow *prev; /* Prev obj pointer (for emacs_insque). */ | |
76 XMWType type; /* Type of window. */ | |
77 Window window; /* X Window Id. */ | |
78 int window_x; /* Window upper left X coordinate. */ | |
79 int window_y; /* Window upper left y coordinate. */ | |
80 int window_w; /* Window width. */ | |
81 int window_h; /* Window height. */ | |
82 int active; /* Window active? */ | |
83 int activated; /* Window activated? */ | |
84 int pad_l1; /* ---- */ | |
85 char *pad_l2; /* ---- */ | |
86 int pad_l3; /* ---- */ | |
87 int pad_l4; /* ---- */ | |
88 int pad_l5; /* ---- */ | |
89 int pad_l6; /* ---- */ | |
90 int pad_l7; /* ---- */ | |
91 int pad_l8; /* ---- */ | |
92 struct _xmwindow *pad_l9; /* ---- */ | |
93 char *pad_l10; /* ---- */ | |
94 struct _xmwindow *pad_l11; /* ---- */ | |
95 } XMWindow; | |
96 | |
97 typedef struct _xmpane { | |
98 struct _xmpane *next; /* Next obj pointer (for emacs_insque). */ | |
99 struct _xmpane *prev; /* Prev obj pointer (for emacs_insque). */ | |
100 XMWType type; /* Type of window. */ | |
101 Window window; /* X Window Id. */ | |
102 int window_x; /* Window upper left X coordinate. */ | |
103 int window_y; /* Window upper left y coordinate. */ | |
104 int window_w; /* Window width. */ | |
105 int window_h; /* Window height. */ | |
106 int active; /* Window active? */ | |
107 int activated; /* Window activated? */ | |
108 int serial; /* -- Pane serial number. */ | |
109 char *label; /* -- Pane label. */ | |
110 int label_width; /* -- Pane label width in pixels. */ | |
111 int label_length; /* -- Pane label length in chars. */ | |
112 int label_x; /* -- Pane label X offset. */ | |
113 int label_uy; /* -- Pane label upper Y offset. */ | |
114 int label_ly; /* -- Pane label lower Y offset. */ | |
115 int s_count; /* -- Selections in this pane. */ | |
116 struct _xmselect *s_list; /* -- Selection window list. */ | |
117 char *pad_l10; /* ---- */ | |
118 struct _xmwindow *pad_l11; /* ---- */ | |
119 } XMPane; | |
120 | |
121 typedef struct _xmselect { | |
122 struct _xmselect *next; /* Next obj pointer (for emacs_insque). */ | |
123 struct _xmselect *prev; /* Prev obj pointer (for emacs_insque). */ | |
124 XMWType type; /* Type of window. */ | |
125 Window window; /* X Window Id. */ | |
126 Window parent; /* X Window id of parent window. */ | |
127 int window_x; /* Window upper left X coordinate. */ | |
128 int window_y; /* Window upper left y coordinate. */ | |
129 int window_w; /* Window width. */ | |
130 int window_h; /* Window height. */ | |
131 int active; /* Window active? */ | |
132 int activated; /* Window activated? */ | |
133 int serial; /* -- Selection serial number. */ | |
134 char *label; /* -- Selection label. */ | |
135 int label_width; /* -- Selection label width in pixels. */ | |
136 int label_length; /* -- Selection label length in chars. */ | |
137 int label_x; /* -- Selection label X offset. */ | |
138 int label_y; /* -- Selection label Y offset. */ | |
139 int pad_l7; /* ---- */ | |
140 int pad_l8; /* ---- */ | |
141 struct _xmwindow *pad_l9; /* ---- */ | |
142 char *data; /* -- Selection data pointer. */ | |
143 struct _xmpane *parent_p; /* -- Selection parent pane structure. */ | |
27454
60bf61bbd0b3
(XmSelect): Add member `help_string'.
Gerd Moellmann <gerd@gnu.org>
parents:
25858
diff
changeset
|
144 char *help_string; /* Help string or null. */ |
25858 | 145 } XMSelect; |
146 | |
147 | |
148 /* | |
149 * Define the XMStyle datatype. | |
150 * | |
151 * Menu presentation style information. | |
152 * | |
153 */ | |
154 typedef enum _xmstyle { | |
155 LEFT, /* Left oriented obejct. */ | |
156 RIGHT, /* Right oriented obejct. */ | |
157 CENTER /* Center oriented object. */ | |
158 } XMStyle; | |
159 | |
160 | |
161 /* | |
162 * Define the XMMode datatype. | |
163 * | |
164 * Menu presentation mode information. | |
165 * | |
166 */ | |
167 typedef enum _xmmode { | |
168 BOX, /* BOXed graphic rendition. */ | |
169 INVERT /* INVERTed graphic rendition. */ | |
170 } XMMode; | |
171 | |
172 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27454
diff
changeset
|
173 /* |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27454
diff
changeset
|
174 * Define the XMenu datatype. |
25858 | 175 * |
176 * All dimensions are in pixels unless otherwise noted. | |
177 */ | |
178 typedef struct _xmenu { | |
179 /* -------------------- Menu data -------------------- */ | |
180 XMStyle menu_style; /* Menu display style. */ | |
181 XMMode menu_mode; /* Menu display mode. */ | |
182 int freeze; /* Freeze server mode? */ | |
183 int aeq; /* Asynchronous Event Queuing mode? */ | |
184 int recompute; /* Recompute menu dependencies? */ | |
185 Window parent; /* Menu's parent window. */ | |
186 int width; /* Overall menu width. */ | |
187 int height; /* Overall menu height. */ | |
188 int x_pos; /* Oveall menu origin. */ | |
189 int y_pos; /* Overall menu origin. */ | |
190 Cursor mouse_cursor; /* Mouse cursor raster. */ | |
191 XAssocTable *assoc_tab; /* XMWindow association table. */ | |
192 XMPane *p_list; /* List of XMPanes. */ | |
193 /* -------------------- Pane window data -------------------- */ | |
194 XMStyle p_style; /* Pane display style. */ | |
195 int p_events; /* Pane window X events. */ | |
196 XFontStruct *p_fnt_info; /* Flag font info structure. */ | |
197 GC pane_GC; /* Pane graphics context. */ | |
198 int p_fnt_pad; /* Fixed flag font padding in pixels. */ | |
199 double p_spread; /* Pane spread in flag height fractions. */ | |
200 int p_bdr_width; /* Pane border width. */ | |
201 int flag_height; /* Flag height. */ | |
202 int p_width; /* Menu pane width. */ | |
203 int p_height; /* Menu pane height. */ | |
204 int p_x_off; /* Pane window X offset. */ | |
205 int p_y_off; /* Pane window Y offset. */ | |
206 int p_count; /* Number of panes per menu. */ | |
207 /* -------------------- Selection window data -------------------- */ | |
208 XMStyle s_style; /* Selection display style. */ | |
209 int s_events; /* Selection window X events. */ | |
210 XFontStruct *s_fnt_info; /* Body font info structure. */ | |
211 int s_fnt_pad; /* Fixed body font padding in pixels. */ | |
212 double s_spread; /* Select spread in line height fractions. */ | |
213 int s_bdr_width; /* Select border width. */ | |
214 int s_width; /* Selection window width. */ | |
215 int s_height; /* Selection window height. */ | |
216 int s_x_off; /* Selection window X offset. */ | |
217 int s_y_off; /* Selection window Y offset. */ | |
218 int s_count; /* Maximum number of selections per pane. */ | |
219 GC normal_select_GC; /* GC used for inactive selections. */ | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
27454
diff
changeset
|
220 GC inverse_select_GC; /* GC used for active (current) selection. */ |
25858 | 221 GC inact_GC; /* GC used for inactive selections and */ |
222 /* panes headers. */ | |
223 /* -------------------- Color data -------------------- */ | |
224 unsigned long p_bdr_color; /* Color of pane border pixmap. */ | |
225 unsigned long s_bdr_color; /* Color of selection border pixmap. */ | |
226 unsigned long p_frg_color; /* Color of pane foreground pixmap. */ | |
227 unsigned long s_frg_color; /* Color of selection pixmap. */ | |
228 unsigned long bkgnd_color; /* Color of menu background pixmap. */ | |
229 /* -------------------- Pixmap data -------------------- */ | |
230 Pixmap p_bdr_pixmap; /* Pane border pixmap. */ | |
231 Pixmap s_bdr_pixmap; /* Selection border pixmap. */ | |
232 Pixmap p_frg_pixmap; /* Pane foreground pixmap. */ | |
233 Pixmap s_frg_pixmap; /* Selection foreground pixmap. */ | |
234 Pixmap bkgnd_pixmap; /* Menu background pixmap. */ | |
235 Pixmap inact_pixmap; /* Menu inactive pixmap. */ | |
236 } XMenu; | |
237 | |
109124
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
238 typedef void (*Wait_func)(void*); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
239 |
25858 | 240 /* |
241 * XMenu library routine declarations. | |
242 */ | |
109124
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
243 XMenu *XMenuCreate(Display *display, Window parent, register char *def_env); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
244 int XMenuAddPane(Display *display, register XMenu *menu, register char *label, int active); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
245 int XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char *help); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
246 int XMenuInsertPane(register XMenu *menu, register int p_num, char *label, int active); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
247 int XMenuInsertSelection(register XMenu *menu, register int p_num, register int s_num, char *data, char *label, int active); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
248 int XMenuFindPane(register XMenu *menu, register char *label); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
249 int XMenuFindSelection(register XMenu *menu, int p_num, register char *label); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
250 int XMenuChangePane(register XMenu *menu, register int p_num, char *label); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
251 int XMenuChangeSelection(Display *display, register XMenu *menu, register int p_num, register int s_num, char *data, int data_sw, char *label, int label_sw); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
252 int XMenuSetPane(register XMenu *menu, register int p_num, register int active); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
253 int XMenuSetSelection(register XMenu *menu, register int p_num, register int s_num, int active); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
254 int XMenuRecompute(Display *display, register XMenu *menu); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
255 int XMenuEventHandler(int (*handler) (XEvent *)); /* No value actually returned. */ |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
256 int XMenuLocate(register Display *display, register XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
257 int XMenuSetFreeze(register XMenu *menu, register int freeze); /* No value actually returned. */ |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
258 void XMenuActivateSetWaitFunction(Wait_func func, void *data); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
259 int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char *, int, int)); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
260 char *XMenuPost(register Display *display, register XMenu *menu, register int *p_num, register int *s_num, register int x_pos, register int y_pos, int event_mask); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
261 int XMenuDeletePane(register Display *display, register XMenu *menu, register int p_num); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
262 int XMenuDeleteSelection(register Display *display, register XMenu *menu, register int p_num, register int s_num); |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
263 int XMenuDestroy(Display *display, register XMenu *menu); /* No value actually returned. */ |
5cc91198ffb2
Convert function definitions in oldXMenu to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
76174
diff
changeset
|
264 char *XMenuError(void); |
25858 | 265 |
266 #endif | |
267 /* Don't add after this point. */ | |
52401 | 268 |
269 /* arch-tag: 7e57b5ac-9355-4057-9385-afbe6912d60f | |
270 (do not change this comment) */ |