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.
Files changed (48) hide show
  1. package/Core/.claude/settings.local.json +7 -0
  2. package/Core/CMakeLists.txt +1 -1
  3. package/Core/Features/API/app-api.ts +28 -28
  4. package/Core/Features/API/browser-api.ts +38 -38
  5. package/Core/Features/API/clipboard-api.ts +21 -21
  6. package/Core/Features/API/display-api.ts +33 -33
  7. package/Core/Features/API/keyboard-api.ts +33 -33
  8. package/Core/Features/API/menu-api.ts +39 -39
  9. package/Core/Features/API/router-api.ts +23 -23
  10. package/Core/Features/API/tray-api.ts +22 -22
  11. package/Core/Features/API/webgpu-api.ts +55 -55
  12. package/Core/Features/App/app.cpp +128 -102
  13. package/Core/Features/Browser/browser.cpp +227 -227
  14. package/Core/Features/Browser/browser.ts +161 -161
  15. package/Core/Features/Clipboard/clipboard.cpp +235 -235
  16. package/Core/Features/Display/display.cpp +212 -212
  17. package/Core/Features/FileDrop/filedrop.cpp +448 -324
  18. package/Core/Features/FileDrop/filedrop.css +421 -421
  19. package/Core/Features/FileDrop/filedrop.ts +0 -7
  20. package/Core/Features/Keyboard/keyboard_linux.cpp +4 -0
  21. package/Core/Features/Router/router.cpp +62 -62
  22. package/Core/Features/Router/router.ts +113 -113
  23. package/Core/Features/Tray/tray.cpp +328 -324
  24. package/Core/Features/WebGPU/webgpu.cpp +948 -948
  25. package/Core/Features/Window/webview.cpp +1009 -1009
  26. package/Core/Features/Window/webview.ts +516 -516
  27. package/Core/Features/Window/window.cpp +2240 -1986
  28. package/Core/include/plusui/api.hpp +237 -237
  29. package/Core/include/plusui/app.hpp +33 -33
  30. package/Core/include/plusui/browser.hpp +67 -67
  31. package/Core/include/plusui/clipboard.hpp +41 -41
  32. package/Core/include/plusui/connect.hpp +340 -340
  33. package/Core/include/plusui/connection.hpp +3 -3
  34. package/Core/include/plusui/display.hpp +90 -90
  35. package/Core/include/plusui/filedrop.hpp +92 -77
  36. package/Core/include/plusui/keyboard.hpp +112 -112
  37. package/Core/include/plusui/menu.hpp +153 -153
  38. package/Core/include/plusui/plusui +18 -18
  39. package/Core/include/plusui/router.hpp +42 -42
  40. package/Core/include/plusui/tray.hpp +94 -94
  41. package/Core/include/plusui/webgpu.hpp +434 -434
  42. package/Core/include/plusui/window.hpp +180 -177
  43. package/Core/scripts/generate-umbrella-header.mjs +77 -77
  44. package/Core/vendor/WebView2EnvironmentOptions.h +406 -406
  45. package/Core/vendor/webview.h +487 -487
  46. package/Core/vendor/webview2.h +52079 -52079
  47. package/README.md +19 -19
  48. package/package.json +1 -1
