]> code.delx.au - gnu-emacs/blobdiff - lwlib/lwlib.c
*** empty log message ***
[gnu-emacs] / lwlib / lwlib.c
index 94da7cfa0f3f5616ae9d863455829d7c1e01c102..39b9400c5c861399af3e27a6e17ac658c4fb1b9a 100644 (file)
@@ -3,20 +3,20 @@
 
 This file is part of the Lucid Widget Library.
 
 
 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 2, or (at your option)
 any later version.
 
 The Lucid Widget Library is distributed in the hope that it will be useful,
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2, 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.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #ifdef NeXT
 #undef __STRICT_BSD__ /* ick */
 
 #ifdef NeXT
 #undef __STRICT_BSD__ /* ick */
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA.  */
 #include <config.h>
 #endif
 
 #include <config.h>
 #endif
 
+#include "../src/lisp.h"
+
 #include <sys/types.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -33,8 +35,6 @@ Boston, MA 02111-1307, USA.  */
 #include "lwlib-utils.h"
 #include <X11/StringDefs.h>
 
 #include "lwlib-utils.h"
 #include <X11/StringDefs.h>
 
-extern long *xmalloc();
-
 #if defined (USE_LUCID)
 #include "lwlib-Xlw.h"
 #endif
 #if defined (USE_LUCID)
 #include "lwlib-Xlw.h"
 #endif
@@ -45,20 +45,13 @@ extern long *xmalloc();
 #define USE_XAW
 #endif /* not USE_MOTIF && USE_LUCID */
 #endif
 #define USE_XAW
 #endif /* not USE_MOTIF && USE_LUCID */
 #endif
-#if defined (USE_OLIT)
-#include "lwlib-Xol.h"
-#endif
 #if defined (USE_XAW)
 #include <X11/Xaw/Paned.h>
 #include "lwlib-Xaw.h"
 #endif
 
 #if defined (USE_XAW)
 #include <X11/Xaw/Paned.h>
 #include "lwlib-Xaw.h"
 #endif
 
-#if !defined (USE_LUCID) && !defined (USE_MOTIF) && !defined (USE_OLIT)
-ERROR!  At least one of USE_LUCID, USE_MOTIF or USE_OLIT must be defined.
-#endif
-
-#if defined (USE_MOTIF) && defined (USE_OLIT)
-ERROR! no more than one of USE_MOTIF and USE_OLIT may be defined.
+#if !defined (USE_LUCID) && !defined (USE_MOTIF)
+ #error  At least one of USE_LUCID or USE_MOTIF must be defined.
 #endif
 
 #ifndef max
 #endif
 
 #ifndef max
@@ -74,15 +67,46 @@ char *lwlib_toolkit_type = "motif";
 #else
 char *lwlib_toolkit_type = "lucid";
 #endif
 #else
 char *lwlib_toolkit_type = "lucid";
 #endif
-\f/* Forward declarations */
-static void
-instantiate_widget_instance (/* widget_instance* instance */);
+
+static widget_value *merge_widget_value P_ ((widget_value *,
+                                            widget_value *,
+                                            int, int *));
+static void instantiate_widget_instance P_ ((widget_instance *));
+static int my_strcasecmp P_ ((char *, char *));
+static void safe_free_str P_ ((char *));
+static void free_widget_value_tree P_ ((widget_value *));
+static widget_value *copy_widget_value_tree P_ ((widget_value *,
+                                                change_type));
+static widget_info *allocate_widget_info P_ ((char *, char *, LWLIB_ID,
+                                             widget_value *,
+                                             lw_callback, lw_callback,
+                                             lw_callback, lw_callback));
+static void free_widget_info P_ ((widget_info *));
+static void mark_widget_destroyed P_ ((Widget, XtPointer, XtPointer));
+static widget_instance *allocate_widget_instance P_ ((widget_info *,
+                                                     Widget, Boolean));
+static void free_widget_instance P_ ((widget_instance *));
+static widget_info *get_widget_info P_ ((LWLIB_ID, Boolean));
+static widget_instance *get_widget_instance P_ ((Widget, Boolean));
+static widget_instance *find_instance P_ ((LWLIB_ID, Widget, Boolean));
+static Boolean safe_strcmp P_ ((char *, char *));
+static Widget name_to_widget P_ ((widget_instance *, char *));
+static void set_one_value P_ ((widget_instance *, widget_value *, Boolean));
+static void update_one_widget_instance P_ ((widget_instance *, Boolean));
+static void update_all_widget_values P_ ((widget_info *, Boolean));
+static void initialize_widget_instance P_ ((widget_instance *));
+static widget_creation_function find_in_table P_ ((char *, widget_creation_entry *));
+static Boolean dialog_spec_p P_ ((char *));
+static void destroy_one_instance P_ ((widget_instance *));
+static void lw_pop_all_widgets P_ ((LWLIB_ID, Boolean));
+static Boolean get_one_value P_ ((widget_instance *, widget_value *));
+static void show_one_widget_busy P_ ((Widget, Boolean));
 
 void
 lwlib_memset (address, value, length)
      char *address;
      int value;
 
 void
 lwlib_memset (address, value, length)
      char *address;
      int value;
