Blender  V3.3
List of all members
GHOST_SystemWayland Class Reference

#include <GHOST_SystemWayland.h>

Inheritance diagram for GHOST_SystemWayland:
GHOST_System GHOST_ISystem

Public Member Functions

GHOST Implementation

WAYLAND specific implementation of the GHOST_System interface.

 GHOST_SystemWayland ()
 
 ~GHOST_SystemWayland () override
 
bool processEvents (bool waitForEvent) override
 
int setConsoleWindowState (GHOST_TConsoleWindowState action) override
 
GHOST_TSuccess getModifierKeys (GHOST_ModifierKeys &keys) const override
 
GHOST_TSuccess getButtons (GHOST_Buttons &buttons) const override
 
char * getClipboard (bool selection) const override
 
void putClipboard (const char *buffer, bool selection) const override
 
uint8_t getNumDisplays () const override
 
GHOST_TSuccess getCursorPositionClientRelative (const GHOST_IWindow *window, int32_t &x, int32_t &y) const override
 
GHOST_TSuccess setCursorPositionClientRelative (GHOST_IWindow *window, int32_t x, int32_t y) override
 
GHOST_TSuccess getCursorPosition (int32_t &x, int32_t &y) const override
 
GHOST_TSuccess setCursorPosition (int32_t x, int32_t y) override
 
void getMainDisplayDimensions (uint32_t &width, uint32_t &height) const override
 
void getAllDisplayDimensions (uint32_t &width, uint32_t &height) const override
 
GHOST_IContextcreateOffscreenContext (GHOST_GLSettings glSettings) override
 
GHOST_TSuccess disposeContext (GHOST_IContext *context) override
 
GHOST_IWindowcreateWindow (const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings, const bool exclusive, const bool is_dialog, const GHOST_IWindow *parentWindow) override
 
GHOST_TSuccess setCursorShape (GHOST_TStandardCursor shape)
 
GHOST_TSuccess hasCursorShape (GHOST_TStandardCursor cursorShape)
 
