changeset 1913:7473844a83d3

[xemacs-hg @ 2004-02-17 15:20:41 by james] Check in_display instead of passing fallible in_redisplay parameters.
author james
date Tue, 17 Feb 2004 15:20:57 +0000
parents 2c839fb06642
children d1312c7bdfab
files src/ChangeLog src/dialog-msw.c src/glyphs-gtk.c src/glyphs-msw.c src/glyphs-widget.c src/glyphs-x.c src/gui.c src/gui.h src/menubar-msw.c src/menubar.c
diffstat 10 files changed, 63 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/ChangeLog	Tue Feb 17 15:20:57 2004 +0000
@@ -1,3 +1,34 @@
+2004-02-16  Jerry James  <james@xemacs.org>
+
+	* gui-x.c (wv_set_evalable_slot): Check for eval within redisplay.
+
+2004-02-14  Jerry James  <james@xemacs.org>
+
+	* gui.c (gui_item_value): Remove in_redisplay parameter; check the
+	in_display global variable instead.
+	* gui.c (gui_item_active_p): Ditto.
+	* gui.c (gui_item_selected_p): Ditto.
+	* gui.c (gui_value_equal): Ditto.
+	* gui.c (gui_item_equal_sans_selected): Ditto.
+	* gui.c (gui_item_list_find_selected): Change calls to drop
+	in_redisplay parameter.
+	* gui.c (gui_item_included_p): Ditto.
+	* gui.c (gui_item_equal): Ditto.
+	* gui.h: Change prototypes accordingly.
+	* dialog-msw.c (handle_question_dialog_box): Change calls to drop
+	in_redisplay parameter.
+	* glyphs-gtk.c (gtk_tab_control_redisplay): Ditto.
+	* glyphs-msw.c (mswindows_redisplay_widget): Ditto.
+	* glyphs-msw.c (mswindows_widget_instantiate): Ditto.
+	* glyphs-msw.c (mswindows_button_instantiate): Ditto.
+	* glyphs-msw.c (mswindows_button_redisplay): Ditto.
+	* glyphs-msw.c (mswindows_tab_control_instantiate): Ditto.
+	* glyphs-msw.c (mswindows_tab_control_redisplay): Ditto.
+	* glyphs-widget.c (tab_control_order_only_changed): Ditto.
+	* glyphs-x.c (x_tab_control_redisplay): Ditto.
+	* menubar-msw.c (populate_menu_add_item): Ditto.
+	* menubar.c (Fmenu_find_real_submenu): Ditto.
+
 2004-01-28  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* Makefile.in.in:  Use XE_CFLAGS, not CFLAGS.
--- a/src/dialog-msw.c	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/dialog-msw.c	Tue Feb 17 15:20:57 2004 +0000
@@ -714,8 +714,7 @@
 	Lisp_Gui_Item *pgui_item = XGUI_ITEM (*gui_item);
 	
 	item_tem.style = (WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON
-			  | (gui_item_active_p (*gui_item, 0) ? 0 :
-			     WS_DISABLED));
+			  | (gui_item_active_p (*gui_item) ? 0 : WS_DISABLED));
 	item_tem.cx = button_width (pgui_item->name);
 	/* Item ids are indices into dialog_items plus offset, to avoid having
            items by reserved ids (IDOK, IDCANCEL) */
--- a/src/glyphs-gtk.c	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/glyphs-gtk.c	Tue Feb 17 15:20:57 2004 +0000
@@ -2450,7 +2450,7 @@
 
 	  LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
 	    {
-	      if (gui_item_equal_sans_selected (XCAR (rest), selected, 0, 1))
+	      if (gui_item_equal_sans_selected (XCAR (rest), selected, 0))
 		{
 		  Lisp_Object old_selected =gui_item_list_find_selected
 		    (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)));
--- a/src/glyphs-msw.c	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/glyphs-msw.c	Tue Feb 17 15:20:57 2004 +0000
@@ -2036,7 +2036,7 @@
       if (CONSP (item))
 	item = XCAR (item);
 
-      if (gui_item_active_p (item, 1))
+      if (gui_item_active_p (item))
 	qxeSetWindowLong (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p),
 			  GWL_STYLE, style & ~WS_DISABLED);
       else
@@ -2227,7 +2227,7 @@
 
   CHECK_MSWINDOWS_DEVICE (device);
 
