Mercurial > emacs
annotate lwlib/lwlib.h @ 26823:aa74cdb3570e
*** empty log message ***
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 13 Dec 1999 01:26:39 +0000 |
parents | d8d30f76cc61 |
children | d895d4e8a6f0 |
rev | line source |
---|---|
5626 | 1 #ifndef LWLIB_H |
2 #define LWLIB_H | |
3 | |
4 #include <X11/Intrinsic.h> | |
5 | |
6 /* | |
7 ** Widget values depend on the Widget type: | |
8 ** | |
9 ** widget: (name value key enabled data contents/selected) | |
10 ** | |
11 ** label: ("name" "string" NULL NULL NULL NULL) | |
12 ** button: ("name" "string" "key" T/F data <default-button-p>) | |
13 ** button w/menu: | |
14 ** ("name" "string" "key" T/F data (label|button|button w/menu...)) | |
15 ** menubar: ("name" NULL NULL T/F data (button w/menu)) | |
16 ** selectable thing: | |
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) | |
8784 | 22 ** main: ("name") |
5626 | 23 */ |
24 | |
25 typedef unsigned long LWLIB_ID; | |
26 | |
27 typedef enum _change_type | |
28 { | |
29 NO_CHANGE = 0, | |
30 INVISIBLE_CHANGE = 1, | |
31 VISIBLE_CHANGE = 2, | |
32 STRUCTURAL_CHANGE = 3 | |
33 } change_type; | |
34 | |
25035
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
35 enum button_type |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
36 { |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
37 BUTTON_TYPE_NONE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
38 BUTTON_TYPE_TOGGLE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
39 BUTTON_TYPE_RADIO |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
40 }; |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
41 |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
42 /* Menu separator types. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
43 |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
44 enum menu_separator |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
45 { |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
46 /* These values are Motif compatible. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
47 SEPARATOR_NO_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
48 SEPARATOR_SINGLE_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
49 SEPARATOR_DOUBLE_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
50 SEPARATOR_SINGLE_DASHED_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
51 SEPARATOR_DOUBLE_DASHED_LINE, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
52 SEPARATOR_SHADOW_ETCHED_IN, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
53 SEPARATOR_SHADOW_ETCHED_OUT, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
54 SEPARATOR_SHADOW_ETCHED_IN_DASH, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
55 SEPARATOR_SHADOW_ETCHED_OUT_DASH, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
56 |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
57 /* The following are supported by XEmacs' Lucid menus. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
58 SEPARATOR_SHADOW_DOUBLE_ETCHED_IN, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
59 SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
60 SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
61 SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
62 }; |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
63 |
5626 | 64 typedef struct _widget_value |
65 { | |
66 /* name of widget */ | |
67 char* name; | |
68 /* value (meaning depend on widget type) */ | |
69 char* value; | |
70 /* keyboard equivalent. no implications for XtTranslations */ | |
71 char* key; | |
72 /* true if enabled */ | |
73 Boolean enabled; | |
74 /* true if selected */ | |
75 Boolean selected; | |
76 /* true if was edited (maintained by get_value) */ | |
77 Boolean edited; | |
25035
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
78 /* The type of a button. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
79 enum button_type button_type; |
5626 | 80 /* true if has changed (maintained by lw library) */ |
81 change_type change; | |
14878
487b03096cc5
(struct widget_value): New field this_one_change.
Richard M. Stallman <rms@gnu.org>
parents:
14018
diff
changeset
|
82 /* true if this widget itself has changed, |
487b03096cc5
(struct widget_value): New field this_one_change.
Richard M. Stallman <rms@gnu.org>
parents:
14018
diff
changeset
|
83 but not counting the other widgets found in the `next' field. */ |
487b03096cc5
(struct widget_value): New field this_one_change.
Richard M. Stallman <rms@gnu.org>
parents:
14018
diff
changeset
|
84 change_type this_one_change; |
5626 | 85 /* Contents of the sub-widgets, also selected slot for checkbox */ |
86 struct _widget_value* contents; | |
87 /* data passed to callback */ | |
88 XtPointer call_data; | |
89 /* next one in the list */ | |
90 struct _widget_value* next; | |
91 /* slot for the toolkit dependent part. Always initialize to NULL. */ | |
92 void* toolkit_data; | |
93 /* tell us if we should free the toolkit data slot when freeing the | |
94 widget_value itself. */ | |
95 Boolean free_toolkit_data; | |
96 | |
97 /* we resource the widget_value structures; this points to the next | |
98 one on the free list if this one has been deallocated. | |
99 */ | |
100 struct _widget_value *free_list; | |
101 } widget_value; | |
102 | |
103 | |
8784 | 104 typedef void (*lw_callback) (/* Widget w, LWLIB_ID id, void* data */); |
5626 | 105 |
8784 | 106 void lw_register_widget (/* char* type, char* name, LWLIB_ID id, |
107 widget_value* val, lw_callback pre_activate_cb, | |
108 lw_callback selection_cb, | |
109 lw_callback post_activate_cb */); | |
110 Widget lw_get_widget (/* LWLIB_ID id, Widget parent, Boolean pop_up_p */); | |
111 Widget lw_make_widget (/* LWLIB_ID id, Widget parent, Boolean pop_up_p */); | |
112 Widget lw_create_widget (/* char* type, char* name, LWLIB_ID id, | |
113 widget_value* val, Widget parent, Boolean pop_up_p, | |
114 lw_callback pre_activate_cb, | |
115 lw_callback selection_cb, | |
116 lw_callback post_activate_cb */); | |
117 LWLIB_ID lw_get_widget_id (/* Widget w */); | |
118 void lw_modify_all_widgets (/* LWLIB_ID id, widget_value* val, Boolean deep_p */); | |
119 void lw_destroy_widget (/* Widget w */); | |
120 void lw_destroy_all_widgets (/* LWLIB_ID id */); | |
121 void lw_destroy_everything (/* void */); | |
122 void lw_destroy_all_pop_ups (/* void */); | |
123 Widget lw_raise_all_pop_up_widgets (/* void */); | |
124 widget_value* lw_get_all_values (/* LWLIB_ID id */); | |
125 Boolean lw_get_some_values (/* LWLIB_ID id, widget_value* val */); | |
126 void lw_pop_up_all_widgets (/* LWLIB_ID id */); | |
127 void lw_pop_down_all_widgets (/* LWLIB_ID id */); | |
5626 | 128 widget_value *malloc_widget_value (); |
8784 | 129 void free_widget_value (/* widget_value * */); |
130 void lw_popup_menu (/* Widget */); | |
5626 | 131 |
132 /* Toolkit independent way of focusing on a Widget at the Xt level. */ | |
8784 | 133 void lw_set_keyboard_focus (/* Widget parent, Widget w */); |
5626 | 134 |
135 /* Silly Energize hack to invert the "sheet" button */ | |
8784 | 136 void lw_show_busy (/* Widget w, Boolean busy */); |
137 | |
138 /* Silly hack to assist with Lucid/Athena geometry management. */ | |
14018 | 139 void lw_refigure_widget (/* Widget w, Boolean doit */); |
8784 | 140 |
141 /* Toolkit independent way of determining if an event occurred on a | |
142 menubar. */ | |
143 Boolean lw_window_is_in_menubar (/* Window win, Widget menubar_widget */); | |
144 | |
145 /* Manage resizing: TRUE permits resizing widget w; FALSE disallows it. */ | |
146 void lw_allow_resizing (/* Widget w, Boolean flag */); | |
5626 | 147 |
9064 | 148 /* Set up the main window. */ |
149 void lw_set_main_areas (/* Widget parent, | |
150 Widget menubar, | |
151 Widget work_area */); | |
152 | |
25035
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
153 /* Value is non-zero if LABEL is a menu separator. If it is, *TYPE is |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
154 set to an appropriate enumerator of type enum menu_separator. |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
155 MOTIF_P non-zero means map separator types not supported by Motif |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
156 to similar ones that are supported. */ |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
157 |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
158 int lw_separator_p (/* char *label, enum menu_separator *type, |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
159 int motif_p */); |
d8d30f76cc61
(enum menu_separator): New.
Gerd Moellmann <gerd@gnu.org>
parents:
15630
diff
changeset
|
160 |
5626 | 161 #endif /* LWLIB_H */ |