GHOST_TSuccess setCustomCursorShape (uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
 
GHOST_TSuccess getCursorBitmap (GHOST_CursorBitmapRef *bitmap)
 
GHOST_TSuccess setCursorVisibility (bool visible)
 
bool supportsCursorWarp ()
 
bool supportsWindowPosition ()
 
bool getCursorGrabUseSoftwareDisplay (const GHOST_TGrabCursorMode mode)
 
Public WAYLAND Direct Data Access

Expose some members via methods.

wl_display * display ()
 
wl_compositor * compositor ()
 
xdg_wm_base * xdg_shell ()
 
zxdg_decoration_manager_v1 * xdg_decoration_manager ()
 
const std::vector< output_t * > & outputs () const
 
wl_shm * shm () const
 
Public WAYLAND Utility Functions

Functionality only used for the WAYLAND implementation.

void selection_set (const std::string &selection)
 
void window_surface_unref (const wl_surface *surface)
 
bool window_cursor_grab_set (const GHOST_TGrabCursorMode mode, const GHOST_TGrabCursorMode mode_current, int32_t init_grab_xy[2], const GHOST_Rect *wrap_bounds, GHOST_TAxisFlag wrap_axis, wl_surface *surface, int scale)
 
- Public Member Functions inherited from GHOST_System
virtual uint64_t getMilliSeconds () const
 
GHOST_ITimerTaskinstallTimer (uint64_t delay, uint64_t 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)
 
GHOST_IWindowgetWindowUnderCursor (int32_t x, int32_t y)
 
void dispatchEvents ()
 
GHOST_TSuccess addEventConsumer (GHOST_IEventConsumer *consumer)
 
GHOST_TSuccess removeEventConsumer (GHOST_IEventConsumer *consumer)
 
GHOST_TSuccess getModifierKeyState (GHOST_TModifierKey mask, bool &isDown) const
 
GHOST_TSuccess getButtonState (GHOST_TButton mask, bool &isDown) const
 
void setMultitouchGestures (const bool use)
 
virtual 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 (GHOST_Debug debug)
 
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 ()
 
static GHOST_TBacktraceFn getBacktraceFn ()
 
static void setBacktraceFn (GHOST_TBacktraceFn backtrace_fn)
 
- 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
 
bool m_multitouchGestures
 
GHOST_TTabletAPI m_tabletAPI
 
bool m_is_debug_enabled
 
- Static Protected Attributes inherited from GHOST_ISystem
static GHOST_ISystemm_system = nullptr
 
static GHOST_TBacktraceFn m_backtrace_fn = nullptr
 

Detailed Description

Definition at line 90 of file GHOST_SystemWayland.h.

Constructor & Destructor Documentation

◆ GHOST_SystemWayland()

GHOST_SystemWayland::GHOST_SystemWayland ( )

◆ ~GHOST_SystemWayland()

GHOST_SystemWayland::~GHOST_SystemWayland ( )
override

Definition at line 2896 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 off-screen context. Never explicitly delete the context, use disposeContext() instead.

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

Implements GHOST_System.

Definition at line 3184 of file GHOST_SystemWayland.cpp.

References compositor(), blender::compositor::context, createOffscreenContext_impl(), display_t::display, GHOST_PRINT, wl_egl_window_create, and wl_egl_window_destroy.

◆ createWindow()

GHOST_IWindow * GHOST_SystemWayland::createWindow ( const char *  title,
int32_t  left,
int32_t  top,
uint32_t  width,
uint32_t  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 3221 of file GHOST_SystemWayland.cpp.

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

◆ 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 3209 of file GHOST_SystemWayland.cpp.

References blender::compositor::context, GHOST_kSuccess, and wl_egl_window_destroy.

◆ getAllDisplayDimensions()

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

Returns the combine dimensions of all monitors.

Returns
The dimension of the workspace.

Implements GHOST_ISystem.

Definition at line 3121 of file GHOST_SystemWayland.cpp.

References height, INT32_MAX, INT32_MIN, max, min, output, display_t::outputs, width, and xy.

◆ 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 2955 of file GHOST_SystemWayland.cpp.

References input_state_pointer_t::buttons, GHOST_kFailure, GHOST_kSuccess, input, input_state_pointer_active(), display_t::inputs, and UNLIKELY.

◆ getClipboard()

char * 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 2970 of file GHOST_SystemWayland.cpp.

◆ getCursorBitmap()

GHOST_TSuccess GHOST_SystemWayland::getCursorBitmap ( GHOST_CursorBitmapRef bitmap)

◆ getCursorGrabUseSoftwareDisplay()

bool GHOST_SystemWayland::getCursorGrabUseSoftwareDisplay ( const GHOST_TGrabCursorMode  mode)

◆ getCursorPosition()

GHOST_TSuccess GHOST_SystemWayland::getCursorPosition ( int32_t x,
int32_t 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 3077 of file GHOST_SystemWayland.cpp.

References getCursorPositionClientRelative_impl(), GHOST_kFailure, ghost_wl_surface_user_data(), input, input_state_pointer_active(), display_t::inputs, UNLIKELY, input_state_pointer_t::wl_surface, x, and y.

◆ getCursorPositionClientRelative()

GHOST_TSuccess GHOST_SystemWayland::getCursorPositionClientRelative ( const GHOST_IWindow window,
int32_t x,
int32_t y 
) const
overridevirtual

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

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

Reimplemented from GHOST_System.

Definition at line 3049 of file GHOST_SystemWayland.cpp.

References getCursorPositionClientRelative_impl(), GHOST_kFailure, input, input_state_pointer_active(), display_t::inputs, UNLIKELY, input_state_pointer_t::wl_surface, x, and y.

◆ getMainDisplayDimensions()

void GHOST_SystemWayland::getMainDisplayDimensions ( uint32_t width,
uint32_t 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 3111 of file GHOST_SystemWayland.cpp.

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

◆ 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 2920 of file GHOST_SystemWayland.cpp.

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

◆ getNumDisplays()

uint8_t GHOST_SystemWayland::getNumDisplays ( ) const
overridevirtual

Returns the number of displays on this system.

Returns
The number of displays.

Implements GHOST_ISystem.

Definition at line 3009 of file GHOST_SystemWayland.cpp.

References display_t::outputs.

Referenced by getMainDisplayDimensions().

◆ hasCursorShape()

GHOST_TSuccess GHOST_SystemWayland::hasCursorShape ( GHOST_TStandardCursor  cursorShape)

Definition at line 3493 of file GHOST_SystemWayland.cpp.

References cursors, GHOST_kFailure, and GHOST_kSuccess.

Referenced by GHOST_WindowWayland::hasCursorShape().

◆ outputs()

const std::vector< output_t * > & GHOST_SystemWayland::outputs ( ) const

Definition at line 3768 of file GHOST_SystemWayland.cpp.

References display_t::outputs.

Referenced by GHOST_WindowWayland::GHOST_WindowWayland().

◆ 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 2901 of file GHOST_SystemWayland.cpp.

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

◆ putClipboard()

void GHOST_SystemWayland::putClipboard ( const char *  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 2977 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, free(), input, display_t::inputs, lock, mime_send, type, and UNLIKELY.

◆ selection_set()

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

Definition at line 3808 of file GHOST_SystemWayland.cpp.

Referenced by data_device_handle_selection().

◆ setConsoleWindowState()

int GHOST_SystemWayland::setConsoleWindowState ( GHOST_TConsoleWindowState  action)
overridevirtual

Set the Console State

Parameters
actionconsole state
Returns
current status (1 -visible, 0 - hidden)

Implements GHOST_ISystem.

Definition at line 2915 of file GHOST_SystemWayland.cpp.

◆ setCursorPosition()

GHOST_TSuccess GHOST_SystemWayland::setCursorPosition ( int32_t  x,
int32_t  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 3095 of file GHOST_SystemWayland.cpp.

References GHOST_kFailure, ghost_wl_surface_user_data(), input, display_t::inputs, setCursorPositionClientRelative_impl(), UNLIKELY, x, and y.

◆ setCursorPositionClientRelative()

GHOST_TSuccess GHOST_SystemWayland::setCursorPositionClientRelative ( GHOST_IWindow window,
int32_t  x,
int32_t  y 
)
overridevirtual

Updates the location of the cursor (location in window coordinates).

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

Reimplemented from GHOST_System.

Definition at line 3065 of file GHOST_SystemWayland.cpp.

References GHOST_kFailure, input, display_t::inputs, setCursorPositionClientRelative_impl(), UNLIKELY, x, and y.

◆ setCursorShape()

GHOST_TSuccess GHOST_SystemWayland::setCursorShape ( GHOST_TStandardCursor  shape)

◆ setCursorVisibility()

GHOST_TSuccess GHOST_SystemWayland::setCursorVisibility ( bool  visible)

◆ setCustomCursorShape()

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

◆ shm()

wl_shm * GHOST_SystemWayland::shm ( ) const

Definition at line 3773 of file GHOST_SystemWayland.cpp.

References display_t::shm.

◆ supportsCursorWarp()

bool GHOST_SystemWayland::supportsCursorWarp ( )
virtual

Return true when warping the cursor is supported.

Reimplemented from GHOST_System.

Definition at line 3611 of file GHOST_SystemWayland.cpp.

◆ supportsWindowPosition()

bool GHOST_SystemWayland::supportsWindowPosition ( )
virtual

Return true getting/setting the window position is supported.

Reimplemented from GHOST_System.

Definition at line 3618 of file GHOST_SystemWayland.cpp.

◆ window_cursor_grab_set()

bool GHOST_SystemWayland::window_cursor_grab_set ( const GHOST_TGrabCursorMode  mode,
const GHOST_TGrabCursorMode  mode_current,
int32_t  init_grab_xy[2],
const GHOST_Rect wrap_bounds,
GHOST_TAxisFlag  wrap_axis,
wl_surface *  surface,
int  scale 
)

◆ window_surface_unref()

void GHOST_SystemWayland::window_surface_unref ( const wl_surface *  surface)

Clear all references to this surface to prevent accessing NULL pointers.

Definition at line 3813 of file GHOST_SystemWayland.cpp.

References input, display_t::inputs, and SURFACE_CLEAR_PTR.

Referenced by GHOST_WindowWayland::~GHOST_WindowWayland().

◆ xdg_decoration_manager()

zxdg_decoration_manager_v1 * GHOST_SystemWayland::xdg_decoration_manager ( )

◆ xdg_shell()

xdg_wm_base * GHOST_SystemWayland::xdg_shell ( )

Definition at line 3756 of file GHOST_SystemWayland.cpp.

References display_t::xdg_shell.

Referenced by GHOST_WindowWayland::GHOST_WindowWayland().


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