-  if (!gui_item_active_p (gui, 0))
+  if (!gui_item_active_p (gui))
     flags |= WS_DISABLED;
 
   style = pgui->style;
@@ -2372,7 +2372,7 @@
 
   wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
   /* set the checked state */
-  if (gui_item_selected_p (gui, 0))
+  if (gui_item_selected_p (gui))
     qxeSendMessage (wnd, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
   else
     qxeSendMessage (wnd, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0);
@@ -2398,7 +2398,7 @@
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
 
   /* buttons checked or otherwise */
-  if (gui_item_selected_p (IMAGE_INSTANCE_WIDGET_ITEM (ii), 1))
+  if (gui_item_selected_p (IMAGE_INSTANCE_WIDGET_ITEM (ii)))
     qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
 		    BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
   else
@@ -2640,7 +2640,7 @@
     {
       int idx = add_tab_item (image_instance, wnd, XCAR (rest), domain, i);
       assert (idx == i);
-      if (gui_item_selected_p (XCAR (rest), 0))
+      if (gui_item_selected_p (XCAR (rest)))
 	selected = i;
       i++;
     }
@@ -2680,7 +2680,7 @@
 
 	  LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
 	    {
-	      if (gui_item_equal_sans_selected (XCAR (rest), selected, 0, 1))
+	      if (gui_item_equal_sans_selected (XCAR (rest), selected, 0))
 		{
 		  Lisp_Object old_selected =
 		    gui_item_list_find_selected
@@ -2715,7 +2715,7 @@
 	    {
 	      add_tab_item (image_instance, wnd, XCAR (rest),
 			    IMAGE_INSTANCE_FRAME (ii), i);
-	      if (gui_item_selected_p (XCAR (rest), 1))
+	      if (gui_item_selected_p (XCAR (rest)))
 		selected_idx = i;
 	      i++;
 	    }
--- a/src/glyphs-widget.c	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/glyphs-widget.c	Tue Feb 17 15:20:57 2004 +0000
@@ -1017,7 +1017,7 @@
 		     XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
 	    {
 	      if (gui_item_equal_sans_selected (XCAR (rest),
-						XCAR (pending_rest), 0, 1))
+						XCAR (pending_rest), 0))
 		{
 		  found = 1;
 		  break;
--- a/src/glyphs-x.c	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/glyphs-x.c	Tue Feb 17 15:20:57 2004 +0000
@@ -2698,7 +2698,7 @@
 
 	  LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
 	    {
-	      if (gui_item_equal_sans_selected (XCAR (rest), selected, 0, 1))
+	      if (gui_item_equal_sans_selected (XCAR (rest), selected, 0))
 		{
 		  /* There may be an encapsulated way of doing this,
 		     but I couldn't find it. */
--- a/src/gui.c	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/gui.c	Tue Feb 17 15:20:57 2004 +0000
@@ -383,7 +383,7 @@
 }
 
 static int
-gui_item_value (Lisp_Object form, int in_redisplay)
+gui_item_value (Lisp_Object form)
 {
   /* This function can call Lisp. */
 
@@ -395,10 +395,7 @@
   if (EQ (form, Qt))
     return 1;
 #endif
-  if (in_redisplay)
-    return !NILP (eval_within_redisplay (form));
-  else
-    return !NILP (Feval (form));
+  return !NILP (in_display ? eval_within_redisplay (form) : Feval (form));
 }
 
 /*
@@ -406,9 +403,9 @@
  * if any
  */
 int
-gui_item_active_p (Lisp_Object gui_item, int in_redisplay)
+gui_item_active_p (Lisp_Object gui_item)
 {
-  return gui_item_value (XGUI_ITEM (gui_item)->active, in_redisplay);
+  return gui_item_value (XGUI_ITEM (gui_item)->active);
 }
 
 /* set menu accelerator key to first underlined character in menu name */
@@ -452,9 +449,9 @@
  * if any
  */
 int
-gui_item_selected_p (Lisp_Object gui_item, int in_redisplay)
+gui_item_selected_p (Lisp_Object gui_item)
 {
-  return gui_item_value (XGUI_ITEM (gui_item)->selected, in_redisplay);
+  return gui_item_value (XGUI_ITEM (gui_item)->selected);
 }
 
 Lisp_Object
@@ -465,7 +462,7 @@
   Lisp_Object rest;
   LIST_LOOP (rest, gui_item_list)
     {
-      if (gui_item_selected_p (XCAR (rest), 1))
+      if (gui_item_selected_p (XCAR (rest)))
 	return XCAR (rest);
     }
   return XCAR (gui_item_list);
@@ -483,7 +480,7 @@
   Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item);
 
   /* Evaluate :included first. Shortcut to avoid evaluating Qt each time */
-  if (!gui_item_value (pgui_item->included, 0))
+  if (!gui_item_value (pgui_item->included))
     return 0;
 
   /* Do :config if conflist is given */
@@ -632,9 +629,9 @@
 }
 
 static int
-gui_value_equal (Lisp_Object a, Lisp_Object b, int depth, int in_redisplay)
+gui_value_equal (Lisp_Object a, Lisp_Object b, int depth)
 {
-  if (in_redisplay)
+  if (in_display)
     return internal_equal_trapping_problems
       (Qredisplay, "Error calling function within redisplay", 0, 0,
        /* say they're not equal in case of error; code calling
@@ -646,18 +643,16 @@
 }
 
 int
-gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth,
-			      int in_redisplay)
+gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth)
 {
   Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
   Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
 
-  if (!(gui_value_equal (p1->name, p2->name, depth + 1, in_redisplay)
+  if (!(gui_value_equal (p1->name, p2->name, depth + 1)
 	&&
-	gui_value_equal (p1->callback, p2->callback, depth + 1, in_redisplay)
+	gui_value_equal (p1->callback, p2->callback, depth + 1)
 	&&
-	gui_value_equal (p1->callback_ex, p2->callback_ex, depth + 1,
-			 in_redisplay)
+	gui_value_equal (p1->callback_ex, p2->callback_ex, depth + 1)
 	&&
 	EQ (p1->suffix, p2->suffix)
 	&&
@@ -686,7 +681,7 @@
   Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
   Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
 
-  if (!(gui_item_equal_sans_selected (obj1, obj2, depth, 0) &&
+  if (!(gui_item_equal_sans_selected (obj1, obj2, depth) &&
 	EQ (p1->selected, p2->selected)))
     return 0;
   return 1;
--- a/src/gui.h	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/gui.h	Tue Feb 17 15:20:57 2004 +0000
@@ -30,8 +30,7 @@
 int separator_string_p (const Ibyte *s);
 void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *);
 int gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2,
-				  int depth, int in_redisplay);
-
+				  int depth);
 
 
 
@@ -77,8 +76,8 @@
 Lisp_Object gui_parse_item_keywords (Lisp_Object item);
 Lisp_Object gui_parse_item_keywords_no_errors (Lisp_Object item);
 void gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item);
-int gui_item_active_p (Lisp_Object, int);
-int gui_item_selected_p (Lisp_Object, int);
+int gui_item_active_p (Lisp_Object);
+int gui_item_selected_p (Lisp_Object);
 Lisp_Object gui_item_list_find_selected (Lisp_Object gui_item_list);
 int gui_item_included_p (Lisp_Object, Lisp_Object into);
 Lisp_Object gui_item_accelerator (Lisp_Object gui_item);
--- a/src/menubar-msw.c	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/menubar-msw.c	Tue Feb 17 15:20:57 2004 +0000
@@ -273,7 +273,7 @@
 	  goto done;
 	}
 
-      if (!gui_item_active_p (gui_item, 0))
+      if (!gui_item_active_p (gui_item))
 	item_info.fState = MFS_GRAYED;
       /* Temptation is to put 'else' right here. Although, the
 	 displayed item won't have an arrow indicating that it is a
@@ -328,7 +328,7 @@
       if (!STRINGP (pgui_item->name))
 	pgui_item->name = Feval (pgui_item->name);
 
-      if (!gui_item_active_p (gui_item, 0))
+      if (!gui_item_active_p (gui_item))
 	item_info.fState = MFS_GRAYED;
 
       style = (NILP (pgui_item->selected) || NILP (Feval (pgui_item->selected))
--- a/src/menubar.c	Mon Feb 16 22:51:09 2004 +0000
+++ b/src/menubar.c	Tue Feb 17 15:20:57 2004 +0000
@@ -202,7 +202,7 @@
       desc = menu_parse_submenu_keywords (desc, gui_item);
 
       /* Check that this (sub)menu is active */
-      if (!gui_item_active_p (gui_item, 0))
+      if (!gui_item_active_p (gui_item))
 	RETURN_UNGCPRO (Qnil);
 
       /* Apply :filter */