*** empty log message ***
[bpt/emacs.git] / lwlib / lwlib-Xaw.c
index c7750c3..3ffc0d6 100644 (file)
@@ -3,13 +3,13 @@
 
 This file is part of the Lucid Widget Library.
 
-The Lucid Widget Library is free software; you can redistribute it and/or 
+The Lucid Widget Library is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 1, or (at your option)
 any later version.
 
 The Lucid Widget Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
@@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 
+#include "../src/lisp.h"
+
 #include "lwlib-Xaw.h"
 
 #include <X11/StringDefs.h>
@@ -51,13 +53,13 @@ lw_xaw_widget_p (widget)
          XtIsSubclass (widget, dialogWidgetClass));
 }
 
+#if 0
 static void
 xaw_update_scrollbar (instance, widget, val)
      widget_instance *instance;
      Widget widget;
      widget_value *val;
 {
-#if 0
   if (val->scrollbar_data)
     {
       scrollbar_values *data = val->scrollbar_data;
@@ -73,7 +75,7 @@ xaw_update_scrollbar (instance, widget, val)
                     XtNy, &pos_y,
                     XtNtopOfThumb, &widget_topOfThumb,
                     XtNshown, &widget_shown,
-                    0);
+                    NULL);
 
       /*
        * First size and position the scrollbar widget.
@@ -88,7 +90,7 @@ xaw_update_scrollbar (instance, widget, val)
          XtVaSetValues (widget,
                         XtNlength, data->scrollbar_height,
                         XtNthickness, width,
-                        0);
+                        NULL);
        }
 
       /*
@@ -113,15 +115,20 @@ xaw_update_scrollbar (instance, widget, val)
       if (new_shown != widget_shown || new_topOfThumb != widget_topOfThumb)
        XawScrollbarSetThumb (widget, new_topOfThumb, new_shown);
     }
-#endif
 }
+#endif
 
 void
+#ifdef PROTOTYPES
+xaw_update_one_widget (widget_instance *instance, Widget widget,
+                      widget_value *val, Boolean deep_p)
+#else
 xaw_update_one_widget (instance, widget, val, deep_p)
      widget_instance *instance;
      Widget widget;
      widget_value *val;
      Boolean deep_p;
+#endif
 {
 #if 0
   if (XtIsSubclass (widget, scrollbarWidgetClass))
@@ -141,7 +148,7 @@ xaw_update_one_widget (instance, widget, val, deep_p)
       Dimension bw = 0;
       Arg al[3];
 
-      XtVaGetValues (widget, XtNborderWidth, &bw, 0);
+      XtVaGetValues (widget, XtNborderWidth, &bw, NULL);
       if (bw == 0)
        /* Don't let buttons end up with 0 borderwidth, that's ugly...
           Yeah, all this should really be done through app-defaults files
@@ -154,11 +161,11 @@ xaw_update_one_widget (instance, widget, val, deep_p)
          XtSetValues (widget, al, 1);
        }
 
+      XtSetSensitive (widget, val->enabled);
       XtSetArg (al[0], XtNlabel, val->value);
-      XtSetArg (al[1], XtNsensitive, val->enabled);
       /* Force centered button text.  Se above. */
-      XtSetArg (al[2], XtNjustify, XtJustifyCenter);
-      XtSetValues (widget, al, 3);
+      XtSetArg (al[1], XtNjustify, XtJustifyCenter);
+      XtSetValues (widget, al, 2);
       XtRemoveAllCallbacks (widget, XtNcallback);
       XtAddCallback (widget, XtNcallback, xaw_generic_callback, instance);
     }
@@ -196,9 +203,13 @@ xaw_popup_menu (widget, event)
 }
 
 void
+#ifdef PROTOTYPES
+xaw_pop_instance (widget_instance *instance, Boolean up)
+#else
 xaw_pop_instance (instance, up)
      widget_instance *instance;
      Boolean up;
+#endif
 {
   Widget widget = instance->widget;
 
@@ -345,7 +356,7 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, ra
         I want the separator to take up the slack between the buttons on
         the right and the buttons on the left (that is I want the buttons
         after the separator to be packed against the right edge of the
-        window) but I can't seem to make it do it.  
+        window) but I can't seem to make it do it.
        */
       ac = 0;
       XtSetArg (av [ac], XtNfromHoriz, button); ac++;
