4 #include <X11/Intrinsic.h>
7 ** Widget values depend on the Widget type:
9 ** widget: (name value key enabled data contents/selected)
11 ** label: ("name" "string" NULL NULL NULL NULL)
12 ** button: ("name" "string" "key" T/F data <default-button-p>)
14 ** ("name" "string" "key" T/F data (label|button|button w/menu...))
15 ** menubar: ("name" NULL NULL T/F data (button w/menu))
17 ** ("name" "string" "key" T/F data T/F)
18 ** checkbox: selectable thing
19 ** radio: ("name" NULL NULL T/F data (selectable thing...))
20 ** strings: ("name" NULL NULL T/F data (selectable thing...))
21 ** text: ("name" "string" <ign> T/F data)
24 typedef unsigned long LWLIB_ID
;
26 typedef enum _change_type
34 typedef struct _widget_value
38 /* value (meaning depend on widget type) */
40 /* keyboard equivalent. no implications for XtTranslations */
44 /* true if selected */
46 /* true if was edited (maintained by get_value) */
48 /* true if has changed (maintained by lw library) */
50 /* Contents of the sub-widgets, also selected slot for checkbox */
51 struct _widget_value
* contents
;
52 /* data passed to callback */
54 /* next one in the list */
55 struct _widget_value
* next
;
56 /* slot for the toolkit dependent part. Always initialize to NULL. */
58 /* tell us if we should free the toolkit data slot when freeing the
59 widget_value itself. */
60 Boolean free_toolkit_data
;
62 /* we resource the widget_value structures; this points to the next
63 one on the free list if this one has been deallocated.
65 struct _widget_value
*free_list
;
69 typedef void (*lw_callback
) (Widget w
, LWLIB_ID id
, void* data
);
71 void lw_register_widget (char* type
, char* name
, LWLIB_ID id
,
72 widget_value
* val
, lw_callback pre_activate_cb
,
73 lw_callback selection_cb
,
74 lw_callback post_activate_cb
);
75 Widget
lw_get_widget (LWLIB_ID id
, Widget parent
, Boolean pop_up_p
);
76 Widget
lw_make_widget (LWLIB_ID id
, Widget parent
, Boolean pop_up_p
);
77 Widget
lw_create_widget (char* type
, char* name
, LWLIB_ID id
,
78 widget_value
* val
, Widget parent
, Boolean pop_up_p
,
79 lw_callback pre_activate_cb
,
80 lw_callback selection_cb
,
81 lw_callback post_activate_cb
);
82 LWLIB_ID
lw_get_widget_id (Widget w
);
83 void lw_modify_all_widgets (LWLIB_ID id
, widget_value
* val
, Boolean deep_p
);
84 void lw_destroy_widget (Widget w
);
85 void lw_destroy_all_widgets (LWLIB_ID id
);
86 void lw_destroy_everything (void);
87 void lw_destroy_all_pop_ups (void);
88 Widget
lw_raise_all_pop_up_widgets (void);
89 widget_value
* lw_get_all_values (LWLIB_ID id
);
90 Boolean
lw_get_some_values (LWLIB_ID id
, widget_value
* val
);
91 void lw_pop_up_all_widgets (LWLIB_ID id
);
92 void lw_pop_down_all_widgets (LWLIB_ID id
);
93 widget_value
*malloc_widget_value ();
94 void free_widget_value (widget_value
*);
95 void lw_popup_menu (Widget
);
97 /* Toolkit independent way of focusing on a Widget at the Xt level. */
98 void lw_set_keyboard_focus (Widget parent
, Widget w
);
100 /* Silly Energize hack to invert the "sheet" button */
101 void lw_show_busy (Widget w
, Boolean busy
);