Use proper assert in lwlib
[sxemacs] / src / ui / lwlib / lwlib-internal.h
1 #ifndef INCLUDED_lwlib_internal_h_
2 #define INCLUDED_lwlib_internal_h_
3
4 #include "lwlib.h"
5 #include "sxe-utils.h"
6
7 /* This represents a single widget within a widget tree.  All the
8    widgets in a widget tree are chained through the `next' field.
9    `info' is a back pointer to the widget tree. */
10
11 typedef struct _widget_instance {
12         Widget widget;
13         Widget parent;
14         Boolean pop_up_p;
15         struct _widget_info *info;
16         struct _widget_instance *next;
17 } widget_instance;
18
19 /* This represents a single widget tree, such as a single menubar.
20    The global variable `all_widget_info' lists all widget trees,
21    chained through the `next' field of this structure. */
22
23 typedef struct _widget_info {
24         char *type;
25         char *name;
26         LWLIB_ID id;
27         widget_value *val;
28         Boolean busy;
29         lw_callback pre_activate_cb;
30         lw_callback selection_cb;
31         lw_callback post_activate_cb;
32         struct _widget_instance *instances;
33         struct _widget_info *next;
34 } widget_info;
35
36 typedef Widget(*widget_creation_function) (widget_instance * instance);
37
38 typedef struct _widget_creation_entry {
39         const char *type;
40         widget_creation_function function;
41 } widget_creation_entry;
42
43 /* update all other instances of a widget.  Can be used in a callback when
44    a widget has been used by the user */
45 void
46 lw_internal_update_other_instances(Widget widget, XtPointer closure,
47                                    XtPointer call_data);
48
49 /* get the widget_value for a widget in a given instance */
50 widget_value *lw_get_widget_value_for_widget(widget_instance * instance,
51                                              Widget w);
52
53 widget_info *lw_get_widget_info(LWLIB_ID id);
54
55 #endif                          /* INCLUDED_lwlib_internal_h_ */