XEmacs 21.2.29 "Hestia".
[chise/xemacs-chise.git.1] / lwlib / lwlib-internal.h
1 #ifndef INCLUDED_lwlib_internal_h_
2 #define INCLUDED_lwlib_internal_h_
3
4 #include "lwlib.h"
5
6 /* This represents a single widget within a widget tree.  All the
7    widgets in a widget tree are chained through the `next' field.
8    `info' is a back pointer to the widget tree. */
9
10 typedef struct _widget_instance
11 {
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 {
25   char*                 type;
26   char*                 name;
27   LWLIB_ID              id;
28   widget_value*         val;
29   Boolean               busy;
30   lw_callback           pre_activate_cb;
31   lw_callback           selection_cb;
32   lw_callback           post_activate_cb;
33   struct _widget_instance*      instances;
34   struct _widget_info*          next;
35 } widget_info;
36
37 typedef Widget
38 (*widget_creation_function) (widget_instance* instance);
39
40 typedef struct _widget_creation_entry
41 {
42   const char*                   type;
43   widget_creation_function      function;
44 } widget_creation_entry;
45
46 /* update all other instances of a widget.  Can be used in a callback when
47    a wiget has been used by the user */
48 void
49 lw_internal_update_other_instances (Widget widget, XtPointer closure,
50                                     XtPointer call_data);
51
52 /* get the widget_value for a widget in a given instance */
53 widget_value*
54 lw_get_widget_value_for_widget (widget_instance* instance, Widget w);
55
56 widget_info *lw_get_widget_info (LWLIB_ID id);
57
58 #endif /* INCLUDED_lwlib_internal_h_ */