Otclient  14/8/2020
PlatformWindow Class Referenceabstract

#include <platformwindow.h>

Inheritance diagram for PlatformWindow:
Collaboration diagram for PlatformWindow:

Public Member Functions

virtual void init ()=0
 
virtual void terminate ()=0
 
virtual void move (const Point &pos)=0
 
virtual void resize (const Size &size)=0
 
virtual void show ()=0
 
virtual void hide ()=0
 
virtual void maximize ()=0
 
virtual void poll ()=0
 
virtual void swapBuffers ()=0
 
virtual void showMouse ()=0
 
virtual void hideMouse ()=0
 
virtual void displayFatalError (const std::string &message)
 
int loadMouseCursor (const std::string &file, const Point &hotSpot)
 
virtual void setMouseCursor (int cursorId)=0
 
virtual void restoreMouseCursor ()=0
 
virtual void setTitle (const std::string &title)=0
 
virtual void setMinimumSize (const Size &minimumSize)=0
 
virtual void setFullscreen (bool fullscreen)=0
 
virtual void setVerticalSync (bool enable)=0
 
virtual void setIcon (const std::string &iconFile)=0
 
virtual void setClipboardText (const std::string &text)=0
 
virtual Size getDisplaySize ()=0
 
virtual std::string getClipboardText ()=0
 
virtual std::string getPlatformType ()=0
 
int getDisplayWidth ()
 
int getDisplayHeight ()
 
Size getUnmaximizedSize ()
 
Size getSize ()
 
Size getMinimumSize ()
 
int getWidth ()
 
int getHeight ()
 
Point getUnmaximizedPos ()
 
Point getPosition ()
 
int getX ()
 
int getY ()
 
Point getMousePosition ()
 
int getKeyboardModifiers ()
 
bool isKeyPressed (Fw::Key keyCode)
 
bool isMouseButtonPressed (Fw::MouseButton mouseButton)
 
bool isVisible ()
 
bool isMaximized ()
 
bool isFullscreen ()
 
bool hasFocus ()
 
void setOnClose (const std::function< void()> &onClose)
 
void setOnResize (const OnResizeCallback &onResize)
 
void setOnInputEvent (const OnInputEventCallback &onInputEvent)
 

Protected Member Functions

virtual int internalLoadMouseCursor (const ImagePtr &image, const Point &hotSpot)=0
 
void updateUnmaximizedCoords ()
 
void processKeyDown (Fw::Key keyCode)
 
void processKeyUp (Fw::Key keyCode)
 
void releaseAllKeys ()
 
void fireKeysPress ()
 

Protected Attributes

std::map< int, Fw::Keym_keyMap
 
std::map< Fw::Key, stdext::boolean< false > > m_keysState
 
std::map< Fw::Key, ticks_tm_firstKeysPress
 
std::map< Fw::Key, ticks_tm_lastKeysPress
 
Timer m_keyPressTimer
 
Size m_size
 
Size m_minimumSize
 
Point m_position
 
Size m_unmaximizedSize
 
Point m_unmaximizedPos
 
InputEvent m_inputEvent
 
stdext::boolean< false > m_mouseButtonStates [4]
 
stdext::boolean< false > m_created
 
stdext::boolean< false > m_visible
 
stdext::boolean< false > m_focused
 
stdext::boolean< false > m_fullscreen
 
stdext::boolean< false > m_maximized
 
std::function< void()> m_onClose
 
OnResizeCallback m_onResize
 
OnInputEventCallback m_onInputEvent
 

Detailed Description

Definition at line 32 of file platformwindow.h.

Member Function Documentation

◆ displayFatalError()

virtual void PlatformWindow::displayFatalError ( const std::string &  message)
inlinevirtual

Reimplemented in WIN32Window.

Definition at line 54 of file platformwindow.h.

Here is the caller graph for this function:

◆ fireKeysPress()

void PlatformWindow::fireKeysPress ( )
protected

Definition at line 157 of file platformwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClipboardText()

virtual std::string PlatformWindow::getClipboardText ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ getDisplayHeight()

int PlatformWindow::getDisplayHeight ( )
inline

Definition at line 72 of file platformwindow.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDisplaySize()

virtual Size PlatformWindow::getDisplaySize ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ getDisplayWidth()

int PlatformWindow::getDisplayWidth ( )
inline

