Nui
|
This class encapsulates the webview. More...
#include <window.hpp>
Classes | |
struct | Implementation |
struct | LinuxImplementation |
struct | MacOsImplementation |
struct | WindowsImplementation |
Public Member Functions | |
Window () | |
Construct a new Window object. More... | |
Window (WindowOptions const &options) | |
Construct a new Window object. More... | |
Window (bool debug) | |
Construct a new Window object. More... | |
Window (std::string const &title, bool debug=false) | |
Construct a new Window object. More... | |
Window (char const *title, bool debug=false) | |
Construct a new Window object. More... | |
~Window () | |
Window (const Window &)=delete | |
Window & | operator= (const Window &)=delete |
Window (Window &&) | |
Window & | operator= (Window &&) |
void | setTitle (std::string const &title) |
Set the Title of the window. More... | |
void | setSize (int width, int height, WebViewHint hint=WebViewHint::WEBVIEW_HINT_NONE) |
Sets the size of the window. More... | |
void | setPosition (int x, int y, bool useFrameOrigin=true) |
Sets the position of the window. More... | |
void | centerOnPrimaryDisplay () |
Center the window on the primary display. More... | |
void | navigate (const std::string &url) |
Navigate to url. More... | |
void | navigate (char const *url) |
Navigate to url. More... | |
void | terminate () |
Close the window and exit run. More... | |
void | openDevTools () |
Open the dev tools. More... | |
void | runInJavascriptThread (std::function< void()> &&func) |
Static Public Attributes | |
constexpr static std::string_view | windowsServeAuthority = "app.example" |
This class encapsulates the webview.
Nui::Window::Window | ( | ) |
Construct a new Window object.
|
explicit |
Construct a new Window object.
options | Additional options. |
|
explicit |
Construct a new Window object.
debug | If true, the dev tools may be opened. |
options | Additional options. |
|
explicit |
Construct a new Window object.
title | The title of the window. |
debug | If true, the dev tools may be opened. |
options | Additional options. |
|
explicit |
Construct a new Window object.
title | The title of the window. |
debug | If true, the dev tools may be opened. |
options | Additional options. |
|
default |
|
delete |
|
default |
void Nui::Window::centerOnPrimaryDisplay | ( | ) |
Center the window on the primary display.
Requires size to be set first.
void Nui::Window::navigate | ( | char const * | url | ) |
Navigate to url.
url |
void Nui::Window::navigate | ( | const std::string & | url | ) |
Navigate to url.
url |
void Nui::Window::openDevTools | ( | ) |
Open the dev tools.
void Nui::Window::runInJavascriptThread | ( | std::function< void()> && | func | ) |
void Nui::Window::setPosition | ( | int | x, |
int | y, | ||
bool | useFrameOrigin = true |
||
) |
Sets the position of the window.
x | xCoordinate |
y | yCoordinate |
(MacOS | only) use setFrameOrigin instead of setFrameTopLeftPoint (see apple doc) |
void Nui::Window::setSize | ( | int | width, |
int | height, | ||
WebViewHint | hint = WebViewHint::WEBVIEW_HINT_NONE |
||
) |
Sets the size of the window.
width | |
height | |
hint |
void Nui::Window::setTitle | ( | std::string const & | title | ) |
Set the Title of the window.
title |
void Nui::Window::terminate | ( | ) |
Close the window and exit run.
|
staticconstexpr |