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.
Files changed (77) hide show
  1. package/Core/.cache/clangd/index/api.hpp.016B34C8046EF490.idx +0 -0
  2. package/Core/.cache/clangd/index/app.cpp.1E6FAF043D496421.idx +0 -0
  3. package/Core/.cache/clangd/index/app.hpp.FA0E5D412C4E6148.idx +0 -0
  4. package/Core/.cache/clangd/index/browser.cpp.9461A2CAF129F1D9.idx +0 -0
  5. package/Core/.cache/clangd/index/browser.hpp.BE40AE80881B3107.idx +0 -0
  6. package/Core/.cache/clangd/index/clipboard.cpp.2399913537B2A7AD.idx +0 -0
  7. package/Core/.cache/clangd/index/clipboard.hpp.C1095DDACD7149E9.idx +0 -0
  8. package/Core/.cache/clangd/index/connect.cpp.518C66C7C28B30A9.idx +0 -0
  9. package/Core/.cache/clangd/index/connect.hpp.08E2F7CD13B78601.idx +0 -0
  10. package/Core/.cache/clangd/index/connection.hpp.849FAEF1523BF2C3.idx +0 -0
  11. package/Core/.cache/clangd/index/display.cpp.F6F6D932BF9F8D8E.idx +0 -0
  12. package/Core/.cache/clangd/index/display.hpp.0C1A9CAD11EE4404.idx +0 -0
  13. package/Core/.cache/clangd/index/filedrop.cpp.669B524B3C501C52.idx +0 -0
  14. package/Core/.cache/clangd/index/filedrop.hpp.48460099C3F35F2D.idx +0 -0
  15. package/Core/.cache/clangd/index/keyboard.cpp.DC6D34E4A4F798DD.idx +0 -0
  16. package/Core/.cache/clangd/index/keyboard.hpp.F016CB68D7DE5A46.idx +0 -0
  17. package/Core/.cache/clangd/index/keyboard_linux.cpp.B403FDCEA7A6CA53.idx +0 -0
  18. package/Core/.cache/clangd/index/menu.cpp.3059F08D8D2DF265.idx +0 -0
  19. package/Core/.cache/clangd/index/menu.hpp.8716DCCC573910D4.idx +0 -0
  20. package/Core/.cache/clangd/index/plusui.hpp.8CFCDFDC2E3F41DD.idx +0 -0
  21. package/Core/.cache/clangd/index/router.cpp.EAC9EAD34C59E573.idx +0 -0
  22. package/Core/.cache/clangd/index/router.hpp.2B06E2EE9998468D.idx +0 -0
  23. package/Core/.cache/clangd/index/stb_image.h.E26CF48FE089A0D3.idx +0 -0
  24. package/Core/.cache/clangd/index/tray.cpp.92F244E7E1D7F0EC.idx +0 -0
  25. package/Core/.cache/clangd/index/tray.hpp.0D881B0601BBBD25.idx +0 -0
  26. package/Core/.cache/clangd/index/webgpu.cpp.FC656FA8BE10FE15.idx +0 -0
  27. package/Core/.cache/clangd/index/webgpu.hpp.5AF1A5E9DF9E5AE0.idx +0 -0
  28. package/Core/.cache/clangd/index/window.cpp.191D8C9ADF874B22.idx +0 -0
  29. package/Core/.cache/clangd/index/window.hpp.B9811B43AA295697.idx +0 -0
  30. package/Core/.claude/settings.local.json +7 -0
  31. package/Core/CMakeLists.txt +1 -1
  32. package/Core/Features/API/app-api.ts +28 -28
  33. package/Core/Features/API/browser-api.ts +38 -38
  34. package/Core/Features/API/clipboard-api.ts +21 -21
  35. package/Core/Features/API/display-api.ts +33 -33
  36. package/Core/Features/API/keyboard-api.ts +33 -33
  37. package/Core/Features/API/menu-api.ts +39 -39
  38. package/Core/Features/API/router-api.ts +23 -23
  39. package/Core/Features/API/tray-api.ts +22 -22
  40. package/Core/Features/API/webgpu-api.ts +55 -55
  41. package/Core/Features/App/app.cpp +135 -102
  42. package/Core/Features/Browser/browser.cpp +227 -227
  43. package/Core/Features/Browser/browser.ts +161 -161
  44. package/Core/Features/Clipboard/clipboard.cpp +235 -235
  45. package/Core/Features/Display/display.cpp +212 -212
  46. package/Core/Features/FileDrop/filedrop.cpp +448 -324
  47. package/Core/Features/FileDrop/filedrop.css +421 -421
  48. package/Core/Features/FileDrop/filedrop.ts +0 -7
  49. package/Core/Features/Keyboard/keyboard_linux.cpp +4 -0
  50. package/Core/Features/Router/router.cpp +62 -62
  51. package/Core/Features/Router/router.ts +113 -113
  52. package/Core/Features/Tray/tray.cpp +437 -324
  53. package/Core/Features/WebGPU/webgpu.cpp +948 -948
  54. package/Core/Features/Window/webview.cpp +1009 -1009
  55. package/Core/Features/Window/webview.ts +516 -516
  56. package/Core/Features/Window/window.cpp +2240 -1986
  57. package/Core/include/plusui/api.hpp +237 -237
  58. package/Core/include/plusui/app.hpp +36 -34
  59. package/Core/include/plusui/browser.hpp +67 -67
  60. package/Core/include/plusui/clipboard.hpp +41 -41
  61. package/Core/include/plusui/connect.hpp +340 -340
  62. package/Core/include/plusui/connection.hpp +3 -3
  63. package/Core/include/plusui/display.hpp +90 -90
  64. package/Core/include/plusui/filedrop.hpp +92 -77
  65. package/Core/include/plusui/keyboard.hpp +112 -112
  66. package/Core/include/plusui/menu.hpp +153 -153
  67. package/Core/include/plusui/plusui +18 -18
  68. package/Core/include/plusui/router.hpp +42 -42
  69. package/Core/include/plusui/tray.hpp +94 -94
  70. package/Core/include/plusui/webgpu.hpp +434 -434
  71. package/Core/include/plusui/window.hpp +180 -177
  72. package/Core/scripts/generate-umbrella-header.mjs +77 -77
  73. package/Core/vendor/WebView2EnvironmentOptions.h +406 -406
  74. package/Core/vendor/webview.h +487 -487
  75. package/Core/vendor/webview2.h +52079 -52079
  76. package/README.md +19 -19
  77. 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
