Blender V5.3
GHOST_SystemSDL Class Reference

#include <GHOST_SystemSDL.hh>

Inherits GHOST_System.

Public Member Functions

void addDirtyWindow (GHOST_WindowSDL *bad_wind)
 GHOST_SystemSDL ()
 ~GHOST_SystemSDL ()
bool processEvents (bool waitForEvent) override
bool setConsoleWindowState (GHOST_TConsoleWindowState) override
GHOST_TSuccess getModifierKeys (GHOST_ModifierKeys &keys) const override
GHOST_TSuccess getButtons (GHOST_Buttons &buttons) const override
GHOST_TCapabilityFlag getCapabilities () const override
char * getClipboard (bool selection) const override
void putClipboard (const char *buffer, bool selection) const override
uint64_t getMilliSeconds () const override
uint8_t getNumDisplays () const override
GHOST_TSuccess getCursorPosition (int32_t &x, int32_t &y) const override
GHOST_TSuccess setCursorPosition (int32_t x, int32_t y) override
void getAllDisplayDimensions (uint32_t &width, uint32_t &height) const override
void getMainDisplayDimensions (uint32_t &width, uint32_t &height) const override
GHOST_IContext * createOffscreenContext (GHOST_GPUSettings gpu_settings) override
GHOST_TSuccess disposeContext (GHOST_IContext *context) override
Public Member Functions inherited from GHOST_System
GHOST_ITimerTask * installTimer (uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timer_proc, GHOST_TUserDataPtr user_data=nullptr) override
GHOST_TSuccess removeTimer (GHOST_ITimerTask *timerTask) override
GHOST_TSuccess disposeWindow (GHOST_IWindow *window) override
bool validWindow (GHOST_IWindow *window) override
bool useNativePixel () override
void useWindowFocus (const bool use_focus) override
void setAutoFocus (const bool auto_focus) override
GHOST_IWindow * getWindowUnderCursor (int32_t x, int32_t y) override
void dispatchEvents () override
GHOST_TSuccess addEventConsumer (GHOST_IEventConsumer *consumer) override
GHOST_TSuccess removeEventConsumer (GHOST_IEventConsumer *consumer) 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
uint32_t getCursorPreferredLogicalSize () const override
GHOST_TSuccess getModifierKeyState (GHOST_TModifierKey mask, bool &is_down) const override
GHOST_TSuccess getButtonState (GHOST_TButton mask, bool &is_down) const override
void setMultitouchGestures (const bool use) override
void setTabletAPI (GHOST_TTabletAPI api) override
GHOST_TTabletAPI getTabletAPI ()
GHOST_TSuccess getPixelAtCursor (float r_color[3]) const override
GHOST_TSuccess hasClipboardImage () const override
uint * getClipboardImage (int *r_width, int *r_height) const override
GHOST_TSuccess putClipboardImage (uint *rgba, int width, int height) const override
void setWindowCSD (const GHOST_CSD_Params &params) override
const GHOST_CSD_Params & getWindowCSD () const
void setWindowCSD_Layout (const GHOST_CSD_Layout &csd_layout)
const GHOST_CSD_Layout & getWindowCSD_Layout () const override
void setIconGenerator (const GHOST_IconGenerator *icon_generator) override
GHOST_TSuccess showMessageBox (const char *, const char *, const char *, const char *, const char *, GHOST_DialogOptions) const override
GHOST_TSuccess pushEvent (std::unique_ptr< const GHOST_IEvent > event)
GHOST_TimerManager * getTimerManager () const
GHOST_EventManager * getEventManager () const
GHOST_WindowManager * getWindowManager () const
void initDebug (GHOST_Debug debug) override
bool isDebugEnabled () override

Additional Inherited Members

Static Public Member Functions inherited from GHOST_ISystem
static GHOST_TSuccess createSystem (bool verbose=true, bool background=false)
static GHOST_TSuccess createSystemBackground ()
static GHOST_TSuccess disposeSystem ()
static GHOST_ISystem * getSystem ()
static const char * getSystemBackend ()
static GHOST_TBacktraceFn getBacktraceFn ()
static void setBacktraceFn (GHOST_TBacktraceFn backtrace_fn)
static bool getUseWindowFrame ()
static void setUseWindowFrame (bool use_window_frame)
Public Attributes inherited from GHOST_System
bool native_pixel_
bool window_focus_
bool auto_focus_
GHOST_CSD_Params window_csd_params_
GHOST_CSD_Layout window_csd_layout_
const GHOST_IconGenerator * icon_generator_ = nullptr
Protected Member Functions inherited from GHOST_System
 GHOST_System ()
 ~GHOST_System () override
GHOST_TSuccess exit () override
Protected Member Functions inherited from GHOST_ISystem
 GHOST_ISystem ()
virtual ~GHOST_ISystem ()=default
Protected Attributes inherited from GHOST_System
GHOST_TimerManager * timer_manager_
GHOST_WindowManager * window_manager_
GHOST_EventManager * event_manager_
bool multitouch_gestures_
GHOST_TTabletAPI tablet_api_
bool is_debug_enabled_
Static Protected Attributes inherited from GHOST_ISystem
static GHOST_ISystem * system_ = nullptr
static const char * system_backend_id_ = nullptr
static GHOST_TBacktraceFn backtrace_fn_ = nullptr
static bool use_window_frame_ = true

