EHS
Loading...
Searching...
No Matches
ehs::Window Class Reference

#include <Window_W32.h>

Inheritance diagram for ehs::Window:
ehs::BaseWindow ehs::BaseWindow ehs::BaseWindow

Public Member Functions

 ~Window () override
 
 Window ()
 
 Window (const Window &win)
 
Windowoperator= (const Window &win)
 
bool Poll () override
 
void Create_32 (const Str_32 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 Creates the native window.
 
void Create_16 (const Str_16 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 Creates the native window.
 
void Create_8 (const Str_8 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 Creates the native window.
 
void Use (HWND windowHdl)
 Uses an already existing window to render an overlay.
 
void Close () override
 Closes the window.
 
void Show () override
 Shows the window.
 
void Hide () override
 Hides the window.
 
void SetTitle_32 (const Str_32 &title) override
 
Str_32 GetTitle_32 () const override
 
void SetTitle_16 (const Str_16 &title) override
 
Str_16 GetTitle_16 () const override
 
void SetTitle_8 (const Str_8 &title) override
 
Str_8 GetTitle_8 () const override
 
void SetIcon (const Str_8 &filePath)
 
HWND GetHdl () const
 
HINSTANCE GetInst () const
 
void ToggleEnabled (bool toggle)
 
bool IsEnabled ()
 
void SetPos (const Vec2_s32 &newPos) override
 
Vec2_s32 GetPos () const override
 
virtual void OnResized (const Vec2< UInt_32 > &newSize)
 
void SetScale (const Vec2_u32 &newScale) override
 
Vec2_u32 GetScale () const override
 
void ShowCursor (bool toggle) override
 
void ConstrainCursor (bool toggle) override
 
Serializer< UInt_64 > GetClipboard () override
 
void SetClipboard (Serializer< UInt_64 > data) override
 
void SetCursorImg (CursorImg img) override
 
 ~Window () override
 
 Window ()
 
 Window (Window &&win) noexcept
 
 Window (const Window &win)
 
Windowoperator= (Window &&win) noexcept
 
Windowoperator= (const Window &win)
 
void Create_32 (const Str_32 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 
void Create_16 (const Str_16 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 
void Create_8 (const Str_8 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 
void OnCreated () override
 
void Close () override
 
void Show () override
 
void Hide () override
 
bool Poll () override
 
void ShowCursor (bool toggle) override
 
void ConstrainCursor (const bool constrain) override
 
void SetTitle_32 (const Str_32 &newTitle) override
 
Str_32 GetTitle_32 () const override
 
void SetTitle_16 (const Str_16 &newTitle) override
 
Str_16 GetTitle_16 () const override
 
void SetTitle_8 (const Str_8 &newTitle) override
 
Str_8 GetTitle_8 () const override
 
void SetPos (const Vec2_s32 &newPos) override
 
Vec2_s32 GetPos () const override
 
void SetScale (const Vec2_u32 &newScale) override
 
Vec2_u32 GetScale () const override
 
Serializer< UInt_64 > GetClipboard () override
 
void SetClipboard (Serializer< UInt_64 > data) override
 
void SetCursorImg (const CursorImg img) override
 
 ~Window () override
 
 Window ()
 
 Window (Window &&win) noexcept
 
 Window (const Window &win)
 
Windowoperator= (Window &&win) noexcept
 
Windowoperator= (const Window &win)
 
void Create_32 (const Str_32 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 
void Create_16 (const Str_16 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 
void Create_8 (const Str_8 &title, const Vec2_s32 &pos, Vec2_u32 scale) override
 
void Close () override
 
void Show () override
 
void Hide () override
 
bool Poll () override
 
void ShowCursor (bool toggle) override
 
void ConstrainCursor (bool constrain) override
 
void SetTitle_32 (const Str_32 &newTitle) override
 
Str_32 GetTitle_32 () const override
 
void SetTitle_16 (const Str_16 &newTitle) override
 
Str_16 GetTitle_16 () const override
 
void SetTitle_8 (const Str_8 &newTitle) override
 
Str_8 GetTitle_8 () const override
 
void SetPos (const Vec2_s32 &newPos) override
 
Vec2_s32 GetPos () const override
 
void SetScale (const Vec2_u32 &newScale) override
 
Vec2_u32 GetScale () const override
 
Serializer< UInt_64 > GetClipboard () override
 
void SetClipboard (Serializer< UInt_64 > data) override
 
void SetCursorImg (CursorImg img) override
 
xcb_connection_t * GetServer ()
 
- Public Member Functions inherited from ehs::BaseWindow
virtual ~BaseWindow ()=default
 
 BaseWindow ()
 
 BaseWindow (const BaseWindow &win)
 
BaseWindowoperator= (const BaseWindow &win)
 
bool IsCreated () const
 
bool HasFocus () const
 
Vec2_s32 GetCursorPos () const
 
bool IsCursorVisible () const
 
bool IsCursorConstrained () const
 
WindowState GetState () const
 
const InputHandlerGetInputHandler () const
 

Static Public Member Functions

static HWND GetAvailableHdl ()
 

Protected Member Functions

void SendMsg (UINT msg, WPARAM wParam, LPARAM lParam)
 

Static Protected Member Functions

static void SurfaceConfigEvent (void *data, xdg_surface *xdg_surface, UInt_32 serial)
 
static void ShellPing (void *data, xdg_wm_base *shell, UInt_32 serial)
 
static void RegistryHandler (void *data, wl_registry *registry, UInt_32 id, const char *interface, UInt_32 version)
 
static void RegistryRemoved (void *data, wl_registry *registry, UInt_32 id)
 
static void ResizeEvent (void *data, xdg_toplevel *xdg_toplevel, Int_32 width, Int_32 height, wl_array *states)
 
static void CloseEvent (void *data, xdg_toplevel *xdg_toplevel)
 
static void SeatCapabilitiesEvent (void *data, wl_seat *seat, UInt_32 capabilities)
 
static void PointerMotionEvent (void *data, wl_pointer *pointer, UInt_32 time, wl_fixed_t sx, wl_fixed_t sy)
 

Protected Attributes

wl_display * display
 
wl_registry * registry
 
wl_compositor * compositor
 
wl_surface * wlSurface
 
xdg_wm_base * xdgShell
 
xdg_surface * xdgSurface
 
xdg_toplevel * xdgToplevel
 
zxdg_decoration_manager_v1 * decManager
 
zxdg_toplevel_decoration_v1 * dec
 
wl_seat * seat
 
wl_pointer * pointer
 
Vec2_u32 scale
 
xcb_connection_t * server
 
xcb_screen_t * screen
 
xcb_window_t hdl
 
xcb_atom_t masks [2]
 
UInt_8 extOpCode
 
Vector< xcb_generic_event_t * > events
 
Serializer< UInt_64 > clipboard
 
- Protected Attributes inherited from ehs::BaseWindow
bool created
 
bool focused
 
Vec2_s32 cursorPos
 
bool cursorVisible
 
bool cursorConstrained
 
WindowState state
 
InputHandler ih
 

Friends

class Input
 

Constructor & Destructor Documentation

◆ ~Window() [1/3]

ehs::Window::~Window ( )
override

◆ Window() [1/8]

ehs::Window::Window ( )

◆ Window() [2/8]

ehs::Window::Window ( const Window & win)

◆ ~Window() [2/3]

ehs::Window::~Window ( )
override

◆ Window() [3/8]

ehs::Window::Window ( )

◆ Window() [4/8]

ehs::Window::Window ( Window && win)
noexcept

◆ Window() [5/8]

ehs::Window::Window ( const Window & win)

◆ ~Window() [3/3]

ehs::Window::~Window ( )
override

◆ Window() [6/8]

ehs::Window::Window ( )

◆ Window() [7/8]

ehs::Window::Window ( Window && win)
noexcept

◆ Window() [8/8]

ehs::Window::Window ( const Window & win)

Member Function Documentation

◆ Close() [1/3]

void ehs::Window::Close ( )
overridevirtual

Closes the window.

Implements ehs::BaseWindow.

◆ Close() [2/3]

void ehs::Window::Close ( )
overridevirtual

Implements ehs::BaseWindow.

◆ Close() [3/3]

void ehs::Window::Close ( )
overridevirtual

Implements ehs::BaseWindow.

◆ CloseEvent()

void ehs::Window::CloseEvent ( void * data,
xdg_toplevel * xdg_toplevel )
staticprotected

◆ ConstrainCursor() [1/3]

void ehs::Window::ConstrainCursor ( bool constrain)
overridevirtual

Implements ehs::BaseWindow.

◆ ConstrainCursor() [2/3]

void ehs::Window::ConstrainCursor ( bool toggle)
overridevirtual

Implements ehs::BaseWindow.

◆ ConstrainCursor() [3/3]

void ehs::Window::ConstrainCursor ( const bool constrain)
overridevirtual

Implements ehs::BaseWindow.

◆ Create_16() [1/3]

void ehs::Window::Create_16 ( const Str_16 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Creates the native window.

Implements ehs::BaseWindow.

◆ Create_16() [2/3]

void ehs::Window::Create_16 ( const Str_16 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Implements ehs::BaseWindow.

◆ Create_16() [3/3]

void ehs::Window::Create_16 ( const Str_16 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Implements ehs::BaseWindow.

◆ Create_32() [1/3]

void ehs::Window::Create_32 ( const Str_32 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Creates the native window.

Implements ehs::BaseWindow.

◆ Create_32() [2/3]

void ehs::Window::Create_32 ( const Str_32 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Implements ehs::BaseWindow.

◆ Create_32() [3/3]

void ehs::Window::Create_32 ( const Str_32 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Implements ehs::BaseWindow.

◆ Create_8() [1/3]

void ehs::Window::Create_8 ( const Str_8 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Creates the native window.

Implements ehs::BaseWindow.

◆ Create_8() [2/3]

void ehs::Window::Create_8 ( const Str_8 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Implements ehs::BaseWindow.

◆ Create_8() [3/3]

void ehs::Window::Create_8 ( const Str_8 & title,
const Vec2_s32 & pos,
Vec2_u32 scale )
overridevirtual

Implements ehs::BaseWindow.

◆ GetAvailableHdl()

HWND ehs::Window::GetAvailableHdl ( )
static

Retrieves the first window handle that has been created using this library.

Returns
The window's native handle.

◆ GetClipboard() [1/3]

Serializer< UInt_64 > ehs::Window::GetClipboard ( )
overridevirtual

Implements ehs::BaseWindow.

◆ GetClipboard() [2/3]

Serializer< UInt_64 > ehs::Window::GetClipboard ( )
overridevirtual

Implements ehs::BaseWindow.

◆ GetClipboard() [3/3]

Serializer< UInt_64 > ehs::Window::GetClipboard ( )
overridevirtual

Implements ehs::BaseWindow.

◆ GetHdl()

HWND ehs::Window::GetHdl ( ) const

Gets the windows native handle for the operating system or other native tasks.

Returns
The window's native handle.

◆ GetInst()

HINSTANCE ehs::Window::GetInst ( ) const

◆ GetPos() [1/3]

Vec2_s32 ehs::Window::GetPos ( ) const
overridevirtual

Gets the windows current position on the desktop.

Returns
The current value.

Implements ehs::BaseWindow.

◆ GetPos() [2/3]

Vec2_s32 ehs::Window::GetPos ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetPos() [3/3]

Vec2_s32 ehs::Window::GetPos ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetScale() [1/3]

Vec2_u32 ehs::Window::GetScale ( ) const
overridevirtual

Gets the windows current scale.

Returns
The current value.

Implements ehs::BaseWindow.

◆ GetScale() [2/3]

Vec2_u32 ehs::Window::GetScale ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetScale() [3/3]

Vec2_u32 ehs::Window::GetScale ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetServer()

xcb_connection_t * ehs::Window::GetServer ( )

◆ GetTitle_16() [1/3]

Str_16 ehs::Window::GetTitle_16 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetTitle_16() [2/3]

Str_16 ehs::Window::GetTitle_16 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetTitle_16() [3/3]

Str_16 ehs::Window::GetTitle_16 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetTitle_32() [1/3]

Str_32 ehs::Window::GetTitle_32 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetTitle_32() [2/3]

Str_32 ehs::Window::GetTitle_32 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetTitle_32() [3/3]

Str_32 ehs::Window::GetTitle_32 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetTitle_8() [1/3]

Str_8 ehs::Window::GetTitle_8 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetTitle_8() [2/3]

Str_8 ehs::Window::GetTitle_8 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ GetTitle_8() [3/3]

Str_8 ehs::Window::GetTitle_8 ( ) const
overridevirtual

Implements ehs::BaseWindow.

◆ Hide() [1/3]

void ehs::Window::Hide ( )
overridevirtual

Hides the window.

Implements ehs::BaseWindow.

◆ Hide() [2/3]

void ehs::Window::Hide ( )
overridevirtual

Implements ehs::BaseWindow.

◆ Hide() [3/3]

void ehs::Window::Hide ( )
overridevirtual

Implements ehs::BaseWindow.

◆ IsEnabled()

bool ehs::Window::IsEnabled ( )

Checks whether the window updates and renders.

Returns
The current status.

◆ OnCreated()

void ehs::Window::OnCreated ( )
overridevirtual

Implements ehs::BaseWindow.

◆ OnResized()

void ehs::Window::OnResized ( const Vec2< UInt_32 > & newSize)
virtual

◆ operator=() [1/5]

Window & ehs::Window::operator= ( const Window & win)

◆ operator=() [2/5]

Window & ehs::Window::operator= ( const Window & win)

◆ operator=() [3/5]

Window & ehs::Window::operator= ( const Window & win)

◆ operator=() [4/5]

Window & ehs::Window::operator= ( Window && win)
noexcept

◆ operator=() [5/5]

Window & ehs::Window::operator= ( Window && win)
noexcept

◆ PointerMotionEvent()

void ehs::Window::PointerMotionEvent ( void * data,
wl_pointer * pointer,
UInt_32 time,
wl_fixed_t sx,
wl_fixed_t sy )
staticprotected

◆ Poll() [1/3]

bool ehs::Window::Poll ( )
overridevirtual

Reimplemented from ehs::BaseWindow.

◆ Poll() [2/3]

bool ehs::Window::Poll ( )
overridevirtual

Reimplemented from ehs::BaseWindow.

◆ Poll() [3/3]

bool ehs::Window::Poll ( )
overridevirtual

Reimplemented from ehs::BaseWindow.

◆ RegistryHandler()

void ehs::Window::RegistryHandler ( void * data,
wl_registry * registry,
UInt_32 id,
const char * interface,
UInt_32 version )
staticprotected

◆ RegistryRemoved()

void ehs::Window::RegistryRemoved ( void * data,
wl_registry * registry,
UInt_32 id )
staticprotected

◆ ResizeEvent()

void ehs::Window::ResizeEvent ( void * data,
xdg_toplevel * xdg_toplevel,
Int_32 width,
Int_32 height,
wl_array * states )
staticprotected

◆ SeatCapabilitiesEvent()

void ehs::Window::SeatCapabilitiesEvent ( void * data,
wl_seat * seat,
UInt_32 capabilities )
staticprotected

◆ SendMsg()

void ehs::Window::SendMsg ( UINT msg,
WPARAM wParam,
LPARAM lParam )
protected

◆ SetClipboard() [1/3]

void ehs::Window::SetClipboard ( Serializer< UInt_64 > data)
overridevirtual

Implements ehs::BaseWindow.

◆ SetClipboard() [2/3]

void ehs::Window::SetClipboard ( Serializer< UInt_64 > data)
overridevirtual

Implements ehs::BaseWindow.

◆ SetClipboard() [3/3]

void ehs::Window::SetClipboard ( Serializer< UInt_64 > data)
overridevirtual

Implements ehs::BaseWindow.

◆ SetCursorImg() [1/3]

void ehs::Window::SetCursorImg ( const CursorImg img)
overridevirtual

Implements ehs::BaseWindow.

◆ SetCursorImg() [2/3]

void ehs::Window::SetCursorImg ( CursorImg img)
overridevirtual

Implements ehs::BaseWindow.

◆ SetCursorImg() [3/3]

void ehs::Window::SetCursorImg ( CursorImg img)
overridevirtual

Implements ehs::BaseWindow.

◆ SetIcon()

void ehs::Window::SetIcon ( const Str_8 & filePath)

◆ SetPos() [1/3]

void ehs::Window::SetPos ( const Vec2_s32 & newPos)
overridevirtual

Sets the windows position on the desktop.

Parameters
[in]xThe x axis in pixels.
[in]yThe y axis in pixels.

Implements ehs::BaseWindow.

◆ SetPos() [2/3]

void ehs::Window::SetPos ( const Vec2_s32 & newPos)
overridevirtual

Implements ehs::BaseWindow.

◆ SetPos() [3/3]

void ehs::Window::SetPos ( const Vec2_s32 & newPos)
overridevirtual

Implements ehs::BaseWindow.

◆ SetScale() [1/3]

void ehs::Window::SetScale ( const Vec2_u32 & newScale)
overridevirtual

Sets the windows scale which includes the border.

Parameters
[in]wThe width in pixels.
[in]hThe height in pixels.

Implements ehs::BaseWindow.

◆ SetScale() [2/3]

void ehs::Window::SetScale ( const Vec2_u32 & newScale)
overridevirtual

Implements ehs::BaseWindow.

◆ SetScale() [3/3]

void ehs::Window::SetScale ( const Vec2_u32 & newScale)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_16() [1/3]

void ehs::Window::SetTitle_16 ( const Str_16 & newTitle)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_16() [2/3]

void ehs::Window::SetTitle_16 ( const Str_16 & newTitle)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_16() [3/3]

void ehs::Window::SetTitle_16 ( const Str_16 & title)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_32() [1/3]

void ehs::Window::SetTitle_32 ( const Str_32 & newTitle)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_32() [2/3]

void ehs::Window::SetTitle_32 ( const Str_32 & newTitle)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_32() [3/3]

void ehs::Window::SetTitle_32 ( const Str_32 & title)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_8() [1/3]

void ehs::Window::SetTitle_8 ( const Str_8 & newTitle)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_8() [2/3]

void ehs::Window::SetTitle_8 ( const Str_8 & newTitle)
overridevirtual

Implements ehs::BaseWindow.

◆ SetTitle_8() [3/3]

void ehs::Window::SetTitle_8 ( const Str_8 & title)
overridevirtual

Implements ehs::BaseWindow.

◆ ShellPing()

void ehs::Window::ShellPing ( void * data,
xdg_wm_base * shell,
UInt_32 serial )
staticprotected

◆ Show() [1/3]

void ehs::Window::Show ( )
overridevirtual

Shows the window.

Implements ehs::BaseWindow.

◆ Show() [2/3]

void ehs::Window::Show ( )
overridevirtual

Implements ehs::BaseWindow.

◆ Show() [3/3]

void ehs::Window::Show ( )
overridevirtual

Implements ehs::BaseWindow.

◆ ShowCursor() [1/3]

void ehs::Window::ShowCursor ( bool toggle)
overridevirtual

Shows the cursor on the window.

Parameters
[in]toggleThe new status.

Implements ehs::BaseWindow.

◆ ShowCursor() [2/3]

void ehs::Window::ShowCursor ( bool toggle)
overridevirtual

Shows the cursor on the window.

Parameters
[in]toggleThe new status.

Implements ehs::BaseWindow.

◆ ShowCursor() [3/3]

void ehs::Window::ShowCursor ( bool toggle)
overridevirtual

Shows the cursor on the window.

Parameters
[in]toggleThe new status.

Implements ehs::BaseWindow.

◆ SurfaceConfigEvent()

void ehs::Window::SurfaceConfigEvent ( void * data,
xdg_surface * xdg_surface,
UInt_32 serial )
staticprotected

◆ ToggleEnabled()

void ehs::Window::ToggleEnabled ( bool toggle)

Toggles whether the window updates and renders.

Parameters
[in]toggleThe new status.

◆ Use()

void ehs::Window::Use ( HWND windowHdl)

Uses an already existing window to render an overlay.

Friends And Related Symbol Documentation

◆ Input

friend class Input
friend

Member Data Documentation

◆ clipboard

Serializer<UInt_64> ehs::Window::clipboard
protected

◆ compositor

wl_compositor* ehs::Window::compositor
protected

◆ dec

zxdg_toplevel_decoration_v1* ehs::Window::dec
protected

◆ decManager

zxdg_decoration_manager_v1* ehs::Window::decManager
protected

◆ display

wl_display* ehs::Window::display
protected

◆ events

Vector<xcb_generic_event_t*> ehs::Window::events
protected

◆ extOpCode

UInt_8 ehs::Window::extOpCode
protected

◆ hdl

xcb_window_t ehs::Window::hdl
protected

◆ masks

xcb_atom_t ehs::Window::masks[2]
protected

◆ pointer

wl_pointer* ehs::Window::pointer
protected

◆ registry

wl_registry* ehs::Window::registry
protected

◆ scale

Vec2_u32 ehs::Window::scale
protected

◆ screen

xcb_screen_t* ehs::Window::screen
protected

◆ seat

wl_seat* ehs::Window::seat
protected

◆ server

xcb_connection_t* ehs::Window::server
protected

◆ wlSurface

wl_surface* ehs::Window::wlSurface
protected

◆ xdgShell

xdg_wm_base* ehs::Window::xdgShell
protected

◆ xdgSurface

xdg_surface* ehs::Window::xdgSurface
protected

◆ xdgToplevel

xdg_toplevel* ehs::Window::xdgToplevel
protected

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