- #include <plusui/plusui.hpp>
7
-
8
- namespace plusui {
9
-
10
- struct App::Impl {
11
- bool running = false;
12
- };
13
-
14
- App::App() : pImpl(std::make_unique<Impl>()) {}
15
- App::~App() = default;
16
-
17
- void App::run() {
18
- pImpl->running = true;
19
- #ifdef _WIN32
20
- MSG msg;
21
- while (GetMessage(&msg, nullptr, 0, 0)) {
22
- TranslateMessage(&msg);
23
- DispatchMessage(&msg);
24
- }
25
- #endif
26
- }
27
-
28
- void App::quit() {
29
- pImpl->running = false;
30
- #ifdef _WIN32
31
- PostQuitMessage(0);
32
- #endif
33
- }
34
-
35
- App::Builder::Builder() = default;
36
-
37
- App::Builder &App::Builder::title(const std::string &t) {
38
- config.title = t;
39
- return *this;
40
- }
41
- App::Builder &App::Builder::width(int w) {
42
- config.width = w;
43
- return *this;
44
- }
45
- App::Builder &App::Builder::height(int h) {
46
- config.height = h;
47
- return *this;
48
- }
49
- App::Builder &App::Builder::resizable(bool r) {
50
- config.resizable = r;
51
- return *this;
52
- }
53
- App::Builder &App::Builder::devtools(bool d) {
54
- config.devtools = d;
55
- return *this;
56
- }
57
- App::Builder &App::Builder::trayIcon(const std::string &icon) {
58
- config.trayIconPath = icon;
59
- return *this;
60
- }
61
- App::Builder &App::Builder::trayTooltip(const std::string &tooltip) {
62
- config.trayTooltip = tooltip;
63
- return *this;
64
- }
65
- App::Builder &App::Builder::alwaysOnTop(bool top) {
66
- config.alwaysOnTop = top;
67
- return *this;
68
- }
69
- App::Builder &App::Builder::centered(bool center) {
70
- config.centered = center;
71
- return *this;
72
- }
73
- App::Builder &App::Builder::transparent(bool transparent) {
74
- config.transparent = transparent;
75
- return *this;
76
- }
77
- App::Builder &App::Builder::decorations(bool decorations) {
78
- config.decorations = decorations;
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
- nativeWinPtr->show();
116
-
117
- // Create embedded webview window inside the native window
118
- Window webviewWin = Window::create(nativeWinPtr->nativeHandle(), winConfig);
119
- webviewWin.setWindow(nativeWinPtr);
120
-
121
- if (!config.trayIconPath.empty()) {
122
- nativeWinPtr->tray().setIcon(config.trayIconPath);
123
- nativeWinPtr->tray().setVisible(true);
124
- if (!config.trayTooltip.empty()) {
125
- nativeWinPtr->tray().setTooltip(config.trayTooltip);
126
- }
127
- }
128
-
129
- return webviewWin;
130
- }
131
-
132
- App::Builder createApp() { return App::Builder(); }
133
-
134
- } // namespace plusui
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