ui/common/context.h

changeset 966
e411ed7c5f10
parent 960
e88ca7dfa943
child 976
e2763e880938
equal deleted inserted replaced
965:5d4419042d9b 966:e411ed7c5f10
41 #endif 41 #endif
42 42
43 typedef struct UiVar UiVar; 43 typedef struct UiVar UiVar;
44 typedef struct UiListPtr UiListPtr; 44 typedef struct UiListPtr UiListPtr;
45 typedef struct UiListVar UiListVar; 45 typedef struct UiListVar UiListVar;
46 typedef struct UiGroupWidget UiGroupWidget; 46 typedef struct UiStateWidget UiStateWidget;
47 typedef struct UiDestroyHandler UiDestroyHandler; 47 typedef struct UiDestroyHandler UiDestroyHandler;
48 48
49 typedef enum UiVarType { 49 typedef enum UiVarType {
50 UI_VAR_SPECIAL = 0, 50 UI_VAR_SPECIAL = 0,
51 UI_VAR_INTEGER, 51 UI_VAR_INTEGER,
67 void *document; 67 void *document;
68 CxList *documents; 68 CxList *documents;
69 69
70 CxMap *vars; 70 CxMap *vars;
71 71
72 CxList *groups; // int list 72 CxList *states; // int list
73 CxList *group_widgets; // UiGroupWidget list 73 CxList *state_widgets; // UiGroupWidget list
74 74
75 void (*attach_document)(UiContext *ctx, void *document); 75 void (*attach_document)(UiContext *ctx, void *document);
76 void (*detach_document2)(UiContext *ctx, void *document); 76 void (*detach_document2)(UiContext *ctx, void *document);
77 77
78 char *title; 78 char *title;
100 UiVar *from; 100 UiVar *from;
101 UiContext *from_ctx; 101 UiContext *from_ctx;
102 UiBool bound; 102 UiBool bound;
103 }; 103 };
104 104
105 struct UiGroupWidget { 105 struct UiStateWidget {
106 void *widget; 106 void *widget;
107 ui_enablefunc enable; 107 ui_enablefunc enable;
108 int *groups; 108 int *states;
109 int numgroups; 109 int numstates;
110 }; 110 };
111 111
112 struct UiDestroyHandler { 112 struct UiDestroyHandler {
113 cx_destructor_func destructor; 113 cx_destructor_func destructor;
114 void *data; 114 void *data;
143 void uic_unbind_var(UiVar *var); 143 void uic_unbind_var(UiVar *var);
144 const char *uic_type2str(UiVarType type); 144 const char *uic_type2str(UiVarType type);
145 145
146 void uic_reg_var(UiContext *ctx, const char *name, UiVarType type, void *value); 146 void uic_reg_var(UiContext *ctx, const char *name, UiVarType type, void *value);
147 147
148 size_t uic_group_array_size(const int *groups); 148 size_t uic_state_array_size(const int *states);
149 void uic_check_group_widgets(UiContext *ctx); 149 void uic_check_state_widgets(UiContext *ctx);
150 void uic_add_group_widget(UiContext *ctx, void *widget, ui_enablefunc enable, CxList *groups); 150 void uic_add_state_widget(UiContext *ctx, void *widget, ui_enablefunc enable, CxList *states);
151 void uic_add_group_widget_i(UiContext *ctx, void *widget, ui_enablefunc enable, const int *groups, size_t numgroups); 151 void uic_add_state_widget_i(UiContext *ctx, void *widget, ui_enablefunc enable, const int *states, size_t numstates);
152 void uic_remove_group_widget(UiContext *ctx, void *widget); 152 void uic_remove_state_widget(UiContext *ctx, void *widget);
153 153
154 #ifdef __cplusplus 154 #ifdef __cplusplus
155 } 155 }
156 #endif 156 #endif
157 157

mercurial