ui/ui/toolkit.h

Sun, 15 Sep 2024 20:19:52 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 15 Sep 2024 20:19:52 +0200
branch
newapi
changeset 296
a362c76dbf99
parent 293
736c962f1011
child 302
b00cbbfeec7a
permissions
-rw-r--r--

add more gtk4 porting (incomplete)

0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
4 * Copyright 2017 Olaf Wintermann. All rights reserved.
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 *
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1f419bd32da1 added files
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
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 */
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 #ifndef UI_TOOLKIT_H
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 #define UI_TOOLKIT_H
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
144
29d98cff4f56 UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 142
diff changeset
32 #include <inttypes.h>
29d98cff4f56 UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 142
diff changeset
33
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 #ifdef UI_COCOA
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36 #ifdef __OBJC__
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
37 #import <Cocoa/Cocoa.h>
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 #define UIWIDGET NSView*
129
5babf09f5f19 fixes stultus commit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 128
diff changeset
39 #define UIMENU NSMenu*
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 #else
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
41 typedef void* UIWIDGET;
129
5babf09f5f19 fixes stultus commit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 128
diff changeset
42 typedef void* UIMENU;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
43 #endif
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44
292
8e5e7adf5372 add gtk4 option to the build system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 265
diff changeset
45 #elif UI_GTK2 || UI_GTK3 || UI_GTK4
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 #include <gtk/gtk.h>
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 #define UIWIDGET GtkWidget*
293
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
49
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
50 #if UI_GTK2 || UI_GTK3
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
51 #define UIMENU GtkMenu*
293
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
52 #endif
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
53 #ifdef UI_GTK4
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
54 #define UIMENU GtkPopoverMenu*
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
55 #endif
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
56
18
06be29a56f8b added menu accelerators
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
57 #define UI_GTK
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 #elif UI_MOTIF
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 #include <Xm/XmAll.h>
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 #define UIWIDGET Widget
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
63 #define UIMENU Widget
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
65 #elif defined(UI_QT4) || defined(UI_QT5)
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
66 #ifdef __cplusplus
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
67 #include <QApplication>
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
68 #include <QWidget>
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
69 #include <QMenu>
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
70 #define UIWIDGET QWidget*
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
71 #define UIMENU QMenu*
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
72 #else /* __cplusplus */
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
73 #define UIWIDGET void*
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
74 #define UIMENU void*
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
75 #endif
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
76
173
809581724cc7 add VS project
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 168
diff changeset
77 #elif UI_WINUI
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
78
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
79 #define UIEXPORT __declspec(dllexport)
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
80
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
81 #ifdef __cplusplus
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
82
205
b1ac0dd1d38b new winui vs project, add toolbar
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
83 #ifndef UI_WINUI_PCH
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
84 #include <Windows.h>
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
85 #undef GetCurrentTime
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
86 #include <winrt/Windows.Foundation.Collections.h>
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
87 #include <winrt/Windows.UI.Xaml.Interop.h>
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
88 #include <winrt/Microsoft.UI.Xaml.Controls.h>
205
b1ac0dd1d38b new winui vs project, add toolbar
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
89 #endif
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
90
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
91 class UiWindow {
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
92 public:
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
93 winrt::Microsoft::UI::Xaml::Window window { nullptr };
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
94
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
95 UiWindow(winrt::Microsoft::UI::Xaml::Window& win);
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
96 };
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
97
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
98 class UiWidget {
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
99 public:
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
100 winrt::Microsoft::UI::Xaml::UIElement uielement;
196
320d85f3cd14 add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 192
diff changeset
101 void* data1 = nullptr;
320d85f3cd14 add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 192
diff changeset
102 void* data2 = nullptr;
320d85f3cd14 add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 192
diff changeset
103 void* data3 = nullptr;
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
104 UiWidget(winrt::Microsoft::UI::Xaml::UIElement& elm);
184
8c9b4b28aaa9 implement ui_button (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 183
diff changeset
105
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
106 };
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
107
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
108 #define UIWIDGET UiWidget*
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
109 #define UIWINDOW UiWindow*
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
110 #define UIMENU void*
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
111
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
112 /*
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
113 // winrt::Microsoft::UI::Xaml::UIElement
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
114 #define UIWIDGET void*
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
115 // winrt::Microsoft::UI::Xaml::Window
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
116 #define UIWINDOW void*
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
117 #define UIMENU void*
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
118 */
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
119
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
120 #else
78
135920fe441b added initial WPF code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
121 #define UIWIDGET void*
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
122 #define UIWINDOW void*
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
123 #define UIMENU void*
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 #endif
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
126
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
127 #endif
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
128
66
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
129 #ifndef TRUE
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
130 #define TRUE 1
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
131 #endif
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
132 #ifndef FALSE
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
133 #define FALSE 0
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
134 #endif
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
135
177
e79a60b3a7cb minimal working winui app
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 173
diff changeset
136 #ifndef UIEXPORT
e79a60b3a7cb minimal working winui app
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 173
diff changeset
137 #define UIEXPORT
e79a60b3a7cb minimal working winui app
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 173
diff changeset
138 #endif
e79a60b3a7cb minimal working winui app
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 173
diff changeset
139
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 #ifdef __cplusplus
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141 extern "C" {
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 #endif
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
144 #define UI_GROUP_SELECTION 20000
208
f632bc0589ab new menu api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 205
diff changeset
145
f632bc0589ab new menu api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 205
diff changeset
146 #define UI_GROUPS(...) (int[]){ __VA_ARGS__, -1 }
22
bcf880b29bc3 textarea automatically sets selection group (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 21
diff changeset
147
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 /* public types */
59
eb6611be50c7 added box container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
149 typedef int UiBool;
eb6611be50c7 added box container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
150
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
151 typedef struct UiObject UiObject;
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
152 typedef struct UiEvent UiEvent;
95
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
153 typedef struct UiMouseEvent UiMouseEvent;
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
154 typedef struct UiObserver UiObserver;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
156 typedef struct UiInteger UiInteger;
145
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
157 typedef struct UiDouble UiDouble;
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
158 typedef struct UiString UiString;
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
159 typedef struct UiText UiText;
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
160 typedef struct UiList UiList;
118
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
161 typedef struct UiRange UiRange;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
163 typedef struct UiStr UiStr;
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
164
243
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
165 typedef struct UiFileList UiFileList;
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
166
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
167 typedef struct UiListSelection UiListSelection;
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
168
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
169 /* begin opaque types */
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
170 typedef struct UiContext UiContext;
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
171 typedef struct UiContainer UiContainer;
146
dd0ae1c62a72 new icon/image api and pixbuf support in treeview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 145
diff changeset
172
dd0ae1c62a72 new icon/image api and pixbuf support in treeview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 145
diff changeset
173 typedef struct UiIcon UiIcon;
dd0ae1c62a72 new icon/image api and pixbuf support in treeview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 145
diff changeset
174 typedef struct UiImage UiImage;
147
2e384acc89a6 adds simple drag and drop support (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 146
diff changeset
175
224
88bc21b19213 add minimal working dnd implementation (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 216
diff changeset
176 typedef struct UiDnD UiDnD;
235
9c79f00fbf36 add threadpool (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 234
diff changeset
177
9c79f00fbf36 add threadpool (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 234
diff changeset
178 typedef struct UiThreadpool UiThreadpool;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
179 /* end opaque types */
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180
52
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
181 typedef struct UiTabbedPane UiTabbedPane;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
182
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
183 typedef enum UiTri UiTri;
230
4f5b32a2a60f add icon parameter for buttons (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 224
diff changeset
184 typedef enum UiLabelType UiLabelType;
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
185
95
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
186 enum UiMouseEventType { UI_PRESS = 0, UI_PRESS2 };
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
187
230
4f5b32a2a60f add icon parameter for buttons (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 224
diff changeset
188 enum UiLabelType { UI_LABEL_DEFAULT, UI_LABEL_TEXT, UI_LABEL_ICON, UI_LABEL_TEXT_ICON };
4f5b32a2a60f add icon parameter for buttons (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 224
diff changeset
189
12
fe94e0fb9ef3 added some text functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
190
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
191
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
192 typedef void(*ui_callback)(UiEvent*, void*); /* event, user data */
12
fe94e0fb9ef3 added some text functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
193
142
46448d38885c new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 141
diff changeset
194 typedef void*(*ui_getvaluefunc)(void*, int);
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
195
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
196 typedef int(*ui_threadfunc)(void*);
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
198 typedef void(*ui_freefunc)(void*);
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
199
168
1b99acacc5bb refactor widget groups
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 167
diff changeset
200 typedef void(*ui_enablefunc)(void*, UiBool);
1b99acacc5bb refactor widget groups
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 167
diff changeset
201
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202 struct UiObject {
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
203 /*
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
204 * native widget
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
205 */
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
206 UIWIDGET widget;
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
207
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
208 #ifdef UI_WINUI
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
209 /*
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
210 * native window object
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
211 */
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
212 UIWINDOW wobj;
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
213 #endif
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
214
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
215 /*
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
216 * user window data
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
217 */
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
218 void *window;
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
219
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
220 /*
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
221 * window context
4
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
222 */
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
223 UiContext *ctx;
4
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
224
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
225 /*
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
226 * container interface
4
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
227 */
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
228 UiContainer *container;
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
229
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
230 /*
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
231 * next container object
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
232 */
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
233 UiObject *next;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 };
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235
52
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
236 struct UiTabbedPane {
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
237 /*
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
238 * native widget
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
239 */
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
240 UIWIDGET widget;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
241
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
242 /*
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
243 * current document
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
244 */
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
245 void *document;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
246
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
247 /*
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
248 * parent context
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
249 */
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
250 UiContext *ctx;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
251 };
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
252
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
253 struct UiEvent {
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
254 UiObject *obj;
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
255 void *document;
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256 void *window;
16
a499c8a72c15 added menu item lists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
257 void *eventdata;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
258 int intval;
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
259 };
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
260
95
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
261 struct UiMouseEvent {
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
262 int x;
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
263 int y;
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
264 enum UiMouseEventType type;
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
265 int button;
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
266 };
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
267
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
268 struct UiObserver {
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
269 ui_callback callback;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
270 void *data;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
271 UiObserver *next;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
272 };
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
273
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
274 struct UiStr {
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
275 char *ptr;
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
276 void (*free)(void *v);
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
277 };
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
278
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
279 struct UiInteger {
144
29d98cff4f56 UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 142
diff changeset
280 int64_t (*get)(UiInteger*);
29d98cff4f56 UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 142
diff changeset
281 void (*set)(UiInteger*, int64_t);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
282 void *obj;
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
283
145
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
284 int64_t value;
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
285 UiObserver *observers;
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
286 };
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
287
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
288 struct UiDouble {
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
289 double (*get)(UiDouble*);
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
290 void (*set)(UiDouble*, double);
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
291 void *obj;
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
292
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
293 double value;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
294 UiObserver *observers;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295 };
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
297 struct UiString {
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
298 char* (*get)(UiString*);
192
bcacd00ea955 implement textfield (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 186
diff changeset
299 void (*set)(UiString*, const char*);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
300 void *obj;
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
301
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
302 UiStr value;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
303 UiObserver *observers;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
304 };
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
305
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
306 struct UiText {
253
087cc9216f28 initial newapi GTK port
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 251
diff changeset
307 void (*set)(UiText*, const char*);
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
308 char* (*get)(UiText*);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
309 char* (*getsubstr)(UiText*, int, int); /* text, begin, end */
12
fe94e0fb9ef3 added some text functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
310 void (*insert)(UiText*, int, char*);
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
311 void (*setposition)(UiText*,int);
26
a137277f9173 added copy & paste (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 24
diff changeset
312 int (*position)(UiText*);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
313 void (*selection)(UiText*, int*, int*); /* text, begin, end */
29
c96169444d88 added locale support (Cocoa) and ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 26
diff changeset
314 int (*length)(UiText*);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
315 void (*remove)(UiText*, int, int); /* text, begin, end */
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
316 UiStr value;
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
317 int pos;
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
318 void *obj;
6
05a18c56d9ca added undo for text
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 5
diff changeset
319 void *undomgr;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
320 // TODO: replacefunc, ...
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
321 UiObserver *observers;
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
322 };
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
323
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
324 /*
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
325 * abstract list
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
326 */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
327 struct UiList {
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
328 /* get the first element */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
329 void*(*first)(UiList *list);
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
330 /* get the next element */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
331 void*(*next)(UiList *list);
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
332 /* get the nth element */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
333 void*(*get)(UiList *list, int i);
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
334 /* get the number of elements */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
335 int(*count)(UiList *list);
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
336 /* iterator changes after first() next() and get() */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
337 void *iter;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
338 /* private - implementation dependent */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
339 void *data;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
340
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
341 /* binding functions */
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
342 void (*update)(UiList *list, int i);
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
343 UiListSelection (*getselection)(UiList *list);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
344 /* binding object */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
345 void *obj;
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
346
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
347 /* list of observers */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
348 UiObserver *observers;
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
349 };
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
350
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
351
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
352 struct UiListSelection {
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
353 /*
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
354 * number of selected items
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
355 */
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
356 int count;
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
357
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
358 /*
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
359 * indices of selected rows
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
360 */
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
361 int *rows;
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
362 };
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
363
118
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
364 struct UiRange {
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
365 double (*get)(UiRange *range);
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
366 void (*set)(UiRange *range, double value);
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
367 void (*setrange)(UiRange *range, double min, double max);
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
368 void (*setextent)(UiRange *range, double extent);
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
369 double value;
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
370 double min;
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
371 double max;
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
372 double extent;
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
373 void *obj;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
374 /* list of observers */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
375 UiObserver *observers;
118
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
376 };
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
377
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
378 enum UiTri {
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
379 UI_DEFAULT = 0,
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
380 UI_ON,
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
381 UI_OFF
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
382 };
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
383
243
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
384 struct UiFileList {
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
385 char **files;
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
386 size_t nfiles;
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
387 };
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
388
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
389
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
390 UIEXPORT void ui_init(const char *appname, int argc, char **argv);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
391 UIEXPORT const char* ui_appname();
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
392
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
393 UIEXPORT UiContext* ui_global_context(void);
167
161511838ea6 add new toolbar toggle button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 163
diff changeset
394
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
395 UIEXPORT void ui_context_closefunc(UiContext *ctx, ui_callback fnc, void *udata);
111
40dbf1a7526a added close handler to UiContext (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 109
diff changeset
396
247
4b21af9d8c5a call context close handler on window close (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 246
diff changeset
397 UIEXPORT void ui_context_destroy(UiContext *ctx);
4b21af9d8c5a call context close handler on window close (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 246
diff changeset
398
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
399 UIEXPORT void ui_onstartup(ui_callback f, void *userdata);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
400 UIEXPORT void ui_onopen(ui_callback f, void *userdata);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
401 UIEXPORT void ui_onexit(ui_callback f, void *userdata);
133
6dd780cbc8c6 using GtkApplication now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 129
diff changeset
402
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
403 UIEXPORT void ui_main();
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
404 UIEXPORT void ui_show(UiObject *obj);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
405 UIEXPORT void ui_close(UiObject *obj);
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
406
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
407 UIEXPORT void ui_job(UiObject *obj, ui_threadfunc tf, void *td, ui_callback f, void *fd);
234
9036b346cd66 implement ui_job() and add ui_call_mainthread (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 231
diff changeset
408 UIEXPORT void ui_call_mainthread(ui_threadfunc tf, void* td);
235
9c79f00fbf36 add threadpool (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 234
diff changeset
409 UIEXPORT UiThreadpool* ui_threadpool_create(int nthreads);
9c79f00fbf36 add threadpool (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 234
diff changeset
410 UIEXPORT void ui_threadpool_destroy(UiThreadpool* pool);
9c79f00fbf36 add threadpool (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 234
diff changeset
411 UIEXPORT void ui_threadpool_job(UiThreadpool* pool, UiObject* obj, ui_threadfunc tf, void* td, ui_callback f, void* fd);
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
412
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
413 UIEXPORT void* ui_document_new(size_t size);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
414 UIEXPORT void ui_document_destroy(void *doc);
52
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
415
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
416 UIEXPORT void ui_set_document(UiObject *obj, void *document); // deprecated
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
417 UIEXPORT void ui_detach_document(UiObject *obj); // deprecated
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
418 UIEXPORT void* ui_get_document(UiObject *obj); // deprecated
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
419 UIEXPORT void ui_set_subdocument(void *document, void *sub); // deprecated
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
420 UIEXPORT void ui_detach_subdocument(void *document, void *sub); // deprecated
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
421 UIEXPORT void* ui_get_subdocument(void *document); // deprecated
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
422
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
423 UIEXPORT UiContext* ui_document_context(void *doc);
37
56016468753d refactored value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 35
diff changeset
424
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
425 UIEXPORT void ui_attach_document(UiContext *ctx, void *document);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
426 UIEXPORT void ui_detach_document2(UiContext *ctx, void *document);
38
8ccdde37275b added some allocation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
427
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
428 UIEXPORT void ui_widget_set_groups(UiContext *ctx, UIWIDGET widget, ui_enablefunc enable, ...);
168
1b99acacc5bb refactor widget groups
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 167
diff changeset
429
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
430 UIEXPORT void ui_set_group(UiContext *ctx, int group);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
431 UIEXPORT void ui_unset_group(UiContext *ctx, int group);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
432 UIEXPORT int* ui_active_groups(UiContext *ctx, int *ngroups);
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
433
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
434 UIEXPORT void* ui_malloc(UiContext *ctx, size_t size);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
435 UIEXPORT void* ui_calloc(UiContext *ctx, size_t nelem, size_t elsize);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
436 UIEXPORT void ui_free(UiContext *ctx, void *ptr);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
437 UIEXPORT void* ui_realloc(UiContext *ctx, void *ptr, size_t size);
38
8ccdde37275b added some allocation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
438
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
439 // types
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
440
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
441 UIEXPORT UiInteger* ui_int_new(UiContext *ctx, char *name);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
442 UIEXPORT UiDouble* ui_double_new(UiContext *ctx, char *name);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
443 UIEXPORT UiString* ui_string_new(UiContext *ctx, char *name);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
444 UIEXPORT UiText* ui_text_new(UiContext *ctx, char *name);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
445 UIEXPORT UiRange* ui_range_new(UiContext *ctx, char *name);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
446
231
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
447 #define ui_get(v) _Generic(v, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
448 UiInteger*: ui_int_get, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
449 UiDouble*: ui_double_get, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
450 UiString*: ui_string_get, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
451 UiText*:ui_text_get) (v)
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
452
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
453 #define ui_set(v, n) _Generic(v, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
454 UiInteger*: ui_int_set, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
455 UiDouble*: ui_double_set, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
456 UiString*: ui_string_set, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
457 UiText*:ui_text_set) (v, n)
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
458
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
459 UIEXPORT void ui_int_set(UiInteger *i, int64_t value);
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
460 UIEXPORT int64_t ui_int_get(UiInteger *i);
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
461 UIEXPORT void ui_double_set(UiDouble *d, double value);
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
462 UIEXPORT double ui_double_get(UiDouble *d);
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
463 UIEXPORT void ui_string_set(UiString *s, const char *value);
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
464 UIEXPORT char* ui_string_get(UiString *s);
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
465 UIEXPORT void ui_text_set(UiText *s, const char* value);
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
466 UIEXPORT char* ui_text_get(UiText *s);
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
467
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
468
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
469 UIEXPORT UiObserver* ui_observer_new(ui_callback f, void *data);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
470 UIEXPORT UiObserver* ui_obsvlist_add(UiObserver *list, UiObserver *observer);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
471 UIEXPORT UiObserver* ui_add_observer(UiObserver *list, ui_callback f, void *data);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
472 UIEXPORT void ui_notify(UiObserver *observer, void *data);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
473 UIEXPORT void ui_notify_except(UiObserver *observer, UiObserver *exc, void *data);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
474 UIEXPORT void ui_notify_evt(UiObserver *observer, UiEvent *event);
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
475
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
476
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
477 UIEXPORT UiList* ui_list_new(UiContext *ctx, char *name);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
478 UIEXPORT void* ui_list_first(UiList *list);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
479 UIEXPORT void* ui_list_next(UiList *list);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
480 UIEXPORT void* ui_list_get(UiList *list, int i);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
481 UIEXPORT int ui_list_count(UiList *list);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
482 UIEXPORT void ui_list_append(UiList *list, void *data);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
483 UIEXPORT void ui_list_prepend(UiList *list, void *data);
251
22dc0b739dd8 add list remove function
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 249
diff changeset
484 UIEXPORT void ui_list_remove(UiList *list, int i);
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
485 UIEXPORT void ui_list_clear(UiList *list);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
486 UIEXPORT void ui_list_addobsv(UiList *list, ui_callback f, void *data);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
487 UIEXPORT void ui_list_notify(UiList *list);
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
488
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
489 UIEXPORT UiListSelection ui_list_getselection(UiList *list);
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
490
246
b19f3098dd11 add missing UIEXPORT
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 243
diff changeset
491 UIEXPORT UiFileList ui_filelist_copy(UiFileList list);
b19f3098dd11 add missing UIEXPORT
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 243
diff changeset
492 UIEXPORT void ui_filelist_free(UiFileList list);
243
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
493
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
494 UIEXPORT void ui_clipboard_set(char *str);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
495 UIEXPORT char* ui_clipboard_get();
1
eb5269000bc8 added some document functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
496
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
497 UIEXPORT void ui_add_image(char *imgname, char *filename); // TODO: remove?
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
498
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
499 // general widget functions
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
500 UIEXPORT void ui_set_enabled(UIWIDGET widget, int enabled);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
501 UIEXPORT void ui_set_show_all(UIWIDGET widget, int value);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
502 UIEXPORT void ui_set_visible(UIWIDGET widget, int visible);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
503
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
504
215
1bd5534c395d add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 208
diff changeset
505
249
4df7c366cff7 copy UiList getselection fptr in uic_copy_binding
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 248
diff changeset
506 UIEXPORT void ui_listselection_free(UiListSelection selection);
215
1bd5534c395d add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 208
diff changeset
507
1bd5534c395d add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 208
diff changeset
508 UIEXPORT UiIcon* ui_icon(const char* name, size_t size);
265
3756725aeaf4 implement new icon API (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 253
diff changeset
509 UIEXPORT UiIcon* ui_icon_unscaled(const char *name, int size);
215
1bd5534c395d add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 208
diff changeset
510 UIEXPORT UiIcon* ui_imageicon(const char* file);
1bd5534c395d add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 208
diff changeset
511 UIEXPORT void ui_icon_free(UiIcon* icon);
1bd5534c395d add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 208
diff changeset
512
216
391c2c723029 add dll icon loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 215
diff changeset
513 UIEXPORT UiIcon* ui_foldericon(size_t size);
391c2c723029 add dll icon loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 215
diff changeset
514 UIEXPORT UiIcon* ui_fileicon(size_t size);
215
1bd5534c395d add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 208
diff changeset
515
241
c51dd0e9ecb7 add support for table string values, that need to be freed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 235
diff changeset
516
246
b19f3098dd11 add missing UIEXPORT
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 243
diff changeset
517 UIEXPORT UiStr ui_str(char *cstr);
b19f3098dd11 add missing UIEXPORT
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 243
diff changeset
518 UIEXPORT UiStr ui_str_free(char *str, void (*free)(void *v));
241
c51dd0e9ecb7 add support for table string values, that need to be freed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 235
diff changeset
519
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
520 #ifdef __cplusplus
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
521 }
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
522 #endif
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
523
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
524 #endif /* UI_TOOLKIT_H */
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
525

mercurial