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,235 +1,235 @@
1
- #include <memory>
2
- #include <mutex>
3
- #include <plusui/clipboard.hpp>
4
-
5
- #ifdef _WIN32
6
- #define WIN32_LEAN_AND_MEAN
7
- #include <windows.h>
8
- #elif defined(__APPLE__)
9
- #include <AppKit/AppKit.h>
10
- #include <CoreFoundation/CoreFoundation.h>
11
- #else
12
- // Linux/GTK - would use GTK clipboard APIs
13
- #include <gtk/gtk.h>
14
- #endif
15
-
16
- namespace PlusUI {
17
-
18
- struct Clipboard::Impl {
19
- std::mutex mtx;
20
- std::function<void(const std::string &)> changeCallback;
21
-
22
- #ifdef _WIN32
23
- HWND hwnd = nullptr;
24
- #endif
25
- };
26
-
27
- Clipboard::Clipboard() : pImpl(new Impl()) {
28
- #ifdef _WIN32
29
- // Create hidden window for clipboard monitoring
30
- // This would be done properly in a full implementation
31
- #endif
32
- }
33
-
34
- Clipboard::~Clipboard() { delete pImpl; }
35
-
36
- std::string Clipboard::getText() {
37
- std::lock_guard<std::mutex> lock(pImpl->mtx);
38
-
39
- #ifdef _WIN32
40
- if (!OpenClipboard(nullptr)) {
41
- return "";
42
- }
43
-
44
- HANDLE hData = GetClipboardData(CF_UNICODETEXT);
45
- if (hData == nullptr) {
46
- CloseClipboard();
47
- return "";
48
- }
49
-
50
- wchar_t *pszText = static_cast<wchar_t *>(GlobalLock(hData));
51
- if (pszText == nullptr) {
52
- CloseClipboard();
53
- return "";
54
- }
55
-
56
- // Convert wide string to UTF-8
57
- int size = WideCharToMultiByte(CP_UTF8, 0, pszText, -1, nullptr, 0, nullptr,
58
- nullptr);
59
- std::string text(size - 1, '\0');
60
- WideCharToMultiByte(CP_UTF8, 0, pszText, -1, &text[0], size, nullptr,
61
- nullptr);
62
-
63
- GlobalUnlock(hData);
64
- CloseClipboard();
65
-
66
- return text;
67
-
68
- #elif defined(__APPLE__)
69
- @autoreleasepool {
70
- NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
71
- NSString *str = [pasteboard stringForType:NSPasteboardTypeString];
72
- if (str) {
73
- return std::string([str UTF8String]);
74
- }
75
- return "";
76
- }
77
-
78
- #else
79
- // Linux/GTK implementation
80
- if (!gtk_init_check(nullptr, nullptr)) {
81
- return "";
82
- }
83
-
84
- GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
85
- gchar *text = gtk_clipboard_wait_for_text(clipboard);
86
-
87
- std::string result;
88
- if (text) {
89
- result = text;
90
- g_free(text);
91
- }
92
-
93
- return result;
94
- #endif
95
- }
96
-
97
- void Clipboard::setText(const std::string &text) {
98
- std::lock_guard<std::mutex> lock(pImpl->mtx);
99
-
100
- #ifdef _WIN32
101
- if (!OpenClipboard(nullptr)) {
102
- return;
103
- }
104
-
105
- EmptyClipboard();
106
-
107
- // Convert UTF-8 to wide string
108
- int size = MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, nullptr, 0);
109
- HGLOBAL hGlob = GlobalAlloc(GMEM_MOVEABLE, size * sizeof(wchar_t));
110
- if (hGlob) {
111
- wchar_t *pGlob = static_cast<wchar_t *>(GlobalLock(hGlob));
112
- MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, pGlob, size);
113
- GlobalUnlock(hGlob);
114
- SetClipboardData(CF_UNICODETEXT, hGlob);
115
- }
116
-
117
- CloseClipboard();
118
-
119
- #elif defined(__APPLE__)
120
- @autoreleasepool {
121
- NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
122
- [pasteboard clearContents];
123
- NSString *str = [NSString stringWithUTF8String:text.c_str()];
124
- [pasteboard setString:str forType:NSPasteboardTypeString];
125
- }
126
-
127
- #else
128
- // Linux/GTK implementation
129
- if (!gtk_init_check(nullptr, nullptr)) {
130
- return;
131
- }
132
-
133
- GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
134
- gtk_clipboard_set_text(clipboard, text.c_str(), -1);
135
- #endif
136
-
137
- // Trigger change callback
138
- if (pImpl->changeCallback) {
139
- pImpl->changeCallback(text);
140
- }
141
- }
142
-
143
- bool Clipboard::hasText() {
144
- #ifdef _WIN32
145
- return IsClipboardFormatAvailable(CF_UNICODETEXT) != 0;
146
-
147
- #elif defined(__APPLE__)
148
- @autoreleasepool {
149
- NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
150
- return
151
- [pasteboard availableTypeFromArray:@[ NSPasteboardTypeString ]] != nil;
152
- }
153
-
154
- #else
155
- // Linux/GTK implementation
156
- if (!gtk_init_check(nullptr, nullptr)) {
157
- return false;
158
- }
159
-
160
- GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
161
- return gtk_clipboard_wait_is_text_available(clipboard);
162
- #endif
163
- }
164
-
165
- std::string Clipboard::getImage() {
166
- // Image support would require base64 encoding/decoding
167
- // Platform-specific image clipboard handling
168
- // This is a placeholder for now
169
- return "";
170
- }
171
-
172
- void Clipboard::setImage(const std::string &base64Data) {
173
- (void)base64Data; // Suppress unused warning - placeholder implementation
174
- // Image support would require base64 decoding
175
- // Platform-specific image clipboard handling
176
- // This is a placeholder for now
177
- }
178
-
179
- bool Clipboard::hasImage() {
180
- #ifdef _WIN32
181
- return IsClipboardFormatAvailable(CF_DIB) != 0 ||
182
- IsClipboardFormatAvailable(CF_BITMAP) != 0;
183
-
184
- #elif defined(__APPLE__)
185
- @autoreleasepool {
186
- NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
187
- return [pasteboard availableTypeFromArray:@[
188
- NSPasteboardTypePNG, NSPasteboardTypeTIFF
189
- ]] != nil;
190
- }
191
-
192
- #else
193
- // Linux/GTK implementation
194
- if (!gtk_init_check(nullptr, nullptr)) {
195
- return false;
196
- }
197
-
198
- GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
199
- return gtk_clipboard_wait_is_image_available(clipboard);
200
- #endif
201
- }
202
-
203
- void Clipboard::clear() {
204
- std::lock_guard<std::mutex> lock(pImpl->mtx);
205
-
206
- #ifdef _WIN32
207
- if (OpenClipboard(nullptr)) {
208
- EmptyClipboard();
209
- CloseClipboard();
210
- }
211
-
212
- #elif defined(__APPLE__)
213
- @autoreleasepool {
214
- NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
215
- [pasteboard clearContents];
216
- }
217
-
218
- #else
219
- // Linux/GTK implementation
220
- if (!gtk_init_check(nullptr, nullptr)) {
221
- return;
222
- }
223
-
224
- GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
225
- gtk_clipboard_clear(clipboard);
226
- #endif
227
- }
228
-
229
- void Clipboard::onClipboardChange(
230
- std::function<void(const std::string &)> callback) {
231
- std::lock_guard<std::mutex> lock(pImpl->mtx);
232
- pImpl->changeCallback = callback;
233
- }
234
-
235
- } // namespace PlusUI
1
+ #include <memory>
2
+ #include <mutex>
3
+ #include <plusui/clipboard.hpp>
4
+
5
+ #ifdef _WIN32
6
+ #define WIN32_LEAN_AND_MEAN
7
+ #include <windows.h>
8
+ #elif defined(__APPLE__)
9
+ #include <AppKit/AppKit.h>
10
+ #include <CoreFoundation/CoreFoundation.h>
11
+ #else
12
+ // Linux/GTK - would use GTK clipboard APIs
13
+ #include <gtk/gtk.h>
14
+ #endif
15
+
16
+ namespace PlusUI {
17
+
18
+ struct Clipboard::Impl {
19
+ std::mutex mtx;
20
+ std::function<void(const std::string &)> changeCallback;
21
+
22
+ #ifdef _WIN32
23
+ HWND hwnd = nullptr;
24
+ #endif
25
+ };
26
+
27
+ Clipboard::Clipboard() : pImpl(new Impl()) {
28
+ #ifdef _WIN32
29
+ // Create hidden window for clipboard monitoring
30
+ // This would be done properly in a full implementation
31
+ #endif
32
+ }
33
+
34
+ Clipboard::~Clipboard() { delete pImpl; }
35
+
36
+ std::string Clipboard::getText() {
37
+ std::lock_guard<std::mutex> lock(pImpl->mtx);
38
+
39
+ #ifdef _WIN32
40
+ if (!OpenClipboard(nullptr)) {
41
+ return "";
42
+ }
43
+
44
+ HANDLE hData = GetClipboardData(CF_UNICODETEXT);
45
+ if (hData == nullptr) {
46
+ CloseClipboard();
47
+ return "";
48
+ }
49
+
50
+ wchar_t *pszText = static_cast<wchar_t *>(GlobalLock(hData));
51
+ if (pszText == nullptr) {
52
+ CloseClipboard();
53
+ return "";
54
+ }
55
+
56
+ // Convert wide string to UTF-8
57
+ int size = WideCharToMultiByte(CP_UTF8, 0, pszText, -1, nullptr, 0, nullptr,
58
+ nullptr);
59
+ std::string text(size - 1, '\0');
60
+ WideCharToMultiByte(CP_UTF8, 0, pszText, -1, &text[0], size, nullptr,
61
+ nullptr);
62
+
63
+ GlobalUnlock(hData);
64
+ CloseClipboard();
65
+
66
+ return text;
67
+
68
+ #elif defined(__APPLE__)
69
+ @autoreleasepool {
70
+ NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
71
+ NSString *str = [pasteboard stringForType:NSPasteboardTypeString];
72
+ if (str) {
73
+ return std::string([str UTF8String]);
74
+ }
75
+ return "";
76
+ }
77
+
78
+ #else
79
+ // Linux/GTK implementation
80
+ if (!gtk_init_check(nullptr, nullptr)) {
81
+ return "";
82
+ }
83
+
84
+ GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
85
+ gchar *text = gtk_clipboard_wait_for_text(clipboard);
86
+
87
+ std::string result;
88
+ if (text) {
89
+ result = text;
90
+ g_free(text);
91
+ }
92
+
93
+ return result;
94
+ #endif
95
+ }
96
+
97
+ void Clipboard::setText(const std::string &text) {
98
+ std::lock_guard<std::mutex> lock(pImpl->mtx);
99
+
100
+ #ifdef _WIN32
101
+ if (!OpenClipboard(nullptr)) {
102
+ return;
103
+ }
104
+
105
+ EmptyClipboard();
106
+
107
+ // Convert UTF-8 to wide string
108
+ int size = MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, nullptr, 0);
109
+ HGLOBAL hGlob = GlobalAlloc(GMEM_MOVEABLE, size * sizeof(wchar_t));
110
+ if (hGlob) {
111
+ wchar_t *pGlob = static_cast<wchar_t *>(GlobalLock(hGlob));
112
+ MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, pGlob, size);
113
+ GlobalUnlock(hGlob);
114
+ SetClipboardData(CF_UNICODETEXT, hGlob);
115
+ }
116
+
117
+ CloseClipboard();
118
+
119
+ #elif defined(__APPLE__)
120
+ @autoreleasepool {
121
+ NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
122
+ [pasteboard clearContents];
123
+ NSString *str = [NSString stringWithUTF8String:text.c_str()];
124
+ [pasteboard setString:str forType:NSPasteboardTypeString];
125
+ }
126
+
127
+ #else
128
+ // Linux/GTK implementation
129
+ if (!gtk_init_check(nullptr, nullptr)) {
130
+ return;
131
+ }
132
+
133
+ GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
134
+ gtk_clipboard_set_text(clipboard, text.c_str(), -1);
135
+ #endif
136
+
137
+ // Trigger change callback
138
+ if (pImpl->changeCallback) {
139
+ pImpl->changeCallback(text);
140
+ }
141
+ }
142
+
143
+ bool Clipboard::hasText() {
144
+ #ifdef _WIN32
145
+ return IsClipboardFormatAvailable(CF_UNICODETEXT) != 0;
146
+
147
+ #elif defined(__APPLE__)
148
+ @autoreleasepool {
149
+ NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
150
+ return
151
+ [pasteboard availableTypeFromArray:@[ NSPasteboardTypeString ]] != nil;
152
+ }
153
+
154
+ #else
155
+ // Linux/GTK implementation
156
+ if (!gtk_init_check(nullptr, nullptr)) {
157
+ return false;
158
+ }
159
+
160
+ GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
161
+ return gtk_clipboard_wait_is_text_available(clipboard);
162
+ #endif
163
+ }
164
+
165
+ std::string Clipboard::getImage() {
166
+ // Image support would require base64 encoding/decoding
167
+ // Platform-specific image clipboard handling
168
+ // This is a placeholder for now
169
+ return "";
170
+ }
171
+
172
+ void Clipboard::setImage(const std::string &base64Data) {
173
+ (void)base64Data; // Suppress unused warning - placeholder implementation
174
+ // Image support would require base64 decoding
175
+ // Platform-specific image clipboard handling
176
+ // This is a placeholder for now
177
+ }
178
+
179
+ bool Clipboard::hasImage() {
180
+ #ifdef _WIN32
181
+ return IsClipboardFormatAvailable(CF_DIB) != 0 ||
182
+ IsClipboardFormatAvailable(CF_BITMAP) != 0;
183
+
184
+ #elif defined(__APPLE__)
185
+ @autoreleasepool {
186
+ NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
187
+ return [pasteboard availableTypeFromArray:@[
188
+ NSPasteboardTypePNG, NSPasteboardTypeTIFF
189
+ ]] != nil;
190
+ }
191
+
192
+ #else
193
+ // Linux/GTK implementation
194
+ if (!gtk_init_check(nullptr, nullptr)) {
195
+ return false;
196
+ }
197
+
198
+ GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
199
+ return gtk_clipboard_wait_is_image_available(clipboard);
200
+ #endif
201
+ }
202
+
203
+ void Clipboard::clear() {
204
+ std::lock_guard<std::mutex> lock(pImpl->mtx);
205
+
206
+ #ifdef _WIN32
207
+ if (OpenClipboard(nullptr)) {
208
+ EmptyClipboard();
209
+ CloseClipboard();
210
+ }
211
+
212
+ #elif defined(__APPLE__)
213
+ @autoreleasepool {
214
+ NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
215
+ [pasteboard clearContents];
216
+ }
217
+
218
+ #else
219
+ // Linux/GTK implementation
220
+ if (!gtk_init_check(nullptr, nullptr)) {
221
+ return;
222
+ }
223
+
224
+ GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
225
+ gtk_clipboard_clear(clipboard);
226
+ #endif
227
+ }
228
+
229
+ void Clipboard::onClipboardChange(
230
+ std::function<void(const std::string &)> callback) {
231
+ std::lock_guard<std::mutex> lock(pImpl->mtx);
232
+ pImpl->changeCallback = callback;
233
+ }
234
+
235
+ } // namespace PlusUI