88 int width; |
95 int width; |
89 int height; |
96 int height; |
90 #endif |
97 #endif |
91 } UiGridContainer; |
98 } UiGridContainer; |
92 |
99 |
|
100 /* |
93 typedef struct UiPanedContainer { |
101 typedef struct UiPanedContainer { |
94 UiContainer container; |
102 UiContainer container; |
95 GtkWidget *current_pane; |
103 GtkWidget *current_pane; |
96 int orientation; |
104 int orientation; |
97 int max; |
105 int max; |
98 int cur; |
106 int cur; |
99 } UiPanedContainer; |
107 } UiPanedContainer; |
|
108 */ |
100 |
109 |
101 typedef struct UiTabViewContainer { |
110 typedef struct UiTabViewContainer { |
102 UiContainer container; |
111 UiContainer container; |
103 } UiTabViewContainer; |
112 } UiTabViewContainer; |
|
113 |
|
114 typedef void (*ui_select_tab_func)(UIWIDGET widget, int tab); |
|
115 typedef void (*ui_add_tab_func)(UIWIDGET widget, int index, const char *name, UIWIDGET child); |
|
116 |
|
117 typedef struct UiGtkTabView { |
|
118 UiObject *obj; |
|
119 GtkWidget *widget; |
|
120 ui_select_tab_func select_tab; |
|
121 ui_select_tab_func remove_tab; |
|
122 ui_add_tab_func add_tab; |
|
123 UiSubContainerType subcontainer; |
|
124 int margin; |
|
125 int spacing; |
|
126 int columnspacing; |
|
127 int rowspacing; |
|
128 } UiGtkTabView; |
|
129 |
|
130 typedef struct UiHeaderbarContainer { |
|
131 UiContainer container; |
|
132 GtkWidget *centerbox; |
|
133 int part; |
|
134 UiHeaderbarAlternative alternative; /* only used by fallback headerbar */ |
|
135 } UiHeaderbarContainer; |
|
136 |
|
137 typedef struct UiGtkItemListContainer { |
|
138 UiObject *parent; |
|
139 GtkWidget *widget; |
|
140 UiContainer *container; |
|
141 void (*create_ui)(UiObject *, int, void *, void *); |
|
142 void *userdata; |
|
143 UiSubContainerType subcontainer; |
|
144 CxMap *current_items; |
|
145 int margin; |
|
146 int spacing; |
|
147 int columnspacing; |
|
148 int rowspacing; |
|
149 bool remove_items; |
|
150 } UiGtkItemListContainer; |
104 |
151 |
105 GtkWidget* ui_gtk_vbox_new(int spacing); |
152 GtkWidget* ui_gtk_vbox_new(int spacing); |
106 GtkWidget* ui_gtk_hbox_new(int spacing); |
153 GtkWidget* ui_gtk_hbox_new(int spacing); |
107 |
154 |
|
155 GtkWidget* ui_subcontainer_create( |
|
156 UiSubContainerType type, |
|
157 UiObject *newobj, |
|
158 int spacing, |
|
159 int columnspacing, |
|
160 int rowspacing, |
|
161 int margin); |
|
162 |
108 UiContainer* ui_frame_container(UiObject *obj, GtkWidget *frame); |
163 UiContainer* ui_frame_container(UiObject *obj, GtkWidget *frame); |
109 void ui_frame_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
164 void ui_frame_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
110 |
165 |
111 UiContainer* ui_box_container(UiObject *obj, GtkWidget *box); |
166 GtkWidget* ui_box_set_margin(GtkWidget *box, int margin); |
|
167 UIWIDGET ui_box_create(UiObject *obj, UiContainerArgs args, UiSubContainerType type); |
|
168 |
|
169 UiContainer* ui_box_container(UiObject *obj, GtkWidget *box, UiSubContainerType type); |
112 void ui_box_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
170 void ui_box_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
113 |
171 |
|
172 GtkWidget* ui_create_grid_widget(int colspacing, int rowspacing); |
114 UiContainer* ui_grid_container(UiObject *obj, GtkWidget *grid); |
173 UiContainer* ui_grid_container(UiObject *obj, GtkWidget *grid); |
115 void ui_grid_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
174 void ui_grid_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
116 |
175 |
|
176 UiContainer* ui_frame_container(UiObject *obj, GtkWidget *frame); |
|
177 void ui_frame_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
|
178 |
|
179 UiContainer* ui_expander_container(UiObject *obj, GtkWidget *expander); |
|
180 void ui_expander_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
|
181 |
117 UiContainer* ui_scrolledwindow_container(UiObject *obj, GtkWidget *scrolledwindow); |
182 UiContainer* ui_scrolledwindow_container(UiObject *obj, GtkWidget *scrolledwindow); |
118 void ui_scrolledwindow_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
183 void ui_scrolledwindow_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
119 |
184 |
120 UiContainer* ui_tabview_container(UiObject *obj, GtkWidget *tabview); |
185 UiContainer* ui_tabview_container(UiObject *obj, GtkWidget *tabview); |
121 void ui_tabview_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
186 void ui_tabview_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
123 void ui_paned_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
188 void ui_paned_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
124 |
189 |
125 void ui_split_container_add1(UiContainer *ct, GtkWidget *widget, UiBool fill); |
190 void ui_split_container_add1(UiContainer *ct, GtkWidget *widget, UiBool fill); |
126 void ui_split_container_add2(UiContainer *ct, GtkWidget *widget, UiBool fill); |
191 void ui_split_container_add2(UiContainer *ct, GtkWidget *widget, UiBool fill); |
127 |
192 |
128 |
193 UiGtkTabView* ui_widget_get_tabview_data(UIWIDGET tabview); |
129 UiObject* ui_add_document_tab(UiDocumentView *view); |
194 |
130 void ui_tab_set_document(UiContext *ctx, void *document); |
195 void ui_gtk_notebook_select_tab(GtkWidget *widget, int tab); |
131 void ui_tab_detach_document(UiContext *ctx); |
196 |
|
197 #if GTK_CHECK_VERSION(3, 10, 0) |
|
198 UiContainer* ui_headerbar_container(UiObject *obj, GtkWidget *headerbar); |
|
199 void ui_headerbar_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
|
200 #endif |
|
201 |
|
202 UiContainer* ui_headerbar_fallback_container(UiObject *obj, GtkWidget *headerbar); |
|
203 void ui_headerbar_fallback_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); |
132 |
204 |
133 #ifdef __cplusplus |
205 #ifdef __cplusplus |
134 } |
206 } |
135 #endif |
207 #endif |
136 |
208 |