Lugdunum  0.1.0
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lug::Window::priv::WindowImpl Class Reference

#include <WindowImplAndroid.hpp>

Collaboration diagram for lug::Window::priv::WindowImpl:
[legend]

Public Member Functions

 WindowImpl (Window *)
 
 ~WindowImpl ()=default
 
bool init (const Window::InitInfo &initInfo)
 
void close ()
 
bool pollEvent (lug::Window::Event &event)
 
void setKeyRepeat (bool state)
 
void setMouseCursorVisible (bool visible)
 
void setMousePos (const Math::Vec2i &mousePosition)
 
ANativeWindow * getWindow ()
 
 WindowImpl (Window *)
 
 ~WindowImpl ()=default
 
 WindowImpl (const WindowImpl &)=delete
 
 WindowImpl (WindowImpl &&)=delete
 
WindowImploperator= (const WindowImpl &)=delete
 
WindowImploperator= (WindowImpl &&)=delete
 
bool init (const Window::InitInfo &initInfo)
 
void close ()
 
bool pollEvent (lug::Window::Event &event)
 
void setKeyRepeat (bool state)
 
void setMouseCursorVisible (bool visible)
 
void setMousePos (const Math::Vec2i &mousePosition)
 
Display * getDisplay () const
 
::Window getWindow () const
 
 WindowImpl (Window *)
 
 ~WindowImpl ()
 
 WindowImpl (const WindowImpl &)=delete
 
 WindowImpl (WindowImpl &&)=delete
 
WindowImploperator= (const WindowImpl &)=delete
 
WindowImploperator= (WindowImpl &&)=delete
 
bool init (const Window::InitInfo &initInfo)
 
void close ()
 
bool pollEvent (lug::Window::Event &)
 
void setKeyRepeat (bool state)
 
void setMouseCursorVisible (bool visible)
 
void setMousePos (const Math::Vec2i &mousePosition)
 
HWND getHandle () const
 
HINSTANCE getHinstance () const
 

Static Public Attributes

static std::queue< lug::Window::Eventevents
 
static AInputQueue * inputQueue = nullptr
 
static ANativeWindow * nativeWindow = nullptr
 
static ANativeActivity * activity = nullptr
 
static std::mutex androidMutex
 
static std::condition_variable cv
 

Private Member Functions

float MapCenteredAxis (AInputEvent *event, int32_t axis)
 
int32_t HandleInput (lug::Window::Event &event, AInputEvent *androidEvent)
 
void setWindowDecorations (Style style)
 
bool shouldIgnoreRepeated (XEvent &xEvent)
 This functions filters event depending on the value of _keyRepeat. More...
 
void processWindowEvents (UINT message, WPARAM wParam, LPARAM lParam)
 
void registerWindow () const
 
bool activateFullscreen ()
 
Keyboard::Key getKeyCode (WPARAM wParam, LPARAM lParam)
 
void configKeyEvent (KeyEvent &key, WPARAM wParam, LPARAM lParam)
 
void configMouseEvent (MouseEvent &mouse, WPARAM wParam, LPARAM lParam)
 
void getMouseEventModifier (MouseEvent &mouse, WPARAM wParam)
 
void getMouseCoord (MouseEvent &mouse, LPARAM lParam)
 
void configMouseButtonEvent (MouseEvent &mouse, UINT message, WPARAM wParam, LPARAM lParam)
 
void configMouseWheelEvent (MouseEvent &mouse, UINT message, WPARAM wParam)
 

Static Private Member Functions

static LRESULT CALLBACK onEvent (HWND handle, UINT message, WPARAM wParam, LPARAM lParam)
 

Private Attributes

Window_parent {nullptr}
 
ndk_helper::DoubletapDetector doubletap_detector_
 
ndk_helper::PinchDetector pinch_detector_
 
ndk_helper::DragDetector drag_detector_
 
Display * _display {nullptr}
 
::Window _window {0}
 
Atom _wmProtocols
 
Atom _wmDeleteWindow
 
Atom _wmHints
 
Cursor _hiddenCursor {0}
 Invisible cursor used to hide the pointer. More...
 
bool _keyRepeat {true}
 
const wchar_t * className {L"LUG_Window"}
 
std::queue< lug::Window::Event_events
 
HWND _handle {nullptr}
 Win32 handle of the window. More...
 
HINSTANCE _hinstance {nullptr}
 Win32 instance. More...
 
LONG_PTR _callback {0}
 Stores the original event callback function of the control. More...
 
HCURSOR _cursor {nullptr}
 The system cursor to display into the window. More...
 
HICON _icon {nullptr}
 Custom icon assigned to the window. More...
 
