declare smobs in alloc.c
[bpt/emacs.git] / lwlib / lwlib-Xm.c
index 4f62768..4d48e64 100644 (file)
@@ -1,6 +1,6 @@
 /* The lwlib interface to Motif widgets.
 
 /* The lwlib interface to Motif widgets.
 
-Copyright (C) 1994-1997, 1999-201 Free Software Foundation, Inc.
+Copyright (C) 1994-1997, 1999-2014 Free Software Foundation, Inc.
 Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
 Copyright (C) 1992 Lucid, Inc.
 
 This file is part of the Lucid Widget Library.
@@ -16,13 +16,9 @@ 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
 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., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
 #include <config.h>
-#endif
 
 #include <unistd.h>
 #include <stdio.h>
 
 #include <unistd.h>
 #include <stdio.h>
@@ -83,7 +79,6 @@ static destroyed_instance *make_destroyed_instance (char *, char *,
                                                     Boolean);
 static void free_destroyed_instance (destroyed_instance*);
 Widget first_child (Widget);
                                                     Boolean);
 static void free_destroyed_instance (destroyed_instance*);
 Widget first_child (Widget);
-Boolean lw_motif_widget_p (Widget);
 static XmString resource_motif_string (Widget, char *);
 static void destroy_all_children (Widget, int);
 static void xm_update_label (widget_instance *, Widget, widget_value *);
 static XmString resource_motif_string (Widget, char *);
 static void destroy_all_children (Widget, int);
 static void xm_update_label (widget_instance *, Widget, widget_value *);
@@ -103,7 +98,6 @@ static void xm_update_menu (widget_instance *, Widget, widget_value *,
 static void xm_update_text (widget_instance *, Widget, widget_value *);
 static void xm_update_text_field (widget_instance *, Widget,
                                   widget_value *);
 static void xm_update_text (widget_instance *, Widget, widget_value *);
 static void xm_update_text_field (widget_instance *, Widget,
                                   widget_value *);
-void xm_update_one_value (widget_instance *, Widget, widget_value *);
 static void activate_button (Widget, XtPointer, XtPointer);
 static Widget make_dialog (char *, Widget, Boolean, char *, char *,
                            Boolean, Boolean, Boolean, int, int);
 static void activate_button (Widget, XtPointer, XtPointer);
 static Widget make_dialog (char *, Widget, Boolean, char *, char *,
                            Boolean, Boolean, Boolean, int, int);
@@ -111,21 +105,16 @@ static destroyed_instance* find_matching_instance (widget_instance*);
 static void mark_dead_instance_destroyed (Widget, XtPointer, XtPointer);
 static void recenter_widget (Widget);
 static Widget recycle_instance (destroyed_instance*);
 static void mark_dead_instance_destroyed (Widget, XtPointer, XtPointer);
 static void recenter_widget (Widget);
 static Widget recycle_instance (destroyed_instance*);
-Widget xm_create_dialog (widget_instance*);
 static Widget make_menubar (widget_instance*);
 static void remove_grabs (Widget, XtPointer, XtPointer);
 static Widget make_popup_menu (widget_instance*);
 static Widget make_main (widget_instance*);
 static Widget make_menubar (widget_instance*);
 static void remove_grabs (Widget, XtPointer, XtPointer);
 static Widget make_popup_menu (widget_instance*);
 static Widget make_main (widget_instance*);
-void xm_destroy_instance (widget_instance*);
-void xm_popup_menu (Widget, XEvent *);
 static void set_min_dialog_size (Widget);
 static void do_call (Widget, XtPointer, enum do_call_type);
 static void xm_generic_callback (Widget, XtPointer, XtPointer);
 static void xm_nosel_callback (Widget, XtPointer, XtPointer);
 static void xm_pull_down_callback (Widget, XtPointer, XtPointer);
 static void xm_pop_down_callback (Widget, XtPointer, XtPointer);
 static void set_min_dialog_size (Widget);
 static void do_call (Widget, XtPointer, enum do_call_type);
 static void xm_generic_callback (Widget, XtPointer, XtPointer);
 static void xm_nosel_callback (Widget, XtPointer, XtPointer);
 static void xm_pull_down_callback (Widget, XtPointer, XtPointer);
 static void xm_pop_down_callback (Widget, XtPointer, XtPointer);
-void xm_set_keyboard_focus (Widget, Widget);
-void xm_set_main_areas (Widget, Widget, Widget);
 static void xm_internal_update_other_instances (Widget, XtPointer,
                                                 XtPointer);
 static void xm_arm_callback (Widget, XtPointer, XtPointer);
 static void xm_internal_update_other_instances (Widget, XtPointer,
                                                 XtPointer);
 static void xm_arm_callback (Widget, XtPointer, XtPointer);
@@ -174,8 +163,8 @@ make_destroyed_instance (char* name,
 {
   destroyed_instance* instance =
     (destroyed_instance*) xmalloc (sizeof (destroyed_instance));
 {
   destroyed_instance* instance =
     (destroyed_instance*) xmalloc (sizeof (destroyed_instance));
-  instance->name = safe_strdup (name);
-  instance->type = safe_strdup (type);
+  instance->name = xstrdup (name);
+  instance->type = xstrdup (type);
   instance->widget = widget;
   instance->parent = parent;
   instance->pop_up_p = pop_up_p;
   instance->widget = widget;
   instance->parent = parent;
   instance->pop_up_p = pop_up_p;
@@ -492,7 +481,6 @@ make_menu_in_widget (widget_instance* instance,
   int child_index;
   widget_value* cur;
   Widget button = 0;
   int child_index;
   widget_value* cur;
   Widget button = 0;
-  Widget title = 0;
   Widget menu;
   Arg al [256];
   int ac;
   Widget menu;
   Arg al [256];
   int ac;
@@ -556,7 +544,7 @@ make_menu_in_widget (widget_instance* instance,
        {
          ac = 0;
          XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
        {
          ac = 0;
          XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
-         title = button = XmCreateLabel (widget, cur->name, al, ac);
+         button = XmCreateLabel (widget, cur->name, al, ac);
        }
       else if (lw_separator_p (cur->name, &separator, 1))
        {
        }
       else if (lw_separator_p (cur->name, &separator, 1))
        {
@@ -958,10 +946,7 @@ xm_update_one_value (widget_instance* instance,
 
              XtVaGetValues (toggle, XmNset, &set, NULL);
              if (set)
 
              XtVaGetValues (toggle, XmNset, &set, NULL);
              if (set)
-               {
-                 xfree (val->value);
-                 val->value = safe_strdup (XtName (toggle));
-               }
+               dupstring (&val->value, XtName (toggle));
            }
          val->edited = True;
        }
            }
          val->edited = True;
        }
@@ -984,7 +969,7 @@ xm_update_one_value (widget_instance* instance,
                  if (pos_list [j] == i)
                    {
                      cur->selected = True;
                  if (pos_list [j] == i)
                    {
                      cur->selected = True;
-                     val->value = safe_strdup (cur->name);
+                     val->value = xstrdup (cur->name);
                    }
              }
          val->edited = 1;
                    }
              }
          val->edited = 1;