ui/ui/container.h

Mon, 13 Jan 2025 22:36:57 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 13 Jan 2025 22:36:57 +0100
changeset 442
dc762a79e72d
parent 423
02bafb660eb2
child 443
3379c8a5b6bb
permissions
-rw-r--r--

add ui_customwidget_create function (GTK)

140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2017 Olaf Wintermann. All rights reserved.
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #ifndef UI_CONTAINER_H
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #define UI_CONTAINER_H
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 #include "toolkit.h"
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 #ifdef __cplusplus
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 extern "C" {
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 #endif
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
37
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
38 typedef enum UiSubContainerType {
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
39 UI_CONTAINER_VBOX = 0,
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
40 UI_CONTAINER_HBOX,
351
63db7e35e2e9 implement scrolledwindow sub container type (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 336
diff changeset
41 UI_CONTAINER_GRID,
63db7e35e2e9 implement scrolledwindow sub container type (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 336
diff changeset
42 UI_CONTAINER_NO_SUB
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
43 } UiSubContainerType;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
44
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
45 typedef enum UiTabViewType {
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
46 UI_TABVIEW_DEFAULT = 0,
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
47 UI_TABVIEW_DOC,
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
48 UI_TABVIEW_NAVIGATION_SIDE,
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
49 UI_TABVIEW_NAVIGATION_TOP,
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
50 UI_TABVIEW_NAVIGATION_TOP2,
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
51 UI_TABVIEW_INVISIBLE
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
52 } UiTabViewType;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
53
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
54 typedef enum UiHeaderbarAlternative {
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
55 UI_HEADERBAR_ALTERNATIVE_DEFAULT = 0,
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
56 UI_HEADERBAR_ALTERNATIVE_TOOLBAR,
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
57 UI_HEADERBAR_ALTERNATIVE_BOX
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
58 } UiHeaderbarAlternative;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
59
442
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
60 typedef struct UiWidgetArgs {
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
61 UiTri fill;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
62 UiBool hexpand;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
63 UiBool vexpand;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
64 UiBool hfill;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
65 UiBool vfill;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
66 int colspan;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
67 int rowspan;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
68 const char *name;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
69 const char *style_class;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
70 } UiWidgetArgs;
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
71
190
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
72 typedef struct UiContainerArgs {
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
73 UiTri fill;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
74 UiBool hexpand;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
75 UiBool vexpand;
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
76 UiBool hfill;
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
77 UiBool vfill;
190
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
78 int colspan;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
79 int rowspan;
313
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
80 const char *name;
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
81 const char *style_class;
190
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
82
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
83 int margin;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
84 int spacing;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
85 int columnspacing;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
86 int rowspacing;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
87 } UiContainerArgs;
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
88
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
89 typedef struct UiFrameArgs {
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
90 UiTri fill;
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
91 UiBool hexpand;
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
92 UiBool vexpand;
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
93 UiBool hfill;
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
94 UiBool vfill;
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
95 int colspan;
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
96 int rowspan;
313
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
97 const char *name;
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
98 const char *style_class;
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
99
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
100 UiSubContainerType subcontainer;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
101
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
102 int margin;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
103 int spacing;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
104 int columnspacing;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
105 int rowspacing;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
106
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
107 const char* label;
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
108 UiBool isexpanded;
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
109 } UiFrameArgs;
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
110
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
111 typedef struct UiTabViewArgs {
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
112 UiTri fill;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
113 UiBool hexpand;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
114 UiBool vexpand;
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
115 UiBool hfill;
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
116 UiBool vfill;
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
117 int colspan;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
118 int rowspan;
313
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
119 const char *name;
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
120 const char *style_class;
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
121
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
122 UiTabViewType tabview;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
123
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
124 UiSubContainerType subcontainer;
330
d615aa36c98e add tabview value/varname parameter
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 328
diff changeset
125
d615aa36c98e add tabview value/varname parameter
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 328
diff changeset
126 UiInteger *value;
d615aa36c98e add tabview value/varname parameter
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 328
diff changeset
127 const char* varname;
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
128
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
129 int margin;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
130 int spacing;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
131 int columnspacing;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
132 int rowspacing;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
133
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
134 const char* label;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
135 UiBool isexpanded;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
136 } UiTabViewArgs;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
137
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
138 typedef struct UiHeaderbarArgs {
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
139 UiTri fill;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
140 UiBool hexpand;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
141 UiBool vexpand;
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
142 UiBool hfill;
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
143 UiBool vfill;
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
144 int colspan;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
145 int rowspan;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
146 const char *name;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
147 const char *style_class;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
148
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
149 UiBool showtitle;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
150 UiBool showwindowbuttons;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
151
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
152 UiHeaderbarAlternative alternative;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
153 int alt_spacing;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
154 } UiHeaderbarArgs;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
155
409
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
156 typedef struct UiSidebarArgs {
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
157 const char *name;
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
158 const char *style_class;
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
159 int margin;
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
160 int spacing;
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
161 } UiSidebarArgs;
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
162
422
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
163 typedef struct UiItemListContainerArgs {
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
164 UiTri fill;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
165 UiBool hexpand;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
166 UiBool vexpand;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
167 UiBool hfill;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
168 UiBool vfill;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
169 int colspan;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
170 int rowspan;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
171 const char *name;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
172 const char *style_class;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
173
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
174 int margin;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
175 int spacing;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
176
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
177 int sub_margin;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
178 int sub_spacing;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
179 int sub_columnspacing;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
180 int sub_rowspacing;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
181
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
182 UiList *value;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
183 const char *varname;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
184 /*
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
185 * void create_ui(UiObject *obj, int index, void *elm, void *userdata)
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
186 *
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
187 * UI constructor for each list element
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
188 *
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
189 * This callback is executed for each list element. A new UiObject is
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
190 * created for every item.
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
191 */
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
192 void (*create_ui)(UiObject *, int, void *, void *);
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
193 void *userdata;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
194
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
195 /*
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
196 * ItemList container type
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
197 * Only UI_CONTAINER_VBOX or UI_CONTAINER_HBOX are supported
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
198 */
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
199 UiSubContainerType container;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
200
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
201 /*
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
202 * item root container
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
203 */
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
204 UiSubContainerType subcontainer;
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
205 } UiItemListContainerArgs;
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
206
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
207 struct UiContainerX {
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
208 void *container;
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
209 int close;
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
210 UiContainerX *prev;
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
211 UiContainerX *next;
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
212 };
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
213
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
214
166
6e48030cf2db add container macros (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 165
diff changeset
215 #define UI_CTN(obj, ctn) for(ctn;ui_container_finish(obj);ui_container_begin_close(obj))
190
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
216
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
217 #define ui_vbox(obj, ...) for(ui_vbox_create(obj, (UiContainerArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
218 #define ui_hbox(obj, ...) for(ui_hbox_create(obj, (UiContainerArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
219 #define ui_grid(obj, ...) for(ui_grid_create(obj, (UiContainerArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
220 #define ui_frame(obj, ...) for(ui_frame_create(obj, (UiFrameArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
221 #define ui_expander(obj, ...) for(ui_expander_create(obj, (UiFrameArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
222 #define ui_scrolledwindow(obj, ...) for(ui_scrolledwindow_create(obj, (UiFrameArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
223 #define ui_tabview(obj, ...) for(ui_tabview_create(obj, (UiTabViewArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
224 #define ui_headerbar(obj, ...) for(ui_headerbar_create(obj, (UiHeaderbarArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
409
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
225 #define ui_sidebar(obj, ...) for(ui_sidebar_create(obj, (UiSidebarArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
194
e2281ace0769 add scrolledwindow (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 193
diff changeset
226
e2281ace0769 add scrolledwindow (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 193
diff changeset
227 #define ui_vbox0(obj) for(ui_vbox_create(obj, (UiContainerArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
e2281ace0769 add scrolledwindow (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 193
diff changeset
228 #define ui_hbox0(obj) for(ui_hbox_create(obj, (UiContainerArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
e2281ace0769 add scrolledwindow (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 193
diff changeset
229 #define ui_grid0(obj) for(ui_grid_create(obj, (UiContainerArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
e2281ace0769 add scrolledwindow (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 193
diff changeset
230 #define ui_frame0(obj) for(ui_frame_create(obj, (UiFrameArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
231 #define ui_expander0(obj) for(ui_expande_create(obj, (UiFrameArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
232 #define ui_scrolledwindow0(obj) for(ui_scrolledwindow_create(obj, (UiFrameArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
233 #define ui_tabview0(obj) for(ui_tabview_create(obj, (UiTabViewArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
234 #define ui_headerbar0(obj) for(ui_headerbar_create(obj, (UiHeaderbarArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
409
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
235 #define ui_sidebar0(obj) for(ui_sidebar_create(obj, (UiSidebarArgs){ 0 });ui_container_finish(obj);ui_container_begin_close(obj))
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
236
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
237 #define ui_tab(obj, label) for(ui_tab_create(obj, label);ui_container_finish(obj);ui_container_begin_close(obj))
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
238
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
239 #define ui_headerbar_start(obj) for(ui_headerbar_start_create(obj);ui_container_finish(obj);ui_container_begin_close(obj))
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
240 #define ui_headerbar_center(obj) for(ui_headerbar_center_create(obj);ui_container_finish(obj);ui_container_begin_close(obj))
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
241 #define ui_headerbar_end(obj) for(ui_headerbar_end_create(obj);ui_container_finish(obj);ui_container_begin_close(obj))
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
242
422
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
243 #define ui_itemlist(obj, ...) ui_itemlist_create(obj, (UiItemListContainerArgs) { __VA_ARGS__} )
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
244
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
245 UIEXPORT void ui_end(UiObject *obj); // deprecated
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
246 UIEXPORT void ui_end_new(UiObject *obj); // TODO: rename to ui_end
146
dd0ae1c62a72 new icon/image api and pixbuf support in treeview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
247
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
248 UIEXPORT UIWIDGET ui_vbox_create(UiObject *obj, UiContainerArgs args);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
249 UIEXPORT UIWIDGET ui_hbox_create(UiObject *obj, UiContainerArgs args);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
250 UIEXPORT UIWIDGET ui_grid_create(UiObject *obj, UiContainerArgs args);
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
251 UIEXPORT UIWIDGET ui_frame_create(UiObject *obj, UiFrameArgs args);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
252 UIEXPORT UIWIDGET ui_expander_create(UiObject *obj, UiFrameArgs args);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
253 UIEXPORT UIWIDGET ui_scrolledwindow_create(UiObject *obj, UiFrameArgs args);
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
254
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
255 UIEXPORT UIWIDGET ui_tabview_create(UiObject *obj, UiTabViewArgs args);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
256 UIEXPORT void ui_tab_create(UiObject *obj, const char* title);
328
059cba080ab4 implement new tabview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 313
diff changeset
257 UIEXPORT void ui_tabview_select(UIWIDGET tabview, int tab);
059cba080ab4 implement new tabview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 313
diff changeset
258 UIEXPORT void ui_tabview_remove(UIWIDGET tabview, int tab);
059cba080ab4 implement new tabview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 313
diff changeset
259 UIEXPORT UiObject* ui_tabview_add(UIWIDGET tabview, const char *name, int tab_index);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
260
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
261 UIEXPORT UIWIDGET ui_headerbar_create(UiObject *obj, UiHeaderbarArgs args);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
262 UIEXPORT void ui_headerbar_start_create(UiObject *obj);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
263 UIEXPORT void ui_headerbar_center_create(UiObject *obj);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
264 UIEXPORT void ui_headerbar_end_create(UiObject *obj);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
265
409
86fbc80f0be7 add sidebar (libadwaita)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
266 UIEXPORT UIWIDGET ui_sidebar_create(UiObject *obj, UiSidebarArgs args);
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
267
422
c1354a29a7e9 add item list container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 409
diff changeset
268 UIEXPORT UIWIDGET ui_itemlist_create(UiObject *obj, UiItemListContainerArgs args);
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
269
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
270 UIEXPORT UIWIDGET ui_hsplitpane(UiObject *obj, int max); // TODO
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
271 UIEXPORT UIWIDGET ui_vsplitpane(UiObject *obj, int max); // TODO
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
272
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
273
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
274 // box container layout functions
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
275 UIEXPORT void ui_layout_fill(UiObject *obj, UiBool fill);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
276 // grid container layout functions
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
277 UIEXPORT void ui_layout_hexpand(UiObject *obj, UiBool expand);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
278 UIEXPORT void ui_layout_vexpand(UiObject *obj, UiBool expand);
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
279 UIEXPORT void ui_layout_hfill(UiObject *obj, UiBool fill);
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
280 UIEXPORT void ui_layout_vfill(UiObject *obj, UiBool fill);
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
281 UIEXPORT void ui_layout_width(UiObject *obj, int width);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
282 UIEXPORT void ui_layout_height(UiObject* obj, int width);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
283 UIEXPORT void ui_layout_colspan(UiObject *obj, int cols);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
284 UIEXPORT void ui_layout_rowspan(UiObject* obj, int rows);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
285 UIEXPORT void ui_newline(UiObject *obj);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
286
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
287 // TODO
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
288 UIEXPORT UiTabbedPane* ui_tabbed_document_view(UiObject *obj);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
289 UIEXPORT UiObject* ui_document_tab(UiTabbedPane *view);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
290
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
291
442
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
292 typedef UIWIDGET (*ui_createwidget_func)(UiObject *obj, UiWidgetArgs args, void *userdata);
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
293 UIEXPORT UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs args);
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
294
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
295 #define ui_customwidget(obj, create_widget, userdata, ...) ui_customwidget_create(obj, create_widget, userdata, (UiWidgetArgs) { __VA_ARGS__ })
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
296
dc762a79e72d add ui_customwidget_create function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 423
diff changeset
297
166
6e48030cf2db add container macros (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 165
diff changeset
298 /* used for macro */
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
299 UIEXPORT void ui_container_begin_close(UiObject *obj);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
300 UIEXPORT int ui_container_finish(UiObject *obj);
166
6e48030cf2db add container macros (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 165
diff changeset
301
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
302 #define UI_APPLY_LAYOUT1(obj, args) \
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
303 if(args.fill != UI_DEFAULT) ui_layout_fill(obj, args.fill == UI_ON ? 1 : 0 ); \
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
304 if(args.hexpand) ui_layout_hexpand(obj, 1); \
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
305 if(args.vexpand) ui_layout_vexpand(obj, 1); \
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
306 if(args.hfill) ui_layout_hfill(obj, 1); \
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
307 if(args.vfill) ui_layout_vfill(obj, 1); \
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
308 if(args.colspan > 0) ui_layout_colspan(obj, args.colspan); \
187
24ce2c326d85 implement toggle button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 186
diff changeset
309 if(args.rowspan > 0) ui_layout_rowspan(obj, args.rowspan); \
24ce2c326d85 implement toggle button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 186
diff changeset
310 /*force caller to add ';'*/(void)0
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
311
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
312
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
313 #ifdef __cplusplus
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
314 }
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
315 #endif
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
316
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
317 #endif /* UI_CONTAINER_H */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
318

mercurial