40 typedef struct UiVar UiVar; |
40 typedef struct UiVar UiVar; |
41 |
41 |
42 struct UiContext { |
42 struct UiContext { |
43 UiObject *toplevel; |
43 UiObject *toplevel; |
44 UcxMempool *mempool; |
44 UcxMempool *mempool; |
45 UcxAllocator *allocator; |
|
46 UcxMap *vars; // key: char* value: UiVar* |
45 UcxMap *vars; // key: char* value: UiVar* |
47 }; |
46 }; |
48 |
47 |
49 struct UiVar { |
48 struct UiVar { |
50 void *value; |
49 void *value; |
51 int type; |
50 int type; |
52 int isextern; |
51 int isextern; |
|
52 UcxMap *from; |
|
53 }; |
|
54 |
|
55 enum UiVarType { |
|
56 UI_VAR_INTEGER = 0, |
|
57 UI_VAR_STRING |
53 }; |
58 }; |
54 |
59 |
55 UiContext* uic_context(UiObject *toplevel, UcxMempool *mp); |
60 UiContext* uic_context(UiObject *toplevel, UcxMempool *mp); |
56 |
61 UiVar* uic_getvar(UiContext *ctx, char *name); |
57 UiVar* uic_getvar(UiObject *obj, char *name); |
62 UiVar* uic_connect_var(UiContext *ctx, char *name, int type); |
58 void uic_rmvar(UiObject *obj, char *name); |
63 void* uic_create_value(UcxAllocator *a, int type); |
59 |
64 |
60 |
65 |
61 #ifdef __cplusplus |
66 #ifdef __cplusplus |
62 } |
67 } |
63 #endif |
68 #endif |