plusui-native-core 0.1.27 → 0.1.29

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.
@@ -117,14 +117,14 @@ void Browser::goForward() {
117
117
  }
118
118
 
119
119
  void Browser::reload() {
120
- if (pImpl->Window) {
121
- pImpl->Window->reload();
120
+ if (pImpl->window) {
121
+ pImpl->window->reload();
122
122
  }
123
123
  }
124
124
 
125
125
  void Browser::stop() {
126
- if (pImpl->Window) {
127
- pImpl->Window->stop();
126
+ if (pImpl->window) {
127
+ pImpl->window->stop();
128
128
  }
129
129
  }
130
130
 
@@ -31,6 +31,7 @@ struct Window::Impl {
31
31
  WindowConfig config;
32
32
  std::string currentURL;
33
33
  std::string currentTitle;
34
+ std::shared_ptr<Window> window; // Keep the native window alive
34
35
  std::string userAgent; // Advanced webview setting
35
36
  bool loading = false;
36
37
  double zoom = 1.0;
@@ -732,7 +733,7 @@ Window Window::create(void *windowHandle, const WindowConfig &config) {
732
733
  }
733
734
 
734
735
  TrayManager &Window::tray() { return *pImpl->trayManager; }
735
- WindowManager &Window::window() { return *pImpl->windowManager; }
736
+ WindowManager &Window::windowManager() { return *pImpl->windowManager; }
736
737
 
737
738
  void Window::setWindow(std::shared_ptr<Window> win) {
738
739
  pImpl->window = win;
@@ -32,7 +32,7 @@ public:
32
32
  ~Browser();
33
33
 
34
34
  static Browser create(Window *window);
35
-
35
+ static Browser create(Window *window);
36
36
  void navigate(const std::string &url);
37
37
  void goBack();
38
38
  void goForward();
@@ -75,7 +75,14 @@ public:
75
75
  Window();
76
76
  ~Window();
77
77
 
78
+ // Move only
79
+ Window(Window &&other) noexcept;
80
+ Window &operator=(Window &&other) noexcept;
81
+ Window(const Window &) = delete;
82
+ Window &operator=(const Window &) = delete;
83
+
78
84
  static Window create(const WindowConfig &config);
85
+ static Window create(void *windowHandle, const WindowConfig &config);
79
86
 
80
87
  void setTitle(const std::string &title);
81
88
  std::string getTitle() const;
@@ -123,6 +130,8 @@ public:
123
130
 
124
131
  void *nativeHandle() const;
125
132
 
133
+ void setWindow(std::shared_ptr<Window> win);
134
+
126
135
  // WebView methods (content loading)
127
136
  using StringCallback = std::function<void(const std::string &result)>;
128
137
  using BoolCallback = std::function<bool(const std::string &url)>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plusui-native-core",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "PlusUI Core framework (frontend + backend implementations)",
5
5
  "type": "module",
6
6
  "files": [