![]() |
Ultralight C++ API 1.3.0
|
#include <AppCore/Window.h>
Window class, represents a platform window.
Static Public Member Functions | |
| static RefPtr< Window > | Create (Monitor *monitor, uint32_t width, uint32_t height, bool fullscreen, unsigned int window_flags) |
| Create a new Window. | |
Public Member Functions | |
| virtual void | set_listener (WindowListener *listener)=0 |
| Set a WindowListener to receive callbacks for window-related events. | |
| virtual WindowListener * | listener ()=0 |
| Get the WindowListener, if any. | |
| virtual uint32_t | screen_width () const =0 |
| Get the window width (in screen coordinates). | |
| virtual uint32_t | width () const =0 |
| Get the window width (in pixels). | |
| virtual uint32_t | screen_height () const =0 |
| Get the window height (in screen coordinates). | |
| virtual uint32_t | height () const =0 |
| Get the window height (in pixels). | |
| virtual void | MoveTo (int x, int y)=0 |
| Move the window to a new position (in screen coordinates) relative to the top-left of the monitor area. | |
| virtual void | MoveToCenter ()=0 |
| Move the window to the center of the monitor. | |
| virtual int | x () const =0 |
| Get the x-position of the window (in screen coordinates) relative to the top-left of the monitor area. | |
| virtual int | y () const =0 |
| Get the y-position of the window (in screen coordinates) relative to the top-left of the monitor area. | |
| virtual bool | is_fullscreen () const =0 |
| Whether or not the window is fullscreen. | |
| virtual bool | is_accelerated () const =0 |
| Whether or not the window is GPU accelerated. | |
| virtual uint32_t | render_buffer_id () const =0 |
| The render buffer id of the the window's backing texture. | |
| virtual double | scale () const =0 |
| The DPI scale of the window. | |
| virtual void | SetTitle (const char *title)=0 |
| Set the window title. | |
| virtual void | SetCursor (ultralight::Cursor cursor)=0 |
| Set the cursor. | |
| virtual void | Show ()=0 |
| Show the window (if it was previously hidden). | |
| virtual void | Hide ()=0 |
| Hide the window. | |
| virtual bool | is_visible () const =0 |
| Whether or not the window is currently visible (not hidden). | |
| virtual void | Close ()=0 |
| Close the window. | |
| virtual int | ScreenToPixels (int val) const =0 |
| Convert screen coordinates to pixels using the current DPI scale. | |
| virtual int | PixelsToScreen (int val) const =0 |
| Convert pixels to screen coordinates using the current DPI scale. | |
| virtual void | DrawSurface (int x, int y, Surface *surface) |
| Draw a surface directly to window, used only by CPU renderer. | |
| virtual void * | native_handle () const =0 |
| Get the underlying native window handle. | |
Public Member Functions inherited from ultralight::RefCounted | |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
| virtual int | ref_count () const =0 |
Protected Member Functions | |
| virtual | ~Window () |
| virtual OverlayManager * | overlay_manager () const =0 |
Protected Member Functions inherited from ultralight::RefCounted | |
| virtual | ~RefCounted () |
Friends | |
| class | OverlayImpl |
|
protectedvirtual |
|
pure virtual |
Close the window.
|
static |
Create a new Window.
| monitor | The monitor to create the Window on. |
| width | The width (in screen coordinates). |
| height | The height (in screen coordinates). |
| fullscreen | Whether or not the window is fullscreen. |
| window_flags | Various window flags. |
Windows are immediately shown by default unless kWindowFlags_Hidden is set in the window_flags parameter. (They can be shown later via Window::Show())
Screen coordinates are device-scale-independent and have the following relationship to pixel coordinates:
|
inlinevirtual |
Draw a surface directly to window, used only by CPU renderer.
|
pure virtual |
Get the window height (in pixels).
|
pure virtual |
Hide the window.
|
pure virtual |
Whether or not the window is GPU accelerated.
|
pure virtual |
Whether or not the window is fullscreen.
|
pure virtual |
Whether or not the window is currently visible (not hidden).
|
pure virtual |
Get the WindowListener, if any.
|
pure virtual |
Move the window to a new position (in screen coordinates) relative to the top-left of the monitor area.
|
pure virtual |
Move the window to the center of the monitor.
|
pure virtual |
Get the underlying native window handle.
|
protectedpure virtual |
|
pure virtual |
Convert pixels to screen coordinates using the current DPI scale.
|
pure virtual |
The render buffer id of the the window's backing texture.
(This will be 0 if the window is not accelerated).
|
pure virtual |
The DPI scale of the window.
|
pure virtual |
Get the window height (in screen coordinates).
|
pure virtual |
Get the window width (in screen coordinates).
|
pure virtual |
Convert screen coordinates to pixels using the current DPI scale.
|
pure virtual |
Set a WindowListener to receive callbacks for window-related events.
|
pure virtual |
Set the cursor.
|
pure virtual |
Set the window title.
|
pure virtual |
Show the window (if it was previously hidden).
|
pure virtual |
Get the window width (in pixels).
|
pure virtual |
Get the x-position of the window (in screen coordinates) relative to the top-left of the monitor area.
|
pure virtual |
Get the y-position of the window (in screen coordinates) relative to the top-left of the monitor area.
|
friend |