bool _fullscreen {false}
 Is the window full-screen? More...
 
bool _mouseIsIn {false}
 Boolean used to know if the mouse is in or out of the screen. More...
 

Static Private Attributes

static uint8_t _windowCount = 0
 
static lug::Window::priv::WindowImpl_fullscreenWindow = nullptr
 

Detailed Description

Definition at line 15 of file WindowImplAndroid.hpp.

Constructor & Destructor Documentation

◆ WindowImpl() [1/7]

lug::Window::priv::WindowImpl::WindowImpl ( Window win)

Definition at line 15 of file WindowImplAndroid.cpp.

◆ ~WindowImpl() [1/3]

lug::Window::priv::WindowImpl::~WindowImpl ( )
default

Definition at line 14 of file WindowImplWin32.cpp.

◆ WindowImpl() [2/7]

lug::Window::priv::WindowImpl::WindowImpl ( Window )

◆ ~WindowImpl() [2/3]

lug::Window::priv::WindowImpl::~WindowImpl ( )
default

◆ WindowImpl() [3/7]

lug::Window::priv::WindowImpl::WindowImpl ( const WindowImpl )
delete

◆ WindowImpl() [4/7]

lug::Window::priv::WindowImpl::WindowImpl ( WindowImpl &&  )
delete

◆ WindowImpl() [5/7]

lug::Window::priv::WindowImpl::WindowImpl ( Window )

◆ ~WindowImpl() [3/3]

lug::Window::priv::WindowImpl::~WindowImpl ( )

◆ WindowImpl() [6/7]

lug::Window::priv::WindowImpl::WindowImpl ( const WindowImpl )
delete

◆ WindowImpl() [7/7]

lug::Window::priv::WindowImpl::WindowImpl ( WindowImpl &&  )
delete

Member Function Documentation

◆ init() [1/3]

bool lug::Window::priv::WindowImpl::init ( const Window::InitInfo initInfo)

Definition at line 17 of file WindowImplAndroid.cpp.

◆ close() [1/3]

void lug::Window::priv::WindowImpl::close ( )

Definition at line 27 of file WindowImplAndroid.cpp.

◆ pollEvent() [1/3]

bool lug::Window::priv::WindowImpl::pollEvent ( lug::Window::Event event)

Definition at line 87 of file WindowImplAndroid.cpp.

◆ setKeyRepeat() [1/3]

void lug::Window::priv::WindowImpl::setKeyRepeat ( bool  state)

Definition at line 113 of file WindowImplAndroid.cpp.

◆ setMouseCursorVisible() [1/3]

void lug::Window::priv::WindowImpl::setMouseCursorVisible ( bool  visible)

Definition at line 118 of file WindowImplAndroid.cpp.

◆ setMousePos() [1/3]

void lug::Window::priv::WindowImpl::setMousePos ( const Math::Vec2i &  mousePosition)

Definition at line 123 of file WindowImplAndroid.cpp.

◆ getWindow() [1/2]

ANativeWindow * lug::Window::priv::WindowImpl::getWindow ( )

Definition at line 29 of file WindowImplAndroid.cpp.

◆ MapCenteredAxis()

float lug::Window::priv::WindowImpl::MapCenteredAxis ( AInputEvent *  event,
int32_t  axis 
)
private

Definition at line 34 of file WindowImplAndroid.cpp.

◆ HandleInput()

int32_t lug::Window::priv::WindowImpl::HandleInput ( lug::Window::Event event,
AInputEvent *  androidEvent 
)
private

Definition at line 46 of file WindowImplAndroid.cpp.

◆ operator=() [1/4]

WindowImpl& lug::Window::priv::WindowImpl::operator= ( const WindowImpl )
delete

◆ operator=() [2/4]

WindowImpl& lug::Window::priv::WindowImpl::operator= ( WindowImpl &&  )
delete

◆ init() [2/3]

bool lug::Window::priv::WindowImpl::init ( const Window::InitInfo initInfo)

◆ close() [2/3]

void lug::Window::priv::WindowImpl::close ( )

◆ pollEvent() [2/3]

bool lug::Window::priv::WindowImpl::pollEvent ( lug::Window::Event event)

◆ setKeyRepeat() [2/3]

void lug::Window::priv::WindowImpl::setKeyRepeat ( bool  state)

◆ setMouseCursorVisible() [2/3]

void lug::Window::priv::WindowImpl::setMouseCursorVisible ( bool  visible)

◆ setMousePos() [2/3]

void lug::Window::priv::WindowImpl::setMousePos ( const Math::Vec2i &  mousePosition)

◆ getDisplay()

