ui/ui/toolkit.h

10 days ago

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 26 Mar 2025 20:27:20 +0100 (10 days ago)
changeset 515
9e18cb8c4412
parent 514
f1662be4eab6
child 516
4b31c74666d7
permissions
-rw-r--r--

remove enum forward declarations

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>
514
f1662be4eab6 re-enable qt5 toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 510
diff changeset
33 #include <stdlib.h>
144
29d98cff4f56 UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 142
diff changeset
34
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 #ifdef UI_COCOA
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
37 #include <stdlib.h>
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
38 #ifdef __OBJC__
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
39 #import <Cocoa/Cocoa.h>
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
40 #endif
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
41 typedef void* UIWIDGET; // NSView*
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
42 typedef void* UIWINDOW; // NSWindow*
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
43 typedef void* UIMENU; // NSMenu*
0
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
443
3379c8a5b6bb implement ui_customwidget_create for Motif
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 411
diff changeset
46 #define UI_GTK
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48 #include <gtk/gtk.h>
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 #define UIWIDGET GtkWidget*
293
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
50
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
51 #if UI_GTK2 || UI_GTK3
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
52 #define UIMENU GtkMenu*
293
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
53 #endif
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
54 #ifdef UI_GTK4
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
55 #define UIMENU GtkPopoverMenu*
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
56 #endif
736c962f1011 initial gtk4 porting, incomplete
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 292
diff changeset
57
18
06be29a56f8b added menu accelerators
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
58 #define UI_GTK
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59
302
b00cbbfeec7a add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 293
diff changeset
60 #ifdef UI_LIBADWAITA
b00cbbfeec7a add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 293
diff changeset
61 #include <adwaita.h>
b00cbbfeec7a add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 293
diff changeset
62 #endif
b00cbbfeec7a add libadwaita toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 293
diff changeset
63
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
64 #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
65 #ifdef __cplusplus
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
66 #include <QApplication>
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
67 #include <QWidget>
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
68 #include <QMenu>
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
69 #define UIWIDGET QWidget*
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
70 #define UIMENU QMenu*
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
71 #else /* __cplusplus */
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
72 #define UIWIDGET void*
514
f1662be4eab6 re-enable qt5 toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 510
diff changeset
73 #define UIWINDOW 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
514
f1662be4eab6 re-enable qt5 toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 510
diff changeset
77 #elif UI_MOTIF
f1662be4eab6 re-enable qt5 toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 510
diff changeset
78
f1662be4eab6 re-enable qt5 toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 510
diff changeset
79 #include <Xm/XmAll.h>
f1662be4eab6 re-enable qt5 toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 510
diff changeset
80 #define UIWIDGET Widget
f1662be4eab6 re-enable qt5 toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 510
diff changeset
81 #define UIMENU Widget
f1662be4eab6 re-enable qt5 toolkit option
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 510
diff changeset
82
510
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
83
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
84 #elif UI_WIN32
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
85
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
86 #include <Windows.h>
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
87
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
88 #define UIEXPORT __declspec(dllexport)
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
89
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
90 #define UIWIDGET void*
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
91 #define UIWINDOW void*
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
92 #define UIMENU void*
9f562a7de4a2 prepare buildsystem for win32
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 498
diff changeset
93
173
809581724cc7 add VS project
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 168
diff changeset
94 #elif UI_WINUI
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
95
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
96 #define UIEXPORT __declspec(dllexport)
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
97
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
98 #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
99
379
958bae372271 implement ui_dialog_window (WINUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
100 #include <functional>
205
b1ac0dd1d38b new winui vs project, add toolbar
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 201
diff changeset
101 #ifndef UI_WINUI_PCH
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
102 #include <Windows.h>
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
103 #undef GetCurrentTime
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
104 #include <winrt/Windows.Foundation.Collections.h>
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
105 #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
106 #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
107 #endif
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
108
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
109 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
110 public:
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
111 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
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 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
114 };
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
115
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
116 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
117 public:
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
118 winrt::Microsoft::UI::Xaml::UIElement uielement;
196
320d85f3cd14 add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 192
diff changeset
119 void* data1 = nullptr;
320d85f3cd14 add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 192
diff changeset
120 void* data2 = nullptr;
320d85f3cd14 add listview (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 192
diff changeset
121 void* data3 = nullptr;
379
958bae372271 implement ui_dialog_window (WINUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 378
diff changeset
122 std::function<void()> Show;
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
123 UiWidget(winrt::Microsoft::UI::Xaml::UIElement& elm);
184
8c9b4b28aaa9 implement ui_button (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 183
diff changeset
124
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
125 };
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
126
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
127 #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
128 #define UIWINDOW UiWindow*
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
129 #define UIMENU void*
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
130
183
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
131 /*
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
132 // 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
133 #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
134 // 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
135 #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
136 #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
137 */
3ce2eb11913b create WinUI wrapper classes for usage in UiObject and widget creation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 181
diff changeset
138
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
139 #else
78
135920fe441b added initial WPF code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
140 #define UIWIDGET void*
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
141 #define UIWINDOW void*
115
102fc0b8fe3e improved context menus
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 111
diff changeset
142 #define UIMENU void*
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143 #endif
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
145
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
146 #endif
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
147
66
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
148 #ifndef TRUE
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
149 #define TRUE 1
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
150 #endif
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
151 #ifndef FALSE
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
152 #define FALSE 0
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
153 #endif
8d490d97aab8 added button and box container (Qt)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 64
diff changeset
154
177
e79a60b3a7cb minimal working winui app
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 173
diff changeset
155 #ifndef UIEXPORT
e79a60b3a7cb minimal working winui app
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 173
diff changeset
156 #define UIEXPORT
e79a60b3a7cb minimal working winui app
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 173
diff changeset
157 #endif
e79a60b3a7cb minimal working winui app
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 173
diff changeset
158
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159 #ifdef __cplusplus
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160 extern "C" {
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161 #endif
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
163 #define UI_GROUP_SELECTION 20000
208
f632bc0589ab new menu api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 205
diff changeset
164
343
54f5d7eb1335 implement widget groups for buttons (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 342
diff changeset
165 #define UI_GROUPS(...) (const int[]){ __VA_ARGS__, -1 }
22
bcf880b29bc3 textarea automatically sets selection group (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 21
diff changeset
166
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167 /* public types */
476
31213068c2ba fix build (WINUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 467
diff changeset
168 #ifndef __cplusplus
411
3e91b7aff6a1 add sourcelist widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 406
diff changeset
169 typedef _Bool UiBool;
476
31213068c2ba fix build (WINUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 467
diff changeset
170 #else
31213068c2ba fix build (WINUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 467
diff changeset
171 typedef bool UiBool;
31213068c2ba fix build (WINUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 467
diff changeset
172 #endif
59
eb6611be50c7 added box container (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 54
diff changeset
173
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
174 typedef struct UiObject UiObject;
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
175 typedef struct UiContainerX UiContainerX;
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
176 typedef struct UiEvent UiEvent;
95
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
177 typedef struct UiMouseEvent UiMouseEvent;
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
178 typedef struct UiObserver UiObserver;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
180 typedef struct UiInteger UiInteger;
145
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
181 typedef struct UiDouble UiDouble;
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
182 typedef struct UiString UiString;
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
183 typedef struct UiText UiText;
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
184 typedef struct UiList UiList;
118
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
185 typedef struct UiRange UiRange;
337
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
186 typedef struct UiGeneric UiGeneric;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
188 typedef struct UiStr UiStr;
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
189
243
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
190 typedef struct UiFileList UiFileList;
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
191
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
192 typedef struct UiListSelection UiListSelection;
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
193
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
194 /* begin opaque types */
388
473c03f85197 add menu builder API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 387
diff changeset
195 typedef struct UiContext UiContext;
473c03f85197 add menu builder API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 387
diff changeset
196 typedef struct UiContainer UiContainer;
473c03f85197 add menu builder API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 387
diff changeset
197 typedef struct UiMenuBuilder UiMenuBuilder;
146
dd0ae1c62a72 new icon/image api and pixbuf support in treeview (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 145
diff changeset
198
388
473c03f85197 add menu builder API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 387
diff changeset
199 typedef struct UiIcon UiIcon;
473c03f85197 add menu builder API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 387
diff changeset
200 typedef struct UiImage UiImage;
147
2e384acc89a6 adds simple drag and drop support (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 146
diff changeset
201
388
473c03f85197 add menu builder API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 387
diff changeset
202 typedef struct UiDnD UiDnD;
235
9c79f00fbf36 add threadpool (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 234
diff changeset
203
388
473c03f85197 add menu builder API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 387
diff changeset
204 typedef struct UiThreadpool UiThreadpool;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
205 /* end opaque types */
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206
52
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
207 typedef struct UiTabbedPane UiTabbedPane;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
208
515
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
209 typedef enum UiTri {
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
210 UI_DEFAULT = 0,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
211 UI_ON,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
212 UI_OFF
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
213 } UiTri;
186
5db4979bf482 implement new api style for ui_button (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 184
diff changeset
214
394
bedd499b640d implement table dnd (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 388
diff changeset
215
95
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
216 enum UiMouseEventType { UI_PRESS = 0, UI_PRESS2 };
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
217
515
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
218 typedef enum UiLabelType {
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
219 UI_LABEL_DEFAULT,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
220 UI_LABEL_TEXT,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
221 UI_LABEL_ICON,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
222 UI_LABEL_TEXT_ICON
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
223 } UiLabelType;
230
4f5b32a2a60f add icon parameter for buttons (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 224
diff changeset
224
515
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
225 typedef enum UiDnDAction {
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
226 UI_DND_ACTION_NONE,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
227 UI_DND_ACTION_COPY,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
228 UI_DND_ACTION_MOVE,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
229 UI_DND_ACTION_LINK,
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
230 UI_DND_ACTION_CUSTOM
9e18cb8c4412 remove enum forward declarations
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 514
diff changeset
231 } UiDndAction;
33
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 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
234
142
46448d38885c new checkbox and radionbutton features and more refactoring
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 141
diff changeset
235 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
236
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
237 typedef int(*ui_threadfunc)(void*);
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
239 typedef void(*ui_freefunc)(void*);
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
240
343
54f5d7eb1335 implement widget groups for buttons (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 342
diff changeset
241 typedef void(*ui_enablefunc)(void*, int);
168
1b99acacc5bb refactor widget groups
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 167
diff changeset
242
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
243 struct UiObject {
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
244 /*
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
245 * native widget
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
246 */
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
247 UIWIDGET widget;
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
248
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
249 #if defined(UI_COCOA) || defined(UI_WINUI)
181
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
250 /*
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
251 * native window object
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
252 */
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
253 UIWINDOW wobj;
c52d88ea020b redefine UIWIDGET, remove widget abstraction class (WinUI)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 177
diff changeset
254 #endif
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
255
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
256 /*
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
257 * user window data
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
258 */
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
259 void *window;
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
260
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
261 /*
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
262 * window context
4
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
263 */
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
264 UiContext *ctx;
4
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
265
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
266 /*
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
267 * container interface (deprecated)
4
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
268 */
39b9b86ec452 added simple container
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
269 UiContainer *container;
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
270
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
271 /*
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
272 * container list
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
273 * TODO: remove old UiContainer and rename UiContainerX to UiContainer
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
274 */
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
275 UiContainerX *container_begin;
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
276 UiContainerX *container_end;
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
277
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
278 /*
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
279 * next container object
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
280 */
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
281 UiObject *next;
383
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
282
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
283 /*
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
284 * obj destroy func
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
285 */
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
286 void (*destroy)(UiObject *obj);
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
287
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
288 /*
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
289 * reference counter
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
290 */
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
291 unsigned int ref;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
292 };
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
293
52
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
294 struct UiTabbedPane {
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
295 /*
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
296 * native widget
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
297 */
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
298 UIWIDGET widget;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
299
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
300 /*
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
301 * current document
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
302 */
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
303 void *document;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
304
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
305 /*
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
306 * parent context
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
307 */
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
308 UiContext *ctx;
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
309 };
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
310
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
311 struct UiEvent {
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
312 UiObject *obj;
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
313 void *document;
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
314 void *window;
16
a499c8a72c15 added menu item lists (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
315 void *eventdata;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
316 int intval;
497
bf53d553e3dc add UiEvent set for indicating, if the event was triggered by ui_set
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 491
diff changeset
317 int set;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
318 };
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
319
95
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
320 struct UiMouseEvent {
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
321 int x;
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
322 int y;
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
323 enum UiMouseEventType type;
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
324 int button;
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
325 };
29f5cd5f5367 added drawing area (Gtk)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 94
diff changeset
326
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
327 struct UiObserver {
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
328 ui_callback callback;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
329 void *data;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
330 UiObserver *next;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
331 };
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
332
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
333 struct UiStr {
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
334 char *ptr;
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
335 void (*free)(void *v);
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
336 };
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
337
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
338 struct UiInteger {
144
29d98cff4f56 UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 142
diff changeset
339 int64_t (*get)(UiInteger*);
29d98cff4f56 UiInteger uses int64 now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 142
diff changeset
340 void (*set)(UiInteger*, int64_t);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
341 void *obj;
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
342
145
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
343 int64_t value;
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
344 UiObserver *observers;
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
345 };
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
346
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
347 struct UiDouble {
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
348 double (*get)(UiDouble*);
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
349 void (*set)(UiDouble*, double);
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
350 void *obj;
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
351
853685152c1d adds spinner widget (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 144
diff changeset
352 double value;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
353 UiObserver *observers;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
354 };
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
355
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
356 struct UiString {
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
357 char* (*get)(UiString*);
192
bcacd00ea955 implement textfield (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 186
diff changeset
358 void (*set)(UiString*, const char*);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
359 void *obj;
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
360
141
cc2170ea05ad improves doc detach and string value handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 140
diff changeset
361 UiStr value;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
362 UiObserver *observers;
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
363 };
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
364
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
365 struct UiText {
486
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
366 void (*save)(UiText*);
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
367 void (*destroy)(UiText*);
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
368 void (*restore)(UiText*);
253
087cc9216f28 initial newapi GTK port
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 251
diff changeset
369 void (*set)(UiText*, const char*);
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
370 char* (*get)(UiText*);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
371 char* (*getsubstr)(UiText*, int, int); /* text, begin, end */
12
fe94e0fb9ef3 added some text functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
372 void (*insert)(UiText*, int, char*);
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
373 void (*setposition)(UiText*,int);
26
a137277f9173 added copy & paste (Cocoa)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 24
diff changeset
374 int (*position)(UiText*);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
375 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
376 int (*length)(UiText*);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
377 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
378 UiStr value;
90
2019fdbaadfd persistent textarea cursor position
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 78
diff changeset
379 int pos;
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
380 void *obj;
486
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
381 int datatype;
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
382 void *data1;
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
383 void *data2;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
384 // TODO: replacefunc, ...
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
385 UiObserver *observers;
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
386 };
337
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
387
486
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
388 /* UiText.datatype */
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
389 #define UI_TEXT_TYPE_BUFFER 1
a5f3abf8b9d1 refactor textarea to store a text buffer object in UiText values (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 476
diff changeset
390
337
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
391 struct UiGeneric {
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
392 void* (*get)(UiGeneric*);
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
393 const char* (*get_type)(UiGeneric*);
339
b68b5f984074 add minimally working image viewer (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 337
diff changeset
394 int (*set)(UiGeneric*, void *, const char *type);
337
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
395 void *obj;
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
396
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
397 void *value;
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
398 const char *type;
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
399 UiObserver *observers;
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
400 };
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
401
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
402 /*
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
403 * abstract list
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
404 */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
405 struct UiList {
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
406 /* get the first element */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
407 void*(*first)(UiList *list);
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
408 /* get the next element */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
409 void*(*next)(UiList *list);
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
410 /* get the nth element */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
411 void*(*get)(UiList *list, int i);
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
412 /* get the number of elements */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
413 int(*count)(UiList *list);
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
414 /* iterator changes after first() next() and get() */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
415 void *iter;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
416 /* private - implementation dependent */
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
417 void *data;
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
418
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
419 /* binding functions */
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
420 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
421 UiListSelection (*getselection)(UiList *list);
360
681b930abe84 implement combobox get/set selection (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 347
diff changeset
422 void (*setselection)(UiList *list, UiListSelection selection);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
423 /* binding object */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
424 void *obj;
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
425
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
426 /* list of observers */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
427 UiObserver *observers;
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
428 };
5
19d37cb9c96c added textarea
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
429
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
430
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
431 struct UiListSelection {
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
432 /*
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
433 * number of selected items
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
434 */
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
435 int count;
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
436
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
437 /*
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
438 * indices of selected rows
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
439 */
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
440 int *rows;
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
441 };
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
442
118
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
443 struct UiRange {
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
444 double (*get)(UiRange *range);
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
445 void (*set)(UiRange *range, double value);
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
446 void (*setrange)(UiRange *range, double min, double max);
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
447 void (*setextent)(UiRange *range, double extent);
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
448 double value;
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
449 double min;
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
450 double max;
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
451 double extent;
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
452 void *obj;
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
453 /* list of observers */
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
454 UiObserver *observers;
118
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
455 };
bb21210e9cac added scrollbar (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 116
diff changeset
456
243
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
457 struct UiFileList {
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
458 char **files;
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
459 size_t nfiles;
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
460 };
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
461
347
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
462 typedef struct UiCondVar {
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
463 void *data;
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
464 int intdata;
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
465 } UiCondVar;
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
466
33
458831c574f4 added listview, sidebar and toolbar image button (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 29
diff changeset
467
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
468 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
469 UIEXPORT const char* ui_appname();
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
470
491
beb5963c3501 add ui_add_styledata function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 486
diff changeset
471 UIEXPORT void ui_add_styledata(const char *styledata, int len);
beb5963c3501 add ui_add_styledata function (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 486
diff changeset
472
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
473 UIEXPORT UiContext* ui_global_context(void);
167
161511838ea6 add new toolbar toggle button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 163
diff changeset
474
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
475 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
476
247
4b21af9d8c5a call context close handler on window close (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 246
diff changeset
477 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
478
383
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
479 UIEXPORT void ui_object_ref(UiObject *obj);
406
0ebf9d7b23e8 add first code of the new Motif implementation, implement buttons
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 404
diff changeset
480 UIEXPORT int ui_object_unref(UiObject *obj);
383
03599608d555 add UiObject reference counting (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 379
diff changeset
481
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
482 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
483 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
484 UIEXPORT void ui_onexit(ui_callback f, void *userdata);
133
6dd780cbc8c6 using GtkApplication now
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 129
diff changeset
485
404
384f6d1f5784 add first working cocoa code
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 394
diff changeset
486 UIEXPORT void ui_main(void);
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
487 UIEXPORT void ui_show(UiObject *obj);
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
488 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
489
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
490 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
491 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
492 UIEXPORT UiThreadpool* ui_threadpool_create(int nthreads);
9c79f00fbf36 add threadpool (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 234
diff changeset
493 UIEXPORT void ui_threadpool_destroy(UiThreadpool* pool);
9c79f00fbf36 add threadpool (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 234
diff changeset
494 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
495
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
496 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
497 UIEXPORT void ui_document_destroy(void *doc);
52
25e5390cce41 added document tabview (GTK, Motif)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 38
diff changeset
498
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
499 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
500 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
501 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
502 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
503 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
504 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
505
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
506 UIEXPORT UiContext* ui_document_context(void *doc);
37
56016468753d refactored value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 35
diff changeset
507
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
508 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
509 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
510
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
511 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
512
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
513 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
514 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
515 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
516
342
99f83fbf48e9 implement context destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 341
diff changeset
517 UIEXPORT void* ui_allocator(UiContext *ctx);
387
80edb1a93f7a add public function for getting the UiContext UCX mempool
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 383
diff changeset
518 UIEXPORT void* ui_cx_mempool(UiContext *ctx);
80edb1a93f7a add public function for getting the UiContext UCX mempool
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 383
diff changeset
519
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
520 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
521 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
522 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
523 UIEXPORT void* ui_realloc(UiContext *ctx, void *ptr, size_t size);
342
99f83fbf48e9 implement context destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 341
diff changeset
524 UIEXPORT char* ui_strdup(UiContext *ctx, const char *str);
38
8ccdde37275b added some allocation functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 37
diff changeset
525
14
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
526 // types
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
527
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
528 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
529 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
530 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
531 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
532 UIEXPORT UiRange* ui_range_new(UiContext *ctx, char *name);
337
2904fba2708b add UiGeneric var type
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 302
diff changeset
533 UIEXPORT UiGeneric* ui_generic_new(UiContext *ctx, char *name);
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
534
231
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
535 #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
536 UiInteger*: ui_int_get, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
537 UiDouble*: ui_double_get, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
538 UiString*: ui_string_get, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
539 UiText*:ui_text_get) (v)
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
540
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
541 #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
542 UiInteger*: ui_int_set, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
543 UiDouble*: ui_double_set, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
544 UiString*: ui_string_set, \
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
545 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
546
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
547 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
548 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
549 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
550 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
551 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
552 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
553 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
554 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
555
341
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
556 UIEXPORT void ui_var_set_int(UiContext *ctx, const char *name, int64_t value);
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
557 UIEXPORT int64_t ui_var_get_int(UiContext *ctx, const char *name);
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
558 UIEXPORT void ui_var_set_double(UiContext *ctx, const char *name, double value);
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
559 UIEXPORT double ui_var_get_double(UiContext *ctx, const char *name);
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
560 UIEXPORT void ui_var_set_string(UiContext *ctx, const char *name, char *value);
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
561 UIEXPORT char* ui_var_get_string(UiContext *ctx, const char *name);
231
e160bb392148 add getter/setter for ui number/string types
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 230
diff changeset
562
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
563 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
564 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
565 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
566 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
567 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
568 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
569
e2fd132ab781 added menu item lists (Cocoa implementation)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
570
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
571 UIEXPORT UiList* ui_list_new(UiContext *ctx, char *name);
467
08e0a66d3bd6 make ui_list_free public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 443
diff changeset
572 UIEXPORT void ui_list_free(UiList *list);
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
573 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
574 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
575 UIEXPORT void* ui_list_get(UiList *list, int i);
342
99f83fbf48e9 implement context destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 341
diff changeset
576 UIEXPORT int ui_list_count(UiList *list);
99f83fbf48e9 implement context destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 341
diff changeset
577 UIEXPORT void ui_list_append(UiList *list, void *data);
99f83fbf48e9 implement context destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 341
diff changeset
578 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
579 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
580 UIEXPORT void ui_list_clear(UiList *list);
342
99f83fbf48e9 implement context destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 341
diff changeset
581 UIEXPORT void ui_list_update(UiList *list);
99f83fbf48e9 implement context destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 341
diff changeset
582 UIEXPORT void ui_list_addobsv(UiList *list, ui_callback f, void *data);
99f83fbf48e9 implement context destroy
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 341
diff changeset
583 UIEXPORT void ui_list_notify(UiList *list);
2
eeb50c534497 added support for replaceable documents
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
584
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
585 UIEXPORT UiListSelection ui_list_getselection(UiList *list);
360
681b930abe84 implement combobox get/set selection (GTK)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 347
diff changeset
586 UIEXPORT void ui_list_setselection(UiList *list, int index);
248
22257f5f4019 add getter for list selections (Common, WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 247
diff changeset
587
246
b19f3098dd11 add missing UIEXPORT
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 243
diff changeset
588 UIEXPORT UiFileList ui_filelist_copy(UiFileList list);
b19f3098dd11 add missing UIEXPORT
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 243
diff changeset
589 UIEXPORT void ui_filelist_free(UiFileList list);
243
9f66c31a27ed implement table dnd drop
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 241
diff changeset
590
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
591 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
592 UIEXPORT char* ui_clipboard_get();
1
eb5269000bc8 added some document functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
593
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
594 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
595
140
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
596 // general widget functions
201
7f67ebbb0c1c add UIEXPORT macro to create a dll
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 196
diff changeset
597 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
598 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
599 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
600
c03c338a7dcf refactors value binding system
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 133
diff changeset
601
215
1bd5534c395d add support for icons in the table widget (WinUI3)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 208
diff changeset
602
249
4df7c366cff7 copy UiList getselection fptr in uic_copy_binding
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 248
diff changeset
603 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
604
241
c51dd0e9ecb7 add support for table string values, that need to be freed
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 235
diff changeset
605
246
b19f3098dd11 add missing UIEXPORT
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 243
diff changeset
606 UIEXPORT UiStr ui_str(char *cstr);
b19f3098dd11 add missing UIEXPORT
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 243
diff changeset
607 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
608
341
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
609
378
d41b1ffc5f77 implement some missing WinUI functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 360
diff changeset
610 UIEXPORT char* ui_getappdir(void);
341
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
611 UIEXPORT char* ui_configfile(char *name);
c7427cadabd3 make ui_getappdir() and ui_configfile() public
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 339
diff changeset
612
347
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
613 UIEXPORT UiCondVar* ui_condvar_create(void);
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
614 UIEXPORT void ui_condvar_wait(UiCondVar *var);
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
615 UIEXPORT void ui_condvar_signal(UiCondVar *var, void *data, int intdata);
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
616 UIEXPORT void ui_condvar_destroy(UiCondVar *var);
6f0d0b0d97f5 add conditional variable API
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 343
diff changeset
617
497
bf53d553e3dc add UiEvent set for indicating, if the event was triggered by ui_set
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 491
diff changeset
618 UIEXPORT void ui_setop_enable(int set);
498
3688266cab3c add missing setop functions
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 497
diff changeset
619 UIEXPORT int ui_get_setop(void);
497
bf53d553e3dc add UiEvent set for indicating, if the event was triggered by ui_set
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 491
diff changeset
620
0
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
621 #ifdef __cplusplus
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
622 }
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
623 #endif
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
624
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
625 #endif /* UI_TOOLKIT_H */
1f419bd32da1 added files
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
626

mercurial