ui/ui/tree.h

branch
newapi
changeset 225
097f45f9c1fa
parent 224
88bc21b19213
child 241
c51dd0e9ecb7
equal deleted inserted replaced
224:88bc21b19213 225:097f45f9c1fa
39 typedef struct UiListCallbacks UiListCallbacks; 39 typedef struct UiListCallbacks UiListCallbacks;
40 typedef struct UiListSelection UiListSelection; 40 typedef struct UiListSelection UiListSelection;
41 typedef struct UiListDnd UiListDnd; 41 typedef struct UiListDnd UiListDnd;
42 42
43 typedef struct UiListArgs UiListArgs; 43 typedef struct UiListArgs UiListArgs;
44 typedef struct UiPathBarArgs UiPathBarArgs;
45 44
46 typedef enum UiModelType { 45 typedef enum UiModelType {
47 UI_STRING = 0, 46 UI_STRING = 0,
48 UI_INTEGER, 47 UI_INTEGER,
49 UI_ICON, 48 UI_ICON,
133 ui_callback ondrop; 132 ui_callback ondrop;
134 void* ondropsdata; 133 void* ondropsdata;
135 UiBool multiselection; 134 UiBool multiselection;
136 }; 135 };
137 136
138 struct UiPathBarArgs {
139 UiTri fill;
140 UiBool hexpand;
141 UiBool vexpand;
142 int colspan;
143 int rowspan;
144
145 UiList* list;
146 const char* varname;
147 UiModel* model;
148 ui_getvaluefunc getvalue;
149 ui_callback onactivate;
150 void* onactivatedata;
151 ui_callback ontextinput;
152 void* ontextinputdata;
153 ui_callback ondragstart;
154 void* ondragstartdata;
155 ui_callback ondragcomplete;
156 void* ondragcompletedata;
157 ui_callback ondrop;
158 void* ondropsdata;
159 UiBool enabledrag;
160 UiBool enabledrop;
161 };
162
163 UIEXPORT UiModel* ui_model(UiContext *ctx, ...); 137 UIEXPORT UiModel* ui_model(UiContext *ctx, ...);
164 UIEXPORT UiModel* ui_model_copy(UiContext *ctx, UiModel* model); 138 UIEXPORT UiModel* ui_model_copy(UiContext *ctx, UiModel* model);
165 UIEXPORT void ui_model_free(UiContext *ctx, UiModel *mi); 139 UIEXPORT void ui_model_free(UiContext *ctx, UiModel *mi);
166 140
167 #define ui_listview(obj, ...) ui_listview_create(obj, (UiListArgs) { __VA_ARGS__ } ) 141 #define ui_listview(obj, ...) ui_listview_create(obj, (UiListArgs) { __VA_ARGS__ } )
168 #define ui_table(obj, ...) ui_table_create(obj, (UiListArgs) { __VA_ARGS__ } ) 142 #define ui_table(obj, ...) ui_table_create(obj, (UiListArgs) { __VA_ARGS__ } )
169 #define ui_combobox(obj, ...) ui_combobox_create(obj, (UiListArgs) { __VA_ARGS__ } ) 143 #define ui_combobox(obj, ...) ui_combobox_create(obj, (UiListArgs) { __VA_ARGS__ } )
170 #define ui_breadcrumbbar(obj, ...) ui_breadcrumbbar_create(obj, (UiListArgs) { __VA_ARGS__ } ) 144 #define ui_breadcrumbbar(obj, ...) ui_breadcrumbbar_create(obj, (UiListArgs) { __VA_ARGS__ } )
171 #define ui_pathbar(obj, ...) ui_pathbar_create(obj, (UiPathBarArgs) { __VA_ARGS__ } )
172 145
173 UIEXPORT UIWIDGET ui_listview_create(UiObject* obj, UiListArgs args); 146 UIEXPORT UIWIDGET ui_listview_create(UiObject* obj, UiListArgs args);
174 UIEXPORT UIWIDGET ui_table_create(UiObject* obj, UiListArgs args); 147 UIEXPORT UIWIDGET ui_table_create(UiObject* obj, UiListArgs args);
175 UIEXPORT UIWIDGET ui_combobox_create(UiObject* obj, UiListArgs args); 148 UIEXPORT UIWIDGET ui_combobox_create(UiObject* obj, UiListArgs args);
176 UIEXPORT UIWIDGET ui_breadcrumbbar_create(UiObject* obj, UiListArgs args); 149 UIEXPORT UIWIDGET ui_breadcrumbbar_create(UiObject* obj, UiListArgs args);
177 UIEXPORT UIWIDGET ui_pathbar_create(UiObject* obj, UiPathBarArgs args);
178 150
179 151
180 void ui_table_dragsource(UIWIDGET tablewidget, int actions, char *target0, ...); 152 void ui_table_dragsource(UIWIDGET tablewidget, int actions, char *target0, ...);
181 void ui_table_dragsource_a(UIWIDGET tablewidget, int actions, char **targets, int nelm); 153 void ui_table_dragsource_a(UIWIDGET tablewidget, int actions, char **targets, int nelm);
182 void ui_table_dragdest(UIWIDGET tablewidget, int actions, char *target0, ...); 154 void ui_table_dragdest(UIWIDGET tablewidget, int actions, char *target0, ...);

mercurial