56 }; |
58 }; |
57 |
59 |
58 struct UiContext { |
60 struct UiContext { |
59 UiContext *parent; |
61 UiContext *parent; |
60 UiObject *obj; |
62 UiObject *obj; |
61 UcxMempool *mempool; |
63 const CxAllocator *allocator; |
62 |
64 |
63 void *document; |
65 void *document; |
64 UcxList *documents; |
66 CxList *documents; |
65 |
67 |
66 UcxMap *vars; // manually created context vars |
68 CxMap *vars; // manually created context vars |
67 UcxMap *vars_unbound; // unbound vars created by widgets |
69 CxMap *vars_unbound; // unbound vars created by widgets |
68 |
70 |
69 UcxList *groups; // int list |
71 CxList *groups; // int list |
70 UcxList *group_widgets; // UiGroupWidget* list |
72 CxList *group_widgets; // UiGroupWidget list |
71 |
73 |
72 void (*attach_document)(UiContext *ctx, void *document); |
74 void (*attach_document)(UiContext *ctx, void *document); |
73 void (*detach_document2)(UiContext *ctx, void *document); |
75 void (*detach_document2)(UiContext *ctx, void *document); |
74 |
76 |
75 char *title; |
77 char *title; |
98 }; |
100 }; |
99 |
101 |
100 |
102 |
101 void uic_init_global_context(void); |
103 void uic_init_global_context(void); |
102 |
104 |
103 UiContext* uic_context(UiObject *toplevel, UcxMempool *mp); |
105 UiContext* uic_context(UiObject *toplevel, const CxAllocator *a); |
104 UiContext* uic_root_context(UiContext *ctx); |
106 UiContext* uic_root_context(UiContext *ctx); |
105 void uic_context_set_document(UiContext *ctx, void *document); // deprecated |
107 void uic_context_set_document(UiContext *ctx, void *document); // deprecated |
106 void uic_context_detach_document(UiContext *ctx); // deprecated |
108 void uic_context_detach_document(UiContext *ctx); // deprecated |
107 |
109 |
108 void uic_context_attach_document(UiContext *ctx, void *document); |
110 void uic_context_attach_document(UiContext *ctx, void *document); |
120 void uic_reg_var(UiContext *ctx, char *name, UiVarType type, void *value); |
122 void uic_reg_var(UiContext *ctx, char *name, UiVarType type, void *value); |
121 |
123 |
122 void uic_remove_bound_var(UiContext *ctx, UiVar *var); |
124 void uic_remove_bound_var(UiContext *ctx, UiVar *var); |
123 |
125 |
124 void uic_check_group_widgets(UiContext *ctx); |
126 void uic_check_group_widgets(UiContext *ctx); |
125 void uic_add_group_widget(UiContext *ctx, void *widget, ui_enablefunc enable, UcxList *groups); |
127 void uic_add_group_widget(UiContext *ctx, void *widget, ui_enablefunc enable, CxList *groups); |
126 |
128 |
127 |
129 |
128 #ifdef __cplusplus |
130 #ifdef __cplusplus |
129 } |
131 } |
130 #endif |
132 #endif |