Detailed Description

Definition at line 22 of file GHOST_SystemSDL.hh.

Constructor & Destructor Documentation

◆ GHOST_SystemSDL()

GHOST_SystemSDL::GHOST_SystemSDL ( )

Definition at line 29 of file GHOST_SystemSDL.cc.

References GHOST_System::GHOST_System().

Referenced by GHOST_ISystem::createSystem().

◆ ~GHOST_SystemSDL()

GHOST_SystemSDL::~GHOST_SystemSDL ( )

Definition at line 42 of file GHOST_SystemSDL.cc.

Member Function Documentation

◆ addDirtyWindow()

void GHOST_SystemSDL::addDirtyWindow ( GHOST_WindowSDL * bad_wind)

Definition at line 811 of file GHOST_SystemSDL.cc.

References GHOST_ASSERT.

◆ createOffscreenContext()

GHOST_IContext * GHOST_SystemSDL::createOffscreenContext ( GHOST_GPUSettings gpu_settings)
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 141 of file GHOST_SystemSDL.cc.

References GHOST_GPUSettings::context_type, GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS_OFFSCREEN, GHOST_ContextSDL::GHOST_ContextSDL(), GHOST_ContextVK::GHOST_ContextVK(), GHOST_OPENGL_SDL_CONTEXT_FLAGS, GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY, and GHOST_GPUSettings::preferred_device.

◆ disposeContext()

GHOST_TSuccess GHOST_SystemSDL::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 186 of file GHOST_SystemSDL.cc.

References GHOST_kSuccess.

◆ getAllDisplayDimensions()

void GHOST_SystemSDL::getAllDisplayDimensions ( 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 111 of file GHOST_SystemSDL.cc.

◆ getButtons()

GHOST_TSuccess GHOST_SystemSDL::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 818 of file GHOST_SystemSDL.cc.

References GHOST_kButtonMaskLeft, GHOST_kButtonMaskMiddle, GHOST_kButtonMaskRight, GHOST_kSuccess, GHOST_Buttons::set(), and state.

◆ getCapabilities()

◆ getClipboard()

char * GHOST_SystemSDL::getClipboard ( bool selection) const
overridevirtual

Return the clipboard buffer or null.

Parameters
selectionUse the "primary" selection. Check the GHOST_kCapabilityClipboardPrimary for backends that support this.
Returns
Returns the clipboard data as a null terminated string or null when unavailable.

Implements GHOST_System.

Definition at line 854 of file GHOST_SystemSDL.cc.

◆ getCursorPosition()

GHOST_TSuccess GHOST_SystemSDL::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 687 of file GHOST_SystemSDL.cc.

References GHOST_kFailure, GHOST_kSuccess, x, and y.

◆ getMainDisplayDimensions()

void GHOST_SystemSDL::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 122 of file GHOST_SystemSDL.cc.

◆ getMilliSeconds()

uint64_t GHOST_SystemSDL::getMilliSeconds ( ) const
overridevirtual

Returns the system time. Returns the number of milliseconds since the start of the system.

Note
The exact method used is platform dependent however monotonic methods should be used instead of wall-clock time.
Returns
The number of milliseconds.

Implements GHOST_ISystem.

Definition at line 876 of file GHOST_SystemSDL.cc.

Referenced by processEvents().

◆ getModifierKeys()

GHOST_TSuccess GHOST_SystemSDL::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 193 of file GHOST_SystemSDL.cc.

References GHOST_kModifierKeyLeftAlt, GHOST_kModifierKeyLeftControl, GHOST_kModifierKeyLeftOS, GHOST_kModifierKeyLeftShift, GHOST_kModifierKeyRightAlt, GHOST_kModifierKeyRightControl, GHOST_kModifierKeyRightOS, GHOST_kModifierKeyRightShift, GHOST_kSuccess, mod, and GHOST_ModifierKeys::set().

◆ getNumDisplays()

uint8_t GHOST_SystemSDL::getNumDisplays ( ) const
overridevirtual

Returns the number of displays on this system.

Returns
The number of displays.

Implements GHOST_ISystem.

Definition at line 133 of file GHOST_SystemSDL.cc.

◆ processEvents()

bool GHOST_SystemSDL::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 741 of file GHOST_SystemSDL.cc.

References GHOST_TimerManager::fireTimers(), getMilliSeconds(), GHOST_System::getTimerManager(), GHOST_kFireTimeNever, and GHOST_TimerManager::nextFireTime().

◆ putClipboard()

void GHOST_SystemSDL::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 866 of file GHOST_SystemSDL.cc.

◆ setConsoleWindowState()

bool GHOST_SystemSDL::setConsoleWindowState ( GHOST_TConsoleWindowState action)
inlineoverridevirtual

Set the Console State

Parameters
actionconsole state
Returns
current status (true: visible, 0: hidden)

Implements GHOST_ISystem.

Definition at line 31 of file GHOST_SystemSDL.hh.

◆ setCursorPosition()

GHOST_TSuccess GHOST_SystemSDL::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 704 of file GHOST_SystemSDL.cc.

References GHOST_kFailure, GHOST_kSuccess, x, and y.


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