1 /* Implements an elisp-programmable menubar -- X interface.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
3 Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
5 This file is part of XEmacs.
7 XEmacs is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with XEmacs; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Synched up with: Not in FSF. */
24 /* created 16-dec-91 by jwz */
29 #include "console-x.h"
30 #include "EmacsFrame.h"
34 #include "commands.h" /* zmacs_regions */
41 static int set_frame_menubar (struct frame *f,
45 #define FRAME_MENUBAR_DATA(frame) ((frame)->menubar_data)
46 #define XFRAME_MENUBAR_DATA(frame) XPOPUP_DATA ((frame)->menubar_data)
48 #define MENUBAR_TYPE 0
49 #define SUBMENU_TYPE 1
53 /* Converting Lisp menu tree descriptions to lwlib's `widget_value' form.
55 menu_item_descriptor_to_widget_value() converts a lisp description of a
56 menubar into a tree of widget_value structures. It allocates widget_values
57 with malloc_widget_value() and allocates other storage only for the `key'
58 slot. All other slots are filled with pointers to Lisp_String data. We
59 allocate a widget_value description of the menu or menubar, and hand it to
60 lwlib, which then makes a copy of it, which it manages internally. We then
61 immediately free our widget_value tree; it will not be referenced again.
63 Incremental menu construction callbacks operate just a bit differently.
64 They allocate widget_values and call replace_widget_value_tree() to tell
65 lwlib to destructively modify the incremental stub (subtree) of its
66 separate widget_value tree.
68 This function is highly recursive (it follows the menu trees) and may call
69 eval. The reason we keep pointers to lisp string data instead of copying
70 it and freeing it later is to avoid the speed penalty that would entail
71 (since this needs to be fast, in the simple cases at least). (The reason
72 we malloc/free the keys slot is because there's not a lisp string around
73 for us to use in that case.)
75 Since we keep pointers to lisp strings, and we call eval, we could lose if
76 GC relocates (or frees) those strings. It's not easy to gc protect the
77 strings because of the recursive nature of this function, and the fact that
78 it returns a data structure that gets freed later. So... we do the
79 sleaziest thing possible and inhibit GC for the duration. This is probably
82 We do not have to worry about the pointers to Lisp_String data after
83 this function successfully finishes. lwlib copies all such data with
87 menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
88 int menu_type, int deep_p,
92 /* This function cannot GC.
93 It is only called from menu_item_descriptor_to_widget_value, which
95 /* !!#### This function has not been Mule-ized */
96 int menubar_root_p = (menu_type == MENUBAR_TYPE && depth == 0);
98 Lisp_Object wv_closure;
99 int count = specpdl_depth ();
100 int partition_seen = 0;
102 wv = xmalloc_widget_value ();
104 wv_closure = make_opaque_ptr (wv);
105 record_unwind_protect (widget_value_unwind, wv_closure);
109 char *string_chars = (char *) XSTRING_DATA (desc);
110 wv->type = (separator_string_p (string_chars) ? SEPARATOR_TYPE :
113 /* #### - should internationalize with X resources instead.
115 string_chars = GETTEXT (string_chars);
117 if (wv->type == SEPARATOR_TYPE)
119 wv->value = menu_separator_style (string_chars);
123 wv->name = string_chars;
125 /* dverna Dec. 98: command_builder_operate_menu_accelerator will
126 manipulate the accel as a Lisp_Object if the widget has a name.
127 Since simple labels have a name, but no accel, we *must* set it
129 wv->accel = LISP_TO_VOID (Qnil);
132 else if (VECTORP (desc))
134 Lisp_Object gui_item = gui_parse_item_keywords (desc);
135 if (!button_item_to_widget_value (gui_item, wv, 1,
136 (menu_type == MENUBAR_TYPE
139 /* :included form was nil */
144 else if (CONSP (desc))
146 Lisp_Object incremental_data = desc;
147 widget_value *prev = 0;
149 if (STRINGP (XCAR (desc)))
151 Lisp_Object key, val;
152 Lisp_Object include_p = Qnil, hook_fn = Qnil, config_tag = Qnil;
153 Lisp_Object active_p = Qt;
155 int included_spec = 0;
157 wv->type = CASCADE_TYPE;
159 wv->name = (char *) XSTRING_DATA (LISP_GETTEXT (XCAR (desc)));
161 accel = gui_name_accelerator (LISP_GETTEXT (XCAR (desc)));
162 wv->accel = LISP_TO_VOID (accel);
166 while (key = Fcar (desc), KEYWORDP (key))
168 Lisp_Object cascade = desc;
171 signal_simple_error ("Keyword in menu lacks a value",
175 if (EQ (key, Q_included))
176 include_p = val, included_spec = 1;
177 else if (EQ (key, Q_config))
179 else if (EQ (key, Q_filter))
181 else if (EQ (key, Q_active))
182 active_p = val, active_spec = 1;
183 else if (EQ (key, Q_accelerator))
187 wv->accel = LISP_TO_VOID (val);
189 signal_simple_error ("bad keyboard accelerator", val);
191 else if (EQ (key, Q_label))
193 /* implement in 21.2 */
196 signal_simple_error ("Unknown menu cascade keyword", cascade);
199 if ((!NILP (config_tag)
200 && NILP (Fmemq (config_tag, Vmenubar_configuration)))
201 || (included_spec && NILP (Feval (include_p))))
208 active_p = Feval (active_p);
210 if (!NILP (hook_fn) && !NILP (active_p))
212 #if defined LWLIB_MENUBARS_LUCID || defined LWLIB_MENUBARS_MOTIF
213 if (filter_p || depth == 0)
216 desc = call1_trapping_errors ("Error in menubar filter",
220 #if defined LWLIB_MENUBARS_LUCID || defined LWLIB_MENUBARS_MOTIF
224 widget_value *incr_wv = xmalloc_widget_value ();
225 wv->contents = incr_wv;
226 incr_wv->type = INCREMENTAL_TYPE;
227 incr_wv->enabled = 1;
228 incr_wv->name = wv->name;
229 /* This is automatically GC protected through
230 the call to lw_map_widget_values(); no need
232 incr_wv->call_data = LISP_TO_VOID (incremental_data);
235 #endif /* LWLIB_MENUBARS_LUCID || LWLIB_MENUBARS_MOTIF */
237 if (menu_type == POPUP_TYPE && popup_menu_titles && depth == 0)
239 /* Simply prepend three more widget values to the contents of
240 the menu: a label, and two separators (to get a double
242 widget_value *title_wv = xmalloc_widget_value ();
243 widget_value *sep_wv = xmalloc_widget_value ();
244 title_wv->type = TEXT_TYPE;
245 title_wv->name = wv->name;
246 title_wv->enabled = 1;
247 title_wv->next = sep_wv;
248 sep_wv->type = SEPARATOR_TYPE;
249 sep_wv->value = menu_separator_style ("==");
252 wv->contents = title_wv;
255 wv->enabled = ! NILP (active_p);
256 if (deep_p && !wv->enabled && !NILP (desc))
259 /* Add a fake entry so the menus show up */
260 wv->contents = dummy = xmalloc_widget_value ();
261 dummy->name = "(inactive)";
262 dummy->accel = LISP_TO_VOID (Qnil);
266 dummy->type = BUTTON_TYPE;
267 dummy->call_data = NULL;
274 else if (menubar_root_p)
276 wv->name = (char *) "menubar";
277 wv->type = CASCADE_TYPE; /* Well, nothing else seems to fit and
278 this is ignored anyway... */
282 signal_simple_error ("Menu name (first element) must be a string",
286 if (deep_p || menubar_root_p)
289 for (; !NILP (desc); desc = Fcdr (desc))
291 Lisp_Object child = Fcar (desc);
292 if (menubar_root_p && NILP (child)) /* the partition */
296 "More than one partition (nil) in menubar description");
298 next = xmalloc_widget_value ();
299 next->type = PUSHRIGHT_TYPE;
303 next = menu_item_descriptor_to_widget_value_1
304 (child, menu_type, deep_p, filter_p, depth + 1);
315 if (deep_p && !wv->contents)
318 else if (NILP (desc))
319 error ("nil may not appear in menu descriptions");
321 signal_simple_error ("Unrecognized menu descriptor", desc);
327 /* Completed normally. Clear out the object that widget_value_unwind()
328 will be called with to tell it not to free the wv (as we are
330 set_opaque_ptr (wv_closure, 0);
333 unbind_to (count, Qnil);
337 static widget_value *
338 menu_item_descriptor_to_widget_value (Lisp_Object desc,
339 int menu_type, /* if this is a menubar,
342 int filter_p) /* if :filter forms
346 int count = specpdl_depth ();
347 record_unwind_protect (restore_gc_inhibit,
348 make_int (gc_currently_forbidden));
349 gc_currently_forbidden = 1;
351 wv = menu_item_descriptor_to_widget_value_1 (desc, menu_type, deep_p,
353 unbind_to (count, Qnil);
358 #if defined LWLIB_MENUBARS_LUCID || defined LWLIB_MENUBARS_MOTIF
359 int in_menu_callback;
362 restore_in_menu_callback (Lisp_Object val)
364 in_menu_callback = XINT(val);
367 #endif /* LWLIB_MENUBARS_LUCID || LWLIB_MENUBARS_MOTIF */
370 /* #### Sort of a hack needed to process Vactivate_menubar_hook
371 correctly wrt buffer-local values. A correct solution would
372 involve adding a callback mechanism to run_hook(). This function
373 is currently unused. */
375 my_run_hook (Lisp_Object hooksym, int allow_global_p)
377 /* This function can GC */
379 Lisp_Object value = Fsymbol_value (hooksym);
382 if (!NILP (value) && (!CONSP (value) || EQ (XCAR (value), Qlambda)))
383 return !EQ (call0 (value), Qt);
385 EXTERNAL_LIST_LOOP (tail, value)
387 if (allow_global_p && EQ (XCAR (tail), Qt))
388 changes |= my_run_hook (Fdefault_value (hooksym), 0);
389 if (!EQ (call0 (XCAR (tail)), Qt))
397 /* The order in which callbacks are run is funny to say the least.
398 It's sometimes tricky to avoid running a callback twice, and to
399 avoid returning prematurely. So, this function returns true
400 if the menu's callbacks are no longer gc protected. So long
401 as we unprotect them before allowing other callbacks to run,
402 everything should be ok.
404 The pre_activate_callback() *IS* intentionally called multiple times.
405 If client_data == NULL, then it's being called before the menu is posted.
406 If client_data != NULL, then client_data is a (widget_value *) and
407 client_data->data is a Lisp_Object pointing to a lisp submenu description
408 that must be converted into widget_values. *client_data is destructively
411 #### Stig thinks that there may be a GC problem here due to the
412 fact that pre_activate_callback() is called multiple times, but I
418 pre_activate_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
420 /* This function can GC */
421 struct device *d = get_device_from_display (XtDisplay (widget));
422 struct frame *f = x_any_window_to_frame (d, XtWindow (widget));
426 /* set in lwlib to the time stamp associated with the most recent menu
428 extern Time x_focus_timestamp_really_sucks_fix_me_better;
431 f = x_any_window_to_frame (d, XtWindow (XtParent (widget)));
435 /* make sure f is the selected frame */
436 XSETFRAME (frame, f);
437 Fselect_frame (frame);
441 /* this is an incremental menu construction callback */
442 widget_value *hack_wv = (widget_value *) client_data;
443 Lisp_Object submenu_desc;
446 assert (hack_wv->type == INCREMENTAL_TYPE);
447 VOID_TO_LISP (submenu_desc, hack_wv->call_data);
450 * #### Fix the menu code so this isn't necessary.
452 * Protect against reentering the menu code otherwise we will
453 * crash later when the code gets confused at the state
456 count = specpdl_depth ();
457 record_unwind_protect (restore_in_menu_callback,
458 make_int (in_menu_callback));
459 in_menu_callback = 1;
460 wv = menu_item_descriptor_to_widget_value (submenu_desc, SUBMENU_TYPE,
462 unbind_to (count, Qnil);
466 wv = xmalloc_widget_value ();
467 wv->type = CASCADE_TYPE;
469 wv->accel = LISP_TO_VOID (Qnil);
470 wv->contents = xmalloc_widget_value ();
471 wv->contents->type = TEXT_TYPE;
472 wv->contents->name = (char *) "No menu";
473 wv->contents->next = NULL;
474 wv->contents->accel = LISP_TO_VOID (Qnil);
476 assert (wv && wv->type == CASCADE_TYPE && wv->contents);
477 replace_widget_value_tree (hack_wv, wv->contents);
478 free_popup_widget_value_tree (wv);
480 else if (!POPUP_DATAP (FRAME_MENUBAR_DATA (f)))
484 #if 0 /* Unused, see comment below. */
487 /* #### - this menubar update mechanism is expensively anti-social and
488 the activate-menubar-hook is now mostly obsolete. */
489 any_changes = my_run_hook (Qactivate_menubar_hook, 1);
491 /* #### - It is necessary to *ALWAYS* call set_frame_menubar() now that
492 incremental menus are implemented. If a subtree of a menu has been
493 updated incrementally (a destructive operation), then that subtree
494 must somehow be wiped.
496 It is difficult to undo the destructive operation in lwlib because
497 a pointer back to lisp data needs to be hidden away somewhere. So
498 that an INCREMENTAL_TYPE widget_value can be recreated... Hmmmmm. */
500 !XFRAME_MENUBAR_DATA (f)->menubar_contents_up_to_date)
501 set_frame_menubar (f, 1, 0);
503 run_hook (Qactivate_menubar_hook);
504 set_frame_menubar (f, 1, 0);
506 DEVICE_X_MOUSE_TIMESTAMP (XDEVICE (FRAME_DEVICE (f))) =
507 DEVICE_X_GLOBAL_MOUSE_TIMESTAMP (XDEVICE (FRAME_DEVICE (f))) =
508 x_focus_timestamp_really_sucks_fix_me_better;
512 static widget_value *
513 compute_menubar_data (struct frame *f, Lisp_Object menubar, int deep_p)
521 Lisp_Object old_buffer;
522 int count = specpdl_depth ();
524 old_buffer = Fcurrent_buffer ();
525 record_unwind_protect (Fset_buffer, old_buffer);
526 Fset_buffer ( XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer);
527 data = menu_item_descriptor_to_widget_value (menubar, MENUBAR_TYPE,
529 Fset_buffer (old_buffer);
530 unbind_to (count, Qnil);
536 set_frame_menubar (struct frame *f, int deep_p, int first_time_p)
542 /* As for the toolbar, the minibuffer does not have its own menubar. */
543 struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f));
548 /***** first compute the contents of the menubar *****/
552 /* evaluate `current-menubar' in the buffer of the selected window
553 of the frame in question. */
554 menubar = symbol_value_in_buffer (Qcurrent_menubar, w->buffer);
558 /* That's a little tricky the first time since the frame isn't
559 fully initialized yet. */
560 menubar = Fsymbol_value (Qcurrent_menubar);
565 menubar = Vblank_menubar;
569 menubar_visible = !NILP (w->menubar_visible_p);
571 data = compute_menubar_data (f, menubar, deep_p);
572 if (!data || (!data->next && !data->contents))
575 if (NILP (FRAME_MENUBAR_DATA (f)))
577 struct popup_data *mdata =
578 alloc_lcrecord_type (struct popup_data, &lrecord_popup_data);
580 mdata->id = new_lwlib_id ();
581 mdata->last_menubar_buffer = Qnil;
582 mdata->menubar_contents_up_to_date = 0;
583 XSETPOPUP_DATA (FRAME_MENUBAR_DATA (f), mdata);
586 /***** now store into the menubar widget, creating it if necessary *****/
588 id = XFRAME_MENUBAR_DATA (f)->id;
589 if (!FRAME_X_MENUBAR_WIDGET (f))
591 Widget parent = FRAME_X_CONTAINER_WIDGET (f);
593 assert (first_time_p);
595 /* It's the first time we've mapped the menubar so compute its
596 contents completely once. This makes sure that the menubar
597 components are created with the right type. */
600 free_popup_widget_value_tree (data);
601 data = compute_menubar_data (f, menubar, 1);
605 FRAME_X_MENUBAR_WIDGET (f) =
606 lw_create_widget ("menubar", "menubar", id, data, parent,
607 0, pre_activate_callback,
608 popup_selection_callback, 0);
613 lw_modify_all_widgets (id, data, deep_p ? True : False);
615 free_popup_widget_value_tree (data);
617 XFRAME_MENUBAR_DATA (f)->menubar_contents_up_to_date = deep_p;
618 XFRAME_MENUBAR_DATA (f)->last_menubar_buffer =
619 XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer;
620 return menubar_visible;
624 /* Called from x_create_widgets() to create the initial menubar of a frame
625 before it is mapped, so that the window is mapped with the menubar already
626 there instead of us tacking it on later and thrashing the window after it
629 x_initialize_frame_menubar (struct frame *f)
631 return set_frame_menubar (f, 1, 1);
635 static LWLIB_ID last_popup_menu_selection_callback_id;
638 popup_menu_selection_callback (Widget widget, LWLIB_ID id,
639 XtPointer client_data)
641 last_popup_menu_selection_callback_id = id;
642 popup_selection_callback (widget, id, client_data);
643 /* lw_destroy_all_widgets() will be called from popup_down_callback() */
647 popup_menu_down_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
649 if (popup_handled_p (id))
651 assert (popup_up_p != 0);
652 ungcpro_popup_callbacks (id);
654 /* if this isn't called immediately after the selection callback, then
655 there wasn't a menu selection. */
656 if (id != last_popup_menu_selection_callback_id)
657 popup_selection_callback (widget, id, (XtPointer) -1);
658 lw_destroy_all_widgets (id);
663 make_dummy_xbutton_event (XEvent *dummy,
665 struct Lisp_Event *eev)
666 /* NULL for eev means query pointer */
668 XButtonPressedEvent *btn = (XButtonPressedEvent *) dummy;
670 btn->type = ButtonPress;
673 btn->display = XtDisplay (daddy);
674 btn->window = XtWindow (daddy);
677 Position shellx, shelly, framex, framey;
678 Widget shell = XtParent (daddy);
680 btn->time = eev->timestamp;
681 btn->button = eev->event.button.button;
682 btn->root = RootWindowOfScreen (XtScreen (daddy));
683 btn->subwindow = (Window) NULL;
684 btn->x = eev->event.button.x;
685 btn->y = eev->event.button.y;
686 XtSetArg (al [0], XtNx, &shellx);
687 XtSetArg (al [1], XtNy, &shelly);
688 XtGetValues (shell, al, 2);
689 XtSetArg (al [0], XtNx, &framex);
690 XtSetArg (al [1], XtNy, &framey);
691 XtGetValues (daddy, al, 2);
692 btn->x_root = shellx + framex + btn->x;
693 btn->y_root = shelly + framey + btn->y;
694 btn->state = ButtonPressMask; /* all buttons pressed */
698 /* CurrentTime is just ZERO, so it's worthless for
699 determining relative click times. */
700 struct device *d = get_device_from_display (XtDisplay (daddy));
701 btn->time = DEVICE_X_MOUSE_TIMESTAMP (d); /* event-Xt maintains this */
703 XQueryPointer (btn->display, btn->window, &btn->root,
704 &btn->subwindow, &btn->x_root, &btn->y_root,
705 &btn->x, &btn->y, &btn->state);
712 x_update_frame_menubar_internal (struct frame *f)
714 /* We assume the menubar contents has changed if the global flag is set,
715 or if the current buffer has changed, or if the menubar has never
718 int menubar_contents_changed =
720 || NILP (FRAME_MENUBAR_DATA (f))
721 || (!EQ (XFRAME_MENUBAR_DATA (f)->last_menubar_buffer,
722 XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer)));
724 Boolean menubar_was_visible = XtIsManaged (FRAME_X_MENUBAR_WIDGET (f));
725 Boolean menubar_will_be_visible = menubar_was_visible;
726 Boolean menubar_visibility_changed;
728 if (menubar_contents_changed)
729 menubar_will_be_visible = set_frame_menubar (f, 0, 0);
731 menubar_visibility_changed = menubar_was_visible != menubar_will_be_visible;
733 if (!menubar_visibility_changed)
736 /* Set menubar visibility */
737 (menubar_will_be_visible ? XtManageChild : XtUnmanageChild)
738 (FRAME_X_MENUBAR_WIDGET (f));
740 MARK_FRAME_SIZE_SLIPPED (f);
744 x_update_frame_menubars (struct frame *f)
746 assert (FRAME_X_P (f));
748 x_update_frame_menubar_internal (f);
750 /* #### This isn't going to work right now that this function works on
751 a per-frame, not per-device basis. Guess what? I don't care. */
755 x_free_frame_menubars (struct frame *f)
757 Widget menubar_widget;
759 assert (FRAME_X_P (f));
761 menubar_widget = FRAME_X_MENUBAR_WIDGET (f);
764 LWLIB_ID id = XFRAME_MENUBAR_DATA (f)->id;
765 lw_destroy_all_widgets (id);
766 XFRAME_MENUBAR_DATA (f)->id = 0;
771 x_popup_menu (Lisp_Object menu_desc, Lisp_Object event)
774 struct frame *f = selected_frame ();
778 struct Lisp_Event *eev = NULL;
782 XSETFRAME (frame, f);
783 CHECK_X_FRAME (frame);
784 parent = FRAME_X_SHELL_WIDGET (f);
788 CHECK_LIVE_EVENT (event);
790 if (eev->event_type != button_press_event
791 && eev->event_type != button_release_event)
792 wrong_type_argument (Qmouse_event_p, event);
794 else if (!NILP (Vthis_command_keys))
796 /* if an event wasn't passed, use the last event of the event sequence
797 currently being executed, if that event is a mouse event */
798 eev = XEVENT (Vthis_command_keys); /* last event first */
799 if (eev->event_type != button_press_event
800 && eev->event_type != button_release_event)
803 make_dummy_xbutton_event (&xev, parent, eev);
805 if (SYMBOLP (menu_desc))
806 menu_desc = Fsymbol_value (menu_desc);
807 CHECK_CONS (menu_desc);
808 CHECK_STRING (XCAR (menu_desc));
809 data = menu_item_descriptor_to_widget_value (menu_desc, POPUP_TYPE, 1, 1);
811 if (! data) error ("no menu");
813 menu_id = new_lwlib_id ();
814 menu = lw_create_widget ("popup", "popup" /* data->name */, menu_id, data,
816 popup_menu_selection_callback,
817 popup_menu_down_callback);
818 free_popup_widget_value_tree (data);
820 gcpro_popup_callbacks (menu_id);
822 /* Setting zmacs-region-stays is necessary here because executing a command
823 from a menu is really a two-command process: the first command (bound to
824 the button-click) simply pops up the menu, and returns. This causes a
825 sequence of magic-events (destined for the popup-menu widget) to begin.
826 Eventually, a menu item is selected, and a menu-event blip is pushed onto
827 the end of the input stream, which is then executed by the event loop.
829 So there are two command-events, with a bunch of magic-events between
830 them. We don't want the *first* command event to alter the state of the
831 region, so that the region can be available as an argument for the second
835 zmacs_region_stays = 1;
838 lw_popup_menu (menu, &xev);
839 /* this speeds up display of pop-up menus */
840 XFlush (XtDisplay (parent));
845 syms_of_menubar_x (void)
850 console_type_create_menubar_x (void)
852 CONSOLE_HAS_METHOD (x, update_frame_menubars);
853 CONSOLE_HAS_METHOD (x, free_frame_menubars);
854 CONSOLE_HAS_METHOD (x, popup_menu);
858 vars_of_menubar_x (void)
860 last_popup_menu_selection_callback_id = (LWLIB_ID) -1;
862 #if defined (LWLIB_MENUBARS_LUCID)
863 Fprovide (intern ("lucid-menubars"));
864 #elif defined (LWLIB_MENUBARS_MOTIF)
865 Fprovide (intern ("motif-menubars"));
866 #elif defined (LWLIB_MENUBARS_ATHENA)
867 Fprovide (intern ("athena-menubars"));