-     int length;
+     size_t length;
 {
   int i;
 
 {
   int i;
 
@@ -104,7 +128,7 @@ lwlib_bcopy (from, to, length)
 \f/* utility functions for widget_instance and widget_info */
 char *
 safe_strdup (s)
 \f/* utility functions for widget_instance and widget_info */
 char *
 safe_strdup (s)
-     char *s;
+     const char *s;
 {
   char *result;
   if (! s) return 0;
 {
   char *result;
   if (! s) return 0;
@@ -161,12 +185,12 @@ malloc_widget_value ()
       wv = (widget_value *) malloc (sizeof (widget_value));
       malloc_cpt++;
     }
       wv = (widget_value *) malloc (sizeof (widget_value));
       malloc_cpt++;
     }
-  lwlib_memset (wv, 0, sizeof (widget_value));
+  lwlib_memset ((void*) wv, 0, sizeof (widget_value));
   return wv;
 }
 
 /* this is analogous to free().  It frees only what was allocated
   return wv;
 }
 
 /* this is analogous to free().  It frees only what was allocated
-   by malloc_widget_value(), and no substructures. 
+   by malloc_widget_value(), and no substructures.
  */
 void
 free_widget_value (wv)
  */
 void
 free_widget_value (wv)
@@ -199,9 +223,8 @@ free_widget_value_tree (wv)
   if (wv->name) free (wv->name);
   if (wv->value) free (wv->value);
   if (wv->key) free (wv->key);
   if (wv->name) free (wv->name);
   if (wv->value) free (wv->value);
   if (wv->key) free (wv->key);
-  if (wv->help) free (wv->help);
 
 
-  wv->name = wv->value = wv->key = wv->help = (char *) 0xDEADBEEF;
+  wv->name = wv->value = wv->key = (char *) 0xDEADBEEF;
 
   if (wv->toolkit_data && wv->free_toolkit_data)
     {
 
   if (wv->toolkit_data && wv->free_toolkit_data)
     {
@@ -228,7 +251,7 @@ copy_widget_value_tree (val, change)
      change_type change;
 {
   widget_value* copy;
      change_type change;
 {
   widget_value* copy;
-  
+
   if (!val)
     return NULL;
   if (val == (widget_value *) 1)
   if (!val)
     return NULL;
   if (val == (widget_value *) 1)
@@ -238,7 +261,7 @@ copy_widget_value_tree (val, change)
   copy->name = safe_strdup (val->name);
   copy->value = safe_strdup (val->value);
   copy->key = safe_strdup (val->key);
   copy->name = safe_strdup (val->name);
   copy->value = safe_strdup (val->value);
   copy->key = safe_strdup (val->key);
-  copy->help = safe_strdup (val->help);
+  copy->help = val->help;
   copy->enabled = val->enabled;
   copy->button_type = val->button_type;
   copy->selected = val->selected;
   copy->enabled = val->enabled;
   copy->button_type = val->button_type;
   copy->selected = val->selected;
@@ -307,11 +330,18 @@ mark_widget_destroyed (widget, closure, call_data)
     instance->widget = NULL;
 }
 
     instance->widget = NULL;
 }
 
+/* The messy #ifdef PROTOTYPES here and elsewhere are prompted by a
+   flood of warnings about argument promotion from proprietary ISO C
+   compilers.  (etags still only makes one entry for each function.)  */
 static widget_instance *
 static widget_instance *
+#ifdef PROTOTYPES
+allocate_widget_instance (widget_info* info, Widget parent, Boolean pop_up_p)
+#else
 allocate_widget_instance (info, parent, pop_up_p)
      widget_info* info;
      Widget parent;
      Boolean pop_up_p;
 allocate_widget_instance (info, parent, pop_up_p)
      widget_info* info;
      Widget parent;
      Boolean pop_up_p;
+#endif
 {
   widget_instance* instance =
     (widget_instance*)malloc (sizeof (widget_instance));
 {
   widget_instance* instance =
     (widget_instance*)malloc (sizeof (widget_instance));
@@ -338,9 +368,13 @@ free_widget_instance (instance)
 }
 
 static widget_info *
 }
 
 static widget_info *
+#ifdef PROTOTYPES
+get_widget_info (LWLIB_ID id, Boolean remove_p)
+#else
 get_widget_info (id, remove_p)
      LWLIB_ID id;
      Boolean remove_p;
 get_widget_info (id, remove_p)
      LWLIB_ID id;
      Boolean remove_p;
+#endif
 {
   widget_info* info;
   widget_info* prev;
 {
   widget_info* info;
   widget_info* prev;
@@ -371,9 +405,13 @@ lw_get_widget_info (id)
 }
 
 static widget_instance *
 }
 
 static widget_instance *
+#ifdef PROTOTYPES
+get_widget_instance (Widget widget, Boolean remove_p)
+#else
 get_widget_instance (widget, remove_p)
      Widget widget;
      Boolean remove_p;
 get_widget_instance (widget, remove_p)
      Widget widget;
      Boolean remove_p;
+#endif
 {
   widget_info* info;
   widget_instance* instance;
 {
   widget_info* info;
   widget_instance* instance;
@@ -407,10 +445,14 @@ lw_get_widget_instance (widget)
 }
 
 static widget_instance*
 }
 
 static widget_instance*
+#ifdef PROTOTYPES
+find_instance (LWLIB_ID id, Widget parent, Boolean pop_up_p)
+#else
 find_instance (id, parent, pop_up_p)
      LWLIB_ID id;
      Widget parent;
      Boolean pop_up_p;
 find_instance (id, parent, pop_up_p)
      LWLIB_ID id;
      Widget parent;
      Boolean pop_up_p;
+#endif
 {
   widget_info* info = get_widget_info (id, False);
   widget_instance* instance;
 {
   widget_info* info = get_widget_info (id, False);
   widget_instance* instance;
@@ -455,10 +497,11 @@ safe_strcmp (s1, s2)
 
 
 static widget_value *
 
 
 static widget_value *
-merge_widget_value (val1, val2, level)
+merge_widget_value (val1, val2, level, change_p)
      widget_value* val1;
      widget_value* val2;
      int level;
      widget_value* val1;
      widget_value* val2;
      int level;
+     int *change_p;
 {
   change_type change, this_one_change;
   widget_value* merged_next;
 {
   change_type change, this_one_change;
   widget_value* merged_next;
@@ -467,16 +510,20 @@ merge_widget_value (val1, val2, level)
   if (!val1)
     {
       if (val2)
   if (!val1)
     {
       if (val2)
-       return copy_widget_value_tree (val2, STRUCTURAL_CHANGE);
+       {
+         *change_p = 1;
+         return copy_widget_value_tree (val2, STRUCTURAL_CHANGE);
+       }
       else
        return NULL;
     }
   if (!val2)
     {
       else
        return NULL;
     }
   if (!val2)
     {
+      *change_p = 1;
       free_widget_value_tree (val1);
       return NULL;
     }
       free_widget_value_tree (val1);
       return NULL;
     }
-  
+
   change = NO_CHANGE;
 
   if (safe_strcmp (val1->name, val2->name))
   change = NO_CHANGE;
 
   if (safe_strcmp (val1->name, val2->name))
@@ -503,13 +550,12 @@ merge_widget_value (val1, val2, level)
       safe_free_str (val1->key);
       val1->key = safe_strdup (val2->key);
     }
       safe_free_str (val1->key);
       val1->key = safe_strdup (val2->key);
     }
-  if (safe_strcmp (val1->help, val2->help))
+  if (! EQ (val1->help, val2->help))
     {
       EXPLAIN (val1->name, change, VISIBLE_CHANGE, "help change",
               val1->help, val2->help);
       change = max (change, VISIBLE_CHANGE);
     {
       EXPLAIN (val1->name, change, VISIBLE_CHANGE, "help change",
               val1->help, val2->help);
       change = max (change, VISIBLE_CHANGE);
-      safe_free_str (val1->help);
-      val1->key = safe_strdup (val2->help);
+      val1->help = val2->help;
     }
   if (val1->enabled != val2->enabled)
     {
     }
   if (val1->enabled != val2->enabled)
     {
@@ -543,8 +589,9 @@ merge_widget_value (val1, val2, level)
   if (level > 0)
     {
       merged_contents =
   if (level > 0)
     {
       merged_contents =
-       merge_widget_value (val1->contents, val2->contents, level - 1);
-      
+       merge_widget_value (val1->contents, val2->contents, level - 1,
+                           change_p);
+
       if (val1->contents && !merged_contents)
        {
          /* This used to say INVISIBLE_CHANGE,
       if (val1->contents && !merged_contents)
        {
          /* This used to say INVISIBLE_CHANGE,
@@ -567,13 +614,13 @@ merge_widget_value (val1, val2, level)
 #endif
 #endif
        }
 #endif
 #endif
        }
-      
+
       val1->contents = merged_contents;
     }
 
   this_one_change = change;
 
       val1->contents = merged_contents;
     }
 
   this_one_change = change;
 
-  merged_next = merge_widget_value (val1->next, val2->next, level);
+  merged_next = merge_widget_value (val1->next, val2->next, level, change_p);
 
   if (val1->next && !merged_next)
     {
 
   if (val1->next && !merged_next)
     {
@@ -593,9 +640,10 @@ merge_widget_value (val1, val2, level)
 
   val1->this_one_change = this_one_change;
   val1->change = change;
 
   val1->this_one_change = this_one_change;
   val1->change = change;
-  
+
   if (change > NO_CHANGE && val1->toolkit_data)
     {
   if (change > NO_CHANGE && val1->toolkit_data)
     {
+      *change_p = 1;
       if (val1->free_toolkit_data)
        XtFree (val1->toolkit_data);
       val1->toolkit_data = NULL;
       if (val1->free_toolkit_data)
        XtFree (val1->toolkit_data);
       val1->toolkit_data = NULL;
@@ -624,7 +672,7 @@ name_to_widget (instance, name)
       char* real_name = (char *) xmalloc (length);
       real_name [0] = '*';
       strcpy (real_name + 1, name);
       char* real_name = (char *) xmalloc (length);
       real_name [0] = '*';
       strcpy (real_name + 1, name);
-      
+
       widget = XtNameToWidget (instance->widget, real_name);
 
       free (real_name);
       widget = XtNameToWidget (instance->widget, real_name);
 
       free (real_name);
@@ -633,13 +681,17 @@ name_to_widget (instance, name)
 }
 
 static void
 }
 
 static void
+#ifdef PROTOTYPES
+set_one_value (widget_instance* instance, widget_value* val, Boolean deep_p)
+#else
 set_one_value (instance, val, deep_p)
      widget_instance* instance;
      widget_value* val;
      Boolean deep_p;
 set_one_value (instance, val, deep_p)
      widget_instance* instance;
      widget_value* val;
      Boolean deep_p;
+#endif
 {
   Widget widget = name_to_widget (instance, val->name);
 {
   Widget widget = name_to_widget (instance, val->name);
-  
+
   if (widget)
     {
 #if defined (USE_LUCID)
   if (widget)
     {
 #if defined (USE_LUCID)
@@ -650,10 +702,6 @@ set_one_value (instance, val, deep_p)
       if (lw_motif_widget_p (instance->widget))
        xm_update_one_widget (instance, widget, val, deep_p);
 #endif
       if (lw_motif_widget_p (instance->widget))
        xm_update_one_widget (instance, widget, val, deep_p);
 #endif
-#if defined (USE_OLIT)
-      if (lw_olit_widget_p (instance->widget))
-       xol_update_one_widget (instance, widget, val, deep_p);
-#endif
 #if defined (USE_XAW)
       if (lw_xaw_widget_p (instance->widget))
        xaw_update_one_widget (instance, widget, val, deep_p);
 #if defined (USE_XAW)
       if (lw_xaw_widget_p (instance->widget))
        xaw_update_one_widget (instance, widget, val, deep_p);
@@ -662,9 +710,13 @@ set_one_value (instance, val, deep_p)
 }
 
 static void
 }
 
 static void
+#ifdef PROTOTYPES
+update_one_widget_instance (widget_instance* instance, Boolean deep_p)
+#else
 update_one_widget_instance (instance, deep_p)
      widget_instance* instance;
      Boolean deep_p;
 update_one_widget_instance (instance, deep_p)
      widget_instance* instance;
      Boolean deep_p;
+#endif
 {
   widget_value *val;
 
 {
   widget_value *val;
 
@@ -678,9 +730,13 @@ update_one_widget_instance (instance, deep_p)
 }
 
 static void
 }
 
 static void
+#ifdef PROTOTYPES
+update_all_widget_values (widget_info* info, Boolean deep_p)
+#else
 update_all_widget_values (info, deep_p)
      widget_info* info;
      Boolean deep_p;
 update_all_widget_values (info, deep_p)
      widget_info* info;
      Boolean deep_p;
+#endif
 {
   widget_instance* instance;
   widget_value* val;
 {
   widget_instance* instance;
   widget_value* val;
@@ -692,11 +748,15 @@ update_all_widget_values (info, deep_p)
     val->change = NO_CHANGE;
 }
 
     val->change = NO_CHANGE;
 }
 
-void
+int
+#ifdef PROTOTYPES
+lw_modify_all_widgets (LWLIB_ID id, widget_value* val, Boolean deep_p)
+#else
 lw_modify_all_widgets (id, val, deep_p)
      LWLIB_ID id;
      widget_value* val;
      Boolean deep_p;
 lw_modify_all_widgets (id, val, deep_p)
      LWLIB_ID id;
      widget_value* val;
      Boolean deep_p;
+#endif
 {
   widget_info* info = get_widget_info (id, False);
   widget_value* new_val;
 {
   widget_info* info = get_widget_info (id, False);
   widget_value* new_val;
@@ -705,9 +765,10 @@ lw_modify_all_widgets (id, val, deep_p)
   widget_value* prev;
   widget_value* next;
   int          found;
   widget_value* prev;
   widget_value* next;
   int          found;
+  int change_p = 0;
 
   if (!info)
 
   if (!info)
-    return;
+    return 0;
 
   for (new_val = val; new_val; new_val = new_val->next)
     {
 
   for (new_val = val; new_val; new_val = new_val->next)
     {
@@ -720,7 +781,8 @@ lw_modify_all_widgets (id, val, deep_p)
            found = True;
            next = cur->next;
            cur->next = NULL;
            found = True;
            next = cur->next;
            cur->next = NULL;
-           cur = merge_widget_value (cur, new_val, deep_p ? 1000 : 1);
+           cur = merge_widget_value (cur, new_val, deep_p ? 1000 : 1,
+                                     &change_p);
            if (prev)
              prev->next = cur ? cur : next;
            else
            if (prev)
              prev->next = cur ? cur : next;
            else
@@ -736,11 +798,13 @@ lw_modify_all_widgets (id, val, deep_p)
            prev->next = copy_widget_value_tree (new_val, STRUCTURAL_CHANGE);
          else
            info->val = copy_widget_value_tree (new_val, STRUCTURAL_CHANGE);
            prev->next = copy_widget_value_tree (new_val, STRUCTURAL_CHANGE);
          else
            info->val = copy_widget_value_tree (new_val, STRUCTURAL_CHANGE);
+         change_p = 1;
        }
       new_val->next = next_new_val;
     }
 
   update_all_widget_values (info, deep_p);
        }
       new_val->next = next_new_val;
     }
 
   update_all_widget_values (info, deep_p);
+  return change_p;
 }
 
 \f
 }
 
 \f
@@ -778,11 +842,11 @@ static Boolean
 dialog_spec_p (name)
      char* name;
 {
 dialog_spec_p (name)
      char* name;
 {
-  /* return True if name matches [EILPQeilpq][1-9][Bb] or 
+  /* return True if name matches [EILPQeilpq][1-9][Bb] or
      [EILPQeilpq][1-9][Bb][Rr][1-9] */
   if (!name)
     return False;
      [EILPQeilpq][1-9][Bb][Rr][1-9] */
   if (!name)
     return False;
-  
+
   switch (name [0])
     {
     case 'E': case 'I': case 'L': case 'P': case 'Q':
   switch (name [0])
     {
     case 'E': case 'I': case 'L': case 'P': case 'Q':
@@ -802,7 +866,7 @@ dialog_spec_p (name)
        }
       else
        return False;
        }
       else
        return False;
-    
+
     default:
       return False;
     }
     default:
       return False;
     }
@@ -822,10 +886,6 @@ instantiate_widget_instance (instance)
   if (!function)
     function = find_in_table (instance->info->type, xm_creation_table);
 #endif
   if (!function)
     function = find_in_table (instance->info->type, xm_creation_table);
 #endif
-#if defined (USE_OLIT)
-  if (!function)
-    function = find_in_table (instance->info->type, xol_creation_table);
-#endif
 #if defined (USE_XAW)
   if (!function)
     function = find_in_table (instance->info->type, xaw_creation_table);
 #if defined (USE_XAW)
   if (!function)
     function = find_in_table (instance->info->type, xaw_creation_table);
@@ -845,13 +905,10 @@ instantiate_widget_instance (instance)
 #if defined (USE_XAW)
          if (!function)
            function = xaw_create_dialog;
 #if defined (USE_XAW)
          if (!function)
            function = xaw_create_dialog;
-#endif
-#if defined (USE_OLIT)
-         /* not yet */
 #endif
        }
     }
 #endif
        }
     }
-  
+
   if (!function)
     {
       printf ("No creation function for widget type %s\n",
   if (!function)
     {
       printf ("No creation function for widget type %s\n",
@@ -867,7 +924,7 @@ instantiate_widget_instance (instance)
   /*   XtRealizeWidget (instance->widget);*/
 }
 
   /*   XtRealizeWidget (instance->widget);*/
 }
 
-void 
+void
 lw_register_widget (type, name, id, val, pre_activate_cb,
                    selection_cb, post_activate_cb, highlight_cb)
      char* type;
 lw_register_widget (type, name, id, val, pre_activate_cb,
                    selection_cb, post_activate_cb, highlight_cb)
      char* type;
@@ -885,26 +942,34 @@ lw_register_widget (type, name, id, val, pre_activate_cb,
 }
 
 Widget
 }
 
 Widget
+#ifdef PROTOTYPES
+lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p)
+#else
 lw_get_widget (id, parent, pop_up_p)
      LWLIB_ID id;
      Widget parent;
      Boolean pop_up_p;
 lw_get_widget (id, parent, pop_up_p)
      LWLIB_ID id;
      Widget parent;
      Boolean pop_up_p;
+#endif
 {
   widget_instance* instance;
 {
   widget_instance* instance;
-  
+
   instance = find_instance (id, parent, pop_up_p);
   return instance ? instance->widget : NULL;
 }
 
 Widget
   instance = find_instance (id, parent, pop_up_p);
   return instance ? instance->widget : NULL;
 }
 
 Widget
+#ifdef PROTOTYPES
+lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p)
+#else
 lw_make_widget (id, parent, pop_up_p)
      LWLIB_ID id;
      Widget parent;
      Boolean pop_up_p;
 lw_make_widget (id, parent, pop_up_p)
      LWLIB_ID id;
      Widget parent;
      Boolean pop_up_p;
+#endif
 {
   widget_instance* instance;
   widget_info* info;
 {
   widget_instance* instance;
   widget_info* info;
-  
+
   instance = find_instance (id, parent, pop_up_p);
   if (!instance)
     {
   instance = find_instance (id, parent, pop_up_p);
   if (!instance)
     {
@@ -920,6 +985,12 @@ lw_make_widget (id, parent, pop_up_p)
 }
 
 Widget
 }
 
 Widget
+#ifdef PROTOTYPES
+lw_create_widget (char* type, char* name, LWLIB_ID id, widget_value* val,
+                 Widget parent, Boolean pop_up_p,
+                 lw_callback pre_activate_cb, lw_callback selection_cb,
+                 lw_callback post_activate_cb, lw_callback highlight_cb)
+#else
 lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb,
                  selection_cb, post_activate_cb, highlight_cb)
      char* type;
 lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb,
                  selection_cb, post_activate_cb, highlight_cb)
      char* type;
@@ -932,12 +1003,13 @@ lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb,
      lw_callback selection_cb;
      lw_callback post_activate_cb;
      lw_callback highlight_cb;
      lw_callback selection_cb;
      lw_callback post_activate_cb;
      lw_callback highlight_cb;
+#endif
 {
   lw_register_widget (type, name, id, val, pre_activate_cb, selection_cb,
                      post_activate_cb, highlight_cb);
   return lw_make_widget (id, parent, pop_up_p);
 }
 {
   lw_register_widget (type, name, id, val, pre_activate_cb, selection_cb,
                      post_activate_cb, highlight_cb);
   return lw_make_widget (id, parent, pop_up_p);
 }
-                 
+
 \f
 /* destroying the widgets */
 static void
 \f
 /* destroying the widgets */
 static void
@@ -971,15 +1043,10 @@ destroy_one_instance (instance)
        xm_destroy_instance (instance);
       else
 #endif
        xm_destroy_instance (instance);
       else
 #endif
-#if defined (USE_OLIT)
-      if (lw_olit_widget_p (instance->widget))
-       xol_destroy_instance (instance);
-      else
-#endif
 #if defined (USE_XAW)
       if (lw_xaw_widget_p (instance->widget))
        xaw_destroy_instance (instance);
 #if defined (USE_XAW)
       if (lw_xaw_widget_p (instance->widget))
        xaw_destroy_instance (instance);
-      else 
+      else
 #endif
        /* do not remove the empty statement */
        ;
 #endif
        /* do not remove the empty statement */
        ;
@@ -993,7 +1060,7 @@ lw_destroy_widget (w)
      Widget w;
 {
   widget_instance* instance = get_widget_instance (w, True);
      Widget w;
 {
   widget_instance* instance = get_widget_instance (w, True);
-  
+
   if (instance)
     {
       widget_info *info = instance->info;
   if (instance)
     {
       widget_info *info = instance->info;
@@ -1086,9 +1153,13 @@ lw_raise_all_pop_up_widgets ()
 }
 
 static void
 }
 
 static void
+#ifdef PROTOTYPES
+lw_pop_all_widgets (LWLIB_ID id, Boolean up)
+#else
 lw_pop_all_widgets (id, up)
      LWLIB_ID id;
      Boolean up;
 lw_pop_all_widgets (id, up)
      LWLIB_ID id;
      Boolean up;
+#endif
 {
   widget_info* info = get_widget_info (id, False);
   widget_instance* instance;
 {
   widget_info* info = get_widget_info (id, False);
   widget_instance* instance;
@@ -1111,13 +1182,6 @@ lw_pop_all_widgets (id, up)
              xm_pop_instance (instance, up);
            }
 #endif
              xm_pop_instance (instance, up);
            }
 #endif
-#if defined (USE_OLIT)
-         if (lw_olit_widget_p (instance->widget))
-           {
-             XtRealizeWidget (instance->widget);
-             xol_pop_instance (instance, up);
-           }
-#endif
 #if defined (USE_XAW)
          if (lw_xaw_widget_p (instance->widget))
            {
 #if defined (USE_XAW)
          if (lw_xaw_widget_p (instance->widget))
            {
@@ -1156,10 +1220,6 @@ lw_popup_menu (widget, event)
   if (lw_motif_widget_p (widget))
     xm_popup_menu (widget, event);
 #endif
   if (lw_motif_widget_p (widget))
     xm_popup_menu (widget, event);
 #endif
-#if defined (USE_OLIT)
-  if (lw_olit_widget_p (widget))
-    xol_popup_menu (widget, event);
-#endif
 #if defined (USE_XAW)
   if (lw_xaw_widget_p (widget))
     xaw_popup_menu (widget, event);
 #if defined (USE_XAW)
   if (lw_xaw_widget_p (widget))
     xaw_popup_menu (widget, event);
@@ -1173,7 +1233,7 @@ get_one_value (instance, val)
      widget_value* val;
 {
   Widget widget = name_to_widget (instance, val->name);
      widget_value* val;
 {
   Widget widget = name_to_widget (instance, val->name);
-      
+
   if (widget)
     {
 #if defined (USE_LUCID)
   if (widget)
     {
 #if defined (USE_LUCID)
@@ -1184,10 +1244,6 @@ get_one_value (instance, val)
       if (lw_motif_widget_p (instance->widget))
        xm_update_one_value (instance, widget, val);
 #endif
       if (lw_motif_widget_p (instance->widget))
        xm_update_one_value (instance, widget, val);
 #endif
-#if defined (USE_OLIT)
-      if (lw_olit_widget_p (instance->widget))
-       xol_update_one_value (instance, widget, val);
-#endif
 #if defined (USE_XAW)
       if (lw_xaw_widget_p (instance->widget))
        xaw_update_one_value (instance, widget, val);
 #if defined (USE_XAW)
       if (lw_xaw_widget_p (instance->widget))
        xaw_update_one_value (instance, widget, val);
@@ -1254,7 +1310,7 @@ lw_get_widget_value_for_widget (instance, w)
 /* To forbid recursive calls */
 static Boolean lwlib_updating;
 
 /* To forbid recursive calls */
 static Boolean lwlib_updating;
 
-/* This function can be used as a an XtCallback for the widgets that get 
+/* This function can be used as a an XtCallback for the widgets that get
   modified to update other instances of the widgets.  Closure should be the
   widget_instance. */
 void
   modified to update other instances of the widgets.  Closure should be the
   widget_instance. */
 void
@@ -1321,30 +1377,38 @@ lw_set_keyboard_focus (parent, w)
 
 \f/* Show busy */
 static void
 
 \f/* Show busy */
 static void
+#ifdef PROTOTYPES
+show_one_widget_busy (Widget w, Boolean flag)
+#else
 show_one_widget_busy (w, flag)
      Widget w;
      Boolean flag;
 show_one_widget_busy (w, flag)
      Widget w;
      Boolean flag;
+#endif
 {
   Pixel foreground = 0;
   Pixel background = 1;
   Widget widget_to_invert = XtNameToWidget (w, "*sheet");
   if (!widget_to_invert)
     widget_to_invert = w;
 {
   Pixel foreground = 0;
   Pixel background = 1;
   Widget widget_to_invert = XtNameToWidget (w, "*sheet");
   if (!widget_to_invert)
     widget_to_invert = w;
-  
+
   XtVaGetValues (widget_to_invert,
                 XtNforeground, &foreground,
                 XtNbackground, &background,
   XtVaGetValues (widget_to_invert,
                 XtNforeground, &foreground,
                 XtNbackground, &background,
-                0);
+                NULL);
   XtVaSetValues (widget_to_invert,
                 XtNforeground, background,
                 XtNbackground, foreground,
   XtVaSetValues (widget_to_invert,
                 XtNforeground, background,
                 XtNbackground, foreground,
-                0);
+                NULL);
 }
 
 void
 }
 
 void
+#ifdef PROTOTYPES
+lw_show_busy (Widget w, Boolean busy)
+#else
 lw_show_busy (w, busy)
      Widget w;
      Boolean busy;
 lw_show_busy (w, busy)
      Widget w;
      Boolean busy;
+#endif
 {
   widget_instance* instance = get_widget_instance (w, False);
   widget_info* info;
 {
   widget_instance* instance = get_widget_instance (w, False);
   widget_info* info;
@@ -1366,11 +1430,15 @@ lw_show_busy (w, busy)
 /* This hack exists because Lucid/Athena need to execute the strange
    function below to support geometry management. */
 void
 /* This hack exists because Lucid/Athena need to execute the strange
    function below to support geometry management. */
 void
+#ifdef PROTOTYPES
+lw_refigure_widget (Widget w, Boolean doit)
+#else
 lw_refigure_widget (w, doit)
      Widget w;
      Boolean doit;
 lw_refigure_widget (w, doit)
      Widget w;
      Boolean doit;
+#endif
 {
 {
-#if defined (USE_XAW)  
+#if defined (USE_XAW)
   XawPanedSetRefigureMode (w, doit);
 #endif
 #if defined (USE_MOTIF)
   XawPanedSetRefigureMode (w, doit);
 #endif
 #if defined (USE_MOTIF)
@@ -1415,9 +1483,13 @@ lw_set_main_areas (parent, menubar, work_area)
 /* Manage resizing for Motif.  This disables resizing when the menubar
    is about to be modified. */
 void
 /* Manage resizing for Motif.  This disables resizing when the menubar
    is about to be modified. */
 void
+#ifdef PROTOTYPES
+lw_allow_resizing (Widget w, Boolean flag)
+#else
 lw_allow_resizing (w, flag)
      Widget w;
      Boolean flag;
 lw_allow_resizing (w, flag)
      Widget w;
      Boolean flag;
+#endif
 {
 #if defined (USE_MOTIF)
   xm_manage_resizing (w, flag);
 {
 #if defined (USE_MOTIF)
   xm_manage_resizing (w, flag);
@@ -1436,7 +1508,7 @@ lw_separator_p (label, type, motif_p)
      enum menu_separator *type;
      int motif_p;
 {
      enum menu_separator *type;
      int motif_p;
 {
-  int separator_p;
+  int separator_p = 0;
 
   if (strlen (label) >= 3
       && bcmp (label, "--:", 3) == 0)
 
   if (strlen (label) >= 3
       && bcmp (label, "--:", 3) == 0)
@@ -1448,21 +1520,21 @@ lw_separator_p (label, type, motif_p)
       }
       separator_names[] =
       {
       }
       separator_names[] =
       {
-       "space",                     SEPARATOR_NO_LINE,
-       "noLine",                    SEPARATOR_NO_LINE,
-       "singleLine",                SEPARATOR_SINGLE_LINE,
-       "doubleLine",                SEPARATOR_DOUBLE_LINE,
-       "singleDashedLine",          SEPARATOR_SINGLE_DASHED_LINE,
-       "doubleDashedLine",          SEPARATOR_DOUBLE_DASHED_LINE,
-       "shadowEtchedIn",            SEPARATOR_SHADOW_ETCHED_IN,
-       "shadowEtchedOut",           SEPARATOR_SHADOW_ETCHED_OUT,
-       "shadowEtchedInDash",        SEPARATOR_SHADOW_ETCHED_IN_DASH,
-       "shadowEtchedOutDash",       SEPARATOR_SHADOW_ETCHED_OUT_DASH,
-       "shadowDoubleEtchedIn",      SEPARATOR_SHADOW_DOUBLE_ETCHED_IN,
-       "shadowDoubleEtchedOut",     SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT,
-       "shadowDoubleEtchedInDash",  SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH,
-       "shadowDoubleEtchedOutDash", SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH,
-       0
+       {"space",                     SEPARATOR_NO_LINE},
+       {"noLine",                    SEPARATOR_NO_LINE},
+       {"singleLine",                SEPARATOR_SINGLE_LINE},
+       {"doubleLine",                SEPARATOR_DOUBLE_LINE},
+       {"singleDashedLine",          SEPARATOR_SINGLE_DASHED_LINE},
+       {"doubleDashedLine",          SEPARATOR_DOUBLE_DASHED_LINE},
+       {"shadowEtchedIn",            SEPARATOR_SHADOW_ETCHED_IN},
+       {"shadowEtchedOut",           SEPARATOR_SHADOW_ETCHED_OUT},
+       {"shadowEtchedInDash",        SEPARATOR_SHADOW_ETCHED_IN_DASH},
+       {"shadowEtchedOutDash",       SEPARATOR_SHADOW_ETCHED_OUT_DASH},
+       {"shadowDoubleEtchedIn",      SEPARATOR_SHADOW_DOUBLE_ETCHED_IN},
+       {"shadowDoubleEtchedOut",     SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT},
+       {"shadowDoubleEtchedInDash",  SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH},
+       {"shadowDoubleEtchedOutDash", SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH},
+       {0,0}
       };
 
       int i;
       };
 
       int i;
@@ -1493,21 +1565,21 @@ lw_separator_p (label, type, motif_p)
       }
       separator_names[] =
       {
       }
       separator_names[] =
       {
-       "space",                        SEPARATOR_NO_LINE,
-       "no-line",                      SEPARATOR_NO_LINE,
-       "single-line",                  SEPARATOR_SINGLE_LINE,
-       "double-line",                  SEPARATOR_DOUBLE_LINE,
-       "single-dashed-line",           SEPARATOR_SINGLE_DASHED_LINE,
-       "double-dashed-line",           SEPARATOR_DOUBLE_DASHED_LINE,
-       "shadow-etched-in",             SEPARATOR_SHADOW_ETCHED_IN,
-       "shadow-etched-out",            SEPARATOR_SHADOW_ETCHED_OUT,
-       "shadow-etched-in-dash",        SEPARATOR_SHADOW_ETCHED_IN_DASH,
-       "shadow-etched-out-dash",       SEPARATOR_SHADOW_ETCHED_OUT_DASH,
-       "shadow-double-etched-in",      SEPARATOR_SHADOW_DOUBLE_ETCHED_IN,
-       "shadow-double-etched-out",     SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT,
-       "shadow-double-etched-in-dash", SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH,
-       "shadow-double-etched-out-dash",SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH,
-       0
+       {"space",                        SEPARATOR_NO_LINE},
+       {"no-line",                      SEPARATOR_NO_LINE},
+       {"single-line",                  SEPARATOR_SINGLE_LINE},
+       {"double-line",                  SEPARATOR_DOUBLE_LINE},
+       {"single-dashed-line",           SEPARATOR_SINGLE_DASHED_LINE},
+       {"double-dashed-line",           SEPARATOR_DOUBLE_DASHED_LINE},
+       {"shadow-etched-in",             SEPARATOR_SHADOW_ETCHED_IN},
+       {"shadow-etched-out",            SEPARATOR_SHADOW_ETCHED_OUT},
+       {"shadow-etched-in-dash",        SEPARATOR_SHADOW_ETCHED_IN_DASH},
+       {"shadow-etched-out-dash",       SEPARATOR_SHADOW_ETCHED_OUT_DASH},
+       {"shadow-double-etched-in",      SEPARATOR_SHADOW_DOUBLE_ETCHED_IN},
+       {"shadow-double-etched-out",     SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT},
+       {"shadow-double-etched-in-dash", SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH},
+       {"shadow-double-etched-out-dash",SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH},
+       {0,0}
       };
 
       int i;
       };
 
       int i;
@@ -1539,3 +1611,5 @@ lw_separator_p (label, type, motif_p)
   return separator_p;
 }
 
   return separator_p;
 }
 
+/* arch-tag: 3d730f36-a441-4a71-9971-48ef3b5a4d9f
+   (do not change this comment) */