@@ -393,7 +404,7 @@ xaw_create_dialog (instance)
   Widget widget;
   Boolean pop_up_p = instance->pop_up_p;
   char *shell_name = 0;
-  char *icon_name;
+  char *icon_name = 0;
   Boolean text_input_slot = False;
   Boolean radio_box = False;
   Boolean list = False;
@@ -429,7 +440,7 @@ xaw_create_dialog (instance)
     shell_name = "Question";
     break;
   }
-  
+
   total_buttons = name [1] - '0';
 
   if (name [3] == 'T' || name [3] == 't')
@@ -439,9 +450,9 @@ xaw_create_dialog (instance)
     }
   else if (name [3])
     right_buttons = name [4] - '0';
-  
+
   left_buttons = total_buttons - right_buttons;
-  
+
   widget = make_dialog (name, parent, pop_up_p,
                        shell_name, icon_name, text_input_slot, radio_box,
                        list, left_buttons, right_buttons);
@@ -476,7 +487,7 @@ xaw_generic_callback (widget, closure, call_data)
 
 #if 0
   user_data = NULL;
-  XtVaGetValues (widget, XtNuserData, &user_data, 0);
+  XtVaGetValues (widget, XtNuserData, &user_data, NULL);
 #else
   /* Damn!  Athena doesn't give us a way to hang our own data on the
      buttons, so we have to go find it...  I guess this assumes that
@@ -512,8 +523,8 @@ wm_delete_window (shell, closure, call_data)
   Widget widget;
   if (! XtIsSubclass (shell, shellWidgetClass))
     abort ();
-  XtVaGetValues (shell, XtNnumChildren, &nkids, 0);
-  XtVaGetValues (shell, XtNchildren, &kids, 0);
+  XtVaGetValues (shell, XtNnumChildren, &nkids, NULL);
+  XtVaGetValues (shell, XtNchildren, &kids, NULL);
   if (!kids || !*kids)
     abort ();
   for (i = 0; i < nkids; i++)
@@ -538,13 +549,13 @@ wm_delete_window (shell, closure, call_data)
 \f
 /* Scrollbars */
 
+#if 0
 static void
 xaw_scrollbar_scroll (widget, closure, call_data)
      Widget widget;
      XtPointer closure;
      XtPointer call_data;
 {
-#if 0
   widget_instance *instance = (widget_instance *) closure;
   LWLIB_ID id;
   scroll_event event_data;
@@ -563,16 +574,16 @@ xaw_scrollbar_scroll (widget, closure, call_data)
 
   if (instance->info->pre_activate_cb)
     instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
-#endif
 }
+#endif
 
+#if 0
 static void
 xaw_scrollbar_jump (widget, closure, call_data)
      Widget widget;
      XtPointer closure;
      XtPointer call_data;
 {
-#if 0
   widget_instance *instance = (widget_instance *) closure;
   LWLIB_ID id;
   scroll_event event_data;
@@ -594,8 +605,8 @@ xaw_scrollbar_jump (widget, closure, call_data)
 
   if (instance->info->pre_activate_cb)
     instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
-#endif
 }
+#endif
 
 static Widget
 xaw_create_scrollbar (instance)
@@ -607,8 +618,8 @@ xaw_create_scrollbar (instance)
   Dimension width;
   Widget scrollbar;
 
-  XtVaGetValues (instance->parent, XtNwidth, &width, 0);
-  
+  XtVaGetValues (instance->parent, XtNwidth, &width, NULL);
+
   XtSetArg (av[ac], XtNshowGrip, 0); ac++;
   XtSetArg (av[ac], XtNresizeToPreferred, 1); ac++;
   XtSetArg (av[ac], XtNallowResize, True); ac++;
@@ -622,7 +633,7 @@ xaw_create_scrollbar (instance)
 
   /* We have to force the border width to be 0 otherwise the
      geometry manager likes to start looping for awhile... */
-  XtVaSetValues (scrollbar, XtNborderWidth, 0, 0);
+  XtVaSetValues (scrollbar, XtNborderWidth, 0, NULL);
 
   XtRemoveAllCallbacks (scrollbar, "jumpProc");
   XtRemoveAllCallbacks (scrollbar, "scrollProc");
@@ -633,6 +644,8 @@ xaw_create_scrollbar (instance)
                 (XtPointer) instance);
 
   return scrollbar;
+#else
+  return NULL;
 #endif
 }