HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Data Fields | Friends
v1::gui_window_win32 Class Referencefinal
Inheritance diagram for v1::gui_window_win32:
v1::gui_window

Public Types

using super = gui_window
 

Public Member Functions

 gui_window_win32 (gui_system &gui, label const &title) noexcept
 
void create_window (extent2i new_size) override
 Let the operating system create the actual window.
 
int windowProc (unsigned int uMsg, uint64_t wParam, int64_t lParam) noexcept
 
void set_cursor (mouse_cursor cursor) noexcept override
 Set the mouse cursor icon.
 
void close_window () override
 Ask the operating system to close this window.
 
void set_size_state (gui_window_size state) noexcept override
 Set the size-state of the window.
 
aarectanglei workspace_rectangle () const noexcept override
 The rectangle of the workspace of the screen where the window is currently located.
 
aarectanglei fullscreen_rectangle () const noexcept override
 The rectangle of the screen where the window is currently located.
 
hi::subpixel_orientation subpixel_orientation () const noexcept override
 
void open_system_menu () override
 Open the system menu of the window.
 
void set_window_size (extent2i extent) override
 Ask the operating system to set the size of this window.
 
std::optional< std::stringget_text_from_clipboard () const noexcept override
 Get text from the clipboard.
 
void put_text_on_clipboard (std::string_view str) const noexcept override
 Put text on the clipboard.
 
- Public Member Functions inherited from v1::gui_window
 gui_window (gui_system &gui, label const &title) noexcept
 
 gui_window (gui_window const &)=delete
 
gui_windowoperator= (gui_window const &)=delete
 
 gui_window (gui_window &&)=delete
 
gui_windowoperator= (gui_window &&)=delete
 
virtual void init ()
 2 phase constructor.
 
void set_device (gfx_device *device) noexcept
 
hi::keyboard_bindings constkeyboard_bindings () const noexcept
 Get the keyboard binding.
 
virtual void render (utc_nanoseconds displayTimePoint)
 Update window.
 
grid_widget & content () noexcept
 Get a reference to the window's content widget.
 
toolbar_widget & toolbar () noexcept
 Get a reference to window's toolbar widget.
 
gui_window_size size_state () const noexcept
 Get the size-state of the window.
 
void update_mouse_target (hi::widget const *new_target_widget, point2i position={}) noexcept
 
void update_keyboard_target (hi::widget const *widget, keyboard_focus_group group=keyboard_focus_group::normal) noexcept
 Change the keyboard focus to the given widget.
 
void update_keyboard_target (hi::widget const *widget, keyboard_focus_group group, keyboard_focus_direction direction) noexcept
 Change the keyboard focus to the previous or next widget from the given widget.
 
void update_keyboard_target (keyboard_focus_group group, keyboard_focus_direction direction) noexcept
 Change the keyboard focus to the given, previous or next widget.
 
translate2i window_to_screen () const noexcept
 
translate2i screen_to_window () const noexcept
 
bool process_event (gui_event const &event) noexcept
 Process the event.
 

Data Fields

HWND win32Window = nullptr
 
- Data Fields inherited from v1::gui_window
gui_systemgui
 
std::unique_ptr< gfx_surfacesurface
 
aarectanglei rectangle
 The current rectangle of the window relative to the screen.
 
mouse_cursor current_mouse_cursor = mouse_cursor::None
 The current cursor.
 
bool resizing = false
 
bool active = false
 
label title
 
float dpi = 72.0
 
hi::theme theme = {}
 Theme to use to draw the widgets on this window.
 
extent2i widget_size
 The size of the widget.
 
std::shared_ptr< window_widget > widget
 The widget covering the complete window.
 
notifier< void()> closing
 Notifier used when the window is closing.
 

Friends

LRESULT CALLBACK _WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) noexcept
 

Member Function Documentation

◆ close_window()

void v1::gui_window_win32::close_window ( )
overridevirtual

Ask the operating system to close this window.

Implements v1::gui_window.

◆ create_window()

void v1::gui_window_win32::create_window ( extent2i new_size)
overridevirtual

Let the operating system create the actual window.

Precondition
title and extent must be set.

Implements v1::gui_window.

◆ fullscreen_rectangle()

aarectanglei v1::gui_window_win32::fullscreen_rectangle ( ) const
overridevirtualnoexcept

The rectangle of the screen where the window is currently located.

Implements v1::gui_window.

◆ get_text_from_clipboard()

std::optional< std::string > v1::gui_window_win32::get_text_from_clipboard ( ) const
overridevirtualnoexcept

Get text from the clipboard.

Note
This is part of the window as some operating systems need to know from which window the text was posted.
Returns
The text from the clipboard.
Return values
emptyWhen the clipboard is locked by another application, on error, if the data on the clipboard can not be converted to text or if the clipboard is empty.

Implements v1::gui_window.

◆ open_system_menu()

void v1::gui_window_win32::open_system_menu ( )
overridevirtual

Open the system menu of the window.

On windows 10 this is activated by pressing Alt followed by Spacebar.

Implements v1::gui_window.

◆ put_text_on_clipboard()

void v1::gui_window_win32::put_text_on_clipboard ( std::string_view text) const
overridevirtualnoexcept

Put text on the clipboard.

Note
This is part of the window as some operating systems need to know from which window the text was posted.
Parameters
textThe text to place on the clipboard.

Implements v1::gui_window.

◆ set_cursor()

void v1::gui_window_win32::set_cursor ( mouse_cursor cursor)
overridevirtualnoexcept

Set the mouse cursor icon.

Implements v1::gui_window.

◆ set_size_state()

void v1::gui_window_win32::set_size_state ( gui_window_size state)
overridevirtualnoexcept

Set the size-state of the window.

This function is used to change the size of the window to one of the predefined states: normal, minimized, maximized or full-screen.

Implements v1::gui_window.

◆ set_window_size()

void v1::gui_window_win32::set_window_size ( extent2i extent)
overridevirtual

Ask the operating system to set the size of this window.

Implements v1::gui_window.

◆ subpixel_orientation()

hi::subpixel_orientation v1::gui_window_win32::subpixel_orientation ( ) const
overridevirtualnoexcept

Implements v1::gui_window.

◆ workspace_rectangle()

aarectanglei v1::gui_window_win32::workspace_rectangle ( ) const
overridevirtualnoexcept

The rectangle of the workspace of the screen where the window is currently located.

Implements v1::gui_window.


The documentation for this class was generated from the following file: