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 |
|
|
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; |
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) |
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) |
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)) |
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, |
614 |
#endif |
#endif |
615 |
#endif |
#endif |
616 |
} |
} |
617 |
|
|
618 |
val1->contents = merged_contents; |
val1->contents = merged_contents; |
619 |
} |
} |
620 |
|
|
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; |
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); |
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) |
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': |
866 |
} |
} |
867 |
else |
else |
868 |
return False; |
return False; |
869 |
|
|
870 |
default: |
default: |
871 |
return False; |
return False; |
872 |
} |
} |
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", |
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; |
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 |
} |
} |
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 |
{ |
{ |
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 |
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 |
; |
; |
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; |
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) |
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 |
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, |
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) |