ui/ui/container.h

Sun, 10 Nov 2024 15:27:44 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 10 Nov 2024 15:27:44 +0100
branch
newapi
changeset 378
d41b1ffc5f77
parent 351
63db7e35e2e9
permissions
-rw-r--r--

implement some missing WinUI functions

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
190
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
60 typedef struct UiContainerArgs {
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
61 UiTri fill;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
62 UiBool hexpand;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
63 UiBool vexpand;
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
64 UiBool hfill;
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
65 UiBool vfill;
190
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
66 int colspan;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
67 int rowspan;
313
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
68 const char *name;
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
69 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
70
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
71 int margin;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
72 int spacing;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
73 int columnspacing;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
74 int rowspacing;
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
75 } UiContainerArgs;
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
76
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
77 typedef struct UiFrameArgs {
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
78 UiTri fill;
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
79 UiBool hexpand;
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
80 UiBool vexpand;
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
81 UiBool hfill;
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
82 UiBool vfill;
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
83 int colspan;
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
84 int rowspan;
313
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
85 const char *name;
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
86 const char *style_class;
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
87
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
88 UiSubContainerType subcontainer;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
89
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
90 int margin;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
91 int spacing;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
92 int columnspacing;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
93 int rowspacing;
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
94
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
95 const char* label;
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
96 UiBool isexpanded;
193
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
97 } UiFrameArgs;
74c688cc1839 add frame container (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 190
diff changeset
98
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
99 typedef struct UiTabViewArgs {
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
100 UiTri fill;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
101 UiBool hexpand;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
102 UiBool vexpand;
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
103 UiBool hfill;
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
104 UiBool vfill;
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
105 int colspan;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
106 int rowspan;
313
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
107 const char *name;
b679cc6059ab add option to name widgets and add css classes (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
108 const char *style_class;
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
109
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
110 UiTabViewType tabview;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
111
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
112 UiSubContainerType subcontainer;
330
d615aa36c98e add tabview value/varname parameter
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 328
diff changeset
113
d615aa36c98e add tabview value/varname parameter
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 328
diff changeset
114 UiInteger *value;
d615aa36c98e add tabview value/varname parameter
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 328
diff changeset
115 const char* varname;
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
116
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
117 int margin;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
118 int spacing;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
119 int columnspacing;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
120 int rowspacing;
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 const char* label;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
123 UiBool isexpanded;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
124 } UiTabViewArgs;
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
125
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
126 typedef struct UiHeaderbarArgs {
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
127 UiTri fill;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
128 UiBool hexpand;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
129 UiBool vexpand;
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
130 UiBool hfill;
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
131 UiBool vfill;
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
132 int colspan;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
133 int rowspan;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
134 const char *name;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
135 const char *style_class;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
136
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
137 UiBool showtitle;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
138 UiBool showwindowbuttons;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
139
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
140 UiHeaderbarAlternative alternative;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
141 int alt_spacing;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
142 } UiHeaderbarArgs;
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
143
198
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
144
195
0f2e69873875 add expander (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 194
diff changeset
145
166
6e48030cf2db add container macros (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 165
diff changeset
146 #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
147
70fd1b24e395 implement new api style for box and grid containers (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 187
diff changeset
148 #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
149 #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
150 #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
151 #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
152 #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
153 #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
154 #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
155 #define ui_headerbar(obj, ...) for(ui_headerbar_create(obj, (UiHeaderbarArgs){ __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
156
e2281ace0769 add scrolledwindow (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 193
diff changeset
157 #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
158 #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
159 #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
160 #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
161 #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
162 #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
163 #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
164 #define ui_headerbar0(obj) for(ui_headerbar_create(obj, (UiHeaderbarArgs){ 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
165
f2332d0d3318 add tabview based on winui the pivot control
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 195
diff changeset
166 #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
167
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
168 #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
169 #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
170 #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
171
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
172 UIEXPORT void ui_end(UiObject *obj);
146
dd0ae1c62a72 new icon/image api and pixbuf support in treeview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
173
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
174 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
175 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
176 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
177 UIEXPORT UIWIDGET ui_frame_create(UiObject *obj, UiFrameArgs args);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
178 UIEXPORT UIWIDGET ui_expander_create(UiObject *obj, UiFrameArgs args);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
179 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
180
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
181 UIEXPORT UIWIDGET ui_tabview_create(UiObject *obj, UiTabViewArgs args);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
182 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
183 UIEXPORT void ui_tabview_select(UIWIDGET tabview, int tab);
059cba080ab4 implement new tabview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 313
diff changeset
184 UIEXPORT void ui_tabview_remove(UIWIDGET tabview, int tab);
059cba080ab4 implement new tabview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 313
diff changeset
185 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
186
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
187 UIEXPORT UIWIDGET ui_headerbar_create(UiObject *obj, UiHeaderbarArgs args);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
188 UIEXPORT void ui_headerbar_start_create(UiObject *obj);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
189 UIEXPORT void ui_headerbar_center_create(UiObject *obj);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
190 UIEXPORT void ui_headerbar_end_create(UiObject *obj);
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
191
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
192
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
193 UIEXPORT UIWIDGET ui_scrolledwindow_deprecated(UiObject *obj); // TODO
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
194
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
195 UIEXPORT UIWIDGET ui_sidebar(UiObject *obj); // TODO
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
196
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
197 UIEXPORT UIWIDGET ui_hsplitpane(UiObject *obj, int max); // TODO
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
198 UIEXPORT UIWIDGET ui_vsplitpane(UiObject *obj, int max); // TODO
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
199
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
200
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201 // box container layout functions
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
202 UIEXPORT void ui_layout_fill(UiObject *obj, UiBool fill);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203 // grid container layout functions
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
204 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
205 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
206 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
207 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
208 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
209 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
210 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
211 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
212 UIEXPORT void ui_newline(UiObject *obj);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
213
336
56c12f44c2d3 add custom headerbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 330
diff changeset
214 // TODO
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
215 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
216 UIEXPORT UiObject* ui_document_tab(UiTabbedPane *view);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218
166
6e48030cf2db add container macros (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 165
diff changeset
219 /* used for macro */
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 198
diff changeset
220 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
221 UIEXPORT int ui_container_finish(UiObject *obj);
166
6e48030cf2db add container macros (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 165
diff changeset
222
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 166
diff changeset
223 #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
224 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
225 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
226 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
227 if(args.hfill) ui_layout_hfill(obj, 1); \
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 351
diff changeset
228 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
229 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
230 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
231 /*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
232
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 #ifdef __cplusplus
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235 }
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 #endif
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238 #endif /* UI_CONTAINER_H */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239

mercurial