/[emacs]/emacs/lwlib/lwlib.c
ViewVC logotype

Diff of /emacs/lwlib/lwlib.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.49 by fx, Wed Nov 20 19:26:04 2002 UTC revision 1.50 by lektu, Tue Feb 4 14:08:23 2003 UTC
# Line 3  Line 3 
3    
4  This file is part of the Lucid Widget Library.  This file is part of the Lucid Widget Library.
5    
6  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
7  modify it under the terms of the GNU General Public License as published by  modify it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)  the Free Software Foundation; either version 2, or (at your option)
9  any later version.  any later version.
10    
11  The Lucid Widget Library is distributed in the hope that it will be useful,  The Lucid Widget Library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.  GNU General Public License for more details.
15    
# Line 101  static void destroy_one_instance P_ ((wi Line 101  static void destroy_one_instance P_ ((wi
101  static void lw_pop_all_widgets P_ ((LWLIB_ID, Boolean));  static void lw_pop_all_widgets P_ ((LWLIB_ID, Boolean));
102  static Boolean get_one_value P_ ((widget_instance *, widget_value *));  static Boolean get_one_value P_ ((widget_instance *, widget_value *));
103  static void show_one_widget_busy P_ ((Widget, Boolean));  static void show_one_widget_busy P_ ((Widget, Boolean));
104        
105  void  void
106  lwlib_memset (address, value, length)  lwlib_memset (address, value, length)
107       char *address;       char *address;
# Line 190  malloc_widget_value () Line 190  malloc_widget_value ()
190  }  }
191    
192  /* this is analogous to free().  It frees only what was allocated  /* this is analogous to free().  It frees only what was allocated
193     by malloc_widget_value(), and no substructures.     by malloc_widget_value(), and no substructures.
194   */   */
195  void  void
196  free_widget_value (wv)  free_widget_value (wv)
# Line 251  copy_widget_value_tree (val, change) Line 251  copy_widget_value_tree (val, change)
251       change_type change;       change_type change;
252  {  {
253    widget_value* copy;    widget_value* copy;
254      
255    if (!val)    if (!val)
256      return NULL;      return NULL;
257    if (val == (widget_value *) 1)    if (val == (widget_value *) 1)
# Line 523  merge_widget_value (val1, val2, level, c Line 523  merge_widget_value (val1, val2, level, c
523        free_widget_value_tree (val1);        free_widget_value_tree (val1);
524        return NULL;        return NULL;
525      }      }
526      
527    change = NO_CHANGE;    change = NO_CHANGE;
528    
529    if (safe_strcmp (val1->name, val2->name))    if (safe_strcmp (val1->name, val2->name))
# Line 591  merge_widget_value (val1, val2, level, c Line 591  merge_widget_value (val1, val2, level, c
591        merged_contents =        merged_contents =
592          merge_widget_value (val1->contents, val2->contents, level - 1,          merge_widget_value (val1->contents, val2->contents, level - 1,
593                              change_p);                              change_p);
594          
595        if (val1->contents && !merged_contents)        if (val1->contents && !merged_contents)
596          {          {
597            /* This used to say INVISIBLE_CHANGE,            /* This used to say INVISIBLE_CHANGE,
# Line 614  merge_widget_value (val1, val2, level, c Line 614  merge_widget_value (val1, val2, level, c
614  #endif  #endif
615  #endif  #endif
616          }          }
617          
618        val1->contents = merged_contents;        val1->contents = merged_contents;
619      }      }
620    
# Line 640  merge_widget_value (val1, val2, level, c Line 640  merge_widget_value (val1, val2, level, c
640    
641    val1->this_one_change = this_one_change;    val1->this_one_change = this_one_change;
642    val1->change = change;    val1->change = change;
643      
644    if (change > NO_CHANGE && val1->toolkit_data)    if (change > NO_CHANGE && val1->toolkit_data)
645      {      {
646        *change_p = 1;        *change_p = 1;
# Line 672  name_to_widget (instance, name) Line 672  name_to_widget (instance, name)
672        char* real_name = (char *) xmalloc (length);        char* real_name = (char *) xmalloc (length);
673        real_name [0] = '*';        real_name [0] = '*';
674        strcpy (real_name + 1, name);        strcpy (real_name + 1, name);
675          
676        widget = XtNameToWidget (instance->widget, real_name);        widget = XtNameToWidget (instance->widget, real_name);
677    
678        free (real_name);        free (real_name);
# Line 691  set_one_value (instance, val, deep_p) Line 691  set_one_value (instance, val, deep_p)
691  #endif  #endif
692  {  {
693    Widget widget = name_to_widget (instance, val->name);    Widget widget = name_to_widget (instance, val->name);
694      
695    if (widget)    if (widget)
696      {      {
697  #if defined (USE_LUCID)  #if defined (USE_LUCID)
# Line 842  static Boolean Line 842  static Boolean
842  dialog_spec_p (name)  dialog_spec_p (name)
843       char* name;       char* name;
844  {  {
845    /* return True if name matches [EILPQeilpq][1-9][Bb] or    /* return True if name matches [EILPQeilpq][1-9][Bb] or
846       [EILPQeilpq][1-9][Bb][Rr][1-9] */       [EILPQeilpq][1-9][Bb][Rr][1-9] */
847    if (!name)    if (!name)
848      return False;      return False;
849      
850    switch (name [0])    switch (name [0])
851      {      {
852      case 'E': case 'I': case 'L': case 'P': case 'Q':      case 'E': case 'I': case 'L': case 'P': case 'Q':
# Line 866  dialog_spec_p (name) Line 866  dialog_spec_p (name)
866          }          }
867        else        else
868          return False;          return False;
869        
870      default:      default:
871        return False;        return False;
872      }      }
# Line 908  instantiate_widget_instance (instance) Line 908  instantiate_widget_instance (instance)
908  #endif  #endif
909          }          }
910      }      }
911      
912    if (!function)    if (!function)
913      {      {
914        printf ("No creation function for widget type %s\n",        printf ("No creation function for widget type %s\n",
# Line 924  instantiate_widget_instance (instance) Line 924  instantiate_widget_instance (instance)
924    /*   XtRealizeWidget (instance->widget);*/    /*   XtRealizeWidget (instance->widget);*/
925  }  }
926    
927  void  void
928  lw_register_widget (type, name, id, val, pre_activate_cb,  lw_register_widget (type, name, id, val, pre_activate_cb,
929                      selection_cb, post_activate_cb, highlight_cb)                      selection_cb, post_activate_cb, highlight_cb)
930       char* type;       char* type;
# Line 952  lw_get_widget (id, parent, pop_up_p) Line 952  lw_get_widget (id, parent, pop_up_p)
952  #endif  #endif
953  {  {
954    widget_instance* instance;    widget_instance* instance;
955      
956    instance = find_instance (id, parent, pop_up_p);    instance = find_instance (id, parent, pop_up_p);
957    return instance ? instance->widget : NULL;    return instance ? instance->widget : NULL;
958  }  }
# Line 969  lw_make_widget (id, parent, pop_up_p) Line 969  lw_make_widget (id, parent, pop_up_p)
969  {  {
970    widget_instance* instance;    widget_instance* instance;
971    widget_info* info;    widget_info* info;
972      
973    instance = find_instance (id, parent, pop_up_p);    instance = find_instance (id, parent, pop_up_p);
974    if (!instance)    if (!instance)
975      {      {
# Line 1009  lw_create_widget (type, name, id, val, p Line 1009  lw_create_widget (type, name, id, val, p
1009                        post_activate_cb, highlight_cb);                        post_activate_cb, highlight_cb);
1010    return lw_make_widget (id, parent, pop_up_p);    return lw_make_widget (id, parent, pop_up_p);
1011  }  }
1012                      
1013    
1014  /* destroying the widgets */  /* destroying the widgets */
1015  static void  static void
# Line 1046  destroy_one_instance (instance) Line 1046  destroy_one_instance (instance)
1046  #if defined (USE_XAW)  #if defined (USE_XAW)
1047        if (lw_xaw_widget_p (instance->widget))        if (lw_xaw_widget_p (instance->widget))
1048          xaw_destroy_instance (instance);          xaw_destroy_instance (instance);
1049        else        else
1050  #endif  #endif
1051          /* do not remove the empty statement */          /* do not remove the empty statement */
1052          ;          ;
# Line 1060  lw_destroy_widget (w) Line 1060  lw_destroy_widget (w)
1060       Widget w;       Widget w;
1061  {  {
1062    widget_instance* instance = get_widget_instance (w, True);    widget_instance* instance = get_widget_instance (w, True);
1063      
1064    if (instance)    if (instance)
1065      {      {
1066        widget_info *info = instance->info;        widget_info *info = instance->info;
# Line 1233  get_one_value (instance, val) Line 1233  get_one_value (instance, val)
1233       widget_value* val;       widget_value* val;
1234  {  {
1235    Widget widget = name_to_widget (instance, val->name);    Widget widget = name_to_widget (instance, val->name);
1236          
1237    if (widget)    if (widget)
1238      {      {
1239  #if defined (USE_LUCID)  #if defined (USE_LUCID)
# Line 1310  lw_get_widget_value_for_widget (instance Line 1310  lw_get_widget_value_for_widget (instance
1310  /* To forbid recursive calls */  /* To forbid recursive calls */
1311  static Boolean lwlib_updating;  static Boolean lwlib_updating;
1312    
1313  /* 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
1314    modified to update other instances of the widgets.  Closure should be the    modified to update other instances of the widgets.  Closure should be the
1315    widget_instance. */    widget_instance. */
1316  void  void
# Line 1390  show_one_widget_busy (w, flag) Line 1390  show_one_widget_busy (w, flag)
1390    Widget widget_to_invert = XtNameToWidget (w, "*sheet");    Widget widget_to_invert = XtNameToWidget (w, "*sheet");
1391    if (!widget_to_invert)    if (!widget_to_invert)
1392      widget_to_invert = w;      widget_to_invert = w;
1393      
1394    XtVaGetValues (widget_to_invert,    XtVaGetValues (widget_to_invert,
1395                   XtNforeground, &foreground,                   XtNforeground, &foreground,
1396                   XtNbackground, &background,                   XtNbackground, &background,
# Line 1438  lw_refigure_widget (w, doit) Line 1438  lw_refigure_widget (w, doit)
1438       Boolean doit;       Boolean doit;
1439  #endif  #endif
1440  {  {
1441  #if defined (USE_XAW)    #if defined (USE_XAW)
1442    XawPanedSetRefigureMode (w, doit);    XawPanedSetRefigureMode (w, doit);
1443  #endif  #endif
1444  #if defined (USE_MOTIF)  #if defined (USE_MOTIF)

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26