@@ -1,153 +1,153 @@
1
- #ifndef PLUSUI_MENU_H
2
- #define PLUSUI_MENU_H
3
-
4
- #include <functional>
5
- #include <map>
6
- #include <memory>
7
- #include <string>
8
- #include <vector>
9
-
10
- namespace plusui {
11
- class Window;
12
- }
13
-
14
- namespace plusui {
15
-
16
- enum class MenuItemType { Normal, Separator, Submenu, Checkbox, Radio };
17
-
18
- struct MenuItem {
19
- std::string id;
20
- std::string label;
21
- std::string accelerator;
22
- std::string icon;
23
- MenuItemType type = MenuItemType::Normal;
24
- bool enabled = true;
25
- bool checked = false;
26
- std::vector<MenuItem> submenu;
27
- };
28
-
29
- struct MenuBarData {
30
- std::vector<MenuItem> items;
31
- };
32
-
33
- class Menu {
34
- public:
35
- Menu();
36
- ~Menu();
37
-
38
- // Move semantics
39
- Menu(Menu &&other) noexcept;
40
- Menu &operator=(Menu &&other) noexcept;
41
-
42
- // Disable copy
43
- Menu(const Menu &) = delete;
44
- Menu &operator=(const Menu &) = delete;
45
-
46
- static Menu create(const std::vector<MenuItem> &items = {});
47
-
48
- void setItems(const std::vector<MenuItem> &items);
49
- std::vector<MenuItem> getItems() const;
50
-
51
- void append(const MenuItem &item);
52
- void insert(int index, const MenuItem &item);
53
- void remove(const std::string &id);
54
- void clear();
55
-
56
- void popup(int x, int y);
57
- void close();
58
-
59
- private:
60
- struct Impl;
61
- std::unique_ptr<Impl> pImpl;
62
- };
63
-
64
- class MenuBar {
65
- public:
66
- MenuBar();
67
- ~MenuBar();
68
-
69
- static MenuBar &instance();
70
-
71
- void setMenu(const MenuBarData &menu);
72
- MenuBarData getMenu() const;
73
-
74
- void append(const MenuItem &item);
75
- void insert(int index, const MenuItem &item);
76
- void remove(const std::string &id);
77
- void clear();
78
-
79
- void onMenuItemClick(std::function<void(const std::string &id)> callback);
80
-
81
- private:
82
- struct Impl;
83
- std::unique_ptr<Impl> pImpl;
84
- };
85
-
86
- class MenuManager {
87
- public:
88
- static MenuManager &instance();
89
-
90
- // Manage ID to Menu mapping
91
- std::string createMenu(const std::vector<MenuItem> &items);
92
- Menu *getMenu(const std::string &id);
93
- void destroyMenu(const std::string &id);
94
-
95
- private:
96
- MenuManager();
97
- ~MenuManager();
98
- struct Impl;
99
- };
100
-
101
- namespace bindings {
102
-
103
- class MenuBindings {
104
- public:
105
- MenuBindings() = default;
106
- ~MenuBindings() = default;
107
-
108
- void registerBindings(Window &window);
109
- void setItemClickCallback(
110
- std::function<void(const std::string &menuId, const std::string &itemId)>
111
- callback);
112
- void setContextMenu(const std::vector<MenuItem> &items);
113
- void enableContextMenu(bool enable);
114
- void showContextMenuAtCursor();
115
-
116
- private:
117
- std::function<void(const std::string &, const std::string &)>
118
- itemClickCallback_;
119
- std::vector<MenuItem> contextMenuItems_;
120
- bool contextMenuEnabled_ = false;
121
- std::string currentContextMenuId_;
122
-
123
- std::vector<MenuItem> parseMenuItems(const std::string &json);
124
- std::string menuItemToJson(const MenuItem &item);
125
- };
126
-
127
- class ContextMenuManager {
128
- public:
129
- static ContextMenuManager &instance();
130
-
131
- void setDefaultMenu(const std::vector<MenuItem> &items);
132
- void setMenuForSelector(const std::string &selector,
133
- const std::vector<MenuItem> &items);
134
- void attachToWebView(Window &window);
135
- void handleRightClick(int x, int y, const std::string &targetSelector);
136
- void onItemClick(std::function<void(const std::string &itemId,
137
- const std::string &targetSelector)>
138
- callback);
139
-
140
- private:
141
- ContextMenuManager() = default;
142
- ~ContextMenuManager() = default;
143
-
144
- std::vector<MenuItem> defaultMenu_;
145
- std::map<std::string, std::vector<MenuItem>> selectorMenus_;
146
- std::function<void(const std::string &, const std::string &)> clickCallback_;
147
- };
148
-
149
- } // namespace bindings
150
-
151
- } // namespace plusui
152
-
153
- #endif
1
+ #ifndef PLUSUI_MENU_H
2
+ #define PLUSUI_MENU_H
3
+
4
+ #include <functional>
5
+ #include <map>
6
+ #include <memory>
7
+ #include <string>
8
+ #include <vector>
9
+
10
+ namespace plusui {
11
+ class Window;
12
+ }
13
+
14
+ namespace plusui {
15
+
16
+ enum class MenuItemType { Normal, Separator, Submenu, Checkbox, Radio };
17
+
18
+ struct MenuItem {
19
+ std::string id;
20
+ std::string label;
21
+ std::string accelerator;
22
+ std::string icon;
23
+ MenuItemType type = MenuItemType::Normal;
24
+ bool enabled = true;
25
+ bool checked = false;
26
+ std::vector<MenuItem> submenu;
27
+ };
28
+
29
+ struct MenuBarData {
30
+ std::vector<MenuItem> items;
31
+ };
32
+
33
+ class Menu {
34
+ public:
35
+ Menu();
36
+ ~Menu();
37
+
38
+ // Move semantics
39
+ Menu(Menu &&other) noexcept;
40
+ Menu &operator=(Menu &&other) noexcept;
41
+
42
+ // Disable copy
43
+ Menu(const Menu &) = delete;
44
+ Menu &operator=(const Menu &) = delete;
45
+
46
+ static Menu create(const std::vector<MenuItem> &items = {});
47
+
48
+ void setItems(const std::vector<MenuItem> &items);
49
+ std::vector<MenuItem> getItems() const;
50
+
51
+ void append(const MenuItem &item);
52
+ void insert(int index, const MenuItem &item);
53
+ void remove(const std::string &id);
54
+ void clear();
55
+
56
+ void popup(int x, int y);
57
+ void close();
58
+
59
+ private:
60
+ struct Impl;
61
+ std::unique_ptr<Impl> pImpl;
62
+ };
63
+
64
+ class MenuBar {
65
+ public:
66
+ MenuBar();
67
+ ~MenuBar();
68
+
69
+ static MenuBar &instance();
70
+
71
+ void setMenu(const MenuBarData &menu);
72
+ MenuBarData getMenu() const;
73
+
74
+ void append(const MenuItem &item);
75
+ void insert(int index, const MenuItem &item);
76
+ void remove(const std::string &id);
77
+ void clear();
78
+
79
+ void onMenuItemClick(std::function<void(const std::string &id)> callback);
80
+
81
+ private:
82
+ struct Impl;
83
+ std::unique_ptr<Impl> pImpl;
84
+ };
85
+
86
+ class MenuManager {
87
+ public:
88
+ static MenuManager &instance();
89
+
90
+ // Manage ID to Menu mapping
91
+ std::string createMenu(const std::vector<MenuItem> &items);
92
+ Menu *getMenu(const std::string &id);
93
+ void destroyMenu(const std::string &id);
94
+
95
+ private:
96
+ MenuManager();
97
+ ~MenuManager();
98
+ struct Impl;
99
+ };
100
+
101
+ namespace bindings {
102
+
103
+ class MenuBindings {
104
+ public:
105
+ MenuBindings() = default;
106
+ ~MenuBindings() = default;
107
+
108
+ void registerBindings(Window &window);
109
+ void setItemClickCallback(
110
+ std::function<void(const std::string &menuId, const std::string &itemId)>
111
+ callback);
112
+ void setContextMenu(const std::vector<MenuItem> &items);
113
+ void enableContextMenu(bool enable);
114
+ void showContextMenuAtCursor();
115
+
116
+ private:
117
+ std::function<void(const std::string &, const std::string &)>
118
+ itemClickCallback_;
119
+ std::vector<MenuItem> contextMenuItems_;
120
+ bool contextMenuEnabled_ = false;
121
+ std::string currentContextMenuId_;
122
+
123
+ std::vector<MenuItem> parseMenuItems(const std::string &json);
124
+ std::string menuItemToJson(const MenuItem &item);
125
+ };
126
+
127
+ class ContextMenuManager {
128
+ public:
129
+ static ContextMenuManager &instance();
130
+
131
+ void setDefaultMenu(const std::vector<MenuItem> &items);
132
+ void setMenuForSelector(const std::string &selector,
133
+ const std::vector<MenuItem> &items);
134
+ void attachToWebView(Window &window);
135
+ void handleRightClick(int x, int y, const std::string &targetSelector);
136
+ void onItemClick(std::function<void(const std::string &itemId,
137
+ const std::string &targetSelector)>
138
+ callback);
139
+
140
+ private:
141
+ ContextMenuManager() = default;
142
+ ~ContextMenuManager() = default;
143
+
144
+ std::vector<MenuItem> defaultMenu_;
145
+ std::map<std::string, std::vector<MenuItem>> selectorMenus_;
146
+ std::function<void(const std::string &, const std::string &)> clickCallback_;
147
+ };
148
+
149
+ } // namespace bindings
150
+
151
+ } // namespace plusui
152
+
153
+ #endif
@@ -1,18 +1,18 @@
1
- /**
2
- * PlusUI - Main Framework Header
3
- *
4
- * Standard library style include (no .hpp extension needed)
5
- *
6
- * Usage:
7
- * #include <plusui>
8
- * using namespace plusui;
9
- *
10
- * This provides access to all core framework features including:
11
- * - App & Window management
12
- * - Browser & WebView
13
- * - Events & Bindings
14
- * - FileDrop, Keyboard, Clipboard
15
- * - Display, Tray, Menu
16
- */
17
-
18
- #include <plusui/plusui.hpp>
1
+ /**
2
+ * PlusUI - Main Framework Header
3
+ *
4
+ * Standard library style include (no .hpp extension needed)
5
+ *
6
+ * Usage:
7
+ * #include <plusui>
8
+ * using namespace plusui;
9
+ *
10
+ * This provides access to all core framework features including:
11
+ * - App & Window management
12
+ * - Browser & WebView
13
+ * - Events & Bindings
14
+ * - FileDrop, Keyboard, Clipboard
15
+ * - Display, Tray, Menu
16
+ */
17
+
18
+ #include <plusui/plusui.hpp>
@@ -1,42 +1,42 @@
1
- #ifndef PLUSUI_ROUTER_H
2
- #define PLUSUI_ROUTER_H
3
-
4
- #include <string>
5
- #include <map>
6
- #include <functional>
7
- #include <memory>
8
- #include <vector>
9
-
10
- namespace plusui {
11
-
12
- class Router {
13
- public:
14
- Router();
15
- ~Router();
16
-
17
- static Router& instance();
18
-
19
- void setRoutes(const std::map<std::string, std::string>& routes);
20
- std::map<std::string, std::string> getRoutes() const;
21
-
22
- void push(const std::string& route, const std::string& windowId = "");
23
- void replace(const std::string& route, const std::string& windowId = "");
24
-
25
- std::string getCurrentRoute(const std::string& windowId = "") const;
26
- void setInitialRoute(const std::string& route);
27
-
28
- using RouteChangeCallback = std::function<void(const std::string& route, const std::string& windowId)>;
29
- void onRouteChange(RouteChangeCallback callback);
30
-
31
- private:
32
- struct Impl;
33
- std::unique_ptr<Impl> pImpl;
34
-
35
- // Prevent copying
36
- Router(const Router&) = delete;
37
- Router& operator=(const Router&) = delete;
38
- };
39
-
40
- } // namespace plusui
41
-
42
- #endif // PLUSUI_ROUTER_H
1
+ #ifndef PLUSUI_ROUTER_H
2
+ #define PLUSUI_ROUTER_H
3
+
4
+ #include <string>
5
+ #include <map>
6
+ #include <functional>
7
+ #include <memory>
8
+ #include <vector>
9
+
10
+ namespace plusui {
11
+
12
+ class Router {
13
+ public:
14
+ Router();
15
+ ~Router();
16
+
17
+ static Router& instance();
18
+
19
+ void setRoutes(const std::map<std::string, std::string>& routes);
20
+ std::map<std::string, std::string> getRoutes() const;
21
+
22
+ void push(const std::string& route, const std::string& windowId = "");
23
+ void replace(const std::string& route, const std::string& windowId = "");
24
+
25
+ std::string getCurrentRoute(const std::string& windowId = "") const;
26
+ void setInitialRoute(const std::string& route);
27
+
28
+ using RouteChangeCallback = std::function<void(const std::string& route, const std::string& windowId)>;
29
+ void onRouteChange(RouteChangeCallback callback);
30
+
31
+ private:
32
+ struct Impl;
33
+ std::unique_ptr<Impl> pImpl;
34
+
35
+ // Prevent copying
36
+ Router(const Router&) = delete;
37
+ Router& operator=(const Router&) = delete;
38
+ };
39
+
40
+ } // namespace plusui
41
+
42
+ #endif // PLUSUI_ROUTER_H
@@ -1,94 +1,94 @@
1
- #ifndef PLUSUI_TRAY_HPP
2
- #define PLUSUI_TRAY_HPP
3
-
4
- #include <cstdint>
5
- #include <functional>
6
- #include <memory>
7
- #include <string>
8
- #include <vector>
9
-
10
- namespace plusui {
11
-
12
- struct TrayMenuItem {
13
- std::string id;
14
- std::string label;
15
- bool enabled = true;
16
- bool checked = false;
17
- bool separator = false;
18
- std::vector<TrayMenuItem> submenu;
19
- };
20
-
21
- struct TrayIconData {
22
- std::string tooltip;
23
- std::string iconPath;
24
- };
25
-
26
- class TrayIcon {
27
- public:
28
- TrayIcon();
29
- ~TrayIcon();
30
-
31
- TrayIcon(TrayIcon &&other) noexcept;
32
- TrayIcon &operator=(TrayIcon &&other) noexcept;
33
- TrayIcon(const TrayIcon &) = delete;
34
- TrayIcon &operator=(const TrayIcon &) = delete;
35
-
36
- static TrayIcon create(const std::string &tooltip = "",
37
- const std::string &iconPath = "");
38
-
39
- void setTooltip(const std::string &tooltip);
40
- void setIcon(const std::string &iconPath);
41
- void setIconFromData(const std::vector<uint8_t> &data, int width, int height);
42
- void setIconFromMemory(const unsigned char *data, size_t size);
43
-
44
- void show();
45
- void hide();
46
- bool isVisible() const;
47
-
48
- void setMenu(const std::vector<TrayMenuItem> &items);
49
- void setContextMenu(const std::vector<TrayMenuItem> &items);
50
-
51
- void onClick(std::function<void(int x, int y)> callback);
52
- void onRightClick(std::function<void(int x, int y)> callback);
53
- void onDoubleClick(std::function<void()> callback);
54
- void onMenuItemClick(std::function<void(const std::string &id)> callback);
55
-
56
- void dispose();
57
- friend class TrayManager;
58
-
59
- private:
60
- struct Impl;
61
- std::unique_ptr<Impl> pImpl;
62
- };
63
-
64
- class TrayManager {
65
- public:
66
- TrayManager();
67
- ~TrayManager();
68
-
69
- static TrayManager &instance();
70
-
71
- void setWindowHandle(void *hwnd);
72
- void setIcon(const std::string &iconPath);
73
- void setIconFromMemory(const unsigned char *data, size_t size);
74
- void setTooltip(const std::string &tooltip);
75
- void setVisible(bool visible);
76
-
77
- std::vector<TrayIcon *> getIcons();
78
-
79
- void onTrayCreated(std::function<void(TrayIcon &)> callback);
80
- void onTrayDestroyed(std::function<void(int)> callback);
81
-
82
- void refresh();
83
-
84
- private:
85
- TrayManager(const TrayManager &) = delete;
86
- TrayManager &operator=(const TrayManager &) = delete;
87
-
88
- struct Impl;
89
- std::unique_ptr<Impl> pImpl;
90
- };
91
-
92
- } // namespace plusui
93
-
94
- #endif
1
+ #ifndef PLUSUI_TRAY_HPP
2
+ #define PLUSUI_TRAY_HPP
3
+
4
+ #include <cstdint>
5
+ #include <functional>
6
+ #include <memory>
7
+ #include <string>
8
+ #include <vector>
9
+
10
+ namespace plusui {
11
+
12
+ struct TrayMenuItem {
13
+ std::string id;
14
+ std::string label;
15
+ bool enabled = true;
16
+ bool checked = false;
17
+ bool separator = false;
18
+ std::vector<TrayMenuItem> submenu;
19
+ };
20
+
21
+ struct TrayIconData {
22
+ std::string tooltip;
23
+ std::string iconPath;
24
+ };
25
+
26
+ class TrayIcon {
27
+ public:
28
+ TrayIcon();
29
+ ~TrayIcon();
30
+
31
+ TrayIcon(TrayIcon &&other) noexcept;
32
+ TrayIcon &operator=(TrayIcon &&other) noexcept;
33
+ TrayIcon(const TrayIcon &) = delete;
34
+ TrayIcon &operator=(const TrayIcon &) = delete;
35
+
36
+ static TrayIcon create(const std::string &tooltip = "",
37
+ const std::string &iconPath = "");
38
+
39
+ void setTooltip(const std::string &tooltip);
40
+ void setIcon(const std::string &iconPath);
41
+ void setIconFromData(const std::vector<uint8_t> &data, int width, int height);
42
+ void setIconFromMemory(const unsigned char *data, size_t size);
43
+
44
+ void show();
45
+ void hide();
46
+ bool isVisible() const;
47
+
48
+ void setMenu(const std::vector<TrayMenuItem> &items);
49
+ void setContextMenu(const std::vector<TrayMenuItem> &items);
50
+
51
+ void onClick(std::function<void(int x, int y)> callback);
52
+ void onRightClick(std::function<void(int x, int y)> callback);
53
+ void onDoubleClick(std::function<void()> callback);
54
+ void onMenuItemClick(std::function<void(const std::string &id)> callback);
55
+
56
+ void dispose();
57
+ friend class TrayManager;
58
+
59
+ private:
60
+ struct Impl;
61
+ std::unique_ptr<Impl> pImpl;
62
+ };
63
+
64
+ class TrayManager {
65
+ public:
66
+ TrayManager();
67
+ ~TrayManager();
68
+
69
+ static TrayManager &instance();
70
+
71
+ void setWindowHandle(void *hwnd);
72
+ void setIcon(const std::string &iconPath);
73
+ void setIconFromMemory(const unsigned char *data, size_t size);
74
+ void setTooltip(const std::string &tooltip);
75
+ void setVisible(bool visible);
76
+
77
+ std::vector<TrayIcon *> getIcons();
78
+
79
+ void onTrayCreated(std::function<void(TrayIcon &)> callback);
80
+ void onTrayDestroyed(std::function<void(int)> callback);
81
+
82
+ void refresh();
83
+
84
+ private:
85
+ TrayManager(const TrayManager &) = delete;
86
+ TrayManager &operator=(const TrayManager &) = delete;
87
+
88
+ struct Impl;
89
+ std::unique_ptr<Impl> pImpl;
90
+ };
91
+
92
+ } // namespace plusui
93
+
94
+ #endif