1 /* General GUI code -- X-specific. (menubars, scrollbars, toolbars, dialogs)
2 Copyright (C) 1995 Board of Trustees, University of Illinois.
3 Copyright (C) 1995, 1996 Ben Wing.
4 Copyright (C) 1995 Sun Microsystems, Inc.
5 Copyright (C) 1998 Free Software Foundation, Inc.
7 This file is part of SXEmacs
9 SXEmacs 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 SXEmacs 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/>. */
23 /* Synched up with: Not in FSF. */
28 #include "console-gtk.h"
31 #include "ui/device.h"
37 Lisp_Object Qmenu_no_selection_hook;
40 static GUI_ID gui_id_ctr = 0;
42 GUI_ID new_gui_id(void)
44 return (++gui_id_ctr);
47 /* This is like FRAME_MENUBAR_DATA (f), but contains an alist of
48 (id . popup-data) for GCPRO'ing the callbacks of the popup menus
50 static Lisp_Object Vpopup_callbacks;
52 void gcpro_popup_callbacks(GUI_ID id, Lisp_Object data)
54 Vpopup_callbacks = Fcons(Fcons(make_int(id), data), Vpopup_callbacks);
57 void ungcpro_popup_callbacks(GUI_ID id)
59 Lisp_Object lid = make_int(id);
60 Lisp_Object this = assq_no_quit(lid, Vpopup_callbacks);
61 Vpopup_callbacks = delq_no_quit(this, Vpopup_callbacks);
64 Lisp_Object get_gcpro_popup_callbacks(GUI_ID id)
66 Lisp_Object lid = make_int(id);
67 Lisp_Object this = assq_no_quit(lid, Vpopup_callbacks);
75 void syms_of_gui_gtk(void)
78 defsymbol(&Qmenu_no_selection_hook, "menu-no-selection-hook");
82 void vars_of_gui_gtk(void)
84 staticpro(&Vpopup_callbacks);
85 Vpopup_callbacks = Qnil;
90 /* This DEFVAR_LISP is just for the benefit of make-docfile. */
92 DEFVAR_LISP("menu-no-selection-hook", &Vmenu_no_selection_hook /*
93 Function or functions to call when a menu or dialog box is dismissed
94 without a selection having been made.
98 Fset(Qmenu_no_selection_hook, Qnil);
99 #endif /* HAVE_POPUPS */