Commit | Line | Data |
---|---|---|
32c92352 GM |
1 | /* |
2 | Copyright (C) 1992, 1993 Lucid, Inc. | |
ba318903 | 3 | Copyright (C) 1994, 1999-2014 Free Software Foundation, Inc. |
32c92352 GM |
4 | |
5 | This file is part of the Lucid Widget Library. | |
6 | ||
7 | The Lucid Widget Library is free software; you can redistribute it and/or | |
8 | modify it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 1, or (at your option) | |
10 | any later version. | |
11 | ||
12 | The Lucid Widget Library is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
fee0bd5f | 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
32c92352 GM |
19 | |
20 | ||
07bf635f RS |
21 | #ifndef LWLIB_H |
22 | #define LWLIB_H | |
23 | ||
24 | #include <X11/Intrinsic.h> | |
25 | ||
26 | /* | |
27 | ** Widget values depend on the Widget type: | |
177c0ea7 | 28 | ** |
07bf635f RS |
29 | ** widget: (name value key enabled data contents/selected) |
30 | ** | |
31 | ** label: ("name" "string" NULL NULL NULL NULL) | |
32 | ** button: ("name" "string" "key" T/F data <default-button-p>) | |
177c0ea7 | 33 | ** button w/menu: |
07bf635f RS |
34 | ** ("name" "string" "key" T/F data (label|button|button w/menu...)) |
35 | ** menubar: ("name" NULL NULL T/F data (button w/menu)) | |
36 | ** selectable thing: | |
37 | ** ("name" "string" "key" T/F data T/F) | |
38 | ** checkbox: selectable thing | |
39 | ** radio: ("name" NULL NULL T/F data (selectable thing...)) | |
40 | ** strings: ("name" NULL NULL T/F data (selectable thing...)) | |
41 | ** text: ("name" "string" <ign> T/F data) | |
dfdcaf49 | 42 | ** main: ("name") |
07bf635f RS |
43 | */ |
44 | ||
181f08a7 | 45 | #include "lwlib-widget.h" |
07bf635f | 46 | |
181f08a7 | 47 | typedef unsigned long LWLIB_ID; |
cedccd2e GM |
48 | |
49 | /* Menu separator types. */ | |
50 | ||
51 | enum menu_separator | |
52 | { | |
53 | /* These values are Motif compatible. */ | |
54 | SEPARATOR_NO_LINE, | |
55 | SEPARATOR_SINGLE_LINE, | |
56 | SEPARATOR_DOUBLE_LINE, | |
57 | SEPARATOR_SINGLE_DASHED_LINE, | |
58 | SEPARATOR_DOUBLE_DASHED_LINE, | |
59 | SEPARATOR_SHADOW_ETCHED_IN, | |
60 | SEPARATOR_SHADOW_ETCHED_OUT, | |
61 | SEPARATOR_SHADOW_ETCHED_IN_DASH, | |
62 | SEPARATOR_SHADOW_ETCHED_OUT_DASH, | |
63 | ||
0591102a | 64 | /* The following are supported by Lucid menus. */ |
cedccd2e GM |
65 | SEPARATOR_SHADOW_DOUBLE_ETCHED_IN, |
66 | SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT, | |
67 | SEPARATOR_SHADOW_DOUBLE_ETCHED_IN_DASH, | |
68 | SEPARATOR_SHADOW_DOUBLE_ETCHED_OUT_DASH | |
69 | }; | |
70 | ||
07bf635f | 71 | |
383e0970 J |
72 | typedef void (*lw_callback) (Widget w, LWLIB_ID id, void* data); |
73 | ||
a953c1e3 | 74 | void lw_register_widget (const char* type, const char* name, LWLIB_ID id, |
383e0970 J |
75 | widget_value* val, lw_callback pre_activate_cb, |
76 | lw_callback selection_cb, | |
77 | lw_callback post_activate_cb, | |
78 | lw_callback highlight_cb); | |
79 | Widget lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p); | |
80 | Widget lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p); | |
a953c1e3 | 81 | Widget lw_create_widget (const char* type, const char* name, LWLIB_ID id, |
383e0970 J |
82 | widget_value* val, Widget parent, Boolean pop_up_p, |
83 | lw_callback pre_activate_cb, | |
84 | lw_callback selection_cb, | |
85 | lw_callback post_activate_cb, | |
86 | lw_callback highlight_cb); | |
87 | LWLIB_ID lw_get_widget_id (Widget w); | |
88 | int lw_modify_all_widgets (LWLIB_ID id, widget_value* val, Boolean deep_p); | |
89 | void lw_destroy_widget (Widget w); | |
90 | void lw_destroy_all_widgets (LWLIB_ID id); | |
91 | void lw_destroy_everything (void); | |
92 | void lw_destroy_all_pop_ups (void); | |
93 | Widget lw_raise_all_pop_up_widgets (void); | |
94 | widget_value* lw_get_all_values (LWLIB_ID id); | |
95 | Boolean lw_get_some_values (LWLIB_ID id, widget_value* val); | |
96 | void lw_pop_up_all_widgets (LWLIB_ID id); | |
97 | void lw_pop_down_all_widgets (LWLIB_ID id); | |
383e0970 | 98 | void lw_popup_menu (Widget, XEvent *); |
07bf635f RS |
99 | |
100 | /* Toolkit independent way of focusing on a Widget at the Xt level. */ | |
383e0970 | 101 | void lw_set_keyboard_focus (Widget parent, Widget w); |
07bf635f RS |
102 | |
103 | /* Silly Energize hack to invert the "sheet" button */ | |
383e0970 | 104 | void lw_show_busy (Widget w, Boolean busy); |
dfdcaf49 PR |
105 | |
106 | /* Silly hack to assist with Lucid/Athena geometry management. */ | |
383e0970 | 107 | void lw_refigure_widget (Widget w, Boolean doit); |
dfdcaf49 PR |
108 | |
109 | /* Toolkit independent way of determining if an event occurred on a | |
110 | menubar. */ | |
383e0970 | 111 | Boolean lw_window_is_in_menubar (Window win, Widget menubar_widget); |
dfdcaf49 PR |
112 | |
113 | /* Manage resizing: TRUE permits resizing widget w; FALSE disallows it. */ | |
1d71c1d9 PE |
114 | #ifndef USE_MOTIF |
115 | ATTRIBUTE_CONST | |
116 | #endif | |
383e0970 | 117 | void lw_allow_resizing (Widget w, Boolean flag); |
07bf635f | 118 | |
11bcd7d4 | 119 | /* Set up the main window. */ |
1d71c1d9 PE |
120 | #ifndef USE_MOTIF |
121 | ATTRIBUTE_CONST | |
122 | #endif | |
383e0970 J |
123 | void lw_set_main_areas (Widget parent, |
124 | Widget menubar, | |
125 | Widget work_area); | |
11bcd7d4 | 126 | |
cedccd2e GM |
127 | /* Value is non-zero if LABEL is a menu separator. If it is, *TYPE is |
128 | set to an appropriate enumerator of type enum menu_separator. | |
129 | MOTIF_P non-zero means map separator types not supported by Motif | |
130 | to similar ones that are supported. */ | |
131 | ||
d6dcbe70 | 132 | int lw_separator_p (const char *label, enum menu_separator *type, |
383e0970 | 133 | int motif_p); |
99570665 | 134 | |
07bf635f | 135 | #endif /* LWLIB_H */ |