42 typedef struct UiListPtr UiListPtr; |
42 typedef struct UiListPtr UiListPtr; |
43 typedef struct UiListVar UiListVar; |
43 typedef struct UiListVar UiListVar; |
44 typedef struct UiGroupWidget UiGroupWidget; |
44 typedef struct UiGroupWidget UiGroupWidget; |
45 |
45 |
46 struct UiContext { |
46 struct UiContext { |
|
47 UiContext *parent; |
47 UiObject *obj; |
48 UiObject *obj; |
48 UcxMempool *mempool; |
49 UcxMempool *mempool; |
49 UcxMap *vars; // key: char* value: UiVar* |
50 UcxMap *vars; // key: char* value: UiVar* |
50 void *document; |
51 void *document; |
51 UcxList *groups; // int list |
52 UcxList *groups; // int list |
52 UcxList *group_widgets; // UiGroupWidget* list |
53 UcxList *group_widgets; // UiGroupWidget* list |
|
54 |
|
55 void (*set_document)(UiContext *ctx, void *document); |
|
56 void (*detach_document)(UiContext *ctx, void *document); |
53 |
57 |
54 #ifdef UI_GTK |
58 #ifdef UI_GTK |
55 GtkAccelGroup *accel_group; |
59 GtkAccelGroup *accel_group; |
56 #endif |
60 #endif |
57 }; |
61 }; |
83 UI_VAR_TEXT, |
87 UI_VAR_TEXT, |
84 UI_VAR_LIST |
88 UI_VAR_LIST |
85 }; |
89 }; |
86 |
90 |
87 UiContext* uic_context(UiObject *toplevel, UcxMempool *mp); |
91 UiContext* uic_context(UiObject *toplevel, UcxMempool *mp); |
|
92 |
|
93 void uic_context_set_document(UiContext *ctx, void *document); |
|
94 void uic_context_detach_document(UiContext *ctx, void *document); |
|
95 |
88 UiVar* uic_get_var(UiContext *ctx, char *name); |
96 UiVar* uic_get_var(UiContext *ctx, char *name); |
89 UiVar* uic_connect_var(UiContext *ctx, char *name, int type); |
97 UiVar* uic_connect_var(UiContext *ctx, char *name, int type); |
90 void uic_move_var(UiVar *from, UiVar *to, int set); |
98 void uic_move_var(UiVar *from, UiVar *to, int set); |
91 void uic_reg_var(UiContext *ctx, char *name, int type, size_t vs, void *value); |
99 void uic_reg_var(UiContext *ctx, char *name, int type, size_t vs, void *value); |
92 void uic_add_var( |
100 void uic_add_var( |
99 void* uic_create_value(UcxAllocator *a, int type); |
107 void* uic_create_value(UcxAllocator *a, int type); |
100 |
108 |
101 void uic_check_group_widgets(UiContext *ctx); |
109 void uic_check_group_widgets(UiContext *ctx); |
102 void uic_add_group_widget(UiContext *ctx, void *widget, UcxList *groups); |
110 void uic_add_group_widget(UiContext *ctx, void *widget, UcxList *groups); |
103 |
111 |
|
112 |
104 #ifdef __cplusplus |
113 #ifdef __cplusplus |
105 } |
114 } |
106 #endif |
115 #endif |
107 |
116 |
108 #endif /* UIC_CONTEXT_H */ |
117 #endif /* UIC_CONTEXT_H */ |