comparison src/gui-x.c @ 231:557eaa0339bf r20-5b14

Import from CVS: tag r20-5b14
author cvs
date Mon, 13 Aug 2007 10:13:48 +0200
parents d44af0c54775
children 11cf20601dec
comparison
equal deleted inserted replaced
230:39ed1d2bdd9d 231:557eaa0339bf
31 #endif 31 #endif
32 #include "gui-x.h" 32 #include "gui-x.h"
33 #include "buffer.h" 33 #include "buffer.h"
34 #include "device.h" 34 #include "device.h"
35 #include "frame.h" 35 #include "frame.h"
36 #include "gui.h"
36 #include "opaque.h" 37 #include "opaque.h"
37 38
38 #ifdef HAVE_POPUPS 39 #ifdef HAVE_POPUPS
39 /* count of menus/dboxes currently up */
40 int popup_up_p;
41
42 Lisp_Object Qmenu_no_selection_hook; 40 Lisp_Object Qmenu_no_selection_hook;
43 #endif 41 #endif
44 42
45 /* we need a unique id for each popup menu, dialog box, and scrollbar */ 43 /* we need a unique id for each popup menu, dialog box, and scrollbar */
46 static unsigned int lwlib_id_tick; 44 static unsigned int lwlib_id_tick;
217 { 215 {
218 free_popup_widget_value_tree (wv->next); 216 free_popup_widget_value_tree (wv->next);
219 wv->next = (widget_value *) 0xDEADBEEF; 217 wv->next = (widget_value *) 0xDEADBEEF;
220 } 218 }
221 free_widget_value (wv); 219 free_widget_value (wv);
222 }
223
224 DEFUN ("popup-up-p", Fpopup_up_p, 0, 0, 0, /*
225 Return t if a popup menu or dialog box is up, nil otherwise.
226 See `popup-menu' and `popup-dialog-box'.
227 */
228 ())
229 {
230 return popup_up_p ? Qt : Qnil;
231 } 220 }
232 221
233 /* The following is actually called from somewhere within XtDispatchEvent(), 222 /* The following is actually called from somewhere within XtDispatchEvent(),
234 called from XtAppProcessEvent() in event-Xt.c */ 223 called from XtAppProcessEvent() in event-Xt.c */
235 224
312 #else 301 #else
313 /* Treat the activep slot of the menu item as a boolean */ 302 /* Treat the activep slot of the menu item as a boolean */
314 # define wv_set_evalable_slot(slot,form) \ 303 # define wv_set_evalable_slot(slot,form) \
315 slot = (!NILP ((form))) 304 slot = (!NILP ((form)))
316 #endif 305 #endif
317
318 Boolean
319 separator_string_p (CONST char *s)
320 {
321 CONST char *p;
322 char first;
323
324 if (!s || s[0] == '\0')
325 return False;
326 first = s[0];
327 if (first != '-' && first != '=')
328 return False;
329 for (p = s; *p == first; p++);
330
331 if (*p == '!' || *p == ':' || *p == '\0')
332 return True;
333 return False;
334 }
335 306
336 char * 307 char *
337 menu_separator_style (CONST char *s) 308 menu_separator_style (CONST char *s)
338 { 309 {
339 CONST char *p; 310 CONST char *p;
631 602
632 void 603 void
633 syms_of_gui_x (void) 604 syms_of_gui_x (void)
634 { 605 {
635 #ifdef HAVE_POPUPS 606 #ifdef HAVE_POPUPS
636 DEFSUBR (Fpopup_up_p);
637 defsymbol (&Qmenu_no_selection_hook, "menu-no-selection-hook"); 607 defsymbol (&Qmenu_no_selection_hook, "menu-no-selection-hook");
638 #endif 608 #endif
639 } 609 }
640 610
641 void 611 void