plusui-native-core 0.1.105 → 0.1.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/.claude/settings.local.json +7 -0
- package/Core/CMakeLists.txt +1 -1
- package/Core/Features/API/app-api.ts +28 -28
- package/Core/Features/API/browser-api.ts +38 -38
- package/Core/Features/API/clipboard-api.ts +21 -21
- package/Core/Features/API/display-api.ts +33 -33
- package/Core/Features/API/keyboard-api.ts +33 -33
- package/Core/Features/API/menu-api.ts +39 -39
- package/Core/Features/API/router-api.ts +23 -23
- package/Core/Features/API/tray-api.ts +22 -22
- package/Core/Features/API/webgpu-api.ts +55 -55
- package/Core/Features/App/app.cpp +128 -102
- package/Core/Features/Browser/browser.cpp +227 -227
- package/Core/Features/Browser/browser.ts +161 -161
- package/Core/Features/Clipboard/clipboard.cpp +235 -235
- package/Core/Features/Display/display.cpp +212 -212
- package/Core/Features/FileDrop/filedrop.cpp +448 -324
- package/Core/Features/FileDrop/filedrop.css +421 -421
- package/Core/Features/FileDrop/filedrop.ts +0 -7
- package/Core/Features/Keyboard/keyboard_linux.cpp +4 -0
- package/Core/Features/Router/router.cpp +62 -62
- package/Core/Features/Router/router.ts +113 -113
- package/Core/Features/Tray/tray.cpp +328 -324
- package/Core/Features/WebGPU/webgpu.cpp +948 -948
- package/Core/Features/Window/webview.cpp +1009 -1009
- package/Core/Features/Window/webview.ts +516 -516
- package/Core/Features/Window/window.cpp +2240 -1986
- package/Core/include/plusui/api.hpp +237 -237
- package/Core/include/plusui/app.hpp +33 -33
- package/Core/include/plusui/browser.hpp +67 -67
- package/Core/include/plusui/clipboard.hpp +41 -41
- package/Core/include/plusui/connect.hpp +340 -340
- package/Core/include/plusui/connection.hpp +3 -3
- package/Core/include/plusui/display.hpp +90 -90
- package/Core/include/plusui/filedrop.hpp +92 -77
- package/Core/include/plusui/keyboard.hpp +112 -112
- package/Core/include/plusui/menu.hpp +153 -153
- package/Core/include/plusui/plusui +18 -18
- package/Core/include/plusui/router.hpp +42 -42
- package/Core/include/plusui/tray.hpp +94 -94
- package/Core/include/plusui/webgpu.hpp +434 -434
- package/Core/include/plusui/window.hpp +180 -177
- package/Core/scripts/generate-umbrella-header.mjs +77 -77
- package/Core/vendor/WebView2EnvironmentOptions.h +406 -406
- package/Core/vendor/webview.h +487 -487
- package/Core/vendor/webview2.h +52079 -52079
- package/README.md +19 -19
- package/package.json +1 -1
|
@@ -1,82 +1,102 @@
|
|
|
1
|
-
#ifdef _WIN32
|
|
2
|
-
#define WIN32_LEAN_AND_MEAN
|
|
3
|
-
#include <windows.h>
|
|
4
|
-
#endif
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
App::Builder &App::Builder::
|
|
58
|
-
config.
|
|
59
|
-
return *this;
|
|
60
|
-
}
|
|
61
|
-
App::Builder &App::Builder::
|
|
62
|
-
config.
|
|
63
|
-
return *this;
|
|
64
|
-
}
|
|
65
|
-
App::Builder &App::Builder::
|
|
66
|
-
config.
|
|
67
|
-
return *this;
|
|
68
|
-
}
|
|
69
|
-
App::Builder &App::Builder::
|
|
70
|
-
config.
|
|
71
|
-
return *this;
|
|
72
|
-
}
|
|
73
|
-
App::Builder &App::Builder::
|
|
74
|
-
config.
|
|
75
|
-
return *this;
|
|
76
|
-
}
|
|
77
|
-
App::Builder &App::Builder::
|
|
78
|
-
config.
|
|
79
|
-
return *this;
|
|
1
|
+
#ifdef _WIN32
|
|
2
|
+
#define WIN32_LEAN_AND_MEAN
|
|
3
|
+
#include <windows.h>
|
|
4
|
+
#endif
|
|
5
|
+
|
|
6
|
+
#if defined(__APPLE__)
|
|
7
|
+
#import <Cocoa/Cocoa.h>
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#if defined(__linux__)
|
|
11
|
+
#include <gtk/gtk.h>
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#include <plusui/plusui.hpp>
|
|
15
|
+
|
|
16
|
+
namespace plusui {
|
|
17
|
+
|
|
18
|
+
struct App::Impl {
|
|
19
|
+
bool running = false;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
App::App() : pImpl(std::make_unique<Impl>()) {}
|
|
23
|
+
App::~App() = default;
|
|
24
|
+
|
|
25
|
+
void App::run() {
|
|
26
|
+
pImpl->running = true;
|
|
27
|
+
#ifdef _WIN32
|
|
28
|
+
MSG msg;
|
|
29
|
+
while (GetMessage(&msg, nullptr, 0, 0)) {
|
|
30
|
+
TranslateMessage(&msg);
|
|
31
|
+
DispatchMessage(&msg);
|
|
32
|
+
}
|
|
33
|
+
#elif defined(__APPLE__)
|
|
34
|
+
// macOS: handled by NSApplicationMain or similar
|
|
35
|
+
while (pImpl->running) {
|
|
36
|
+
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
|
37
|
+
}
|
|
38
|
+
#else
|
|
39
|
+
// Linux: GTK main loop
|
|
40
|
+
gtk_main();
|
|
41
|
+
#endif
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
void App::quit() {
|
|
45
|
+
pImpl->running = false;
|
|
46
|
+
#ifdef _WIN32
|
|
47
|
+
PostQuitMessage(0);
|
|
48
|
+
#elif defined(__APPLE__)
|
|
49
|
+
// macOS: handled by NSApplication
|
|
50
|
+
#else
|
|
51
|
+
gtk_main_quit();
|
|
52
|
+
#endif
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
App::Builder::Builder() = default;
|
|
56
|
+
|
|
57
|
+
App::Builder &App::Builder::title(const std::string &t) {
|
|
58
|
+
config.title = t;
|
|
59
|
+
return *this;
|
|
60
|
+
}
|
|
61
|
+
App::Builder &App::Builder::width(int w) {
|
|
62
|
+
config.width = w;
|
|
63
|
+
return *this;
|
|
64
|
+
}
|
|
65
|
+
App::Builder &App::Builder::height(int h) {
|
|
66
|
+
config.height = h;
|
|
67
|
+
return *this;
|
|
68
|
+
}
|
|
69
|
+
App::Builder &App::Builder::resizable(bool r) {
|
|
70
|
+
config.resizable = r;
|
|
71
|
+
return *this;
|
|
72
|
+
}
|
|
73
|
+
App::Builder &App::Builder::devtools(bool d) {
|
|
74
|
+
config.devtools = d;
|
|
75
|
+
return *this;
|
|
76
|
+
}
|
|
77
|
+
App::Builder &App::Builder::trayIcon(const std::string &icon) {
|
|
78
|
+
config.trayIconPath = icon;
|
|
79
|
+
return *this;
|
|
80
|
+
}
|
|
81
|
+
App::Builder &App::Builder::trayTooltip(const std::string &tooltip) {
|
|
82
|
+
config.trayTooltip = tooltip;
|
|
83
|
+
return *this;
|
|
84
|
+
}
|
|
85
|
+
App::Builder &App::Builder::alwaysOnTop(bool top) {
|
|
86
|
+
config.alwaysOnTop = top;
|
|
87
|
+
return *this;
|
|
88
|
+
}
|
|
89
|
+
App::Builder &App::Builder::centered(bool center) {
|
|
90
|
+
config.centered = center;
|
|
91
|
+
return *this;
|
|
92
|
+
}
|
|
93
|
+
App::Builder &App::Builder::transparent(bool transparent) {
|
|
94
|
+
config.transparent = transparent;
|
|
95
|
+
return *this;
|
|
96
|
+
}
|
|
97
|
+
App::Builder &App::Builder::decorations(bool decorations) {
|
|
98
|
+
config.decorations = decorations;
|
|
99
|
+
return *this;
|
|
80
100
|
}
|
|
81
101
|
App::Builder &App::Builder::skipTaskbar(bool skip) {
|
|
82
102
|
config.skipTaskbar = skip;
|
|
@@ -109,26 +129,32 @@ Window App::Builder::build() {
|
|
|
109
129
|
winConfig.scrollbars = config.scrollbars;
|
|
110
130
|
winConfig.disableWebviewDragDrop =
|
|
111
131
|
config.fileDrop; // Auto-disable browser drag-drop when OS file drop enabled
|
|
112
|
-
|
|
113
|
-
// Create native window
|
|
114
|
-
auto nativeWinPtr = std::make_shared<Window>(Window::create(winConfig));
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
|
|
133
|
+
// Create native window (do not show yet — caller controls visibility)
|
|
134
|
+
auto nativeWinPtr = std::make_shared<Window>(Window::create(winConfig));
|
|
135
|
+
|
|
136
|
+
// Create embedded webview window inside the native window
|
|
137
|
+
Window webviewWin = Window::create(nativeWinPtr->nativeHandle(), winConfig);
|
|
138
|
+
webviewWin.setWindow(nativeWinPtr);
|
|
139
|
+
|
|
140
|
+
if (config.fileDrop) {
|
|
141
|
+
plusui::FileDrop::instance().attach(
|
|
142
|
+
nativeWinPtr->nativeHandle(),
|
|
143
|
+
webviewWin.nativeWebView()
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (!config.trayIconPath.empty()) {
|
|
148
|
+
nativeWinPtr->tray().setIcon(config.trayIconPath);
|
|
149
|
+
nativeWinPtr->tray().setVisible(true);
|
|
150
|
+
if (!config.trayTooltip.empty()) {
|
|
151
|
+
nativeWinPtr->tray().setTooltip(config.trayTooltip);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return webviewWin;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
App::Builder createApp() { return App::Builder(); }
|
|
159
|
+
|
|
160
|
+
} // namespace plusui
|