35 #include <cx/array_list.h> |
35 #include <cx/array_list.h> |
36 |
36 |
37 #ifdef __cplusplus |
37 #ifdef __cplusplus |
38 extern "C" { |
38 extern "C" { |
39 #endif |
39 #endif |
|
40 |
|
41 typedef struct UiColData UiColData; |
40 |
42 |
41 typedef struct UiListView { |
43 typedef struct UiListView { |
42 UiObject *obj; |
44 UiObject *obj; |
43 GtkWidget *widget; |
45 GtkWidget *widget; |
44 UiVar *var; |
46 UiVar *var; |
45 UiModel *model; |
47 UiModel *model; |
46 ui_callback ondragstart; |
48 #if GTK_CHECK_VERSION(4, 10, 0) |
47 void *ondragstartdata; |
49 GListStore *liststore; |
48 ui_callback ondragcomplete; |
50 GtkSelectionModel *selectionmodel; |
49 void *ondragcompletedata; |
51 UiColData *columns; |
50 ui_callback ondrop; |
52 #endif |
51 void *ondropdata; |
53 ui_callback onactivate; |
|
54 void *onactivatedata; |
|
55 ui_callback onselection; |
|
56 void *onselectiondata; |
|
57 ui_callback ondragstart; |
|
58 void *ondragstartdata; |
|
59 ui_callback ondragcomplete; |
|
60 void *ondragcompletedata; |
|
61 ui_callback ondrop; |
|
62 void *ondropdata; |
|
63 UiListSelection selection; |
52 |
64 |
53 } UiListView; |
65 } UiListView; |
|
66 |
|
67 struct UiColData { |
|
68 UiListView *listview; |
|
69 int model_column; |
|
70 int data_column; |
|
71 }; |
54 |
72 |
55 typedef struct UiTreeEventData { |
73 typedef struct UiTreeEventData { |
56 UiObject *obj; |
74 UiObject *obj; |
57 ui_callback activate; |
75 ui_callback activate; |
58 ui_callback selection; |
76 ui_callback selection; |
83 ui_callback onbuttonclick; |
101 ui_callback onbuttonclick; |
84 void *onbuttonclickdata; |
102 void *onbuttonclickdata; |
85 |
103 |
86 GtkListBoxRow *first_row; |
104 GtkListBoxRow *first_row; |
87 }; |
105 }; |
|
106 |
|
107 |
|
108 #if GTK_CHECK_VERSION(4, 10, 0) |
|
109 |
|
110 void ui_update_liststore(GListStore *liststore, UiList *list); |
|
111 |
|
112 void ui_listview_update2(UiList *list, int i); |
|
113 UiListSelection ui_listview_getselection2(UiList *list); |
|
114 void ui_listview_setselection2(UiList *list, UiListSelection selection); |
|
115 |
|
116 void ui_columnview_activate(GtkColumnView* self, guint position, gpointer userdata); |
|
117 void ui_listview_selection_changed(GtkSelectionModel* self, guint position, guint n_items, gpointer user_data); |
|
118 |
|
119 #endif |
88 |
120 |
89 void* ui_strmodel_getvalue(void *elm, int column); |
121 void* ui_strmodel_getvalue(void *elm, int column); |
90 |
122 |
91 UIWIDGET ui_listview_var(UiObject *obj, UiVar *var, ui_getvaluefunc getvalue, ui_callback f, void *udata); |
123 UIWIDGET ui_listview_var(UiObject *obj, UiVar *var, ui_getvaluefunc getvalue, ui_callback f, void *udata); |
92 UIWIDGET ui_table_var(UiObject *obj, UiVar *var, UiModel *model, UiListCallbacks cb); |
124 UIWIDGET ui_table_var(UiObject *obj, UiVar *var, UiModel *model, UiListCallbacks cb); |