plusui-native-core 0.1.105 → 0.1.107
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/.cache/clangd/index/api.hpp.016B34C8046EF490.idx +0 -0
- package/Core/.cache/clangd/index/app.cpp.1E6FAF043D496421.idx +0 -0
- package/Core/.cache/clangd/index/app.hpp.FA0E5D412C4E6148.idx +0 -0
- package/Core/.cache/clangd/index/browser.cpp.9461A2CAF129F1D9.idx +0 -0
- package/Core/.cache/clangd/index/browser.hpp.BE40AE80881B3107.idx +0 -0
- package/Core/.cache/clangd/index/clipboard.cpp.2399913537B2A7AD.idx +0 -0
- package/Core/.cache/clangd/index/clipboard.hpp.C1095DDACD7149E9.idx +0 -0
- package/Core/.cache/clangd/index/connect.cpp.518C66C7C28B30A9.idx +0 -0
- package/Core/.cache/clangd/index/connect.hpp.08E2F7CD13B78601.idx +0 -0
- package/Core/.cache/clangd/index/connection.hpp.849FAEF1523BF2C3.idx +0 -0
- package/Core/.cache/clangd/index/display.cpp.F6F6D932BF9F8D8E.idx +0 -0
- package/Core/.cache/clangd/index/display.hpp.0C1A9CAD11EE4404.idx +0 -0
- package/Core/.cache/clangd/index/filedrop.cpp.669B524B3C501C52.idx +0 -0
- package/Core/.cache/clangd/index/filedrop.hpp.48460099C3F35F2D.idx +0 -0
- package/Core/.cache/clangd/index/keyboard.cpp.DC6D34E4A4F798DD.idx +0 -0
- package/Core/.cache/clangd/index/keyboard.hpp.F016CB68D7DE5A46.idx +0 -0
- package/Core/.cache/clangd/index/keyboard_linux.cpp.B403FDCEA7A6CA53.idx +0 -0
- package/Core/.cache/clangd/index/menu.cpp.3059F08D8D2DF265.idx +0 -0
- package/Core/.cache/clangd/index/menu.hpp.8716DCCC573910D4.idx +0 -0
- package/Core/.cache/clangd/index/plusui.hpp.8CFCDFDC2E3F41DD.idx +0 -0
- package/Core/.cache/clangd/index/router.cpp.EAC9EAD34C59E573.idx +0 -0
- package/Core/.cache/clangd/index/router.hpp.2B06E2EE9998468D.idx +0 -0
- package/Core/.cache/clangd/index/stb_image.h.E26CF48FE089A0D3.idx +0 -0
- package/Core/.cache/clangd/index/tray.cpp.92F244E7E1D7F0EC.idx +0 -0
- package/Core/.cache/clangd/index/tray.hpp.0D881B0601BBBD25.idx +0 -0
- package/Core/.cache/clangd/index/webgpu.cpp.FC656FA8BE10FE15.idx +0 -0
- package/Core/.cache/clangd/index/webgpu.hpp.5AF1A5E9DF9E5AE0.idx +0 -0
- package/Core/.cache/clangd/index/window.cpp.191D8C9ADF874B22.idx +0 -0
- package/Core/.cache/clangd/index/window.hpp.B9811B43AA295697.idx +0 -0
- 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 +135 -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 +437 -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 +36 -34
- 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,55 +1,55 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WebGPU API
|
|
3
|
-
*
|
|
4
|
-
* GPU-accelerated rendering and compute via the WebGPU standard.
|
|
5
|
-
*
|
|
6
|
-
* Actions:
|
|
7
|
-
* gpu.requestAdapter(options?) - Request a GPU adapter (entry point for WebGPU)
|
|
8
|
-
* gpu.getPreferredCanvasFormat() - Get the preferred swap-chain texture format
|
|
9
|
-
*
|
|
10
|
-
* Events:
|
|
11
|
-
* gpu.onAdapterLost(cb) - Fires when the GPU adapter is lost
|
|
12
|
-
* gpu.onDeviceLost(cb) - Fires when the GPU device is lost
|
|
13
|
-
* gpu.onError(cb) - Fires on GPU errors
|
|
14
|
-
*
|
|
15
|
-
* Core types (mirrors the WebGPU spec):
|
|
16
|
-
* GPUAdapter, GPUDevice, GPUBuffer, GPUTexture, GPUTextureView
|
|
17
|
-
* GPUSampler, GPUShaderModule, GPURenderPipeline, GPUComputePipeline
|
|
18
|
-
* GPUBindGroup, GPUBindGroupLayout, GPUCommandEncoder
|
|
19
|
-
* GPURenderPassEncoder, GPUComputePassEncoder, GPUQueue, GPUCommandBuffer
|
|
20
|
-
*
|
|
21
|
-
* Usage flags / constants:
|
|
22
|
-
* GPUBufferUsage, GPUTextureUsage, GPUMapMode, GPUShaderStage, GPUColorWrite
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
export type {
|
|
26
|
-
GPUAdapter,
|
|
27
|
-
GPUAdapterInfo,
|
|
28
|
-
GPUDevice,
|
|
29
|
-
GPUDeviceLostInfo,
|
|
30
|
-
GPUBuffer,
|
|
31
|
-
GPUTexture,
|
|
32
|
-
GPUTextureView,
|
|
33
|
-
GPUSampler,
|
|
34
|
-
GPUShaderModule,
|
|
35
|
-
GPURenderPipeline,
|
|
36
|
-
GPUComputePipeline,
|
|
37
|
-
GPUBindGroupLayout,
|
|
38
|
-
GPUBindGroup,
|
|
39
|
-
GPUCommandEncoder,
|
|
40
|
-
GPURenderPassEncoder,
|
|
41
|
-
GPUComputePassEncoder,
|
|
42
|
-
GPUQueue,
|
|
43
|
-
GPUCommandBuffer,
|
|
44
|
-
GPURequestAdapterOptions,
|
|
45
|
-
GPUDeviceDescriptor,
|
|
46
|
-
} from '../WebGPU/webgpu';
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
gpu,
|
|
50
|
-
GPUBufferUsage,
|
|
51
|
-
GPUTextureUsage,
|
|
52
|
-
GPUMapMode,
|
|
53
|
-
GPUShaderStage,
|
|
54
|
-
GPUColorWrite,
|
|
55
|
-
} from '../WebGPU/webgpu';
|
|
1
|
+
/**
|
|
2
|
+
* WebGPU API
|
|
3
|
+
*
|
|
4
|
+
* GPU-accelerated rendering and compute via the WebGPU standard.
|
|
5
|
+
*
|
|
6
|
+
* Actions:
|
|
7
|
+
* gpu.requestAdapter(options?) - Request a GPU adapter (entry point for WebGPU)
|
|
8
|
+
* gpu.getPreferredCanvasFormat() - Get the preferred swap-chain texture format
|
|
9
|
+
*
|
|
10
|
+
* Events:
|
|
11
|
+
* gpu.onAdapterLost(cb) - Fires when the GPU adapter is lost
|
|
12
|
+
* gpu.onDeviceLost(cb) - Fires when the GPU device is lost
|
|
13
|
+
* gpu.onError(cb) - Fires on GPU errors
|
|
14
|
+
*
|
|
15
|
+
* Core types (mirrors the WebGPU spec):
|
|
16
|
+
* GPUAdapter, GPUDevice, GPUBuffer, GPUTexture, GPUTextureView
|
|
17
|
+
* GPUSampler, GPUShaderModule, GPURenderPipeline, GPUComputePipeline
|
|
18
|
+
* GPUBindGroup, GPUBindGroupLayout, GPUCommandEncoder
|
|
19
|
+
* GPURenderPassEncoder, GPUComputePassEncoder, GPUQueue, GPUCommandBuffer
|
|
20
|
+
*
|
|
21
|
+
* Usage flags / constants:
|
|
22
|
+
* GPUBufferUsage, GPUTextureUsage, GPUMapMode, GPUShaderStage, GPUColorWrite
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export type {
|
|
26
|
+
GPUAdapter,
|
|
27
|
+
GPUAdapterInfo,
|
|
28
|
+
GPUDevice,
|
|
29
|
+
GPUDeviceLostInfo,
|
|
30
|
+
GPUBuffer,
|
|
31
|
+
GPUTexture,
|
|
32
|
+
GPUTextureView,
|
|
33
|
+
GPUSampler,
|
|
34
|
+
GPUShaderModule,
|
|
35
|
+
GPURenderPipeline,
|
|
36
|
+
GPUComputePipeline,
|
|
37
|
+
GPUBindGroupLayout,
|
|
38
|
+
GPUBindGroup,
|
|
39
|
+
GPUCommandEncoder,
|
|
40
|
+
GPURenderPassEncoder,
|
|
41
|
+
GPUComputePassEncoder,
|
|
42
|
+
GPUQueue,
|
|
43
|
+
GPUCommandBuffer,
|
|
44
|
+
GPURequestAdapterOptions,
|
|
45
|
+
GPUDeviceDescriptor,
|
|
46
|
+
} from '../WebGPU/webgpu';
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
gpu,
|
|
50
|
+
GPUBufferUsage,
|
|
51
|
+
GPUTextureUsage,
|
|
52
|
+
GPUMapMode,
|
|
53
|
+
GPUShaderStage,
|
|
54
|
+
GPUColorWrite,
|
|
55
|
+
} from '../WebGPU/webgpu';
|
|
@@ -1,82 +1,106 @@
|
|
|
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::tray(bool enable) {
|
|
86
|
+
config.tray = enable;
|
|
87
|
+
return *this;
|
|
88
|
+
}
|
|
89
|
+
App::Builder &App::Builder::alwaysOnTop(bool top) {
|
|
90
|
+
config.alwaysOnTop = top;
|
|
91
|
+
return *this;
|
|
92
|
+
}
|
|
93
|
+
App::Builder &App::Builder::centered(bool center) {
|
|
94
|
+
config.centered = center;
|
|
95
|
+
return *this;
|
|
96
|
+
}
|
|
97
|
+
App::Builder &App::Builder::transparent(bool transparent) {
|
|
98
|
+
config.transparent = transparent;
|
|
99
|
+
return *this;
|
|
100
|
+
}
|
|
101
|
+
App::Builder &App::Builder::decorations(bool decorations) {
|
|
102
|
+
config.decorations = decorations;
|
|
103
|
+
return *this;
|
|
80
104
|
}
|
|
81
105
|
App::Builder &App::Builder::skipTaskbar(bool skip) {
|
|
82
106
|
config.skipTaskbar = skip;
|
|
@@ -109,26 +133,35 @@ Window App::Builder::build() {
|
|
|
109
133
|
winConfig.scrollbars = config.scrollbars;
|
|
110
134
|
winConfig.disableWebviewDragDrop =
|
|
111
135
|
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
|
-
}
|
|
136
|
+
|
|
137
|
+
// Create native window (do not show yet — caller controls visibility)
|
|
138
|
+
auto nativeWinPtr = std::make_shared<Window>(Window::create(winConfig));
|
|
139
|
+
|
|
140
|
+
// Create embedded webview window inside the native window
|
|
141
|
+
Window webviewWin = Window::create(nativeWinPtr->nativeHandle(), winConfig);
|
|
142
|
+
webviewWin.setWindow(nativeWinPtr);
|
|
143
|
+
|
|
144
|
+
if (config.fileDrop) {
|
|
145
|
+
plusui::FileDrop::instance().attach(
|
|
146
|
+
nativeWinPtr->nativeHandle(),
|
|
147
|
+
webviewWin.nativeWebView()
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (config.tray || !config.trayIconPath.empty()) {
|
|
152
|
+
auto& trayMgr = nativeWinPtr->tray();
|
|
153
|
+
if (!config.trayIconPath.empty()) {
|
|
154
|
+
trayMgr.setIcon(config.trayIconPath);
|
|
155
|
+
}
|
|
156
|
+
if (!config.trayTooltip.empty()) {
|
|
157
|
+
trayMgr.setTooltip(config.trayTooltip);
|
|
158
|
+
}
|
|
159
|
+
trayMgr.setVisible(true);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return webviewWin;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
App::Builder createApp() { return App::Builder(); }
|
|
166
|
+
|
|
167
|
+
} // namespace plusui
|