Blender  V2.93
List of all members
GHOST_SystemWayland Class Reference

#include <GHOST_SystemWayland.h>

Inherits GHOST_System.

Public Member Functions

Ghost Implementation

Wayland specific implementation of the GHOST_System interface.

 GHOST_SystemWayland ()
 
 ~GHOST_SystemWayland () override
 
bool processEvents (bool waitForEvent) override
 
int toggleConsole (int action) override
 
GHOST_TSuccess getModifierKeys (GHOST_ModifierKeys &keys) const override
 
GHOST_TSuccess getButtons (GHOST_Buttons &buttons) const override
 
GHOST_TUns8getClipboard (bool selection) const override
 
void putClipboard (GHOST_TInt8 *buffer, bool selection) const override
 
GHOST_TUns8 getNumDisplays () const override
 
GHOST_TSuccess getCursorPosition (GHOST_TInt32 &x, GHOST_TInt32 &y) const override
 
GHOST_TSuccess setCursorPosition (GHOST_TInt32 x, GHOST_TInt32 y) override
 
void getMainDisplayDimensions (GHOST_TUns32 &width, GHOST_TUns32 &height) const override
 
void getAllDisplayDimensions (GHOST_TUns32 &width, GHOST_TUns32 &height) const override
 
GHOST_IContextcreateOffscreenContext (GHOST_GLSettings glSettings) override
 
GHOST_TSuccess disposeContext (GHOST_IContext *context) override
 
GHOST_IWindowcreateWindow (const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings, const bool exclusive, const bool is_dialog, const GHOST_IWindow *parentWindow) override
 
wl_display * display ()
 
wl_compositor * compositor ()
 
xdg_wm_base * shell ()
 
void setSelection (const std::string &selection)
 
GHOST_TSuccess setCursorShape (GHOST_TStandardCursor shape)
 
GHOST_TSuccess hasCursorShape (GHOST_TStandardCursor cursorShape)
 
