36 |
36 |
37 #ifdef __cplusplus |
37 #ifdef __cplusplus |
38 extern "C" { |
38 extern "C" { |
39 #endif |
39 #endif |
40 |
40 |
41 typedef struct UiVar UiVar; |
41 typedef struct UiVar UiVar; |
|
42 typedef struct UiGroupWidget UiGroupWidget; |
42 |
43 |
43 struct UiContext { |
44 struct UiContext { |
44 UiObject *toplevel; |
45 UiObject *toplevel; |
45 UcxMempool *mempool; |
46 UcxMempool *mempool; |
46 UcxMap *vars; // key: char* value: UiVar* |
47 UcxMap *vars; // key: char* value: UiVar* |
47 UcxList *groups; // int list |
48 UcxList *groups; // int list |
|
49 UcxList *group_widgets; // UiGroupWidget* list |
48 |
50 |
49 #ifdef UI_GTK |
51 #ifdef UI_GTK |
50 GtkAccelGroup *accel_group; |
52 GtkAccelGroup *accel_group; |
51 #endif |
53 #endif |
52 }; |
54 }; |
56 int type; |
58 int type; |
57 int isextern; |
59 int isextern; |
58 UcxMap *from; |
60 UcxMap *from; |
59 }; |
61 }; |
60 |
62 |
|
63 struct UiGroupWidget { |
|
64 UIWIDGET widget; |
|
65 int *groups; |
|
66 int numgroups; |
|
67 }; |
|
68 |
61 enum UiVarType { |
69 enum UiVarType { |
62 UI_VAR_INTEGER = 0, |
70 UI_VAR_INTEGER = 0, |
63 UI_VAR_STRING |
71 UI_VAR_STRING |
64 }; |
72 }; |
65 |
73 |
66 UiContext* uic_context(UiObject *toplevel, UcxMempool *mp); |
74 UiContext* uic_context(UiObject *toplevel, UcxMempool *mp); |
67 UiVar* uic_getvar(UiContext *ctx, char *name); |
75 UiVar* uic_getvar(UiContext *ctx, char *name); |
68 UiVar* uic_connect_var(UiContext *ctx, char *name, int type); |
76 UiVar* uic_connect_var(UiContext *ctx, char *name, int type); |
69 void* uic_create_value(UcxAllocator *a, int type); |
77 void* uic_create_value(UcxAllocator *a, int type); |
70 |
78 |
71 |
79 void uic_check_group_widgets(UiContext *ctx); |
|
80 void uic_add_group_widget(UiContext *ctx, UIWIDGET widget, UcxList *groups); |
72 |
81 |
73 #ifdef __cplusplus |
82 #ifdef __cplusplus |
74 } |
83 } |
75 #endif |
84 #endif |
76 |
85 |