comparison lwlib/lwlib.c @ 6305:65beaa9aa1e4

*** empty log message ***
author Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
date Fri, 11 Mar 1994 10:36:17 +0000
parents b135bb2b4bfe
children 19fc40b33f52
comparison
equal deleted inserted replaced
6304:e6b7a921ccab 6305:65beaa9aa1e4
33 33
34 #if defined(__GNUC__) && !defined(alloca) 34 #if defined(__GNUC__) && !defined(alloca)
35 #define alloca __builtin_alloca 35 #define alloca __builtin_alloca
36 #endif 36 #endif
37 37
38 #if ((!__GNUC__) && !defined(__hpux)) && !defined(AIXV3) 38 #if ((!__GNUC__) && !defined(__hpux)) && !defined(_AIX)
39 #include <alloca.h> 39 #include <alloca.h>
40 #endif 40 #endif
41 41
42 #if defined(AIXV3) 42 #if defined(_AIX)
43 #pragma alloca 43 #pragma alloca
44 #endif 44 #endif
45 45
46 #if defined (USE_LUCID) 46 #if defined (USE_LUCID)
47 #include "lwlib-Xlw.h" 47 #include "lwlib-Xlw.h"
49 #if defined (USE_MOTIF) 49 #if defined (USE_MOTIF)
50 #include "lwlib-Xm.h" 50 #include "lwlib-Xm.h"
51 #endif 51 #endif
52 #if defined (USE_OLIT) 52 #if defined (USE_OLIT)
53 #include "lwlib-Xol.h" 53 #include "lwlib-Xol.h"
54 #endif
55 #if defined (USE_XAW)
56 #include "lwlib-Xaw.h"
54 #endif 57 #endif
55 58
56 #if !defined (USE_LUCID) && !defined (USE_MOTIF) && !defined (USE_OLIT) 59 #if !defined (USE_LUCID) && !defined (USE_MOTIF) && !defined (USE_OLIT)
57 ERROR! At least one of USE_LUCID, USE_MOTIF or USE_OLIT must be defined. 60 ERROR! At least one of USE_LUCID, USE_MOTIF or USE_OLIT must be defined.
58 #endif 61 #endif
317 all_widget_info = info->next; 320 all_widget_info = info->next;
318 } 321 }
319 return info; 322 return info;
320 } 323 }
321 return NULL; 324 return NULL;
325 }
326
327 /* Internal function used by the library dependent implementation to get the
328 widget_value for a given widget in an instance */
329 widget_info *
330 lw_get_widget_info (LWLIB_ID id)
331 {
332 return get_widget_info (id, 0);
322 } 333 }
323 334
324 static widget_instance * 335 static widget_instance *
325 get_widget_instance (widget, remove_p) 336 get_widget_instance (widget, remove_p)
326 Widget widget; 337 Widget widget;
570 xm_update_one_widget (instance, widget, val, deep_p); 581 xm_update_one_widget (instance, widget, val, deep_p);
571 #endif 582 #endif
572 #if defined (USE_OLIT) 583 #if defined (USE_OLIT)
573 if (lw_olit_widget_p (instance->widget)) 584 if (lw_olit_widget_p (instance->widget))
574 xol_update_one_widget (instance, widget, val, deep_p); 585 xol_update_one_widget (instance, widget, val, deep_p);
586 #endif
587 #if defined (USE_XAW)
588 if (lw_xaw_widget_p (instance->widget))
589 xaw_update_one_widget (instance, widget, val, deep_p);
575 #endif 590 #endif
576 } 591 }
577 } 592 }
578 593
579 static void 594 static void
739 #endif 754 #endif
740 #if defined (USE_OLIT) 755 #if defined (USE_OLIT)
741 if (!function) 756 if (!function)
742 function = find_in_table (instance->info->type, xol_creation_table); 757 function = find_in_table (instance->info->type, xol_creation_table);
743 #endif 758 #endif
759 #if defined (USE_XAW)
760 if (!function)
761 function = find_in_table (instance->info->type, xaw_creation_table);
762 #endif
744 763
745 if (!function) 764 if (!function)
746 { 765 {
747 if (dialog_spec_p (instance->info->type)) 766 if (dialog_spec_p (instance->info->type))
748 { 767 {
750 /* not yet */ 769 /* not yet */
751 #endif 770 #endif
752 #if defined(USE_MOTIF) 771 #if defined(USE_MOTIF)
753 if (!function) 772 if (!function)
754 function = xm_create_dialog; 773 function = xm_create_dialog;
774 #endif
775 #if defined (USE_XAW)
776 if (!function)
777 function = xaw_create_dialog;
755 #endif 778 #endif
756 #if defined (USE_OLIT) 779 #if defined (USE_OLIT)
757 /* not yet */ 780 /* not yet */
758 #endif 781 #endif
759 } 782 }
876 #endif 899 #endif
877 #if defined (USE_OLIT) 900 #if defined (USE_OLIT)
878 if (lw_olit_widget_p (instance->widget)) 901 if (lw_olit_widget_p (instance->widget))
879 xol_destroy_instance (instance); 902 xol_destroy_instance (instance);
880 else 903 else
904 #endif
905 #if defined (USE_XAW)
906 if (lw_xaw_widget_p (instance->widget))
907 xaw_destroy_instance (instance);
908 else
881 #endif 909 #endif
882 /* do not remove the empty statement */ 910 /* do not remove the empty statement */
883 ; 911 ;
884 } 912 }
885 913
993 1021
994 if (info) 1022 if (info)
995 for (instance = info->instances; instance; instance = instance->next) 1023 for (instance = info->instances; instance; instance = instance->next)
996 if (instance->pop_up_p && instance->widget) 1024 if (instance->pop_up_p && instance->widget)
997 { 1025 {
998 if (!XtIsRealized (instance->widget))
999 XtRealizeWidget (instance->widget);
1000 #if defined (USE_LUCID) 1026 #if defined (USE_LUCID)
1001 if (lw_lucid_widget_p (instance->widget)) 1027 if (lw_lucid_widget_p (instance->widget))
1002 xlw_pop_instance (instance, up); 1028 {
1029 XtRealizeWidget (instance->widget);
1030 xlw_pop_instance (instance, up);
1031 }
1003 #endif 1032 #endif
1004 #if defined (USE_MOTIF) 1033 #if defined (USE_MOTIF)
1005 if (lw_motif_widget_p (instance->widget)) 1034 if (lw_motif_widget_p (instance->widget))
1006 xm_pop_instance (instance, up); 1035 {
1036 XtRealizeWidget (instance->widget);
1037 xm_pop_instance (instance, up);
1038 }
1007 #endif 1039 #endif
1008 #if defined (USE_OLIT) 1040 #if defined (USE_OLIT)
1009 if (lw_olit_widget_p (instance->widget)) 1041 if (lw_olit_widget_p (instance->widget))
1010 xol_pop_instance (instance, up); 1042 {
1043 XtRealizeWidget (instance->widget);
1044 xol_pop_instance (instance, up);
1045 }
1046 #endif
1047 #if defined (USE_XAW)
1048 if (lw_xaw_widget_p (instance->widget))
1049 {
1050 XtRealizeWidget (XtParent (instance->widget));
1051 XtRealizeWidget (instance->widget);
1052 xaw_pop_instance (instance, up);
1053 }
1011 #endif 1054 #endif
1012 } 1055 }
1013 } 1056 }
1014 1057
1015 void 1058 void
1039 xm_popup_menu (widget); 1082 xm_popup_menu (widget);
1040 #endif 1083 #endif
1041 #if defined (USE_OLIT) 1084 #if defined (USE_OLIT)
1042 if (lw_olit_widget_p (widget)) 1085 if (lw_olit_widget_p (widget))
1043 xol_popup_menu (widget); 1086 xol_popup_menu (widget);
1087 #endif
1088 #if defined (USE_XAW)
1089 if (lw_xaw_widget_p (widget))
1090 xaw_popup_menu (widget);
1044 #endif 1091 #endif
1045 } 1092 }
1046 1093
1047 /* get the values back */ 1094 /* get the values back */
1048 static Boolean 1095 static Boolean
1063 xm_update_one_value (instance, widget, val); 1110 xm_update_one_value (instance, widget, val);
1064 #endif 1111 #endif
1065 #if defined (USE_OLIT) 1112 #if defined (USE_OLIT)
1066 if (lw_olit_widget_p (instance->widget)) 1113 if (lw_olit_widget_p (instance->widget))
1067 xol_update_one_value (instance, widget, val); 1114 xol_update_one_value (instance, widget, val);
1115 #endif
1116 #if defined (USE_XAW)
1117 if (lw_xaw_widget_p (instance->widget))
1118 xaw_update_one_value (instance, widget, val);
1068 #endif 1119 #endif
1069 return True; 1120 return True;
1070 } 1121 }
1071 else 1122 else
1072 return False; 1123 return False;