1: #include <X/mit-copyright.h>
2:
3: /* $Header: XMenu.h,v 10.18 86/02/01 16:14:03 tony Rel $ */
4: /* Copyright Massachusetts Institute of Technology 1985 */
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.
11: *
12: * Author: Tony Della Fera, DEC
13: * August, 1984
14: */
15:
16: #define FAILURE -1
17: #define SUCCESS 1
18: #define POST_ERROR -1
19: #define NO_SELECTION -1
20:
21: #define XM_FAILURE -1
22: #define XM_SUCCESS 1
23: #define XM_NO_SELECT 2
24: #define XM_IA_SELECT 3
25:
26: #define XME_CODE_COUNT 17
27:
28: #define XME_NO_ERROR 0
29: #define XME_NOT_INIT 1
30: #define XME_ARG_BOUNDS 2
31: #define XME_P_NOT_FOUND 3
32: #define XME_S_NOT_FOUND 4
33: #define XME_STYLE_PARAM 5
34: #define XME_GRAB_MOUSE 6
35: #define XME_INTERP_LOC 7
36: #define XME_CALLOC 8
37: #define XME_CREATE_ASSOC 9
38: #define XME_STORE_BITMAP 10
39: #define XME_MAKE_TILES 11
40: #define XME_MAKE_PIXMAP 12
41: #define XME_CREATE_CURSOR 13
42: #define XME_OPEN_FONT 14
43: #define XME_CREATE_WINDOW 15
44: #define XME_CREATE_TRANSP 16
45:
46: /*
47: * XMenu error code and error list definitions.>
48: */
49: extern int _XMErrorCode;
50: extern char *_XMErrorList[];
51:
52: /*
53: * Define the XMWindow datatypes.
54: *
55: * An XMWindow is either an XMPane or an XMSelect.
56: *
57: * XMWindow is wrapper used to identify the constant window
58: * information that makes up XMPane and XMSelect objects.
59: *
60: * An XMPane is a menu pane made up of one or more XMSelect and a label.
61: *
62: * An XMSelect is a menu selection object with a label and a data pointer.
63: */
64: typedef enum _xmwintype {PANE, SELECTION, PL_HEADER, SL_HEADER} XMWType;
65:
66: typedef struct _xmwindow {
67: struct _xmwindow *next; /* Next obj pointer (for insque). */
68: struct _xmwindow *prev; /* Prev obj pointer (for insque). */
69: XMWType type; /* Type of window. */
70: Window window; /* X Window Id. */
71: int window_x; /* Window upper left X coordinate. */
72: int window_y; /* Window upper left y coordinate. */
73: int window_w; /* Window width. */
74: int window_h; /* Window height. */
75: int active; /* Window active? */
76: int activated; /* Window activated? */
77: int pad_l1; /* ---- */
78: char *pad_l2; /* ---- */
79: int pad_l3; /* ---- */
80: int pad_l4; /* ---- */
81: int pad_l5; /* ---- */
82: int pad_l6; /* ---- */
83: int pad_l7; /* ---- */
84: int pad_l8; /* ---- */
85: struct _xmwindow *pad_l9; /* ---- */
86: char *pad_l10; /* ---- */
87: struct _xmwindow *pad_l11; /* ---- */
88: } XMWindow;
89:
90: typedef struct _xmpane {
91: struct _xmpane *next; /* Next obj pointer (for insque). */
92: struct _xmpane *prev; /* Prev obj pointer (for insque). */
93: XMWType type; /* Type of window. */
94: Window window; /* X Window Id. */
95: int window_x; /* Window upper left X coordinate. */
96: int window_y; /* Window upper left y coordinate. */
97: int window_w; /* Window width. */
98: int window_h; /* Window height. */
99: int active; /* Window active? */
100: int activated; /* Window activated? */
101: int serial; /* -- Pane serial number. */
102: char *label; /* -- Pane label. */
103: int label_width; /* -- Pane label width in pixels. */
104: int label_length; /* -- Pane label length in chars. */
105: int label_x; /* -- Pane label X offset. */
106: int label_uy; /* -- Pane label upper Y offset. */
107: int label_ly; /* -- Pane label lower Y offset. */
108: int s_count; /* -- Selections in this pane. */
109: struct _xmselect *s_list; /* -- Selection window list. */
110: char *pad_l10; /* ---- */
111: struct _xmwindow *pad_l11; /* ---- */
112: } XMPane;
113:
114: typedef struct _xmselect {
115: struct _xmselect *next; /* Next obj pointer (for insque). */
116: struct _xmselect *prev; /* Prev obj pointer (for insque). */
117: XMWType type; /* Type of window. */
118: Window window; /* X Window Id. */
119: Window parent; /* X Window id of parent window. */
120: int window_x; /* Window upper left X coordinate. */
121: int window_y; /* Window upper left y coordinate. */
122: int window_w; /* Window width. */
123: int window_h; /* Window height. */
124: int active; /* Window active? */
125: int activated; /* Window activated? */
126: int serial; /* -- Selection serial number. */
127: char *label; /* -- Selection label. */
128: int label_width; /* -- Selection label width in pixels. */
129: int label_length; /* -- Selection label length in chars. */
130: int label_x; /* -- Selection label X offset. */
131: int label_y; /* -- Selection label Y offset. */
132: int pad_l7; /* ---- */
133: int pad_l8; /* ---- */
134: struct _xmwindow *pad_l9; /* ---- */
135: char *data; /* -- Selection data pointer. */
136: struct _xmpane *parent_p; /* -- Selection parent pane structure. */
137: } XMSelect;
138:
139:
140: /*
141: * Define the XMStyle datatype.
142: *
143: * Menu presentation style information.
144: *
145: */
146: typedef enum _xmstyle {
147: LEFT, /* Left oriented obejct. */
148: RIGHT, /* Right oriented obejct. */
149: CENTER /* Center oriented object. */
150: } XMStyle;
151:
152:
153: /*
154: * Define the XMMode datatype.
155: *
156: * Menu presentation mode information.
157: *
158: */
159: typedef enum _xmmode {
160: BOX, /* BOXed graphic rendition. */
161: INVERT, /* INVERTed graphic rendition. */
162: } XMMode;
163:
164:
165: /*
166: * Define the XMenu datatype.
167: *
168: * All dimensions are in pixels unless otherwise noted.
169: */
170: typedef struct {
171: /* -------------------- Menu data -------------------- */
172: XMStyle menu_style; /* Menu display style. */
173: XMMode menu_mode; /* Menu display mode. */
174: int freeze; /* Freeze server. */
175: int recompute; /* Recompute menu dependecies? */
176: Window parent; /* Menu's parent window. */
177: int width; /* Overall menu width. */
178: int height; /* Overall menu height. */
179: Cursor mouse_cursor; /* Mouse cursor raster. */
180: XAssocTable *assoc_tab; /* XMWindow association table. */
181: XMPane *p_list; /* List of XMPanes. */
182: /* -------------------- Pane window data -------------------- */
183: XMStyle p_style; /* Pane display style. */
184: int p_events; /* Pane window X events. */
185: FontInfo *p_fnt_info; /* Flag font info structure. */
186: int p_fnt_pad; /* Fixed flag font padding in pixels. */
187: double p_spread; /* Pane spread in flag height fractions. */
188: int p_bdr_width; /* Pane border width. */
189: int flag_height; /* Flag height. */
190: int p_width; /* Menu pane width. */
191: int p_height; /* Menu pane height. */
192: int p_x_off; /* Pane window X offset. */
193: int p_y_off; /* Pane window Y offset. */
194: int p_count; /* Number of panes per menu. */
195: /* -------------------- Selection window data -------------------- */
196: XMStyle s_style; /* Selection display style. */
197: int s_events; /* Selection window X events. */
198: FontInfo *s_fnt_info; /* Body font info structure. */
199: int s_fnt_pad; /* Fixed body font padding in pixels. */
200: double s_spread; /* Select spread in line height fractions. */
201: int s_bdr_width; /* Select border width. */
202: int s_width; /* Selection window width. */
203: int s_height; /* Selection window height. */
204: int s_x_off; /* Selection window X offset. */
205: int s_y_off; /* Selection window Y offset. */
206: int s_count; /* Maximum number of selections per pane. */
207: /* -------------------- Color data -------------------- */
208: int p_bdr_color; /* Color of pane border pixmap. */
209: int s_bdr_color; /* Color of selection border pixmap. */
210: int p_frg_color; /* Color of pane foreground pixmap. */
211: int s_frg_color; /* Color of selection pixmap. */
212: int bkgnd_color; /* Color of menu background pixmap. */
213: /* -------------------- Pixmap data -------------------- */
214: Pixmap p_bdr_pixmap; /* Pane border pixmap. */
215: Pixmap s_bdr_pixmap; /* Selection border pixmap. */
216: Pixmap p_frg_pixmap; /* Pane foreground pixmap. */
217: Pixmap s_frg_pixmap; /* Selection foreground pixmap. */
218: Pixmap bkgnd_pixmap; /* Menu background pixmap. */
219: Pixmap inact_pixmap; /* Menu inactive pixmap. */
220: } ;
221:
222: /*
223: * XMenu library routine declarations.
224: */
225: XMenu *XMenuCreate();
226: int XMenuAddPane();
227: int XMenuAddSelection();
228: int XMenuInsertPane();
229: int XMenuInsertSelection();
230: int XMenuFindPane();
231: int XMenuFindSelection();
232: int XMenuChangePane();
233: int XMenuChangeSelection();
234: int XMenuSetPane();
235: int XMenuSetSelection();
236: int XMenuRecompute();
237: int XMenuEventHandler(); /* No value actually returned. */
238: int XMenuLocate();
239: int XMenuSetFreeze(); /* No value actually returned. */
240: int XMenuActivate();
241: char *XMenuPost();
242: int XMenuDeletePane();
243: int XMenuDeleteSelection();
244: int XMenuDestroy(); /* No value actually returned. */
245: char *XMenuError();
Defined struct's
defined in line
170;
never used
Defined enum's
Defined typedef's
XMPane
defined in line
112; used 43 times
- in line 181
- in /usr/src/new/X/XMenu/XMenuActivate.c line
78-80(3),
252,
300,
490
- in /usr/src/new/X/XMenu/XMenuAddPane.c line
24,
41(2)
- in /usr/src/new/X/XMenu/XMenuAddSel.c line
26
- in /usr/src/new/X/XMenu/XMenuChgPane.c line
25
- in /usr/src/new/X/XMenu/XMenuChgSel.c line
29
- in /usr/src/new/X/XMenu/XMenuCreate.c line
75,
130(2)
- in /usr/src/new/X/XMenu/XMenuDelPane.c line
24
- in /usr/src/new/X/XMenu/XMenuDelSel.c line
25
- in /usr/src/new/X/XMenu/XMenuDestroy.c line
21
- in /usr/src/new/X/XMenu/XMenuFindPane.c line
24
- in /usr/src/new/X/XMenu/XMenuFindSel.c line
25
- in /usr/src/new/X/XMenu/XMenuInsPane.c line
27-28(2),
52(2)
- in /usr/src/new/X/XMenu/XMenuInsSel.c line
27
- in /usr/src/new/X/XMenu/XMenuInternal.c line
40-41(2),
112,
181,
335-340(2),
373,
409,
509,
759,
807,
840
- in /usr/src/new/X/XMenu/XMenuInternal.h line
47
- in /usr/src/new/X/XMenu/XMenuLocate.c line
32
- in /usr/src/new/X/XMenu/XMenuRecomp.c line
22
- in /usr/src/new/X/XMenu/XMenuSetPane.c line
25
- in /usr/src/new/X/XMenu/XMenuSetSel.c line
26
XMSelect
defined in line
137; used 36 times
- in /usr/src/new/X/XMenu/XMenuActivate.c line
81,
274
- in /usr/src/new/X/XMenu/XMenuAddPane.c line
25,
46(2)
- in /usr/src/new/X/XMenu/XMenuAddSel.c line
27,
51(2)
- in /usr/src/new/X/XMenu/XMenuChgSel.c line
30
- in /usr/src/new/X/XMenu/XMenuDelPane.c line
25
- in /usr/src/new/X/XMenu/XMenuDelSel.c line
26
- in /usr/src/new/X/XMenu/XMenuDestroy.c line
22
- in /usr/src/new/X/XMenu/XMenuFindSel.c line
26
- in /usr/src/new/X/XMenu/XMenuInsPane.c line
29,
57(2)
- in /usr/src/new/X/XMenu/XMenuInsSel.c line
28-32(2),
61(2)
- in /usr/src/new/X/XMenu/XMenuInternal.c line
37-38(2),
145,
182,
371-376(2),
410,
643,
760,
842-843(2),
882
- in /usr/src/new/X/XMenu/XMenuInternal.h line
48
- in /usr/src/new/X/XMenu/XMenuLocate.c line
33
- in /usr/src/new/X/XMenu/XMenuRecomp.c line
23
- in /usr/src/new/X/XMenu/XMenuSetSel.c line
27
defined in line
220; used 46 times
- in line 225
- in /usr/src/new/X/XMenu/XMenuActivate.c line
57
- in /usr/src/new/X/XMenu/XMenuAddPane.c line
20
- in /usr/src/new/X/XMenu/XMenuAddSel.c line
20
- in /usr/src/new/X/XMenu/XMenuChgPane.c line
20
- in /usr/src/new/X/XMenu/XMenuChgSel.c line
20
- in /usr/src/new/X/XMenu/XMenuCreate.c line
63,
72,
125(2)
- in /usr/src/new/X/XMenu/XMenuDelPane.c line
20
- in /usr/src/new/X/XMenu/XMenuDelSel.c line
20
- in /usr/src/new/X/XMenu/XMenuDestroy.c line
19
- in /usr/src/new/X/XMenu/XMenuFindPane.c line
21
- in /usr/src/new/X/XMenu/XMenuFindSel.c line
21
- in /usr/src/new/X/XMenu/XMenuInsPane.c line
21
- in /usr/src/new/X/XMenu/XMenuInsSel.c line
20
- in /usr/src/new/X/XMenu/XMenuInternal.c line
111,
144,
177,
337,
407,
508,
642,
758,
806,
839,
881
- in /usr/src/new/X/XMenu/XMenuLocate.c line
21
- in /usr/src/new/X/XMenu/XMenuPost.c line
43
- in /usr/src/new/X/XMenu/XMenuRecomp.c line
20
- in /usr/src/new/X/XMenu/XMenuSetFrz.c line
21
- in /usr/src/new/X/XMenu/XMenuSetPane.c line
20
- in /usr/src/new/X/XMenu/XMenuSetSel.c line
20
- in /usr/src/new/X/XMenu/tests/acttest.c line
27,
47
- in /usr/src/new/X/XMenu/tests/deltest.c line
32,
46
- in /usr/src/new/X/XMenu/tests/instest.c line
32,
46
- in /usr/src/new/X/XMenu/tests/posttest.c line
26,
46
- in /usr/src/new/X/XMenu/tests/rstest.c line
27,
47
- in /usr/src/new/X/xterm/button.c line
342,
362
Defined macros
XME_NO_ERROR
defined in line
28; used 27 times
- in /usr/src/new/X/XMenu/XMenuActivate.c line
505
- in /usr/src/new/X/XMenu/XMenuAddPane.c line
98
- in /usr/src/new/X/XMenu/XMenuAddSel.c line
93
- in /usr/src/new/X/XMenu/XMenuChgPane.c line
65
- in /usr/src/new/X/XMenu/XMenuChgSel.c line
86
- in /usr/src/new/X/XMenu/XMenuCreate.c line
519
- in /usr/src/new/X/XMenu/XMenuDelPane.c line
82
- in /usr/src/new/X/XMenu/XMenuDelSel.c line
70
- in /usr/src/new/X/XMenu/XMenuFindPane.c line
45,
51
- in /usr/src/new/X/XMenu/XMenuFindSel.c line
53,
59
- in /usr/src/new/X/XMenu/XMenuInsPane.c line
110
- in /usr/src/new/X/XMenu/XMenuInsSel.c line
104
- in /usr/src/new/X/XMenu/XMenuInternal.c line
52,
132,
165,
325,
360,
396,
630,
742
- in /usr/src/new/X/XMenu/XMenuLocate.c line
77
- in /usr/src/new/X/XMenu/XMenuRecomp.c line
32,
126
- in /usr/src/new/X/XMenu/XMenuSetPane.c line
41
- in /usr/src/new/X/XMenu/XMenuSetSel.c line
49
XM_FAILURE
defined in line
21; used 186 times
- in /usr/src/new/X/XMenu/XMenuActivate.c line
100,
109,
116,
122,
210,
298
- in /usr/src/new/X/XMenu/XMenuAddPane.c line
35,
44-49(2)
- in /usr/src/new/X/XMenu/XMenuAddSel.c line
39,
46,
54
- in /usr/src/new/X/XMenu/XMenuChgPane.c line
35,
42
- in /usr/src/new/X/XMenu/XMenuChgSel.c line
40,
47,
53
- in /usr/src/new/X/XMenu/XMenuDelPane.c line
31
- in /usr/src/new/X/XMenu/XMenuDelSel.c line
32,
38
- in /usr/src/new/X/XMenu/XMenuFindPane.c line
32,
63
- in /usr/src/new/X/XMenu/XMenuFindSel.c line
34,
41,
71
- in /usr/src/new/X/XMenu/XMenuInsPane.c line
39,
47,
55-60(2)
- in /usr/src/new/X/XMenu/XMenuInsSel.c line
42,
49,
56,
64
- in /usr/src/new/X/XMenu/XMenuLocate.c line
40,
47,
53
- in /usr/src/new/X/XMenu/XMenuRecomp.c line
42,
64,
80,
92
- in /usr/src/new/X/XMenu/XMenuSetPane.c line
31
- in /usr/src/new/X/XMenu/XMenuSetSel.c line
33,
39
- in /usr/src/new/X/XMenu/tests/acttest.c line
55-101(20),
109,
130,
144-186(20),
195-200(2)
- in /usr/src/new/X/XMenu/tests/deltest.c line
54-100(20),
108,
131,
148-159(4)
- in /usr/src/new/X/XMenu/tests/instest.c line
54-100(20),
108,
129,
152-155(2),
165,
174,
182-185(2)
- in /usr/src/new/X/XMenu/tests/posttest.c line
54-100(20),
108,
129
- in /usr/src/new/X/XMenu/tests/rstest.c line
55-71(5),
80-108(15),
116,
137
- in /usr/src/new/X/xterm/button.c line
446
Usage of this include