ui/gtk/list.h

changeset 1244
a29b53f97d1a
parent 1179
2f4c73ff962f
equal deleted inserted replaced
1243:59d97ac069f0 1244:a29b53f97d1a
28 28
29 #ifndef LIST_H 29 #ifndef LIST_H
30 #define LIST_H 30 #define LIST_H
31 31
32 #include "../ui/list.h" 32 #include "../ui/list.h"
33 #include "../ui/tree.h"
33 #include "toolkit.h" 34 #include "toolkit.h"
34 35
35 #include <cx/array_list.h> 36 #include <cx/array_list.h>
36 37
37 #ifdef __cplusplus 38 #ifdef __cplusplus
96 char *ondrop_action; 97 char *ondrop_action;
97 ui_list_savefunc onsave; 98 ui_list_savefunc onsave;
98 void *onsavedata; 99 void *onsavedata;
99 UiListSelection selection; 100 UiListSelection selection;
100 101
102 ui_tree_getdepthfunc getdepth;
103 void *getdepthdata;
104 UiBool istreeview;
105
101 }; 106 };
102 107
103 typedef struct UiTreeEventData { 108 typedef struct UiTreeEventData {
104 UiObject *obj; 109 UiObject *obj;
105 ui_callback activate; 110 ui_callback activate;
137 GtkListBoxRow *first_row; 142 GtkListBoxRow *first_row;
138 UiBool header_is_item; 143 UiBool header_is_item;
139 UiSubListEventData current_eventdata; 144 UiSubListEventData current_eventdata;
140 }; 145 };
141 146
147 void* ui_null_getvalue(UiList *list, void *elm, int row, int col, void *userdata, UiBool *freeResult);
142 148
143 #if GTK_CHECK_VERSION(4, 10, 0) 149 #if GTK_CHECK_VERSION(4, 10, 0)
144 150
145 void ui_update_liststore(GListStore *liststore, UiList *list); 151 void ui_update_liststore(GListStore *liststore, UiList *list);
146 void ui_update_liststore_static(GListStore *liststore, char **elm, size_t nelm); 152 void ui_update_liststore_static(GListStore *liststore, char **elm, size_t nelm);
158 164
159 #endif 165 #endif
160 166
161 void* ui_strmodel_getvalue(void *elm, int column); 167 void* ui_strmodel_getvalue(void *elm, int column);
162 168
163 UIWIDGET ui_listview_var(UiObject *obj, UiVar *var, ui_getvaluefunc getvalue, ui_callback f, void *udata);
164 UIWIDGET ui_table_var(UiObject *obj, UiVar *var, UiModel *model, UiListCallbacks cb);
165
166 GtkWidget* ui_get_tree_widget(UIWIDGET widget);
167 169
168 void ui_listview_update_model(UiModel *model, void *userdata, int insert_index, int delete_index); 170 void ui_listview_update_model(UiModel *model, void *userdata, int insert_index, int delete_index);
169 void ui_listview_update(UiList *list, int i); 171 void ui_listview_update(UiList *list, int i);
170 UiListSelection ui_listview_getselection(UiList *list); 172 UiListSelection ui_listview_getselection(UiList *list);
171 void ui_listview_setselection(UiList *list, UiListSelection selection); 173 void ui_listview_setselection(UiList *list, UiListSelection selection);
209 void ui_listbox_list_update(UiList *list, int i); 211 void ui_listbox_list_update(UiList *list, int i);
210 void ui_listbox_list_setselection(UiList *list, UiListSelection sel); 212 void ui_listbox_list_setselection(UiList *list, UiListSelection sel);
211 UiListSelection ui_listbox_list_getselection(UiList *list); 213 UiListSelection ui_listbox_list_getselection(UiList *list);
212 214
213 void ui_listbox_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data); 215 void ui_listbox_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data);
216
217 #if GTK_CHECK_VERSION(4, 10, 0)
218
219 typedef struct _ObjWrapper {
220 GObject parent_instance;
221 void *data;
222 int i;
223 } ObjWrapper;
224
225 ObjWrapper* ui_gobj_wrapper_new(void* data, int i);
226
227 #endif
214 228
215 #ifdef __cplusplus 229 #ifdef __cplusplus
216 } 230 }
217 #endif 231 #endif
218 232

mercurial