Mercurial > hg > xemacs-beta
comparison lwlib/lwlib-Xm.c @ 243:f220cc83d72e r20-5b20
Import from CVS: tag r20-5b20
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:17:07 +0200 |
parents | d44af0c54775 |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
242:fc816b73a05f | 243:f220cc83d72e |
---|---|
21 | 21 |
22 #include <config.h> | 22 #include <config.h> |
23 #include <stdlib.h> | 23 #include <stdlib.h> |
24 #include <string.h> | 24 #include <string.h> |
25 #include <stdio.h> | 25 #include <stdio.h> |
26 #ifdef HAVE_LIMITS_H | |
27 #include <limits.h> | 26 #include <limits.h> |
28 #endif | |
29 #ifdef HAVE_UNISTD_H | 27 #ifdef HAVE_UNISTD_H |
30 #include <unistd.h> | 28 #include <unistd.h> |
31 #endif | 29 #endif |
32 | 30 |
33 #include <X11/StringDefs.h> | 31 #include <X11/StringDefs.h> |
61 #include <Xm/ScrolledW.h> | 59 #include <Xm/ScrolledW.h> |
62 #include <Xm/Separator.h> | 60 #include <Xm/Separator.h> |
63 #include <Xm/DialogS.h> | 61 #include <Xm/DialogS.h> |
64 #include <Xm/Form.h> | 62 #include <Xm/Form.h> |
65 | 63 |
66 #ifdef MENUBARS_MOTIF | 64 #ifdef LWLIB_MENUBARS_MOTIF |
67 static void xm_pull_down_callback (Widget, XtPointer, XtPointer); | 65 static void xm_pull_down_callback (Widget, XtPointer, XtPointer); |
68 #if 0 | 66 #if 0 |
69 static void xm_pop_down_callback (Widget, XtPointer, XtPointer); | 67 static void xm_pop_down_callback (Widget, XtPointer, XtPointer); |
70 #endif /* 0 */ | 68 #endif /* 0 */ |
71 #endif | 69 #endif |
72 static void xm_internal_update_other_instances (Widget, XtPointer, | 70 static void xm_internal_update_other_instances (Widget, XtPointer, |
73 XtPointer); | 71 XtPointer); |
74 static void xm_generic_callback (Widget, XtPointer, XtPointer); | 72 static void xm_generic_callback (Widget, XtPointer, XtPointer); |
75 #ifdef DIALOGS_MOTIF | 73 #ifdef LWLIB_DIALOGS_MOTIF |
76 static void xm_nosel_callback (Widget, XtPointer, XtPointer); | 74 static void xm_nosel_callback (Widget, XtPointer, XtPointer); |
77 #endif | 75 #endif |
78 #ifdef SCROLLBARS_MOTIF | 76 #ifdef LWLIB_SCROLLBARS_MOTIF |
79 static void xm_scrollbar_callback (Widget, XtPointer, XtPointer); | 77 static void xm_scrollbar_callback (Widget, XtPointer, XtPointer); |
80 #endif | 78 #endif |
81 | 79 |
82 #ifdef MENUBARS_MOTIF | 80 #ifdef LWLIB_MENUBARS_MOTIF |
83 static void | 81 static void |
84 xm_update_menu (widget_instance* instance, Widget widget, widget_value* val, | 82 xm_update_menu (widget_instance* instance, Widget widget, widget_value* val, |
85 Boolean deep_p); | 83 Boolean deep_p); |
86 #endif | 84 #endif |
87 | 85 |
144 | 142 |
145 Boolean | 143 Boolean |
146 lw_motif_widget_p (Widget widget) | 144 lw_motif_widget_p (Widget widget) |
147 { | 145 { |
148 return | 146 return |
149 #ifdef DIALOGS_MOTIF | 147 #ifdef LWLIB_DIALOGS_MOTIF |
150 XtClass (widget) == xmDialogShellWidgetClass || | 148 XtClass (widget) == xmDialogShellWidgetClass || |
151 #endif | 149 #endif |
152 XmIsPrimitive (widget) || XmIsManager (widget) || XmIsGadget (widget); | 150 XmIsPrimitive (widget) || XmIsManager (widget) || XmIsGadget (widget); |
153 } | 151 } |
154 | 152 |
169 XtGetSubresources (widget, (XtPointer)&result, name, | 167 XtGetSubresources (widget, (XtPointer)&result, name, |
170 name, &resource, 1, NULL, 0); | 168 name, &resource, 1, NULL, 0); |
171 return result; | 169 return result; |
172 } | 170 } |
173 | 171 |
174 #ifdef MENUBARS_MOTIF | 172 #ifdef LWLIB_MENUBARS_MOTIF |
175 | 173 |
176 static void | 174 static void |
177 destroy_all_children (Widget widget) | 175 destroy_all_children (Widget widget) |
178 { | 176 { |
179 Widget* children; | 177 Widget* children; |
196 } | 194 } |
197 XtFree ((char *) children); | 195 XtFree ((char *) children); |
198 } | 196 } |
199 } | 197 } |
200 | 198 |
201 #endif /* MENUBARS_MOTIF */ | 199 #endif /* LWLIB_MENUBARS_MOTIF */ |
202 | 200 |
203 | 201 |
204 | 202 |
205 #ifdef DIALOGS_MOTIF | 203 #ifdef LWLIB_DIALOGS_MOTIF |
206 | 204 |
207 static Boolean | 205 static Boolean |
208 is_in_dialog_box (Widget w) | 206 is_in_dialog_box (Widget w) |
209 { | 207 { |
210 Widget wmshell; | 208 Widget wmshell; |
217 return True; | 215 return True; |
218 else | 216 else |
219 return False; | 217 return False; |
220 } | 218 } |
221 | 219 |
222 #endif /* DIALOGS_MOTIF */ | 220 #endif /* LWLIB_DIALOGS_MOTIF */ |
223 | 221 |
224 #if defined (DIALOGS_MOTIF) || defined (MENUBARS_MOTIF) | 222 #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) |
225 | 223 |
226 /* update the label of anything subclass of a label */ | 224 /* update the label of anything subclass of a label */ |
227 static void | 225 static void |
228 xm_update_label (widget_instance* instance, Widget widget, widget_value* val) | 226 xm_update_label (widget_instance* instance, Widget widget, widget_value* val) |
229 { | 227 { |
234 Arg al [20]; | 232 Arg al [20]; |
235 int ac = 0; | 233 int ac = 0; |
236 | 234 |
237 if (val->value) | 235 if (val->value) |
238 { | 236 { |
239 #ifdef DIALOGS_MOTIF | 237 #ifdef LWLIB_DIALOGS_MOTIF |
240 /* | 238 /* |
241 * Sigh. The main text of a label is the name field for menubar | 239 * Sigh. The main text of a label is the name field for menubar |
242 * entries. The value field is a possible additional field to be | 240 * entries. The value field is a possible additional field to be |
243 * concatenated on to the name field. HOWEVER, with dialog boxes | 241 * concatenated on to the name field. HOWEVER, with dialog boxes |
244 * the value field is the complete text which is supposed to be | 242 * the value field is the complete text which is supposed to be |
254 | 252 |
255 built_string = | 253 built_string = |
256 XmStringCreateLtoR (value_name, XmSTRING_DEFAULT_CHARSET); | 254 XmStringCreateLtoR (value_name, XmSTRING_DEFAULT_CHARSET); |
257 } | 255 } |
258 else | 256 else |
259 #endif /* DIALOGS_MOTIF */ | 257 #endif /* LWLIB_DIALOGS_MOTIF */ |
260 { | 258 { |
261 char *value_name = NULL; | 259 char *value_name = NULL; |
262 char *res_name = NULL; | 260 char *res_name = NULL; |
263 | 261 |
264 res_name = resource_string (widget, val->name); | 262 res_name = resource_string (widget, val->name); |
303 | 301 |
304 if (name_string) | 302 if (name_string) |
305 XmStringFree (name_string); | 303 XmStringFree (name_string); |
306 } | 304 } |
307 | 305 |
308 #endif /* defined (DIALOGS_MOTIF) || defined (MENUBARS_MOTIF) */ | 306 #endif /* defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) */ |
309 | 307 |
310 /* update of list */ | 308 /* update of list */ |
311 static void | 309 static void |
312 xm_update_list (widget_instance* instance, Widget widget, widget_value* val) | 310 xm_update_list (widget_instance* instance, Widget widget, widget_value* val) |
313 { | 311 { |
338 XtSetValues (widget, al, 1); | 336 XtSetValues (widget, al, 1); |
339 XtRemoveAllCallbacks (widget, XmNactivateCallback); | 337 XtRemoveAllCallbacks (widget, XmNactivateCallback); |
340 XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); | 338 XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); |
341 } | 339 } |
342 | 340 |
343 #ifdef MENUBARS_MOTIF | 341 #ifdef LWLIB_MENUBARS_MOTIF |
344 | 342 |
345 static void | 343 static void |
346 xm_update_cascadebutton (widget_instance* instance, Widget widget, | 344 xm_update_cascadebutton (widget_instance* instance, Widget widget, |
347 widget_value* val) | 345 widget_value* val) |
348 { | 346 { |
366 XtAddCallback (widget, XmNcascadingCallback, xm_pull_down_callback, | 364 XtAddCallback (widget, XmNcascadingCallback, xm_pull_down_callback, |
367 instance); | 365 instance); |
368 } | 366 } |
369 } | 367 } |
370 | 368 |
371 #endif /* MENUBARS_MOTIF */ | 369 #endif /* LWLIB_MENUBARS_MOTIF */ |
372 | 370 |
373 /* update toggle and radiobox */ | 371 /* update toggle and radiobox */ |
374 static void | 372 static void |
375 xm_update_toggle (widget_instance* instance, Widget widget, widget_value* val) | 373 xm_update_toggle (widget_instance* instance, Widget widget, widget_value* val) |
376 { | 374 { |
423 XtSetValues (toggle, al, 1); | 421 XtSetValues (toggle, al, 1); |
424 } | 422 } |
425 } | 423 } |
426 } | 424 } |
427 | 425 |
428 #ifdef MENUBARS_MOTIF | 426 #ifdef LWLIB_MENUBARS_MOTIF |
429 | 427 |
430 /* update a popup menu, pulldown menu or a menubar */ | 428 /* update a popup menu, pulldown menu or a menubar */ |
431 static void | 429 static void |
432 make_menu_in_widget (widget_instance* instance, Widget widget, | 430 make_menu_in_widget (widget_instance* instance, Widget widget, |
433 widget_value* val) | 431 widget_value* val) |
655 if (cur) | 653 if (cur) |
656 abort (); | 654 abort (); |
657 } | 655 } |
658 } | 656 } |
659 | 657 |
660 #endif /* MENUBARS_MOTIF */ | 658 #endif /* LWLIB_MENUBARS_MOTIF */ |
661 | 659 |
662 | 660 |
663 #ifdef DIALOGS_MOTIF | 661 #ifdef LWLIB_DIALOGS_MOTIF |
664 | 662 |
665 /* update text widgets */ | 663 /* update text widgets */ |
666 | 664 |
667 static void | 665 static void |
668 xm_update_text (widget_instance* instance, Widget widget, widget_value* val) | 666 xm_update_text (widget_instance* instance, Widget widget, widget_value* val) |
685 XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); | 683 XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); |
686 XtAddCallback (widget, XmNvalueChangedCallback, | 684 XtAddCallback (widget, XmNvalueChangedCallback, |
687 xm_internal_update_other_instances, instance); | 685 xm_internal_update_other_instances, instance); |
688 } | 686 } |
689 | 687 |
690 #endif /* DIALOGS_MOTIF */ | 688 #endif /* LWLIB_DIALOGS_MOTIF */ |
691 | 689 |
692 #ifdef SCROLLBARS_MOTIF | 690 #ifdef LWLIB_SCROLLBARS_MOTIF |
693 | 691 |
694 /* | 692 /* |
695 * If this function looks like it does a lot more work than it needs to, | 693 * If this function looks like it does a lot more work than it needs to, |
696 * you're right. Blame the Motif scrollbar for not being smart about | 694 * you're right. Blame the Motif scrollbar for not being smart about |
697 * updating its appearance. | 695 * updating its appearance. |
758 } | 756 } |
759 } | 757 } |
760 } | 758 } |
761 } | 759 } |
762 | 760 |
763 #endif /* SCROLLBARS_MOTIF */ | 761 #endif /* LWLIB_SCROLLBARS_MOTIF */ |
764 | 762 |
765 | 763 |
766 /* update a motif widget */ | 764 /* update a motif widget */ |
767 | 765 |
768 void | 766 void |
778 /* Common to all widget types */ | 776 /* Common to all widget types */ |
779 XtSetArg (al [0], XmNsensitive, val->enabled); | 777 XtSetArg (al [0], XmNsensitive, val->enabled); |
780 XtSetArg (al [1], XmNuserData, val->call_data); | 778 XtSetArg (al [1], XmNuserData, val->call_data); |
781 XtSetValues (widget, al, 2); | 779 XtSetValues (widget, al, 2); |
782 | 780 |
783 #if defined (DIALOGS_MOTIF) || defined (MENUBARS_MOTIF) | 781 #if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) |
784 /* Common to all label like widgets */ | 782 /* Common to all label like widgets */ |
785 if (XtIsSubclass (widget, xmLabelWidgetClass)) | 783 if (XtIsSubclass (widget, xmLabelWidgetClass)) |
786 xm_update_label (instance, widget, val); | 784 xm_update_label (instance, widget, val); |
787 #endif | 785 #endif |
788 | 786 |
791 if (class == xmPushButtonWidgetClass || | 789 if (class == xmPushButtonWidgetClass || |
792 class == xmArrowButtonWidgetClass) | 790 class == xmArrowButtonWidgetClass) |
793 { | 791 { |
794 xm_update_pushbutton (instance, widget, val); | 792 xm_update_pushbutton (instance, widget, val); |
795 } | 793 } |
796 #ifdef MENUBARS_MOTIF | 794 #ifdef LWLIB_MENUBARS_MOTIF |
797 else if (class == xmCascadeButtonWidgetClass) | 795 else if (class == xmCascadeButtonWidgetClass) |
798 { | 796 { |
799 xm_update_cascadebutton (instance, widget, val); | 797 xm_update_cascadebutton (instance, widget, val); |
800 } | 798 } |
801 #endif | 799 #endif |
811 XtSetArg (al [0], XmNradioBehavior, &radiobox); | 809 XtSetArg (al [0], XmNradioBehavior, &radiobox); |
812 XtGetValues (widget, al, 1); | 810 XtGetValues (widget, al, 1); |
813 | 811 |
814 if (radiobox) | 812 if (radiobox) |
815 xm_update_radiobox (instance, widget, val); | 813 xm_update_radiobox (instance, widget, val); |
816 #ifdef MENUBARS_MOTIF | 814 #ifdef LWLIB_MENUBARS_MOTIF |
817 else | 815 else |
818 xm_update_menu (instance, widget, val, deep_p); | 816 xm_update_menu (instance, widget, val, deep_p); |
819 #endif | 817 #endif |
820 } | 818 } |
821 #ifdef DIALOGS_MOTIF | 819 #ifdef LWLIB_DIALOGS_MOTIF |
822 else if (class == xmTextWidgetClass) | 820 else if (class == xmTextWidgetClass) |
823 { | 821 { |
824 xm_update_text (instance, widget, val); | 822 xm_update_text (instance, widget, val); |
825 } | 823 } |
826 else if (class == xmTextFieldWidgetClass) | 824 else if (class == xmTextFieldWidgetClass) |
830 #endif | 828 #endif |
831 else if (class == xmListWidgetClass) | 829 else if (class == xmListWidgetClass) |
832 { | 830 { |
833 xm_update_list (instance, widget, val); | 831 xm_update_list (instance, widget, val); |
834 } | 832 } |
835 #ifdef SCROLLBARS_MOTIF | 833 #ifdef LWLIB_SCROLLBARS_MOTIF |
836 else if (class == xmScrollBarWidgetClass) | 834 else if (class == xmScrollBarWidgetClass) |
837 { | 835 { |
838 xm_update_scrollbar (instance, widget, val); | 836 xm_update_scrollbar (instance, widget, val); |
839 } | 837 } |
840 #endif | 838 #endif |
861 Arg al [1]; | 859 Arg al [1]; |
862 XtSetArg (al [0], XmNset, &val->selected); | 860 XtSetArg (al [0], XmNset, &val->selected); |
863 XtGetValues (widget, al, 1); | 861 XtGetValues (widget, al, 1); |
864 val->edited = True; | 862 val->edited = True; |
865 } | 863 } |
866 #ifdef DIALOGS_MOTIF | 864 #ifdef LWLIB_DIALOGS_MOTIF |
867 else if (class == xmTextWidgetClass) | 865 else if (class == xmTextWidgetClass) |
868 { | 866 { |
869 if (val->value) | 867 if (val->value) |
870 free (val->value); | 868 free (val->value); |
871 val->value = XmTextGetString (widget); | 869 val->value = XmTextGetString (widget); |
933 } | 931 } |
934 val->edited = 1; | 932 val->edited = 1; |
935 XtFree ((char *) pos_list); | 933 XtFree ((char *) pos_list); |
936 } | 934 } |
937 } | 935 } |
938 #ifdef SCROLLBARS_MOTIF | 936 #ifdef LWLIB_SCROLLBARS_MOTIF |
939 else if (class == xmScrollBarWidgetClass) | 937 else if (class == xmScrollBarWidgetClass) |
940 { | 938 { |
941 /* This function is not used by the scrollbar. */ | 939 /* This function is not used by the scrollbar. */ |
942 return; | 940 return; |
943 } | 941 } |
958 XtCallCallbacks (button, XmNactivateCallback, NULL); | 956 XtCallCallbacks (button, XmNactivateCallback, NULL); |
959 } | 957 } |
960 | 958 |
961 /* creation functions */ | 959 /* creation functions */ |
962 | 960 |
963 #ifdef DIALOGS_MOTIF | 961 #ifdef LWLIB_DIALOGS_MOTIF |
964 | 962 |
965 /* dialogs */ | 963 /* dialogs */ |
966 | 964 |
967 #if (XmVersion >= 1002) | 965 #if (XmVersion >= 1002) |
968 # define ARMANDACTIVATE_KLUDGE | 966 # define ARMANDACTIVATE_KLUDGE |
1488 XtAddCallback (widget, XmNpopdownCallback, xm_nosel_callback, | 1486 XtAddCallback (widget, XmNpopdownCallback, xm_nosel_callback, |
1489 (XtPointer) instance); | 1487 (XtPointer) instance); |
1490 return widget; | 1488 return widget; |
1491 } | 1489 } |
1492 | 1490 |
1493 #endif /* DIALOGS_MOTIF */ | 1491 #endif /* LWLIB_DIALOGS_MOTIF */ |
1494 | 1492 |
1495 #ifdef MENUBARS_MOTIF | 1493 #ifdef LWLIB_MENUBARS_MOTIF |
1496 static Widget | 1494 static Widget |
1497 make_menubar (widget_instance* instance) | 1495 make_menubar (widget_instance* instance) |
1498 { | 1496 { |
1499 Arg al[10]; | 1497 Arg al[10]; |
1500 int ac = 0; | 1498 int ac = 0; |
1525 XtAddCallback (XtParent (result), XmNpopdownCallback, remove_grabs, | 1523 XtAddCallback (XtParent (result), XmNpopdownCallback, remove_grabs, |
1526 (XtPointer)result); | 1524 (XtPointer)result); |
1527 parent->core.window = parent_window; | 1525 parent->core.window = parent_window; |
1528 return result; | 1526 return result; |
1529 } | 1527 } |
1530 #endif /* MENUBARS_MOTIF */ | 1528 #endif /* LWLIB_MENUBARS_MOTIF */ |
1531 | 1529 |
1532 #ifdef SCROLLBARS_MOTIF | 1530 #ifdef LWLIB_SCROLLBARS_MOTIF |
1533 static Widget | 1531 static Widget |
1534 make_scrollbar (widget_instance *instance, int vertical) | 1532 make_scrollbar (widget_instance *instance, int vertical) |
1535 { | 1533 { |
1536 Arg al[20]; | 1534 Arg al[20]; |
1537 int ac = 0; | 1535 int ac = 0; |
1569 make_horizontal_scrollbar (widget_instance *instance) | 1567 make_horizontal_scrollbar (widget_instance *instance) |
1570 { | 1568 { |
1571 return make_scrollbar (instance, 0); | 1569 return make_scrollbar (instance, 0); |
1572 } | 1570 } |
1573 | 1571 |
1574 #endif /* SCROLLBARS_MOTIF */ | 1572 #endif /* LWLIB_SCROLLBARS_MOTIF */ |
1575 | 1573 |
1576 /* Table of functions to create widgets */ | 1574 /* Table of functions to create widgets */ |
1577 | 1575 |
1578 widget_creation_entry | 1576 widget_creation_entry |
1579 xm_creation_table [] = | 1577 xm_creation_table [] = |
1580 { | 1578 { |
1581 #ifdef MENUBARS_MOTIF | 1579 #ifdef LWLIB_MENUBARS_MOTIF |
1582 {"menubar", make_menubar}, | 1580 {"menubar", make_menubar}, |
1583 {"popup", make_popup_menu}, | 1581 {"popup", make_popup_menu}, |
1584 #endif | 1582 #endif |
1585 #ifdef SCROLLBARS_MOTIF | 1583 #ifdef LWLIB_SCROLLBARS_MOTIF |
1586 {"vertical-scrollbar", make_vertical_scrollbar}, | 1584 {"vertical-scrollbar", make_vertical_scrollbar}, |
1587 {"horizontal-scrollbar", make_horizontal_scrollbar}, | 1585 {"horizontal-scrollbar", make_horizontal_scrollbar}, |
1588 #endif | 1586 #endif |
1589 {NULL, NULL} | 1587 {NULL, NULL} |
1590 }; | 1588 }; |
1591 | 1589 |
1592 /* Destruction of instances */ | 1590 /* Destruction of instances */ |
1593 void | 1591 void |
1594 xm_destroy_instance (widget_instance* instance) | 1592 xm_destroy_instance (widget_instance* instance) |
1595 { | 1593 { |
1596 #ifdef DIALOGS_MOTIF | 1594 #ifdef LWLIB_DIALOGS_MOTIF |
1597 /* It appears that this is used only for dialog boxes. */ | 1595 /* It appears that this is used only for dialog boxes. */ |
1598 Widget widget = instance->widget; | 1596 Widget widget = instance->widget; |
1599 /* recycle the dialog boxes */ | 1597 /* recycle the dialog boxes */ |
1600 /* Disable the recycling until we can find a way to have the dialog box | 1598 /* Disable the recycling until we can find a way to have the dialog box |
1601 get reasonable layout after we modify its contents. */ | 1599 get reasonable layout after we modify its contents. */ |
1622 XtRemoveCallback (instance->widget, XtNdestroyCallback, | 1620 XtRemoveCallback (instance->widget, XtNdestroyCallback, |
1623 xm_nosel_callback, (XtPointer)instance); | 1621 xm_nosel_callback, (XtPointer)instance); |
1624 | 1622 |
1625 XtDestroyWidget (instance->widget); | 1623 XtDestroyWidget (instance->widget); |
1626 } | 1624 } |
1627 #endif /* DIALOGS_MOTIF */ | 1625 #endif /* LWLIB_DIALOGS_MOTIF */ |
1628 } | 1626 } |
1629 | 1627 |
1630 /* popup utility */ | 1628 /* popup utility */ |
1631 #ifdef MENUBARS_MOTIF | 1629 #ifdef LWLIB_MENUBARS_MOTIF |
1632 | 1630 |
1633 void | 1631 void |
1634 xm_popup_menu (Widget widget, XEvent *event) | 1632 xm_popup_menu (Widget widget, XEvent *event) |
1635 { | 1633 { |
1636 if (event->type == ButtonPress || event->type == ButtonRelease) | 1634 if (event->type == ButtonPress || event->type == ButtonRelease) |
1656 XtManageChild (widget); | 1654 XtManageChild (widget); |
1657 } | 1655 } |
1658 | 1656 |
1659 #endif | 1657 #endif |
1660 | 1658 |
1661 #ifdef DIALOGS_MOTIF | 1659 #ifdef LWLIB_DIALOGS_MOTIF |
1662 | 1660 |
1663 static void | 1661 static void |
1664 set_min_dialog_size (Widget w) | 1662 set_min_dialog_size (Widget w) |
1665 { | 1663 { |
1666 short width; | 1664 short width; |
1681 void | 1679 void |
1682 xm_pop_instance (widget_instance* instance, Boolean up) | 1680 xm_pop_instance (widget_instance* instance, Boolean up) |
1683 { | 1681 { |
1684 Widget widget = instance->widget; | 1682 Widget widget = instance->widget; |
1685 | 1683 |
1686 #ifdef DIALOGS_MOTIF | 1684 #ifdef LWLIB_DIALOGS_MOTIF |
1687 if (XtClass (widget) == xmDialogShellWidgetClass) | 1685 if (XtClass (widget) == xmDialogShellWidgetClass) |
1688 { | 1686 { |
1689 Widget widget_to_manage = first_child (widget); | 1687 Widget widget_to_manage = first_child (widget); |
1690 if (up) | 1688 if (up) |
1691 { | 1689 { |
1775 } | 1773 } |
1776 | 1774 |
1777 static void | 1775 static void |
1778 xm_generic_callback (Widget widget, XtPointer closure, XtPointer call_data) | 1776 xm_generic_callback (Widget widget, XtPointer closure, XtPointer call_data) |
1779 { | 1777 { |
1780 #if (defined (MENUBARS_MOTIF) || defined (DIALOGS_MOTIF)) | 1778 #if (defined (LWLIB_MENUBARS_MOTIF) || defined (LWLIB_DIALOGS_MOTIF)) |
1781 /* We want the selected status to change only when we decide it | 1779 /* We want the selected status to change only when we decide it |
1782 should change. Yuck but correct. */ | 1780 should change. Yuck but correct. */ |
1783 if (XtClass (widget) == xmToggleButtonWidgetClass | 1781 if (XtClass (widget) == xmToggleButtonWidgetClass |
1784 || XtClass (widget) == xmToggleButtonGadgetClass) | 1782 || XtClass (widget) == xmToggleButtonGadgetClass) |
1785 { | 1783 { |
1795 #endif | 1793 #endif |
1796 lw_internal_update_other_instances (widget, closure, call_data); | 1794 lw_internal_update_other_instances (widget, closure, call_data); |
1797 do_call (widget, closure, selection); | 1795 do_call (widget, closure, selection); |
1798 } | 1796 } |
1799 | 1797 |
1800 #ifdef DIALOGS_MOTIF | 1798 #ifdef LWLIB_DIALOGS_MOTIF |
1801 | 1799 |
1802 static void | 1800 static void |
1803 xm_nosel_callback (Widget widget, XtPointer closure, XtPointer call_data) | 1801 xm_nosel_callback (Widget widget, XtPointer closure, XtPointer call_data) |
1804 { | 1802 { |
1805 /* This callback is only called when a dialog box is dismissed with the wm's | 1803 /* This callback is only called when a dialog box is dismissed with the wm's |
1814 XtDestroyWidget (widget); | 1812 XtDestroyWidget (widget); |
1815 } | 1813 } |
1816 | 1814 |
1817 #endif | 1815 #endif |
1818 | 1816 |
1819 #ifdef MENUBARS_MOTIF | 1817 #ifdef LWLIB_MENUBARS_MOTIF |
1820 | 1818 |
1821 static void | 1819 static void |
1822 xm_pull_down_callback (Widget widget, XtPointer closure, XtPointer call_data) | 1820 xm_pull_down_callback (Widget widget, XtPointer closure, XtPointer call_data) |
1823 { | 1821 { |
1824 #if 0 | 1822 #if 0 |
1838 { | 1836 { |
1839 do_call (widget, closure, post_activate); | 1837 do_call (widget, closure, post_activate); |
1840 } | 1838 } |
1841 #endif /* 0 */ | 1839 #endif /* 0 */ |
1842 | 1840 |
1843 #endif /* MENUBARS_MOTIF */ | 1841 #endif /* LWLIB_MENUBARS_MOTIF */ |
1844 | 1842 |
1845 #ifdef SCROLLBARS_MOTIF | 1843 #ifdef LWLIB_SCROLLBARS_MOTIF |
1846 static void | 1844 static void |
1847 xm_scrollbar_callback (Widget widget, XtPointer closure, XtPointer call_data) | 1845 xm_scrollbar_callback (Widget widget, XtPointer closure, XtPointer call_data) |
1848 { | 1846 { |
1849 widget_instance *instance = (widget_instance *) closure; | 1847 widget_instance *instance = (widget_instance *) closure; |
1850 LWLIB_ID id; | 1848 LWLIB_ID id; |
1928 } | 1926 } |
1929 | 1927 |
1930 if (instance->info->pre_activate_cb) | 1928 if (instance->info->pre_activate_cb) |
1931 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data); | 1929 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data); |
1932 } | 1930 } |
1933 #endif /* SCROLLBARS_MOTIF */ | 1931 #endif /* LWLIB_SCROLLBARS_MOTIF */ |
1934 | 1932 |
1935 | 1933 |
1936 /* set the keyboard focus */ | 1934 /* set the keyboard focus */ |
1937 void | 1935 void |
1938 xm_set_keyboard_focus (Widget parent, Widget w) | 1936 xm_set_keyboard_focus (Widget parent, Widget w) |