annotate src/gui-x.c @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 9ee227acff29
children 859a2309aef8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* General GUI code -- X-specific. (menubars, scrollbars, toolbars, dialogs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1995 Board of Trustees, University of Illinois.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1995, 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 Copyright (C) 1995 Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #include "lisp.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include "console-x.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #ifdef LWLIB_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #include <Xm/Xm.h> /* for XmVersion */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include "gui-x.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #include "buffer.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #include "device.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #include "frame.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #include "opaque.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #ifdef HAVE_POPUPS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 /* count of menus/dboxes currently up */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 int popup_up_p;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 Lisp_Object Qmenu_no_selection_hook;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 /* we need a unique id for each popup menu, dialog box, and scrollbar */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 static unsigned int lwlib_id_tick;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 LWLIB_ID new_lwlib_id (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 LWLIB_ID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 new_lwlib_id (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 return ++lwlib_id_tick;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 widget_value *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 xmalloc_widget_value (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 widget_value *tmp = malloc_widget_value ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 if (!tmp) memory_full ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 return tmp;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #ifdef HAVE_POPUPS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 static Lisp_Object mark_popup_data (Lisp_Object obj,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 void (*markobj) (Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 DEFINE_LRECORD_IMPLEMENTATION ("popup-data", popup_data,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 mark_popup_data, internal_object_printer,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 0, 0, 0, struct popup_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 struct mark_widget_value_closure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 void (*markobj) (Lisp_Object);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 mark_widget_value_mapper (widget_value *val, void *closure)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 Lisp_Object markee;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 struct mark_widget_value_closure *cl =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (struct mark_widget_value_closure *) closure;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 if (val->call_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 VOID_TO_LISP (markee, val->call_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (cl->markobj) (markee);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 static Lisp_Object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 mark_popup_data (Lisp_Object obj, void (*markobj) (Lisp_Object))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 struct popup_data *data = (struct popup_data *) XPOPUP_DATA (obj);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 /* Now mark the callbacks and such that are hidden in the lwlib
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 call-data */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 if (data->id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 struct mark_widget_value_closure closure;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 closure.markobj = markobj;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 lw_map_widget_values (data->id, mark_widget_value_mapper, &closure);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 return (data->last_menubar_buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 /* This is like FRAME_MENUBAR_DATA (f), but contains an alist of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (id . popup-data) for GCPRO'ing the callbacks of the popup menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 and dialog boxes. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 static Lisp_Object Vpopup_callbacks;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 gcpro_popup_callbacks (LWLIB_ID id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 struct popup_data *pdata;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 Lisp_Object lid = make_int (id);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 Lisp_Object lpdata = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 assert (NILP (assq_no_quit (lid, Vpopup_callbacks)));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 pdata = alloc_lcrecord (sizeof (struct popup_data), lrecord_popup_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 pdata->id = id;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 pdata->last_menubar_buffer = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 pdata->menubar_contents_up_to_date = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 XSETPOPUP_DATA (lpdata, pdata);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 Vpopup_callbacks = Fcons (Fcons (lid, lpdata), Vpopup_callbacks);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ungcpro_popup_callbacks (LWLIB_ID id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 Lisp_Object lid = make_int (id);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 Lisp_Object this = assq_no_quit (lid, Vpopup_callbacks);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 assert (!NILP (this));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 Vpopup_callbacks = delq_no_quit (this, Vpopup_callbacks);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 popup_handled_p (LWLIB_ID id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 return (NILP (assq_no_quit (make_int (id), Vpopup_callbacks)));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 /* menu_item_descriptor_to_widget_value() et al. mallocs a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 widget_value, but then may signal lisp errors. If an error does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 not occur, the opaque ptr we have here has had its pointer set to 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 to tell us not to do anything. Otherwise we free the widget value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (This has nothing to do with GC, it's just about not dropping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 pointers to malloc'd data when errors happen.) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 Lisp_Object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 widget_value_unwind (Lisp_Object closure)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 widget_value *wv = (widget_value *) get_opaque_ptr (closure);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 free_opaque_ptr (closure);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 if (wv)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 free_widget_value (wv);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 return Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 print_widget_value (widget_value *wv, int depth)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 /* !!#### This function has not been Mule-ized */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 char d [200];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 int i;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 for (i = 0; i < depth; i++) d[i] = ' ';
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 d[depth]=0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 /* #### - print type field */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 printf ("%sname: %s\n", d, (wv->name ? wv->name : "(null)"));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 if (wv->value) printf ("%svalue: %s\n", d, wv->value);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 if (wv->key) printf ("%skey: %s\n", d, wv->key);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 printf ("%senabled: %d\n", d, wv->enabled);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 if (wv->contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 printf ("\n%scontents: \n", d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 print_widget_value (wv->contents, depth + 5);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 if (wv->next)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 printf ("\n");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 print_widget_value (wv->next, depth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 /* This recursively calls free_widget_value() on the tree of widgets.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 It must free all data that was malloc'ed for these widget_values.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 It used to be that emacs only allocated new storage for the `key' slot.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 All other slots are pointers into the data of Lisp_Strings, and must be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 left alone. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 free_popup_widget_value_tree (widget_value *wv)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 if (! wv) return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 if (wv->key) xfree (wv->key);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 if (wv->value) xfree (wv->value);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 wv->name = wv->value = wv->key = (char *) 0xDEADBEEF;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 if (wv->contents && (wv->contents != (widget_value*)1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 free_popup_widget_value_tree (wv->contents);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 wv->contents = (widget_value *) 0xDEADBEEF;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 if (wv->next)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 free_popup_widget_value_tree (wv->next);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 wv->next = (widget_value *) 0xDEADBEEF;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 free_widget_value (wv);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 DEFUN ("popup-up-p", Fpopup_up_p, Spopup_up_p, 0, 0, 0 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 Return t if a popup menu or dialog box is up, nil otherwise.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 See `popup-menu' and `popup-dialog-box'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 */ )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 return popup_up_p ? Qt : Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 /* The following is actually called from somewhere within XtDispatchEvent(),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 called from XtAppProcessEvent() in event-Xt.c */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 popup_selection_callback (Widget widget, LWLIB_ID ignored_id,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 XtPointer client_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 Lisp_Object fn, arg;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 Lisp_Object data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 Lisp_Object frame = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 struct device *d = get_device_from_display (XtDisplay (widget));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 struct frame *f = x_any_widget_or_parent_to_frame (d, widget);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 if (!f)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 if (((EMACS_INT) client_data) == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 VOID_TO_LISP (data, client_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 XSETFRAME (frame, f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 /* #### What the hell? I can't understand why this call is here,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 and doing it is really courting disaster in the new event
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 model, since popup_selection_callback is called from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 within next_event_internal() and Faccept_process_output()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 itself calls next_event_internal(). --Ben */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 /* Flush the X and process input */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 Faccept_process_output (Qnil, Qnil, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 if (((EMACS_INT) client_data) == -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 fn = Qrun_hooks;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 arg = Qmenu_no_selection_hook;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 else if (SYMBOLP (data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 fn = Qcall_interactively;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 arg = data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 else if (CONSP (data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 fn = Qeval;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 arg = data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 fn = Qeval;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 arg = list3 (Qsignal,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 list2 (Qquote, Qerror),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 list2 (Qquote, list2 (build_translated_string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ("illegal popup callback"),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 data)));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 /* This is the timestamp used for asserting focus so we need to get an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 up-to-date value event if no events has been dispatched to emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 DEVICE_X_MOUSE_TIMESTAMP (d) = DEVICE_X_GLOBAL_MOUSE_TIMESTAMP (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 signal_special_Xt_user_event (frame, fn, arg);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 #if 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 /* Eval the activep slot of the menu item */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 # define wv_set_evalable_slot(slot,form) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 do { Lisp_Object _f_ = (form); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 slot = (NILP (_f_) ? 0 : \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 EQ (_f_, Qt) ? 1 : \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 !NILP (Feval (_f_))); \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 } while (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 /* Treat the activep slot of the menu item as a boolean */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 # define wv_set_evalable_slot(slot,form) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 slot = (!NILP ((form)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 Boolean
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 separator_string_p (CONST char *s)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 CONST char *p;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 char first;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 if (!s || s[0] == '\0')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 return False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 first = s[0];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 if (first != '-' && first != '=')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 return False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 for (p = s; *p == first; p++);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 if (*p == '!' || *p == ':' || *p == '\0')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 return True;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 return False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 char *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 menu_separator_style (CONST char *s)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 CONST char *p;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 char first;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 if (!s || s[0] == '\0')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 return NULL;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 first = s[0];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 if (first != '-' && first != '=')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 return NULL;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 for (p = s; *p == first; p++);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 /* #### - cannot currently specify a separator tag "--!tag" and a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 separator style "--:style" at the same time. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 /* #### - Also, the motif menubar code doesn't deal with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 double etched style yet, so it's not good to get into the habit of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 using "===" in menubars to get double-etched lines */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 if (*p == '!' || *p == '\0')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 return ((first == '-')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 ? NULL /* single etched is the default */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 : xstrdup ("shadowDoubleEtchedIn"));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 else if (*p == ':')
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 return xstrdup (p+1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 return NULL;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 /* This does the dirty work. gc_currently_forbidden is 1 when this is called.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 button_item_to_widget_value (Lisp_Object desc, widget_value *wv,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 int allow_text_field_p, int no_keys_p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 /* !!#### This function has not been Mule-ized */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 /* This function cannot GC because gc_currently_forbidden is set when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 it's called */
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
361 Lisp_Object name = Qnil;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
362 Lisp_Object callback = Qnil;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
363 Lisp_Object suffix = Qnil;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
364 Lisp_Object active_p = Qt;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
365 Lisp_Object include_p = Qt;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 Lisp_Object selected_p = Qnil;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
367 Lisp_Object keys = Qnil;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
368 Lisp_Object style = Qnil;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 Lisp_Object config_tag = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 int length = vector_length (XVECTOR (desc));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 Lisp_Object *contents = vector_data (XVECTOR (desc));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 int plist_p;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 int selected_spec = 0, included_spec = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 if (length < 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 signal_simple_error ("button descriptors must be at least 3 long", desc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 /* length 3: [ "name" callback active-p ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 length 4: [ "name" callback active-p suffix ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 or [ "name" callback keyword value ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 length 5+: [ "name" callback [ keyword value ]+ ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 plist_p = (length >= 5 || KEYWORDP (contents [2]));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 if (!plist_p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 /* the old way */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 name = contents [0];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 callback = contents [1];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 active_p = contents [2];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 if (length == 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 suffix = contents [3];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 /* the new way */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 int i;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 if (length & 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 signal_simple_error (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 "button descriptor has an odd number of keywords and values",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 desc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 name = contents [0];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 callback = contents [1];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 for (i = 2; i < length;)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 Lisp_Object key = contents [i++];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 Lisp_Object val = contents [i++];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 if (!KEYWORDP (key))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 signal_simple_error_2 ("not a keyword", key, desc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
412 if (EQ (key, Q_active)) active_p = val;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
413 else if (EQ (key, Q_suffix)) suffix = val;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
414 else if (EQ (key, Q_keys)) keys = val;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
415 else if (EQ (key, Q_style)) style = val;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 else if (EQ (key, Q_selected)) selected_p = val, selected_spec = 1;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
417 else if (EQ (key, Q_included)) include_p = val, included_spec = 1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 else if (EQ (key, Q_config)) config_tag = val;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 else if (EQ (key, Q_filter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 signal_simple_error(":filter keyword not permitted on leaf nodes", desc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 signal_simple_error_2 ("unknown menu item keyword", key, desc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 #ifdef HAVE_MENUBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 if ((!NILP (config_tag) && NILP (Fmemq (config_tag, Vmenubar_configuration)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 || (included_spec && NILP (Feval (include_p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 /* the include specification says to ignore this item. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 }
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
433 #endif /* HAVE_MENUBARS */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 CHECK_STRING (name);
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
436 wv->name = (char *) XSTRING_DATA (name);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 if (!NILP (suffix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 CONST char *const_bogosity;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 CHECK_STRING (suffix);
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
442 GET_C_STRING_FILENAME_DATA_ALLOCA (suffix, const_bogosity);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 wv->value = (char *) const_bogosity;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 wv->value = xstrdup (wv->value);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 wv_set_evalable_slot (wv->enabled, active_p);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 wv_set_evalable_slot (wv->selected, selected_p);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 wv->call_data = LISP_TO_VOID (callback);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 if (no_keys_p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 #ifdef HAVE_MENUBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 || !menubar_show_keybindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 wv->key = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 else if (!NILP (keys)) /* Use this string to generate key bindings */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 CHECK_STRING (keys);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 keys = Fsubstitute_command_keys (keys);
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
462 if (XSTRING_LENGTH (keys) > 0)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
463 wv->key = xstrdup ((char *) XSTRING_DATA (keys));
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 wv->key = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 else if (SYMBOLP (callback)) /* Show the binding of this command. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 char buf [1024];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 /* #### Warning, dependency here on current_buffer and point */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 where_is_to_char (callback, buf);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 if (buf [0])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 wv->key = xstrdup (buf);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 wv->key = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 CHECK_SYMBOL (style);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 if (NILP (style))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 /* If the callback is nil, treat this item like unselectable text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 This way, dashes will show up as a separator. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 if (!wv->enabled)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 wv->type = BUTTON_TYPE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 if (separator_string_p (wv->name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 wv->type = SEPARATOR_TYPE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 wv->value = menu_separator_style (wv->name);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 /* #### - this is generally desirable for menubars, but it breaks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 a package that uses dialog boxes and next_command_event magic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 to use the callback slot in dialog buttons for data instead of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 a real callback.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 Code is data, right? The beauty of LISP abuse. --Stig */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 if (NILP (callback))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 wv->type = TEXT_TYPE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 wv->type = BUTTON_TYPE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 else if (EQ (style, Qbutton))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 wv->type = BUTTON_TYPE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 else if (EQ (style, Qtoggle))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 wv->type = TOGGLE_TYPE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 else if (EQ (style, Qradio))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 wv->type = RADIO_TYPE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 else if (EQ (style, Qtext))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 wv->type = TEXT_TYPE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 wv->value = wv->name;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 wv->name = "value";
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 signal_simple_error_2 ("unknown style", style, desc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 if (!allow_text_field_p && (wv->type == TEXT_TYPE))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 signal_simple_error ("text field not allowed in this context", desc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 if (selected_spec && EQ (style, Qtext))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 signal_simple_error (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 ":selected only makes sense with :style toggle, radio or button",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 desc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 #endif /* HAVE_POPUPS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 /* This is a kludge to make sure emacs can only link against a version of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 lwlib that was compiled in the right way. Emacs references symbols which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 correspond to the way it thinks lwlib was compiled, and if lwlib wasn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 compiled in that way, then somewhat meaningful link errors will result.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 The alternatives to this range from obscure link errors, to obscure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 runtime errors that look a lot like bugs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 sanity_check_lwlib (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 #define MACROLET(v) { extern int v; v = 1; }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 #if (XlibSpecificationRelease == 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 MACROLET (lwlib_uses_x11r4);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 #elif (XlibSpecificationRelease == 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 MACROLET (lwlib_uses_x11r5);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 #elif (XlibSpecificationRelease == 6)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 MACROLET (lwlib_uses_x11r6);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 MACROLET (lwlib_uses_unknown_x11);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 #ifdef LWLIB_USES_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 MACROLET (lwlib_uses_motif);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 MACROLET (lwlib_does_not_use_motif);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 #if (XmVersion >= 1002)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 MACROLET (lwlib_uses_motif_1_2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 MACROLET (lwlib_does_not_use_motif_1_2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 #ifdef LWLIB_MENUBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 MACROLET (lwlib_menubars_lucid);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 #elif defined (HAVE_MENUBARS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 MACROLET (lwlib_menubars_motif);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 #ifdef LWLIB_SCROLLBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 MACROLET (lwlib_scrollbars_lucid);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 #elif defined (LWLIB_SCROLLBARS_MOTIF)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 MACROLET (lwlib_scrollbars_motif);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 #elif defined (HAVE_SCROLLBARS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 MACROLET (lwlib_scrollbars_athena);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 #ifdef LWLIB_DIALOGS_MOTIF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 MACROLET (lwlib_dialogs_motif);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 #elif defined (HAVE_DIALOGS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 MACROLET (lwlib_dialogs_athena);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 #ifdef ENERGIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 MACROLET (lwlib_uses_energize);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 MACROLET (lwlib_does_not_use_energize);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 #undef MACROLET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 syms_of_gui_x (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 #ifdef HAVE_POPUPS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 defsubr (&Spopup_up_p);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 defsymbol (&Qmenu_no_selection_hook, "menu-no-selection-hook");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 vars_of_gui_x (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 lwlib_id_tick = (1<<16); /* start big, to not conflict with Energize */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 #ifdef HAVE_POPUPS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 popup_up_p = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 Vpopup_callbacks = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 staticpro (&Vpopup_callbacks);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 /* This DEFVAR_LISP is just for the benefit of make-docfile. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 /* #### misnamed */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 DEFVAR_LISP ("menu-no-selection-hook", &Vmenu_no_selection_hook /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 Function or functions to call when a menu or dialog box is dismissed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 without a selection having been made.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 */ );
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 Fset (Qmenu_no_selection_hook, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 #endif /* HAVE_POPUPS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 /* this makes only safe calls as in emacs.c */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 sanity_check_lwlib ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 }