Definition at line 71 of file platformwindow.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHeight()

int PlatformWindow::getHeight ( )
inline

Definition at line 78 of file platformwindow.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getKeyboardModifiers()

int PlatformWindow::getKeyboardModifiers ( )
inline

Definition at line 84 of file platformwindow.h.

Here is the caller graph for this function:

◆ getMinimumSize()

Size PlatformWindow::getMinimumSize ( )
inline

Definition at line 76 of file platformwindow.h.

◆ getMousePosition()

Point PlatformWindow::getMousePosition ( )
inline

Definition at line 83 of file platformwindow.h.

Here is the caller graph for this function:

◆ getPlatformType()

virtual std::string PlatformWindow::getPlatformType ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ getPosition()

Point PlatformWindow::getPosition ( )
inline

Definition at line 80 of file platformwindow.h.

Here is the caller graph for this function:

◆ getSize()

Size PlatformWindow::getSize ( )
inline

Definition at line 75 of file platformwindow.h.

Here is the caller graph for this function:

◆ getUnmaximizedPos()

Point PlatformWindow::getUnmaximizedPos ( )
inline

Definition at line 79 of file platformwindow.h.

Here is the caller graph for this function:

◆ getUnmaximizedSize()

Size PlatformWindow::getUnmaximizedSize ( )
inline

Definition at line 74 of file platformwindow.h.

Here is the caller graph for this function:

◆ getWidth()

int PlatformWindow::getWidth ( )
inline

Definition at line 77 of file platformwindow.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getX()

int PlatformWindow::getX ( )
inline

Definition at line 81 of file platformwindow.h.

Here is the caller graph for this function:

◆ getY()

int PlatformWindow::getY ( )
inline

Definition at line 82 of file platformwindow.h.

Here is the caller graph for this function:

◆ hasFocus()

bool PlatformWindow::hasFocus ( )
inline

Definition at line 91 of file platformwindow.h.

Here is the caller graph for this function:

◆ hide()

virtual void PlatformWindow::hide ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ hideMouse()

virtual void PlatformWindow::hideMouse ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ init()

virtual void PlatformWindow::init ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ internalLoadMouseCursor()

virtual int PlatformWindow::internalLoadMouseCursor ( const ImagePtr image,
const Point hotSpot 
)
protectedpure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ isFullscreen()

bool PlatformWindow::isFullscreen ( )
inline

Definition at line 90 of file platformwindow.h.

Here is the caller graph for this function:

◆ isKeyPressed()

bool PlatformWindow::isKeyPressed ( Fw::Key  keyCode)
inline

Definition at line 86 of file platformwindow.h.

Here is the caller graph for this function:

◆ isMaximized()

bool PlatformWindow::isMaximized ( )
inline

Definition at line 89 of file platformwindow.h.

Here is the caller graph for this function:

◆ isMouseButtonPressed()

bool PlatformWindow::isMouseButtonPressed ( Fw::MouseButton  mouseButton)
inline

Definition at line 87 of file platformwindow.h.

Here is the caller graph for this function:

◆ isVisible()

bool PlatformWindow::isVisible ( )
inline

Definition at line 88 of file platformwindow.h.

Here is the caller graph for this function:

◆ loadMouseCursor()

int PlatformWindow::loadMouseCursor ( const std::string &  file,
const Point hotSpot 
)

Definition at line 39 of file platformwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ maximize()

virtual void PlatformWindow::maximize ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ move()

virtual void PlatformWindow::move ( const Point pos)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ poll()

virtual void PlatformWindow::poll ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ processKeyDown()

void PlatformWindow::processKeyDown ( Fw::Key  keyCode)
protected

Definition at line 69 of file platformwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processKeyUp()

void PlatformWindow::processKeyUp ( Fw::Key  keyCode)
protected

Definition at line 106 of file platformwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ releaseAllKeys()

void PlatformWindow::releaseAllKeys ( )
protected

Definition at line 139 of file platformwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize()

virtual void PlatformWindow::resize ( const Size size)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ restoreMouseCursor()

virtual void PlatformWindow::restoreMouseCursor ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ setClipboardText()

virtual void PlatformWindow::setClipboardText ( const std::string &  text)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ setFullscreen()

virtual void PlatformWindow::setFullscreen ( bool  fullscreen)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ setIcon()

virtual void PlatformWindow::setIcon ( const std::string &  iconFile)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ setMinimumSize()

