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)
25 typedef unsigned long LWLIB_ID
;
27 typedef enum _change_type
35 typedef struct _widget_value
39 /* value (meaning depend on widget type) */
41 /* keyboard equivalent. no implications for XtTranslations */
45 /* true if selected */
47 /* true if was edited (maintained by get_value) */
49 /* true if has changed (maintained by lw library) */
51 /* Contents of the sub-widgets, also selected slot for checkbox */
52 struct _widget_value
* contents
;
53 /* data passed to callback */
55 /* next one in the list */
56 struct _widget_value
* next
;
57 /* slot for the toolkit dependent part. Always initialize to NULL. */
59 /* tell us if we should free the toolkit data slot when freeing the
60 widget_value itself. */
61 Boolean free_toolkit_data
;
63 /* we resource the widget_value structures; this points to the next
64 one on the free list if this one has been deallocated.
66 struct _widget_value
*free_list
;
70 typedef void (*lw_callback
) (/* Widget w, LWLIB_ID id, void* data */);
72 void lw_register_widget (/* char* type, char* name, LWLIB_ID id,
73 widget_value* val, lw_callback pre_activate_cb,
74 lw_callback selection_cb,
75 lw_callback post_activate_cb */);
76 Widget
lw_get_widget (/* LWLIB_ID id, Widget parent, Boolean pop_up_p */);
77 Widget
lw_make_widget (/* LWLIB_ID id, Widget parent, Boolean pop_up_p */);
78 Widget
lw_create_widget (/* char* type, char* name, LWLIB_ID id,
79 widget_value* val, Widget parent, Boolean pop_up_p,
80 lw_callback pre_activate_cb,
81 lw_callback selection_cb,
82 lw_callback post_activate_cb */);
83 LWLIB_ID
lw_get_widget_id (/* Widget w */);
84 void lw_modify_all_widgets (/* LWLIB_ID id, widget_value* val, Boolean deep_p */);
85 void lw_destroy_widget (/* Widget w */);
86 void lw_destroy_all_widgets (/* LWLIB_ID id */);
87 void lw_destroy_everything (/* void */);
88 void lw_destroy_all_pop_ups (/* void */);
89 Widget
lw_raise_all_pop_up_widgets (/* void */);
90 widget_value
* lw_get_all_values (/* LWLIB_ID id */);
91 Boolean
lw_get_some_values (/* LWLIB_ID id, widget_value* val */);
92 void lw_pop_up_all_widgets (/* LWLIB_ID id */);
93 void lw_pop_down_all_widgets (/* LWLIB_ID id */);
94 widget_value
*malloc_widget_value ();
95 void free_widget_value (/* widget_value * */);
96 void lw_popup_menu (/* Widget */);
98 /* Toolkit independent way of focusing on a Widget at the Xt level. */
99 void lw_set_keyboard_focus (/* Widget parent, Widget w */);
101 /* Silly Energize hack to invert the "sheet" button */
102 void lw_show_busy (/* Widget w, Boolean busy */);
104 /* Silly hack to assist with Lucid/Athena geometry management. */
105 void lw_refigure_widget (/* Widget w, Boolan doit */);
107 /* Toolkit independent way of determining if an event occurred on a
109 Boolean
lw_window_is_in_menubar (/* Window win, Widget menubar_widget */);
111 /* Manage resizing: TRUE permits resizing widget w; FALSE disallows it. */
112 void lw_allow_resizing (/* Widget w, Boolean flag */);
114 /* Set up the main window. */
115 void lw_set_main_areas (/* Widget parent,
117 Widget work_area */);