ui/ui/tree.h

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

mercurial