*** empty log message ***
[emacs.git] / oldXMenu / Create.c
blobe500e406349bde02c35380694e9c4d89fb7be077
1 /* $Header: /cvs/emacs/oldXMenu/Create.c,v 1.1 1999/10/03 19:34:56 fx Exp $ */
2 /* Copyright Massachusetts Institute of Technology 1985 */
4 #include "copyright.h"
6 /*
7 * XMenu: MIT Project Athena, X Window system menu package
9 * XMenuCreate - Creates an X window system menu object.
11 * Author: Tony Della Fera, DEC
12 * January 23, 1986
16 #include <config.h>
17 #include "XMenuInt.h"
20 #ifdef EMACS_BITMAP_FILES
21 #include "../src/bitmaps/dimple1.xbm"
22 #include "../src/bitmaps/dimple3.xbm"
23 #include "../src/bitmaps/gray1.xbm"
24 #include "../src/bitmaps/gray3.xbm"
25 #include "../src/bitmaps/crosswv.xbm"
27 #include "../src/bitmaps/leftptr.xbm"
28 #include "../src/bitmaps/leftpmsk.xbm"
29 #include "../src/bitmaps/rtptr.xbm"
30 #include "../src/bitmaps/rtpmsk.xbm"
31 #include "../src/bitmaps/cntrptr.xbm"
32 #include "../src/bitmaps/cntrpmsk.xbm"
33 #include "../src/bitmaps/stipple.xbm"
35 #else
36 #ifndef VMS
38 #include <X11/bitmaps/dimple1>
39 #include <X11/bitmaps/dimple3>
40 #include <X11/bitmaps/gray1>
41 #include <X11/bitmaps/gray3>
42 #include <X11/bitmaps/cross_weave>
44 #include <X11/bitmaps/left_ptr>
45 #include <X11/bitmaps/left_ptrmsk>
46 #include <X11/bitmaps/right_ptr>
47 #include <X11/bitmaps/right_ptrmsk>
48 #include <X11/bitmaps/cntr_ptr>
49 #include <X11/bitmaps/cntr_ptrmsk>
50 #include <X11/bitmaps/stipple>
52 #else
54 #include "[-.src.bitmaps]dimple1.xbm"
55 #include "[-.src.bitmaps]dimple3.xbm"
56 #include "[-.src.bitmaps]gray1.xbm"
57 #include "[-.src.bitmaps]gray3.xbm"
58 #include "[-.src.bitmaps]crosswv.xbm"
60 #include "[-.src.bitmaps]leftptr.xbm"
61 #include "[-.src.bitmaps]leftpmsk.xbm"
62 #include "[-.src.bitmaps]rtptr.xbm"
63 #include "[-.src.bitmaps]rtpmsk.xbm"
64 #include "[-.src.bitmaps]cntrptr.xbm"
65 #include "[-.src.bitmaps]cntrpmsk.xbm"
66 #include "[-.src.bitmaps]stipple.xbm"
68 #endif /* VMS */
69 #endif /* not EMACS_BITMAP_FILES */
71 #define DEF_FREEZE 0
72 #define DEF_REVERSE 0
73 #define DEF_MENU_STYLE LEFT
74 #define DEF_MENU_MODE BOX
75 #define DEF_INACT_PNUM 3
76 #define MAX_INACT_PNUM 4
78 #define DEF_P_STYLE CENTER
80 #define DEF_P_EVENTS (EnterWindowMask | ExposureMask)
81 #define DEF_P_FNT_NAME "fixed"
82 #define DEF_P_SPREAD 0.5
83 #define DEF_P_BDR_WIDTH 2
85 #define DEF_S_STYLE LEFT
86 #define DEF_S_EVENTS (EnterWindowMask | LeaveWindowMask)
87 #define DEF_S_FNT_NAME "fixed"
88 #define DEF_S_SPREAD 0.10
89 #define DEF_S_BDR_WIDTH 1
91 #define XASSOC_TABLE_SIZE 64
93 #define TILE_BUF_SIZE 5
95 int atoi();
96 double atof();
97 char *x_get_resource_string ();
101 static Status
102 XAllocDisplayColor(display, map, colorName, color, junk)
103 Display *display;
104 Colormap map;
105 char *colorName;
106 XColor *color;
107 XColor *junk;
109 return (colorName!=0 &&
110 XParseColor(display, map, colorName, color) &&
111 XAllocColor(display, map, color));
115 XMenu *
116 XMenuCreate(display, parent, def_env)
117 Display *display; /* ID of previously opened display */
118 Window parent; /* Window ID of the menu's parent window. */
119 register char *def_env; /* X Defaults program environment name. */
121 register int i; /* Loop counter. */
122 register int j; /* Loop counter. */
123 register char *def_val; /* X Default value temp variable. */
125 register XMenu *menu; /* Pointer to the new menu. */
126 XMStyle menu_style; /* Menu display style. */
127 XMMode menu_mode; /* Menu display mode. */
128 XMPane *pane; /* Pane list header. */
129 XAssocTable *assoc_tab; /* XAssocTable pointer. */
131 int freeze; /* Freeze server mode. */
132 int reverse; /* Reverse video mode. */
134 XMStyle p_style; /* Pane display style. */
135 char *p_fnt_name; /* Flag font name. */
136 XFontStruct *p_fnt_info; /* Flag font structure */
137 int p_fnt_pad; /* Flag font padding in pixels. */
138 double p_spread; /* Pane spread in flag height fractions. */
139 int p_fnt_height; /* Pane character height. */
140 int p_bdr_width; /* Pane border width. */
141 int flag_height; /* Flag window height. */
142 int p_height; /* Pane window height. */
143 int p_x_off; /* Pane X offset. */
144 int p_y_off; /* Pane Y offset. */
145 GC pane_GC; /* Pane graphics context. */
147 XMStyle s_style; /* Selection display style. */
148 char *s_fnt_name; /* Selection font name. */
149 XFontStruct *s_fnt_info; /* Selection font structure. */
150 int s_fnt_pad; /* Selection font padding in pixels. */
151 int s_fnt_height; /* Selection font character height */
152 double s_spread; /* Select spread in line height fractions. */
153 int s_bdr_width; /* Highlight border width. */
154 int s_height; /* Selection window height. */
155 int s_x_off; /* Selection window X offset. */
156 int s_y_off; /* Selection window Y offset. */
157 GC normal_select_GC; /* GC used for normal video selection. */
158 GC inverse_select_GC; /* GC used for inverse video selection. */
159 GC inact_GC; /* GC for inactive pane header and */
160 /* selections. */
161 GC inact_GC_noexpose;
163 XColor color_def; /* Temp color definition holder. */
164 XColor screen_def; /* Temp screen color definition holder */
165 XColor p_bdr_color; /* Color of border. */
166 XColor s_bdr_color; /* Color of highlight. */
167 XColor p_frg_color; /* Color of pane foreground color. */
168 XColor s_frg_color; /* Color of selection foreground. */
169 XColor bkgnd_color; /* Color of background.. */
170 XColor mouse_color; /* Color of mouse cursor. */
171 Cursor mouse_cursor; /* Mouse cursor. */
172 Pixmap inact_bitmap; /* Menu inactive pixmap. */
174 int inact_pnum; /* Inactive background pattern number. */
176 Pixel p_bdr_pixel; /* Pane border pixel. */
177 Pixel s_bdr_pixel; /* Selection border pixel. */
178 Pixel p_frg_pixel; /* Pane foreground pixel. */
179 Pixel s_frg_pixel; /* Selection foreground pixel. */
180 Pixel bkgnd_pixel; /* Menu background pixel. */
182 int *width, *height;
183 Pixmap *bitmap;
184 int *x_hot, *y_hot;
185 int status; /* Return code from XReadBitmapFile. */
187 Pixmap cursor; /* Cursor pixmap holder. */
188 Pixmap cursor_mask; /* Cursor mask pixmap holder. */
189 Pixmap stipple_pixmap; /* Stipple mask for half-tone text. */
190 unsigned long valuemask;
191 XGCValues *values;
193 Window root = RootWindow (display, DefaultScreen (display));
196 * Calloc the XMenu structure and the initial pane.
198 menu = (XMenu *)calloc(1, sizeof(XMenu));
199 if (menu == NULL) {
200 _XMErrorCode = XME_CALLOC;
201 return(NULL);
203 pane = (XMPane *)calloc(1, sizeof(XMPane));
204 if (pane == NULL) {
205 _XMErrorCode = XME_CALLOC;
206 return(NULL);
210 * Create the XAssocTable
212 assoc_tab = (XAssocTable *)XCreateAssocTable(XASSOC_TABLE_SIZE);
213 if(assoc_tab == NULL) {
214 _XMErrorCode= XME_CREATE_ASSOC;
215 return(NULL);
219 * Set up the default environment name.
221 if (def_env == NULL || *def_env == '\0') def_env = "XMenu";
224 * Set up internal fail-safe defaults.
226 freeze = DEF_FREEZE;
227 reverse = DEF_REVERSE;
228 menu_style = DEF_MENU_STYLE;
229 menu_mode = DEF_MENU_MODE;
230 inact_pnum = DEF_INACT_PNUM;
232 p_style = DEF_P_STYLE;
233 p_spread = DEF_P_SPREAD;
234 p_fnt_name = DEF_P_FNT_NAME;
235 p_bdr_width = DEF_P_BDR_WIDTH;
237 s_style = DEF_S_STYLE;
238 s_spread = DEF_S_SPREAD;
239 s_fnt_name = DEF_S_FNT_NAME;
240 s_bdr_width = DEF_S_BDR_WIDTH;
243 * Get default values from X.
245 def_val = x_get_resource_string ("menuFreeze", "MenuFreeze");
246 if (def_val != NULL) {
247 if (strcmp(def_val, "on") == 0) freeze = 1;
248 else if (strcmp(def_val, "off") == 0) freeze = 0;
251 def_val = x_get_resource_string ("menuReverseVideo", "MenuReverseVideo");
252 if (def_val != NULL) {
253 if (strcmp(def_val, "on") == 0) reverse = 1;
254 else if (strcmp(def_val, "off") == 0) reverse = 0;
257 def_val = x_get_resource_string ("menuStyle", "MenuStyle");
258 if (def_val != NULL) {
259 if (strcmp(def_val, "right_hand") == 0) menu_style = RIGHT;
260 else if (strcmp(def_val, "left_hand") == 0) menu_style = LEFT;
261 else if (strcmp(def_val, "center") == 0) menu_style = CENTER;
264 def_val = x_get_resource_string ("menuMode", "MenuMode");
265 if (def_val != NULL) {
266 if (strcmp(def_val, "box") == 0) menu_mode = BOX;
267 else if (strcmp(def_val, "invert") == 0) menu_mode = INVERT;
270 def_val = x_get_resource_string ("menuMouse", "MenuMouse");
271 if (
272 def_val != NULL &&
273 DisplayCells(display, DefaultScreen(display)) > 2 &&
274 XAllocDisplayColor(display,
275 DefaultColormap(display, DefaultScreen(display)),
276 def_val,
277 &mouse_color, &color_def)
279 else if (reverse &&
280 XAllocDisplayColor(display,
281 DefaultColormap(display, DefaultScreen(display)),
282 "white",
283 &mouse_color, &color_def)
286 else if (XAllocDisplayColor(display,
287 DefaultColormap(display, DefaultScreen(display)),
288 "black",
289 &mouse_color, &color_def)
292 else ;
294 def_val = x_get_resource_string ("menuBackground", "MenuBackground");
295 if (
296 def_val != NULL &&
297 DisplayCells(display, DefaultScreen(display)) > 2 &&
298 XAllocDisplayColor(display,
299 DefaultColormap(display, DefaultScreen(display)),
300 def_val,
301 &bkgnd_color, &color_def)
303 else if (reverse &&
304 XAllocDisplayColor(display,
305 DefaultColormap(display, DefaultScreen(display)),
306 "black",
307 &bkgnd_color, &color_def)
309 else if (XAllocDisplayColor(display,
310 DefaultColormap(display, DefaultScreen(display)),
311 "white",
312 &bkgnd_color, &color_def)
314 else;
316 def_val = x_get_resource_string ("menuInactivePattern", "MenuInactivePattern");
317 if (def_val != NULL) {
318 if (strcmp(def_val, "dimple1") == 0) inact_pnum = 0;
319 else if (strcmp(def_val, "dimple3") == 0) inact_pnum = 1;
320 else if (strcmp(def_val, "gray1") == 0) inact_pnum = 2;
321 else if (strcmp(def_val, "gray3") == 0) inact_pnum = 3;
322 else if (strcmp(def_val, "cross_weave") == 0) inact_pnum = 4;
325 def_val = x_get_resource_string ("paneStyle", "PaneStyle");
326 if (def_val != NULL) {
327 if (strcmp(def_val, "flush_left") == 0) p_style = LEFT;
328 else if (strcmp(def_val, "flush_right") == 0) p_style = RIGHT;
329 else if (strcmp(def_val, "center") == 0) p_style = CENTER;
332 def_val = x_get_resource_string ("paneFont", "PaneFont");
333 if (def_val != NULL) p_fnt_name = def_val;
335 def_val = x_get_resource_string ("paneForeground", "PaneForeground");
336 if (
337 def_val != NULL &&
338 DisplayCells(display, DefaultScreen(display)) > 2
340 XAllocDisplayColor(display, DefaultColormap(display,
341 DefaultScreen(display)),
342 def_val,
343 &p_frg_color, &color_def);
345 else if (reverse) XAllocDisplayColor(display,
346 DefaultColormap(display,
347 DefaultScreen(display)),
348 "white",
349 &p_frg_color, &color_def);
350 else XAllocDisplayColor(display,
351 DefaultColormap(display, DefaultScreen(display)),
352 "black",
353 &p_frg_color, &color_def);
355 def_val = x_get_resource_string ("paneBorder", "PaneBorder");
356 if (
357 def_val != NULL &&
358 DisplayCells(display, DefaultScreen(display)) > 2 &&
359 XAllocDisplayColor(display,
360 DefaultColormap(display, DefaultScreen(display)),
361 def_val,
362 &p_bdr_color, &color_def)
364 else if (reverse &&
365 XAllocDisplayColor(display,
366 DefaultColormap(display, DefaultScreen(display)),
367 "white",
368 &p_bdr_color, &color_def)
370 else XAllocDisplayColor(display,
371 DefaultColormap(display, DefaultScreen(display)),
372 "black",
373 &p_bdr_color, &color_def);
375 def_val = x_get_resource_string ("paneBorderWidth", "PaneBorderWidth");
376 if (def_val != NULL) p_bdr_width = atoi(def_val);
378 def_val = x_get_resource_string ("paneSpread", "PaneSpread");
379 if (def_val != NULL) p_spread = atof(def_val);
381 def_val = x_get_resource_string ("selectionStyle", "SelectionStyle");
382 if (def_val != NULL) {
383 if (strcmp(def_val, "flush_left") == 0) s_style = LEFT;
384 else if (strcmp(def_val, "flush_right") == 0) s_style = RIGHT;
385 else if (strcmp(def_val, "center") == 0) s_style = CENTER;
388 def_val = x_get_resource_string ("selectionFont", "SelectionFont");
389 if (def_val != NULL) s_fnt_name = def_val;
391 def_val = x_get_resource_string ("selectionForeground", "SelectionForeground");
392 if (
393 def_val != NULL &&
394 DisplayCells(display, DefaultScreen(display)) > 2 &&
395 XAllocDisplayColor(display,
396 DefaultColormap(display, DefaultScreen(display)),
397 def_val,
398 &s_frg_color, &color_def)
400 else if (reverse &&
401 XAllocDisplayColor(display,
402 DefaultColormap(display, DefaultScreen(display)),
403 "white",
404 &s_frg_color, &color_def)
406 else if (XAllocDisplayColor(display,
407 DefaultColormap(display, DefaultScreen(display)),
408 "black",
409 &s_frg_color, &color_def)
411 else ;
414 def_val = x_get_resource_string ("selectionBorder", "SelectionBorder");
415 if (
416 def_val != NULL &&
417 DisplayCells(display, DefaultScreen(display)) > 2 &&
418 XAllocDisplayColor(display,
419 DefaultColormap(display, DefaultScreen(display)),
420 def_val,
421 &s_bdr_color, &color_def)
423 else if (reverse &&
424 XAllocDisplayColor(display,
425 DefaultColormap(display, DefaultScreen(display)),
426 "white",
427 &s_bdr_color, &color_def)
429 else if (XAllocDisplayColor(display,
430 DefaultColormap(display, DefaultScreen(display)),
431 "black",
432 &s_bdr_color, &color_def)
434 else ;
436 def_val = x_get_resource_string ("selectionBorderWidth", "SelectionBorderWidth");
437 if (def_val != NULL) s_bdr_width = atoi(def_val);
439 def_val = x_get_resource_string ("selectionSpread", "SelectionSpread");
440 if (def_val != NULL) s_spread = atof(def_val);
443 * Create and store the inactive pattern pixmap.
446 char *data = NULL;
447 int width, height;
449 switch (inact_pnum)
451 case 0:
452 data = (char *)dimple1_bits;
453 width = dimple1_width;
454 height = dimple1_height;
455 break;
457 case 1:
458 data = (char *)dimple3_bits;
459 width = dimple3_width;
460 height = dimple3_height;
461 break;
463 case 2:
464 data = (char *)gray1_bits;
465 width = gray1_width;
466 height = gray1_height;
467 break;
469 case 3:
470 data = (char *)gray3_bits;
471 width = gray3_width;
472 height = gray3_height;
473 break;
475 case 4:
476 data = (char *)cross_weave_bits;
477 width = cross_weave_width;
478 height = cross_weave_height;
479 break;
482 if (! data)
484 _XMErrorCode = XME_STORE_BITMAP;
485 return(NULL);
488 inact_bitmap =
489 XCreatePixmapFromBitmapData
490 (display, root, data, width, height,
491 p_frg_color.pixel, bkgnd_color.pixel,
492 DisplayPlanes (display, DefaultScreen (display)));
496 * Load the mouse cursor.
499 switch (menu_style) {
500 case LEFT:
501 cursor = XCreateBitmapFromData(display,
502 root,
503 left_ptr_bits,
504 left_ptr_width,
505 left_ptr_height);
506 cursor_mask = XCreateBitmapFromData(display,
507 root,
508 left_ptrmsk_bits,
509 left_ptrmsk_width,
510 left_ptrmsk_height);
511 mouse_cursor = XCreatePixmapCursor(
512 display,
513 cursor, cursor_mask,
514 &mouse_color, &bkgnd_color,
515 left_ptr_x_hot,
516 left_ptr_y_hot
518 XFreePixmap(display, cursor);
519 XFreePixmap(display, cursor_mask);
520 break;
521 case RIGHT:
522 cursor = XCreateBitmapFromData(display,
523 root,
524 right_ptr_bits,
525 right_ptr_width,
526 right_ptr_height);
527 cursor_mask = XCreateBitmapFromData(display,
528 root,
529 right_ptrmsk_bits,
530 right_ptrmsk_width,
531 right_ptrmsk_height);
532 mouse_cursor = XCreatePixmapCursor(
533 display,
534 cursor, cursor_mask,
535 &mouse_color, &bkgnd_color,
536 right_ptr_x_hot,
537 right_ptr_y_hot
539 XFreePixmap(display, cursor);
540 XFreePixmap(display, cursor_mask);
541 break;
542 case CENTER:
543 cursor = XCreateBitmapFromData(display,
544 root,
545 cntr_ptr_bits,
546 cntr_ptr_width,
547 cntr_ptr_height);
548 cursor_mask = XCreateBitmapFromData(display,
549 root,
550 cntr_ptrmsk_bits,
551 cntr_ptrmsk_width,
552 cntr_ptrmsk_height);
553 mouse_cursor = XCreatePixmapCursor(
554 display,
555 cursor, cursor_mask,
556 &mouse_color, &bkgnd_color,
557 cntr_ptr_x_hot,
558 cntr_ptr_y_hot
560 XFreePixmap(display, cursor);
561 XFreePixmap(display, cursor_mask);
562 break;
563 default:
564 /* Error! Invalid style parameter. */
565 _XMErrorCode = XME_STYLE_PARAM;
566 return(NULL);
568 if (mouse_cursor == _X_FAILURE) {
569 _XMErrorCode = XME_CREATE_CURSOR;
570 return(NULL);
574 * Open the pane and selection fonts.
577 p_fnt_info = XLoadQueryFont(display, p_fnt_name);
578 if (p_fnt_info == NULL) {
579 _XMErrorCode = XME_OPEN_FONT;
580 return(NULL);
584 s_fnt_info = XLoadQueryFont(display, s_fnt_name);
585 if (s_fnt_info == NULL) {
586 _XMErrorCode = XME_OPEN_FONT;
587 return(NULL);
590 * Calculate the fixed padding value in pixels for each font.
592 p_fnt_height = p_fnt_info->max_bounds.ascent + p_fnt_info->max_bounds.descent;
593 s_fnt_height = s_fnt_info->max_bounds.ascent + s_fnt_info->max_bounds.descent;
594 p_fnt_pad = s_spread * p_fnt_height;
595 s_fnt_pad = s_spread * s_fnt_height;
598 * Calculate fixed height and offset requirements.
600 flag_height = p_fnt_height + (p_fnt_pad << 1);
602 p_height = 0;
603 p_y_off = flag_height + p_bdr_width;
604 p_x_off = p_y_off * p_spread;
606 s_height = s_fnt_height + (s_fnt_pad << 1) + (s_bdr_width << 1);
607 s_y_off = s_height;
608 s_x_off = p_x_off;
611 * Set up the pane list header.
613 pane->next = pane;
614 pane->prev = pane;
615 pane->type = PL_HEADER;
616 pane->serial = -1;
619 * Initialize the internal pane and selection creation queues.
621 _XMWinQueInit();
624 * Create pane, active, and inactive GC's.
626 values = (XGCValues *)malloc(sizeof(XGCValues));
627 valuemask = (GCForeground | GCBackground | GCFont | GCLineWidth);
630 * First, pane.
633 values->foreground = p_frg_color.pixel;
634 values->background = bkgnd_color.pixel;
635 values->font = p_fnt_info->fid;
636 values->line_width = p_bdr_width;
638 pane_GC = XCreateGC(
639 display,
640 root,
641 valuemask,
642 values);
644 * Then normal video selection.
647 values->foreground = s_frg_color.pixel;
648 values->background = bkgnd_color.pixel;
649 values->font = s_fnt_info->fid;
650 values->line_width = s_bdr_width;
651 normal_select_GC = XCreateGC(display,
652 root,
653 valuemask,
654 values);
656 * Inverse video selection.
659 values->foreground = bkgnd_color.pixel;
660 values->background = s_frg_color.pixel;
661 values->font = s_fnt_info->fid;
662 values->line_width = s_bdr_width;
663 inverse_select_GC = XCreateGC(display,
664 root,
665 valuemask,
666 values);
667 stipple_pixmap = XCreateBitmapFromData(display,
668 root,
669 stipple_bits,
670 stipple_width,
671 stipple_height);
674 * Finally, inactive pane header and selections
676 valuemask |= (GCFillStyle | GCStipple);
677 values->foreground = s_frg_color.pixel;
678 values->background = bkgnd_color.pixel;
679 values->font = s_fnt_info->fid;
680 values->line_width = s_bdr_width;
681 values->fill_style = FillStippled;
682 values->stipple = stipple_pixmap;
684 inact_GC = XCreateGC(display,
685 root,
686 valuemask,
687 values);
689 valuemask |= (GCGraphicsExposures);
690 values->graphics_exposures = False;
691 inact_GC_noexpose = XCreateGC (display,
692 root,
693 valuemask, values);
697 * Construct the XMenu object.
699 /* -------------------- Menu data -------------------- */
700 menu->menu_style = menu_style;
701 menu->menu_mode = menu_mode;
702 menu->freeze = freeze;
703 menu->aeq = 0;
704 menu->recompute = 1;
705 menu->parent = parent;
706 menu->height = 0;
707 menu->width = 0;
708 menu->mouse_cursor = mouse_cursor;
709 menu->assoc_tab = assoc_tab;
710 menu->p_list = pane;
711 /* -------------------- Pane window data -------------------- */
712 menu->p_style = p_style;
713 menu->p_events = DEF_P_EVENTS;
714 menu->p_fnt_info = p_fnt_info;
715 menu->p_fnt_pad = p_fnt_pad;
716 menu->p_spread = p_spread;
717 menu->p_bdr_width = p_bdr_width;
718 menu->flag_height = flag_height;
719 menu->p_width = 0;
720 menu->p_height = p_height;
721 menu->p_x_off = p_x_off;
722 menu->p_y_off = p_y_off;
723 menu->p_count = 0;
724 menu->pane_GC = pane_GC;
725 menu->x_pos = 0;
726 menu->y_pos = 0;
727 /* -------------------- Selection window data -------------------- */
728 menu->s_style = s_style;
729 menu->s_events = DEF_S_EVENTS;
730 menu->s_fnt_info = s_fnt_info;
731 menu->s_fnt_pad = s_fnt_pad;
732 menu->s_spread = s_spread;
733 menu->s_bdr_width = s_bdr_width; /* unnecessary */
734 menu->s_width = 0;
735 menu->s_height = s_height;
736 menu->s_x_off = s_x_off;
737 menu->s_y_off = s_y_off;
738 menu->s_count = 0;
739 menu->normal_select_GC = normal_select_GC;
740 menu->inverse_select_GC = inverse_select_GC;
741 menu->inact_GC = inact_GC;
742 /* -------------------- Color data -------------------- */
743 menu->p_bdr_color = p_bdr_color.pixel;
744 menu->s_bdr_color = s_bdr_color.pixel;
745 menu->p_frg_color = p_frg_color.pixel;
746 menu->s_frg_color = s_frg_color.pixel;
747 menu->bkgnd_color = bkgnd_color.pixel;
748 /* -------------------- Pixmap data -------------------- */
749 menu->p_bdr_pixmap = None;
750 menu->s_bdr_pixmap = None;
751 menu->p_frg_pixmap = None;
752 menu->s_frg_pixmap = None;
753 menu->bkgnd_pixmap = None;
754 menu->inact_pixmap = inact_bitmap;
757 * Return the completed XMenu.
759 _XMErrorCode = XME_NO_ERROR;
760 return(menu);