Nuke arch-tags.
[emacs.git] / oldXMenu / Create.c
blobb5f814a6ec3e51f9dd2ec2eb3b6131ec10fce2b0
1 /* Copyright Massachusetts Institute of Technology 1985 */
3 #include "copyright.h"
5 /*
6 Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
7 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 * XMenu: MIT Project Athena, X Window system menu package
26 * XMenuCreate - Creates an X window system menu object.
28 * Author: Tony Della Fera, DEC
29 * January 23, 1986
33 #include <config.h>
34 #include "XMenuInt.h"
37 #ifdef EMACS_BITMAP_FILES
38 #include "../src/bitmaps/dimple1.xbm"
39 #include "../src/bitmaps/dimple3.xbm"
40 #include "../src/bitmaps/gray1.xbm"
41 #include "../src/bitmaps/gray3.xbm"
42 #include "../src/bitmaps/crosswv.xbm"
44 #include "../src/bitmaps/leftptr.xbm"
45 #include "../src/bitmaps/leftpmsk.xbm"
46 #include "../src/bitmaps/rtptr.xbm"
47 #include "../src/bitmaps/rtpmsk.xbm"
48 #include "../src/bitmaps/cntrptr.xbm"
49 #include "../src/bitmaps/cntrpmsk.xbm"
50 #include "../src/bitmaps/stipple.xbm"
52 #else
54 #include <X11/bitmaps/dimple1>
55 #include <X11/bitmaps/dimple3>
56 #include <X11/bitmaps/gray1>
57 #include <X11/bitmaps/gray3>
58 #include <X11/bitmaps/cross_weave>
60 #include <X11/bitmaps/left_ptr>
61 #include <X11/bitmaps/left_ptrmsk>
62 #include <X11/bitmaps/right_ptr>
63 #include <X11/bitmaps/right_ptrmsk>
64 #include <X11/bitmaps/cntr_ptr>
65 #include <X11/bitmaps/cntr_ptrmsk>
66 #include <X11/bitmaps/stipple>
68 #endif /* not EMACS_BITMAP_FILES */
70 #define DEF_FREEZE 0
71 #define DEF_REVERSE 0
72 #define DEF_MENU_STYLE LEFT
73 #define DEF_MENU_MODE BOX
74 #define DEF_INACT_PNUM 3
75 #define MAX_INACT_PNUM 4
77 #define DEF_P_STYLE CENTER
79 #define DEF_P_EVENTS (EnterWindowMask | ExposureMask)
80 #define DEF_P_FNT_NAME "fixed"
81 #define DEF_P_SPREAD 0.5
82 #define DEF_P_BDR_WIDTH 2
84 #define DEF_S_STYLE LEFT
85 #define DEF_S_EVENTS (EnterWindowMask | LeaveWindowMask)
86 #define DEF_S_FNT_NAME "fixed"
87 #define DEF_S_SPREAD 0.10
88 #define DEF_S_BDR_WIDTH 1
90 #define XASSOC_TABLE_SIZE 64
92 #define TILE_BUF_SIZE 5
94 int atoi(const char *);
95 double atof(const char *);
96 char *x_get_resource_string (char *attribute, char *class);
100 static Status
101 XAllocDisplayColor(Display *display, Colormap map, char *colorName, XColor *color, XColor *junk)
103 return (colorName!=0 &&
104 XParseColor(display, map, colorName, color) &&
105 XAllocColor(display, map, color));
109 XMenu *
110 XMenuCreate(Display *display, Window parent, register char *def_env)
111 /* ID of previously opened display */
112 /* Window ID of the menu's parent window. */
113 /* X Defaults program environment name. */
115 register int i; /* Loop counter. */
116 register int j; /* Loop counter. */
117 register char *def_val; /* X Default value temp variable. */
119 register XMenu *menu; /* Pointer to the new menu. */
120 XMStyle menu_style; /* Menu display style. */
121 XMMode menu_mode; /* Menu display mode. */
122 XMPane *pane; /* Pane list header. */
123 XAssocTable *assoc_tab; /* XAssocTable pointer. */
125 int freeze; /* Freeze server mode. */
126 int reverse; /* Reverse video mode. */
128 XMStyle p_style; /* Pane display style. */
129 char *p_fnt_name; /* Flag font name. */
130 XFontStruct *p_fnt_info; /* Flag font structure */
131 int p_fnt_pad; /* Flag font padding in pixels. */
132 double p_spread; /* Pane spread in flag height fractions. */
133 int p_fnt_height; /* Pane character height. */
134 int p_bdr_width; /* Pane border width. */
135 int flag_height; /* Flag window height. */
136 int p_height; /* Pane window height. */
137 int p_x_off; /* Pane X offset. */
138 int p_y_off; /* Pane Y offset. */
139 GC pane_GC; /* Pane graphics context. */
141 XMStyle s_style; /* Selection display style. */
142 char *s_fnt_name; /* Selection font name. */
143 XFontStruct *s_fnt_info; /* Selection font structure. */
144 int s_fnt_pad; /* Selection font padding in pixels. */
145 int s_fnt_height; /* Selection font character height */
146 double s_spread; /* Select spread in line height fractions. */
147 int s_bdr_width; /* Highlight border width. */
148 int s_height; /* Selection window height. */
149 int s_x_off; /* Selection window X offset. */
150 int s_y_off; /* Selection window Y offset. */
151 GC normal_select_GC; /* GC used for normal video selection. */
152 GC inverse_select_GC; /* GC used for inverse video selection. */
153 GC inact_GC; /* GC for inactive pane header and */
154 /* selections. */
155 GC inact_GC_noexpose;
157 XColor color_def; /* Temp color definition holder. */
158 XColor screen_def; /* Temp screen color definition holder */
159 XColor p_bdr_color; /* Color of border. */
160 XColor s_bdr_color; /* Color of highlight. */
161 XColor p_frg_color; /* Color of pane foreground color. */
162 XColor s_frg_color; /* Color of selection foreground. */
163 XColor bkgnd_color; /* Color of background.. */
164 XColor mouse_color; /* Color of mouse cursor. */
165 Cursor mouse_cursor; /* Mouse cursor. */
166 Pixmap inact_bitmap; /* Menu inactive pixmap. */
168 int inact_pnum; /* Inactive background pattern number. */
170 Pixel p_bdr_pixel; /* Pane border pixel. */
171 Pixel s_bdr_pixel; /* Selection border pixel. */
172 Pixel p_frg_pixel; /* Pane foreground pixel. */
173 Pixel s_frg_pixel; /* Selection foreground pixel. */
174 Pixel bkgnd_pixel; /* Menu background pixel. */
176 int *width, *height;
177 Pixmap *bitmap;
178 int *x_hot, *y_hot;
179 int status; /* Return code from XReadBitmapFile. */
181 Pixmap cursor; /* Cursor pixmap holder. */
182 Pixmap cursor_mask; /* Cursor mask pixmap holder. */
183 Pixmap stipple_pixmap; /* Stipple mask for half-tone text. */
184 unsigned long valuemask;
185 XGCValues *values;
187 Window root = RootWindow (display, DefaultScreen (display));
190 * Calloc the XMenu structure and the initial pane.
192 menu = (XMenu *)calloc(1, sizeof(XMenu));
193 if (menu == NULL) {
194 _XMErrorCode = XME_CALLOC;
195 return(NULL);
197 pane = (XMPane *)calloc(1, sizeof(XMPane));
198 if (pane == NULL) {
199 _XMErrorCode = XME_CALLOC;
200 return(NULL);
204 * Create the XAssocTable
206 assoc_tab = (XAssocTable *)XCreateAssocTable(XASSOC_TABLE_SIZE);
207 if(assoc_tab == NULL) {
208 _XMErrorCode= XME_CREATE_ASSOC;
209 return(NULL);
213 * Set up the default environment name.
215 if (def_env == NULL || *def_env == '\0') def_env = "XMenu";
218 * Set up internal fail-safe defaults.
220 freeze = DEF_FREEZE;
221 reverse = DEF_REVERSE;
222 menu_style = DEF_MENU_STYLE;
223 menu_mode = DEF_MENU_MODE;
224 inact_pnum = DEF_INACT_PNUM;
226 p_style = DEF_P_STYLE;
227 p_spread = DEF_P_SPREAD;
228 p_fnt_name = DEF_P_FNT_NAME;
229 p_bdr_width = DEF_P_BDR_WIDTH;
231 s_style = DEF_S_STYLE;
232 s_spread = DEF_S_SPREAD;
233 s_fnt_name = DEF_S_FNT_NAME;
234 s_bdr_width = DEF_S_BDR_WIDTH;
237 * Get default values from X.
239 def_val = x_get_resource_string ("menuFreeze", "MenuFreeze");
240 if (def_val != NULL) {
241 if (strcmp(def_val, "on") == 0) freeze = 1;
242 else if (strcmp(def_val, "off") == 0) freeze = 0;
245 def_val = x_get_resource_string ("menuReverseVideo", "MenuReverseVideo");
246 if (def_val != NULL) {
247 if (strcmp(def_val, "on") == 0) reverse = 1;
248 else if (strcmp(def_val, "off") == 0) reverse = 0;
251 def_val = x_get_resource_string ("menuStyle", "MenuStyle");
252 if (def_val != NULL) {
253 if (strcmp(def_val, "right_hand") == 0) menu_style = RIGHT;
254 else if (strcmp(def_val, "left_hand") == 0) menu_style = LEFT;
255 else if (strcmp(def_val, "center") == 0) menu_style = CENTER;
258 def_val = x_get_resource_string ("menuMode", "MenuMode");
259 if (def_val != NULL) {
260 if (strcmp(def_val, "box") == 0) menu_mode = BOX;
261 else if (strcmp(def_val, "invert") == 0) menu_mode = INVERT;
264 def_val = x_get_resource_string ("menuMouse", "MenuMouse");
265 if (
266 def_val != NULL &&
267 DisplayCells(display, DefaultScreen(display)) > 2 &&
268 XAllocDisplayColor(display,
269 DefaultColormap(display, DefaultScreen(display)),
270 def_val,
271 &mouse_color, &color_def)
273 else if (reverse &&
274 XAllocDisplayColor(display,
275 DefaultColormap(display, DefaultScreen(display)),
276 "white",
277 &mouse_color, &color_def)
280 else if (XAllocDisplayColor(display,
281 DefaultColormap(display, DefaultScreen(display)),
282 "black",
283 &mouse_color, &color_def)
286 else ;
288 def_val = x_get_resource_string ("menuBackground", "MenuBackground");
289 if (
290 def_val != NULL &&
291 DisplayCells(display, DefaultScreen(display)) > 2 &&
292 XAllocDisplayColor(display,
293 DefaultColormap(display, DefaultScreen(display)),
294 def_val,
295 &bkgnd_color, &color_def)
297 else if (reverse &&
298 XAllocDisplayColor(display,
299 DefaultColormap(display, DefaultScreen(display)),
300 "black",
301 &bkgnd_color, &color_def)
303 else if (XAllocDisplayColor(display,
304 DefaultColormap(display, DefaultScreen(display)),
305 "white",
306 &bkgnd_color, &color_def)
308 else;
310 def_val = x_get_resource_string ("menuInactivePattern", "MenuInactivePattern");
311 if (def_val != NULL) {
312 if (strcmp(def_val, "dimple1") == 0) inact_pnum = 0;
313 else if (strcmp(def_val, "dimple3") == 0) inact_pnum = 1;
314 else if (strcmp(def_val, "gray1") == 0) inact_pnum = 2;
315 else if (strcmp(def_val, "gray3") == 0) inact_pnum = 3;
316 else if (strcmp(def_val, "cross_weave") == 0) inact_pnum = 4;
319 def_val = x_get_resource_string ("paneStyle", "PaneStyle");
320 if (def_val != NULL) {
321 if (strcmp(def_val, "flush_left") == 0) p_style = LEFT;
322 else if (strcmp(def_val, "flush_right") == 0) p_style = RIGHT;
323 else if (strcmp(def_val, "center") == 0) p_style = CENTER;
326 def_val = x_get_resource_string ("paneFont", "PaneFont");
327 if (def_val != NULL) p_fnt_name = def_val;
329 def_val = x_get_resource_string ("paneForeground", "PaneForeground");
330 if (
331 def_val != NULL &&
332 DisplayCells(display, DefaultScreen(display)) > 2
334 XAllocDisplayColor(display, DefaultColormap(display,
335 DefaultScreen(display)),
336 def_val,
337 &p_frg_color, &color_def);
339 else if (reverse) XAllocDisplayColor(display,
340 DefaultColormap(display,
341 DefaultScreen(display)),
342 "white",
343 &p_frg_color, &color_def);
344 else XAllocDisplayColor(display,
345 DefaultColormap(display, DefaultScreen(display)),
346 "black",
347 &p_frg_color, &color_def);
349 def_val = x_get_resource_string ("paneBorder", "PaneBorder");
350 if (
351 def_val != NULL &&
352 DisplayCells(display, DefaultScreen(display)) > 2 &&
353 XAllocDisplayColor(display,
354 DefaultColormap(display, DefaultScreen(display)),
355 def_val,
356 &p_bdr_color, &color_def)
358 else if (reverse &&
359 XAllocDisplayColor(display,
360 DefaultColormap(display, DefaultScreen(display)),
361 "white",
362 &p_bdr_color, &color_def)
364 else XAllocDisplayColor(display,
365 DefaultColormap(display, DefaultScreen(display)),
366 "black",
367 &p_bdr_color, &color_def);
369 def_val = x_get_resource_string ("paneBorderWidth", "PaneBorderWidth");
370 if (def_val != NULL) p_bdr_width = atoi(def_val);
372 def_val = x_get_resource_string ("paneSpread", "PaneSpread");
373 if (def_val != NULL) p_spread = atof(def_val);
375 def_val = x_get_resource_string ("selectionStyle", "SelectionStyle");
376 if (def_val != NULL) {
377 if (strcmp(def_val, "flush_left") == 0) s_style = LEFT;
378 else if (strcmp(def_val, "flush_right") == 0) s_style = RIGHT;
379 else if (strcmp(def_val, "center") == 0) s_style = CENTER;
382 def_val = x_get_resource_string ("selectionFont", "SelectionFont");
383 if (def_val != NULL) s_fnt_name = def_val;
385 def_val = x_get_resource_string ("selectionForeground", "SelectionForeground");
386 if (
387 def_val != NULL &&
388 DisplayCells(display, DefaultScreen(display)) > 2 &&
389 XAllocDisplayColor(display,
390 DefaultColormap(display, DefaultScreen(display)),
391 def_val,
392 &s_frg_color, &color_def)
394 else if (reverse &&
395 XAllocDisplayColor(display,
396 DefaultColormap(display, DefaultScreen(display)),
397 "white",
398 &s_frg_color, &color_def)
400 else if (XAllocDisplayColor(display,
401 DefaultColormap(display, DefaultScreen(display)),
402 "black",
403 &s_frg_color, &color_def)
405 else ;
408 def_val = x_get_resource_string ("selectionBorder", "SelectionBorder");
409 if (
410 def_val != NULL &&
411 DisplayCells(display, DefaultScreen(display)) > 2 &&
412 XAllocDisplayColor(display,
413 DefaultColormap(display, DefaultScreen(display)),
414 def_val,
415 &s_bdr_color, &color_def)
417 else if (reverse &&
418 XAllocDisplayColor(display,
419 DefaultColormap(display, DefaultScreen(display)),
420 "white",
421 &s_bdr_color, &color_def)
423 else if (XAllocDisplayColor(display,
424 DefaultColormap(display, DefaultScreen(display)),
425 "black",
426 &s_bdr_color, &color_def)
428 else ;
430 def_val = x_get_resource_string ("selectionBorderWidth", "SelectionBorderWidth");
431 if (def_val != NULL) s_bdr_width = atoi(def_val);
433 def_val = x_get_resource_string ("selectionSpread", "SelectionSpread");
434 if (def_val != NULL) s_spread = atof(def_val);
437 * Create and store the inactive pattern pixmap.
440 char *data = NULL;
441 int width, height;
443 switch (inact_pnum)
445 case 0:
446 data = (char *)dimple1_bits;
447 width = dimple1_width;
448 height = dimple1_height;
449 break;
451 case 1:
452 data = (char *)dimple3_bits;
453 width = dimple3_width;
454 height = dimple3_height;
455 break;
457 case 2:
458 data = (char *)gray1_bits;
459 width = gray1_width;
460 height = gray1_height;
461 break;
463 case 3:
464 data = (char *)gray3_bits;
465 width = gray3_width;
466 height = gray3_height;
467 break;
469 case 4:
470 data = (char *)cross_weave_bits;
471 width = cross_weave_width;
472 height = cross_weave_height;
473 break;
476 if (! data)
478 _XMErrorCode = XME_STORE_BITMAP;
479 return(NULL);
482 inact_bitmap =
483 XCreatePixmapFromBitmapData
484 (display, root, data, width, height,
485 p_frg_color.pixel, bkgnd_color.pixel,
486 DisplayPlanes (display, DefaultScreen (display)));
490 * Load the mouse cursor.
493 switch (menu_style) {
494 case LEFT:
495 cursor = XCreateBitmapFromData(display,
496 root,
497 left_ptr_bits,
498 left_ptr_width,
499 left_ptr_height);
500 cursor_mask = XCreateBitmapFromData(display,
501 root,
502 left_ptrmsk_bits,
503 left_ptrmsk_width,
504 left_ptrmsk_height);
505 mouse_cursor = XCreatePixmapCursor(
506 display,
507 cursor, cursor_mask,
508 &mouse_color, &bkgnd_color,
509 left_ptr_x_hot,
510 left_ptr_y_hot
512 XFreePixmap(display, cursor);
513 XFreePixmap(display, cursor_mask);
514 break;
515 case RIGHT:
516 cursor = XCreateBitmapFromData(display,
517 root,
518 right_ptr_bits,
519 right_ptr_width,
520 right_ptr_height);
521 cursor_mask = XCreateBitmapFromData(display,
522 root,
523 right_ptrmsk_bits,
524 right_ptrmsk_width,
525 right_ptrmsk_height);
526 mouse_cursor = XCreatePixmapCursor(
527 display,
528 cursor, cursor_mask,
529 &mouse_color, &bkgnd_color,
530 right_ptr_x_hot,
531 right_ptr_y_hot
533 XFreePixmap(display, cursor);
534 XFreePixmap(display, cursor_mask);
535 break;
536 case CENTER:
537 cursor = XCreateBitmapFromData(display,
538 root,
539 cntr_ptr_bits,
540 cntr_ptr_width,
541 cntr_ptr_height);
542 cursor_mask = XCreateBitmapFromData(display,
543 root,
544 cntr_ptrmsk_bits,
545 cntr_ptrmsk_width,
546 cntr_ptrmsk_height);
547 mouse_cursor = XCreatePixmapCursor(
548 display,
549 cursor, cursor_mask,
550 &mouse_color, &bkgnd_color,
551 cntr_ptr_x_hot,
552 cntr_ptr_y_hot
554 XFreePixmap(display, cursor);
555 XFreePixmap(display, cursor_mask);
556 break;
557 default:
558 /* Error! Invalid style parameter. */
559 _XMErrorCode = XME_STYLE_PARAM;
560 return(NULL);
562 if (mouse_cursor == _X_FAILURE) {
563 _XMErrorCode = XME_CREATE_CURSOR;
564 return(NULL);
568 * Open the pane and selection fonts.
571 p_fnt_info = XLoadQueryFont(display, p_fnt_name);
572 if (p_fnt_info == NULL) {
573 _XMErrorCode = XME_OPEN_FONT;
574 return(NULL);
578 s_fnt_info = XLoadQueryFont(display, s_fnt_name);
579 if (s_fnt_info == NULL) {
580 _XMErrorCode = XME_OPEN_FONT;
581 return(NULL);
584 * Calculate the fixed padding value in pixels for each font.
586 p_fnt_height = p_fnt_info->max_bounds.ascent + p_fnt_info->max_bounds.descent;
587 s_fnt_height = s_fnt_info->max_bounds.ascent + s_fnt_info->max_bounds.descent;
588 p_fnt_pad = s_spread * p_fnt_height;
589 s_fnt_pad = s_spread * s_fnt_height;
592 * Calculate fixed height and offset requirements.
594 flag_height = p_fnt_height + (p_fnt_pad << 1);
596 p_height = 0;
597 p_y_off = flag_height + p_bdr_width;
598 p_x_off = p_y_off * p_spread;
600 s_height = s_fnt_height + (s_fnt_pad << 1) + (s_bdr_width << 1);
601 s_y_off = s_height;
602 s_x_off = p_x_off;
605 * Set up the pane list header.
607 pane->next = pane;
608 pane->prev = pane;
609 pane->type = PL_HEADER;
610 pane->serial = -1;
613 * Initialize the internal pane and selection creation queues.
615 _XMWinQueInit();
618 * Create pane, active, and inactive GC's.
620 values = (XGCValues *)malloc(sizeof(XGCValues));
621 valuemask = (GCForeground | GCBackground | GCFont | GCLineWidth);
624 * First, pane.
627 values->foreground = p_frg_color.pixel;
628 values->background = bkgnd_color.pixel;
629 values->font = p_fnt_info->fid;
630 values->line_width = p_bdr_width;
632 pane_GC = XCreateGC(
633 display,
634 root,
635 valuemask,
636 values);
638 * Then normal video selection.
641 values->foreground = s_frg_color.pixel;
642 values->background = bkgnd_color.pixel;
643 values->font = s_fnt_info->fid;
644 values->line_width = s_bdr_width;
645 normal_select_GC = XCreateGC(display,
646 root,
647 valuemask,
648 values);
650 * Inverse video selection.
653 values->foreground = bkgnd_color.pixel;
654 values->background = s_frg_color.pixel;
655 values->font = s_fnt_info->fid;
656 values->line_width = s_bdr_width;
657 inverse_select_GC = XCreateGC(display,
658 root,
659 valuemask,
660 values);
661 stipple_pixmap = XCreateBitmapFromData(display,
662 root,
663 stipple_bits,
664 stipple_width,
665 stipple_height);
668 * Finally, inactive pane header and selections
670 valuemask |= (GCFillStyle | GCStipple);
671 values->foreground = s_frg_color.pixel;
672 values->background = bkgnd_color.pixel;
673 values->font = s_fnt_info->fid;
674 values->line_width = s_bdr_width;
675 values->fill_style = FillStippled;
676 values->stipple = stipple_pixmap;
678 inact_GC = XCreateGC(display,
679 root,
680 valuemask,
681 values);
683 valuemask |= (GCGraphicsExposures);
684 values->graphics_exposures = False;
685 inact_GC_noexpose = XCreateGC (display,
686 root,
687 valuemask, values);
691 * Construct the XMenu object.
693 /* -------------------- Menu data -------------------- */
694 menu->menu_style = menu_style;
695 menu->menu_mode = menu_mode;
696 menu->freeze = freeze;
697 menu->aeq = 0;
698 menu->recompute = 1;
699 menu->parent = parent;
700 menu->height = 0;
701 menu->width = 0;
702 menu->mouse_cursor = mouse_cursor;
703 menu->assoc_tab = assoc_tab;
704 menu->p_list = pane;
705 /* -------------------- Pane window data -------------------- */
706 menu->p_style = p_style;
707 menu->p_events = DEF_P_EVENTS;
708 menu->p_fnt_info = p_fnt_info;
709 menu->p_fnt_pad = p_fnt_pad;
710 menu->p_spread = p_spread;
711 menu->p_bdr_width = p_bdr_width;
712 menu->flag_height = flag_height;
713 menu->p_width = 0;
714 menu->p_height = p_height;
715 menu->p_x_off = p_x_off;
716 menu->p_y_off = p_y_off;
717 menu->p_count = 0;
718 menu->pane_GC = pane_GC;
719 menu->x_pos = 0;
720 menu->y_pos = 0;
721 /* -------------------- Selection window data -------------------- */
722 menu->s_style = s_style;
723 menu->s_events = DEF_S_EVENTS;
724 menu->s_fnt_info = s_fnt_info;
725 menu->s_fnt_pad = s_fnt_pad;
726 menu->s_spread = s_spread;
727 menu->s_bdr_width = s_bdr_width; /* unnecessary */
728 menu->s_width = 0;
729 menu->s_height = s_height;
730 menu->s_x_off = s_x_off;
731 menu->s_y_off = s_y_off;
732 menu->s_count = 0;
733 menu->normal_select_GC = normal_select_GC;
734 menu->inverse_select_GC = inverse_select_GC;
735 menu->inact_GC = inact_GC;
736 /* -------------------- Color data -------------------- */
737 menu->p_bdr_color = p_bdr_color.pixel;
738 menu->s_bdr_color = s_bdr_color.pixel;
739 menu->p_frg_color = p_frg_color.pixel;
740 menu->s_frg_color = s_frg_color.pixel;
741 menu->bkgnd_color = bkgnd_color.pixel;
742 /* -------------------- Pixmap data -------------------- */
743 menu->p_bdr_pixmap = None;
744 menu->s_bdr_pixmap = None;
745 menu->p_frg_pixmap = None;
746 menu->s_frg_pixmap = None;
747 menu->bkgnd_pixmap = None;
748 menu->inact_pixmap = inact_bitmap;
751 * Return the completed XMenu.
753 _XMErrorCode = XME_NO_ERROR;
754 return(menu);