|
|
1.1 root 1: #include <X/mit-copyright.h>
2:
3: /* $Header: XMenu.h,v 10.19 86/03/12 10:41:33 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 _xmenu {
171: /* -------------------- Menu data -------------------- */
172: XMStyle menu_style; /* Menu display style. */
173: XMMode menu_mode; /* Menu display mode. */
174: int freeze; /* Freeze server mode? */
175: int aeq; /* Asynchronous Event Queueing mode? */
176: int recompute; /* Recompute menu dependecies? */
177: Window parent; /* Menu's parent window. */
178: int width; /* Overall menu width. */
179: int height; /* Overall menu height. */
180: Cursor mouse_cursor; /* Mouse cursor raster. */
181: XAssocTable *assoc_tab; /* XMWindow association table. */
182: XMPane *p_list; /* List of XMPanes. */
183: /* -------------------- Pane window data -------------------- */
184: XMStyle p_style; /* Pane display style. */
185: int p_events; /* Pane window X events. */
186: FontInfo *p_fnt_info; /* Flag font info structure. */
187: int p_fnt_pad; /* Fixed flag font padding in pixels. */
188: double p_spread; /* Pane spread in flag height fractions. */
189: int p_bdr_width; /* Pane border width. */
190: int flag_height; /* Flag height. */
191: int p_width; /* Menu pane width. */
192: int p_height; /* Menu pane height. */
193: int p_x_off; /* Pane window X offset. */
194: int p_y_off; /* Pane window Y offset. */
195: int p_count; /* Number of panes per menu. */
196: /* -------------------- Selection window data -------------------- */
197: XMStyle s_style; /* Selection display style. */
198: int s_events; /* Selection window X events. */
199: FontInfo *s_fnt_info; /* Body font info structure. */
200: int s_fnt_pad; /* Fixed body font padding in pixels. */
201: double s_spread; /* Select spread in line height fractions. */
202: int s_bdr_width; /* Select border width. */
203: int s_width; /* Selection window width. */
204: int s_height; /* Selection window height. */
205: int s_x_off; /* Selection window X offset. */
206: int s_y_off; /* Selection window Y offset. */
207: int s_count; /* Maximum number of selections per pane. */
208: /* -------------------- Color data -------------------- */
209: int p_bdr_color; /* Color of pane border pixmap. */
210: int s_bdr_color; /* Color of selection border pixmap. */
211: int p_frg_color; /* Color of pane foreground pixmap. */
212: int s_frg_color; /* Color of selection pixmap. */
213: int bkgnd_color; /* Color of menu background pixmap. */
214: /* -------------------- Pixmap data -------------------- */
215: Pixmap p_bdr_pixmap; /* Pane border pixmap. */
216: Pixmap s_bdr_pixmap; /* Selection border pixmap. */
217: Pixmap p_frg_pixmap; /* Pane foreground pixmap. */
218: Pixmap s_frg_pixmap; /* Selection foreground pixmap. */
219: Pixmap bkgnd_pixmap; /* Menu background pixmap. */
220: Pixmap inact_pixmap; /* Menu inactive pixmap. */
221: } XMenu;
222:
223: /*
224: * XMenu library routine declarations.
225: */
226: XMenu *XMenuCreate();
227: int XMenuAddPane();
228: int XMenuAddSelection();
229: int XMenuInsertPane();
230: int XMenuInsertSelection();
231: int XMenuFindPane();
232: int XMenuFindSelection();
233: int XMenuChangePane();
234: int XMenuChangeSelection();
235: int XMenuSetPane();
236: int XMenuSetSelection();
237: int XMenuRecompute();
238: int XMenuEventHandler(); /* No value actually returned. */
239: int XMenuLocate();
240: int XMenuSetFreeze(); /* No value actually returned. */
241: int XMenuActivate();
242: char *XMenuPost();
243: int XMenuDeletePane();
244: int XMenuDeleteSelection();
245: int XMenuDestroy(); /* No value actually returned. */
246: char *XMenuError();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.