virtual void PlatformWindow::setMinimumSize ( const Size minimumSize)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ setMouseCursor()

virtual void PlatformWindow::setMouseCursor ( int  cursorId)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ setOnClose()

void PlatformWindow::setOnClose ( const std::function< void()> &  onClose)
inline

Definition at line 93 of file platformwindow.h.

Here is the caller graph for this function:

◆ setOnInputEvent()

void PlatformWindow::setOnInputEvent ( const OnInputEventCallback &  onInputEvent)
inline

Definition at line 95 of file platformwindow.h.

Here is the caller graph for this function:

◆ setOnResize()

void PlatformWindow::setOnResize ( const OnResizeCallback &  onResize)
inline

Definition at line 94 of file platformwindow.h.

Here is the caller graph for this function:

◆ setTitle()

virtual void PlatformWindow::setTitle ( const std::string &  title)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ setVerticalSync()

virtual void PlatformWindow::setVerticalSync ( bool  enable)
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ show()

virtual void PlatformWindow::show ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ showMouse()

virtual void PlatformWindow::showMouse ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ swapBuffers()

virtual void PlatformWindow::swapBuffers ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ terminate()

virtual void PlatformWindow::terminate ( )
pure virtual

Implemented in WIN32Window, and X11Window.

Here is the caller graph for this function:

◆ updateUnmaximizedCoords()

void PlatformWindow::updateUnmaximizedCoords ( )
protected

Definition at line 61 of file platformwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_created

stdext::boolean<false> PlatformWindow::m_created
protected

Definition at line 121 of file platformwindow.h.

◆ m_firstKeysPress

std::map<Fw::Key, ticks_t> PlatformWindow::m_firstKeysPress
protected

Definition at line 109 of file platformwindow.h.

◆ m_focused

stdext::boolean<false> PlatformWindow::m_focused
protected

Definition at line 123 of file platformwindow.h.

◆ m_fullscreen

stdext::boolean<false> PlatformWindow::m_fullscreen
protected

Definition at line 124 of file platformwindow.h.

◆ m_inputEvent

InputEvent PlatformWindow::m_inputEvent
protected

Definition at line 118 of file platformwindow.h.

◆ m_keyMap

std::map<int, Fw::Key> PlatformWindow::m_keyMap
protected

Definition at line 107 of file platformwindow.h.

◆ m_keyPressTimer

Timer PlatformWindow::m_keyPressTimer
protected

Definition at line 111 of file platformwindow.h.

◆ m_keysState

std::map<Fw::Key, stdext::boolean<false> > PlatformWindow::m_keysState
protected

Definition at line 108 of file platformwindow.h.

◆ m_lastKeysPress

std::map<Fw::Key, ticks_t> PlatformWindow::m_lastKeysPress
protected

Definition at line 110 of file platformwindow.h.

◆ m_maximized

stdext::boolean<false> PlatformWindow::m_maximized
protected

Definition at line 125 of file platformwindow.h.

◆ m_minimumSize

Size PlatformWindow::m_minimumSize
protected

Definition at line 114 of file platformwindow.h.

◆ m_mouseButtonStates

stdext::boolean<false> PlatformWindow::m_mouseButtonStates[4]
protected

Definition at line 119 of file platformwindow.h.

◆ m_onClose

std::function<void()> PlatformWindow::m_onClose
protected

Definition at line 127 of file platformwindow.h.

◆ m_onInputEvent

OnInputEventCallback PlatformWindow::m_onInputEvent
protected

Definition at line 129 of file platformwindow.h.

◆ m_onResize

OnResizeCallback PlatformWindow::m_onResize
protected

Definition at line 128 of file platformwindow.h.

◆ m_position

Point PlatformWindow::m_position
protected

Definition at line 115 of file platformwindow.h.

◆ m_size

Size PlatformWindow::m_size
protected

Definition at line 113 of file platformwindow.h.

◆ m_unmaximizedPos

Point PlatformWindow::m_unmaximizedPos
protected

Definition at line 117 of file platformwindow.h.

◆ m_unmaximizedSize

Size PlatformWindow::m_unmaximizedSize
protected

Definition at line 116 of file platformwindow.h.

◆ m_visible

stdext::boolean<false> PlatformWindow::m_visible
protected

Definition at line 122 of file platformwindow.h.


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