Display * lug::Window::priv::WindowImpl::getDisplay ( ) const

Definition at line 524 of file WindowImplX11.cpp.

◆ getWindow() [2/2]

Window lug::Window::priv::WindowImpl::getWindow ( ) const

Definition at line 528 of file WindowImplX11.cpp.

◆ setWindowDecorations()

void lug::Window::priv::WindowImpl::setWindowDecorations ( Style  style)
private

Definition at line 569 of file WindowImplX11.cpp.

◆ shouldIgnoreRepeated()

bool lug::Window::priv::WindowImpl::shouldIgnoreRepeated ( XEvent &  xEvent)
private

This functions filters event depending on the value of _keyRepeat.

Parameters
xEventThe x event to filter.
Returns
True if the event should be ignored, False if it should be keeped.

Definition at line 363 of file WindowImplX11.cpp.

◆ operator=() [3/4]

WindowImpl& lug::Window::priv::WindowImpl::operator= ( const WindowImpl )
delete

◆ operator=() [4/4]

WindowImpl& lug::Window::priv::WindowImpl::operator= ( WindowImpl &&  )
delete

◆ init() [3/3]

bool lug::Window::priv::WindowImpl::init ( const Window::InitInfo initInfo)

◆ close() [3/3]

void lug::Window::priv::WindowImpl::close ( )

◆ pollEvent() [3/3]

bool lug::Window::priv::WindowImpl::pollEvent ( lug::Window::Event )

◆ setKeyRepeat() [3/3]

void lug::Window::priv::WindowImpl::setKeyRepeat ( bool  state)

◆ setMouseCursorVisible() [3/3]

void lug::Window::priv::WindowImpl::setMouseCursorVisible ( bool  visible)

◆ setMousePos() [3/3]

void lug::Window::priv::WindowImpl::setMousePos ( const Math::Vec2i &  mousePosition)

◆ getHandle()

HWND lug::Window::priv::WindowImpl::getHandle ( ) const

Definition at line 379 of file WindowImplWin32.cpp.

◆ getHinstance()

HINSTANCE lug::Window::priv::WindowImpl::getHinstance ( ) const

Definition at line 383 of file WindowImplWin32.cpp.

◆ processWindowEvents()