GHOST_TSuccess setCustomCursorShape (GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
 
GHOST_TSuccess setCursorVisibility (bool visible)
 
GHOST_TSuccess setCursorGrab (const GHOST_TGrabCursorMode mode, wl_surface *surface)
 
- Public Member Functions inherited from GHOST_System
virtual GHOST_TUns64 getMilliSeconds () const
 
GHOST_ITimerTaskinstallTimer (GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=NULL)
 
GHOST_TSuccess removeTimer (GHOST_ITimerTask *timerTask)
 
GHOST_TSuccess disposeWindow (GHOST_IWindow *window)
 
bool validWindow (GHOST_IWindow *window)
 
GHOST_TSuccess beginFullScreen (const GHOST_DisplaySetting &setting, GHOST_IWindow **window, const bool stereoVisual, const bool alphaBackground)
 
GHOST_TSuccess updateFullScreen (const GHOST_DisplaySetting &setting, GHOST_IWindow **window)
 
GHOST_TSuccess endFullScreen (void)
 
bool getFullScreen (void)
 
bool useNativePixel (void)
 
void useWindowFocus (const bool use_focus)
 
void dispatchEvents ()
 
GHOST_TSuccess addEventConsumer (GHOST_IEventConsumer *consumer)
 
GHOST_TSuccess removeEventConsumer (GHOST_IEventConsumer *consumer)
 
GHOST_TSuccess getModifierKeyState (GHOST_TModifierKeyMask mask, bool &isDown) const
 
GHOST_TSuccess getButtonState (GHOST_TButtonMask mask, bool &isDown) const
 
void setTabletAPI (GHOST_TTabletAPI api)
 
GHOST_TTabletAPI getTabletAPI (void)
 
GHOST_TSuccess pushEvent (GHOST_IEvent *event)
 
GHOST_TimerManagergetTimerManager () const
 
GHOST_EventManagergetEventManager () const
 
GHOST_WindowManagergetWindowManager () const
 
virtual GHOST_TSuccess showMessageBox (const char *, const char *, const char *, const char *, const char *, GHOST_DialogOptions) const
 
virtual void initDebug (bool is_debug_enabled)
 
virtual bool isDebugEnabled ()
 

Additional Inherited Members

- Static Public Member Functions inherited from GHOST_ISystem
static GHOST_TSuccess createSystem ()
 
static GHOST_TSuccess disposeSystem ()
 
static GHOST_ISystemgetSystem ()
 
- Public Attributes inherited from GHOST_System
bool m_nativePixel
 
bool m_windowFocus
 
- Protected Member Functions inherited from GHOST_System
 GHOST_System ()
 
virtual ~GHOST_System ()
 
virtual GHOST_TSuccess init ()
 
virtual GHOST_TSuccess exit ()
 
GHOST_TSuccess createFullScreenWindow (GHOST_Window **window, const GHOST_DisplaySetting &settings, const bool stereoVisual, const bool alphaBackground=0)
 
- Protected Member Functions inherited from GHOST_ISystem
 GHOST_ISystem ()
 
virtual ~GHOST_ISystem ()
 
- Protected Attributes inherited from GHOST_System
GHOST_DisplayManagerm_displayManager
 
GHOST_TimerManagerm_timerManager
 
GHOST_WindowManagerm_windowManager
 
GHOST_EventManagerm_eventManager
 
GHOST_DisplaySetting m_preFullScreenSetting
 
GHOST_TTabletAPI m_tabletAPI
 
bool m_is_debug_enabled
 
- Static Protected Attributes inherited from GHOST_ISystem
static GHOST_ISystemm_system = NULL
 

Detailed Description

Definition at line 37 of file GHOST_SystemWayland.h.

Constructor & Destructor Documentation

◆ GHOST_SystemWayland()

GHOST_SystemWayland::GHOST_SystemWayland ( )

◆ ~GHOST_SystemWayland()

GHOST_SystemWayland::~GHOST_SystemWayland ( )
override

Definition at line 1350 of file GHOST_SystemWayland.cpp.

References display_destroy().

Member Function Documentation

◆ compositor()

wl_compositor * GHOST_SystemWayland::compositor ( )

◆ createOffscreenContext()

GHOST_IContext * GHOST_SystemWayland::createOffscreenContext ( GHOST_GLSettings  glSettings)
overridevirtual

Create a new offscreen context. Never explicitly delete the context, use disposeContext() instead.

Returns
The new context (or 0 if creation failed).

Implements GHOST_System.

Definition at line 1484 of file GHOST_SystemWayland.cpp.

References compositor(), context, display_t::display, GHOST_OPENGL_EGL_CONTEXT_FLAGS, GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY, GHOST_PRINT, display_t::os_egl_windows, and display_t::os_surfaces.

◆ createWindow()

GHOST_IWindow * GHOST_SystemWayland::createWindow ( const char *  title,
GHOST_TInt32  left,
GHOST_TInt32  top,
GHOST_TUns32  width,
GHOST_TUns32  height,
GHOST_TWindowState  state,
GHOST_TDrawingContextType  type,
GHOST_GLSettings  glSettings,
const bool  exclusive,
const bool  is_dialog,
const GHOST_IWindow parentWindow 
)
overridevirtual

Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.

Parameters
titleThe name of the window (displayed in the title bar of the window if the OS supports it).
leftThe coordinate of the left edge of the window.
topThe coordinate of the top edge of the window.
widthThe width the window.
heightThe height the window.
stateThe state of the window when opened.
typeThe type of drawing context installed in this window.
glSettingsMisc OpenGL settings.
exclusiveUse to show the window on top and ignore others (used full-screen).
is_dialogStay on top of parent window, no icon in taskbar, can't be minimized.
parentWindowParent (embedder) window
Returns
The new window (or 0 if creation failed).

Implements GHOST_ISystem.

Definition at line 1521 of file GHOST_SystemWayland.cpp.

References GHOST_WindowManager::addWindow(), GHOST_GLSettings::flags, GHOST_System::getMilliSeconds(), GHOST_Window::getValid(), GHOST_glStereoVisual, GHOST_kEventWindowSize, height, left, GHOST_System::m_windowManager, GHOST_System::pushEvent(), GHOST_WindowManager::setActiveWindow(), state, top, type, and width.

◆ display()

wl_display * GHOST_SystemWayland::display ( )

◆ disposeContext()

GHOST_TSuccess GHOST_SystemWayland::disposeContext ( GHOST_IContext context)
overridevirtual

Dispose of a context.

Parameters
contextPointer to the context to be disposed.
Returns
Indication of success.

Implements GHOST_ISystem.

Definition at line 1515 of file GHOST_SystemWayland.cpp.

References context, and GHOST_kSuccess.

◆ getAllDisplayDimensions()

void GHOST_SystemWayland::getAllDisplayDimensions ( GHOST_TUns32 width,
GHOST_TUns32 height 
) const
overridevirtual

Returns the combine dimensions of all monitors.

Returns
The dimension of the workspace.

Implements GHOST_ISystem.

Definition at line 1479 of file GHOST_SystemWayland.cpp.

References getMainDisplayDimensions(), height, and width.

◆ getButtons()

GHOST_TSuccess GHOST_SystemWayland::getButtons ( GHOST_Buttons buttons) const
overridevirtual

Returns the state of the mouse buttons (outside the message queue).

Parameters
buttonsThe state of the buttons.
Returns
Indication of success.

Implements GHOST_System.

Definition at line 1405 of file GHOST_SystemWayland.cpp.

References GHOST_kFailure, GHOST_kSuccess, and display_t::inputs.

◆ getClipboard()

GHOST_TUns8 * GHOST_SystemWayland::getClipboard ( bool  selection) const
overridevirtual

Returns the selection buffer

Parameters
selectionOnly used on X11.
Returns
Returns the clipboard data

Implements GHOST_System.

Definition at line 1414 of file GHOST_SystemWayland.cpp.

◆ getCursorPosition()

GHOST_TSuccess GHOST_SystemWayland::getCursorPosition ( GHOST_TInt32 x,
GHOST_TInt32 y 
) const
overridevirtual

Returns the current location of the cursor (location in screen coordinates)

Parameters
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns
Indication of success.

Implements GHOST_ISystem.

Definition at line 1453 of file GHOST_SystemWayland.cpp.

References GHOST_kFailure, GHOST_kSuccess, display_t::inputs, x, and y.

◆ getMainDisplayDimensions()

void GHOST_SystemWayland::getMainDisplayDimensions ( GHOST_TUns32 width,
GHOST_TUns32 height 
) const
overridevirtual

Returns the dimensions of the main display on this system.

Returns
The dimension of the main display.

Implements GHOST_ISystem.

Definition at line 1470 of file GHOST_SystemWayland.cpp.

References getNumDisplays(), height, display_t::outputs, and width.

Referenced by getAllDisplayDimensions().

◆ getModifierKeys()

GHOST_TSuccess GHOST_SystemWayland::getModifierKeys ( GHOST_ModifierKeys keys) const
overridevirtual

Returns the state of all modifier keys.

Parameters
keysThe state of all modifier keys (true == pressed).
Returns
Indication of success.

Implements GHOST_System.

Definition at line 1374 of file GHOST_SystemWayland.cpp.

References GHOST_kFailure, GHOST_kModifierKeyLeftAlt, GHOST_kModifierKeyLeftControl, GHOST_kModifierKeyLeftShift, GHOST_kModifierKeyNumMasks, GHOST_kModifierKeyOS, GHOST_kModifierKeyRightAlt, GHOST_kModifierKeyRightControl, GHOST_kModifierKeyRightShift, GHOST_kSuccess, display_t::inputs, and GHOST_ModifierKeys::set().

◆ getNumDisplays()

GHOST_TUns8 GHOST_SystemWayland::getNumDisplays ( ) const
overridevirtual

Returns the number of displays on this system.

Returns
The number of displays.

Implements GHOST_ISystem.

Definition at line 1448 of file GHOST_SystemWayland.cpp.

References display_t::outputs.

Referenced by getMainDisplayDimensions().

◆ hasCursorShape()

GHOST_TSuccess GHOST_SystemWayland::hasCursorShape ( GHOST_TStandardCursor  cursorShape)

Definition at line 1632 of file GHOST_SystemWayland.cpp.

References cursors.

Referenced by GHOST_WindowWayland::hasCursorShape().

◆ processEvents()

bool GHOST_SystemWayland::processEvents ( bool  waitForEvent)
overridevirtual

Retrieves events from the system and stores them in the queue.

Parameters
waitForEventFlag to wait for an event (or return immediately).
Returns
Indication of the presence of events.

Implements GHOST_ISystem.

Definition at line 1355 of file GHOST_SystemWayland.cpp.

References display_t::display, GHOST_TimerManager::fireTimers(), GHOST_System::getEventManager(), GHOST_System::getMilliSeconds(), GHOST_EventManager::getNumEvents(), and GHOST_System::getTimerManager().

◆ putClipboard()

void GHOST_SystemWayland::putClipboard ( GHOST_TInt8 buffer,
bool  selection 
) const
overridevirtual

Put data to the Clipboard

Parameters
bufferThe buffer to copy to the clipboard.
selectionThe clipboard to copy too only used on X11.

Implements GHOST_System.

Definition at line 1421 of file GHOST_SystemWayland.cpp.

References buffer, data_source_t::buffer_out, display_t::data_device_manager, data_source_t::data_source, data_source_listener, display_t::inputs, mime_send, data_source_t::source_serial, and type.

◆ setCursorGrab()

GHOST_TSuccess GHOST_SystemWayland::setCursorGrab ( const GHOST_TGrabCursorMode  mode,
wl_surface *  surface 
)

◆ setCursorPosition()

GHOST_TSuccess GHOST_SystemWayland::setCursorPosition ( GHOST_TInt32  x,
GHOST_TInt32  y 
)
overridevirtual

Updates the location of the cursor (location in screen coordinates). Not all operating systems allow the cursor to be moved (without the input device being moved).

Parameters
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns
Indication of success.

Implements GHOST_ISystem.

Definition at line 1465 of file GHOST_SystemWayland.cpp.

References GHOST_kFailure.

◆ setCursorShape()

GHOST_TSuccess GHOST_SystemWayland::setCursorShape ( GHOST_TStandardCursor  shape)

◆ setCursorVisibility()

GHOST_TSuccess GHOST_SystemWayland::setCursorVisibility ( bool  visible)

◆ setCustomCursorShape()

GHOST_TSuccess GHOST_SystemWayland::setCustomCursorShape ( GHOST_TUns8 bitmap,
GHOST_TUns8 mask,
int  sizex,
int  sizey,
int  hotX,
int  hotY,
bool  canInvertColor 
)

◆ setSelection()

void GHOST_SystemWayland::setSelection ( const std::string &  selection)

Definition at line 1577 of file GHOST_SystemWayland.cpp.

◆ shell()

xdg_wm_base * GHOST_SystemWayland::shell ( )

Definition at line 1572 of file GHOST_SystemWayland.cpp.

References display_t::xdg_shell.

Referenced by GHOST_WindowWayland::GHOST_WindowWayland().

◆ toggleConsole()

int GHOST_SystemWayland::toggleConsole ( int  action)
overridevirtual

Toggles console

Parameters
action
  • 0: Hides.
  • 1: Shows
  • 2: Toggles
  • 3: Hides if it runs not from command line
  • *: Does nothing
Returns
current status (1 -visible, 0 - hidden)

Implements GHOST_ISystem.

Definition at line 1369 of file GHOST_SystemWayland.cpp.


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