void lug::Window::priv::WindowImpl::processWindowEvents ( UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 387 of file WindowImplWin32.cpp.

◆ registerWindow()

void lug::Window::priv::WindowImpl::registerWindow ( ) const
private

Definition at line 506 of file WindowImplWin32.cpp.

◆ activateFullscreen()

bool lug::Window::priv::WindowImpl::activateFullscreen ( )
private

Definition at line 526 of file WindowImplWin32.cpp.

◆ getKeyCode()

Keyboard::Key lug::Window::priv::WindowImpl::getKeyCode ( WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 561 of file WindowImplWin32.cpp.

◆ configKeyEvent()

void lug::Window::priv::WindowImpl::configKeyEvent ( KeyEvent key,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 585 of file WindowImplWin32.cpp.

◆ configMouseEvent()

void lug::Window::priv::WindowImpl::configMouseEvent ( MouseEvent mouse,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 620 of file WindowImplWin32.cpp.

◆ getMouseEventModifier()

void lug::Window::priv::WindowImpl::getMouseEventModifier ( MouseEvent mouse,
WPARAM  wParam 
)
private

Definition at line 633 of file WindowImplWin32.cpp.

◆ getMouseCoord()

void lug::Window::priv::WindowImpl::getMouseCoord ( MouseEvent mouse,
LPARAM  lParam 
)
private

Definition at line 665 of file WindowImplWin32.cpp.

◆ configMouseButtonEvent()

void lug::Window::priv::WindowImpl::configMouseButtonEvent ( MouseEvent mouse,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 593 of file WindowImplWin32.cpp.

◆ configMouseWheelEvent()

void lug::Window::priv::WindowImpl::configMouseWheelEvent ( MouseEvent mouse,
UINT  message,
WPARAM  wParam 
)
private

Definition at line 670 of file WindowImplWin32.cpp.

◆ onEvent()

LRESULT CALLBACK lug::Window::priv::WindowImpl::onEvent ( HWND  handle,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
staticprivate

Definition at line 684 of file WindowImplWin32.cpp.

Member Data Documentation

◆ events

std::queue< lug::Window::Event > lug::Window::priv::WindowImpl::events
static

Definition at line 29 of file WindowImplAndroid.hpp.

◆ inputQueue

AInputQueue * lug::Window::priv::WindowImpl::inputQueue = nullptr
static

Definition at line 30 of file WindowImplAndroid.hpp.

◆ nativeWindow

ANativeWindow * lug::Window::priv::WindowImpl::nativeWindow = nullptr
static

Definition at line 31 of file WindowImplAndroid.hpp.

◆ activity

ANativeActivity * lug::Window::priv::WindowImpl::activity = nullptr
static

Definition at line 32 of file WindowImplAndroid.hpp.

◆ androidMutex

std::mutex lug::Window::priv::WindowImpl::androidMutex
static

Definition at line 33 of file WindowImplAndroid.hpp.

◆ cv

std::condition_variable lug::Window::priv::WindowImpl::cv
static

Definition at line 34 of file WindowImplAndroid.hpp.

◆ _parent

Window * lug::Window::priv::WindowImpl::_parent {nullptr}
private

Definition at line 40 of file WindowImplAndroid.hpp.

◆ doubletap_detector_

ndk_helper::DoubletapDetector lug::Window::priv::WindowImpl::doubletap_detector_
private

Definition at line 42 of file WindowImplAndroid.hpp.

◆ pinch_detector_

ndk_helper::PinchDetector lug::Window::priv::WindowImpl::pinch_detector_
private

Definition at line 43 of file WindowImplAndroid.hpp.

◆ drag_detector_

ndk_helper::DragDetector lug::Window::priv::WindowImpl::drag_detector_
private

Definition at line 44 of file WindowImplAndroid.hpp.

◆ _display

Display* lug::Window::priv::WindowImpl::_display {nullptr}
private

Definition at line 39 of file WindowImplX11.hpp.

◆ _window

::Window lug::Window::priv::WindowImpl::_window {0}
private

Definition at line 40 of file WindowImplX11.hpp.

◆ _wmProtocols

Atom lug::Window::priv::WindowImpl::_wmProtocols
private

Definition at line 42 of file WindowImplX11.hpp.

◆ _wmDeleteWindow

Atom lug::Window::priv::WindowImpl::_wmDeleteWindow
private

Definition at line 43 of file WindowImplX11.hpp.

◆ _wmHints

Atom lug::Window::priv::WindowImpl::_wmHints
private

Definition at line 44 of file WindowImplX11.hpp.

◆ _hiddenCursor

Cursor lug::Window::priv::WindowImpl::_hiddenCursor {0}
private

Invisible cursor used to hide the pointer.

Definition at line 46 of file WindowImplX11.hpp.

◆ _keyRepeat

bool lug::Window::priv::WindowImpl::_keyRepeat {true}
private

Definition at line 48 of file WindowImplX11.hpp.

◆ className

const wchar_t* lug::Window::priv::WindowImpl::className {L"LUG_Window"}
private

Definition at line 52 of file WindowImplWin32.hpp.

◆ _events

std::queue<lug::Window::Event> lug::Window::priv::WindowImpl::_events
private

Definition at line 55 of file WindowImplWin32.hpp.

◆ _handle

HWND lug::Window::priv::WindowImpl::_handle {nullptr}
private

Win32 handle of the window.

Definition at line 57 of file WindowImplWin32.hpp.

◆ _hinstance

HINSTANCE lug::Window::priv::WindowImpl::_hinstance {nullptr}
private

Win32 instance.

Definition at line 58 of file WindowImplWin32.hpp.

◆ _callback

LONG_PTR lug::Window::priv::WindowImpl::_callback {0}
private

Stores the original event callback function of the control.

Definition at line 59 of file WindowImplWin32.hpp.

◆ _cursor

HCURSOR lug::Window::priv::WindowImpl::_cursor {nullptr}
private

The system cursor to display into the window.

Definition at line 60 of file WindowImplWin32.hpp.

◆ _icon

HICON lug::Window::priv::WindowImpl::_icon {nullptr}
private

Custom icon assigned to the window.

Definition at line 61 of file WindowImplWin32.hpp.

◆ _fullscreen

bool lug::Window::priv::WindowImpl::_fullscreen {false}
private

Is the window full-screen?

Definition at line 62 of file WindowImplWin32.hpp.

◆ _windowCount

uint8_t lug::Window::priv::WindowImpl::_windowCount = 0
staticprivate

Definition at line 64 of file WindowImplWin32.hpp.

◆ _fullscreenWindow

WindowImpl * lug::Window::priv::WindowImpl::_fullscreenWindow = nullptr
staticprivate

Definition at line 65 of file WindowImplWin32.hpp.

◆ _mouseIsIn

bool lug::Window::priv::WindowImpl::_mouseIsIn {false}
private

Boolean used to know if the mouse is in or out of the screen.

Definition at line 68 of file WindowImplWin32.hpp.


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