Blender V4.3
GHOST_SystemHeadless Class Reference

#include <GHOST_SystemHeadless.hh>

Inherits GHOST_System.

Public Member Functions

 GHOST_SystemHeadless ()
 
 ~GHOST_SystemHeadless () override=default
 
bool processEvents (bool) override
 
bool setConsoleWindowState (GHOST_TConsoleWindowState) override
 
GHOST_TSuccess getModifierKeys (GHOST_ModifierKeys &) const override
 
GHOST_TSuccess getButtons (GHOST_Buttons &) const override
 
GHOST_TCapabilityFlag getCapabilities () const override
 
char * getClipboard (bool) const override
 
void putClipboard (const char *, bool) const override
 
uint64_t getMilliSeconds () const override
 
uint8_t getNumDisplays () const override
 
GHOST_TSuccess getCursorPosition (int32_t &, int32_t &) const override
 
GHOST_TSuccess setCursorPosition (int32_t, int32_t) override
 
void getMainDisplayDimensions (uint32_t &, uint32_t &) const override
 
void getAllDisplayDimensions (uint32_t &, uint32_t &) const override
 
GHOST_IContextcreateOffscreenContext (GHOST_GPUSettings) override
 
GHOST_TSuccess disposeContext (GHOST_IContext *context) override
 
GHOST_TSuccess init () override
 
GHOST_IWindowcreateWindow (const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_GPUSettings gpuSettings, const bool, const bool, const GHOST_IWindow *parentWindow) override
 
GHOST_IWindowgetWindowUnderCursor (int32_t, int32_t) override
 
- Public Member Functions inherited from GHOST_System
GHOST_ITimerTaskinstallTimer (uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=nullptr)
 
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)
 
GHOST_TSuccess updateFullScreen (const GHOST_DisplaySetting &setting, GHOST_IWindow **window)
 
GHOST_TSuccess endFullScreen ()
 
bool getFullScreen ()
 
bool useNativePixel ()
 
void useWindowFocus (const bool use_focus)
 
void setAutoFocus (const bool auto_focus)
 
void dispatchEvents ()
 
GHOST_TSuccess addEventConsumer (GHOST_IEventConsumer *consumer)
 
GHOST_TSuccess removeEventConsumer (GHOST_IEventConsumer *consumer)
 
GHOST_TSuccess getCursorPositionClientRelative (const GHOST_IWindow *window, int32_t &x, int32_t &y) const
 
GHOST_TSuccess setCursorPositionClientRelative (GHOST_IWindow *window, int32_t x, int32_t y)
 
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 ()
 
GHOST_TSuccess getPixelAtCursor (float r_color[3]) const
 
GHOST_TSuccess pushEvent (const GHOST_IEvent *event)
 
GHOST_TimerManagergetTimerManager () const
 
GHOST_EventManagergetEventManager () const
 
GHOST_WindowManagergetWindowManager () const
 
GHOST_TSuccess hasClipboardImage () const
 
uintgetClipboardImage (int *r_width, int *r_height) const
 
GHOST_TSuccess putClipboardImage (uint *rgba, int width, int height) 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 (bool verbose, bool background)
 
static GHOST_TSuccess createSystemBackground ()
 
static GHOST_TSuccess disposeSystem ()
 
static GHOST_ISystemgetSystem ()
 
static const char * getSystemBackend ()
 
static GHOST_TBacktraceFn getBacktraceFn ()
 
static void setBacktraceFn (GHOST_TBacktraceFn backtrace_fn)
 
- Public Attributes inherited from GHOST_System
bool m_nativePixel
 
bool m_windowFocus
 
bool m_autoFocus
 
- Protected Member Functions inherited from GHOST_System
 GHOST_System ()
 
virtual ~GHOST_System ()
 
virtual GHOST_TSuccess exit ()
 
GHOST_TSuccess createFullScreenWindow (GHOST_Window **window, const GHOST_DisplaySetting &settings, const bool stereoVisual)
 
- 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 const char * m_system_backend_id = nullptr
 
static GHOST_TBacktraceFn m_backtrace_fn = nullptr
 

Detailed Description

Definition at line 24 of file GHOST_SystemHeadless.hh.

Constructor & Destructor Documentation

◆ GHOST_SystemHeadless()

GHOST_SystemHeadless::GHOST_SystemHeadless ( )
inline

Definition at line 26 of file GHOST_SystemHeadless.hh.

◆ ~GHOST_SystemHeadless()

GHOST_SystemHeadless::~GHOST_SystemHeadless ( )
overridedefault

Member Function Documentation

◆ createOffscreenContext()

GHOST_IContext * GHOST_SystemHeadless::createOffscreenContext ( GHOST_GPUSettings gpuSettings)
inlineoverridevirtual

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 85 of file GHOST_SystemHeadless.hh.

References GHOST_OPENGL_EGL_CONTEXT_FLAGS, and GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY.

◆ createWindow()

GHOST_IWindow * GHOST_SystemHeadless::createWindow ( const char * title,
int32_t left,
int32_t top,
uint32_t width,
uint32_t height,
GHOST_TWindowState state,
GHOST_GPUSettings gpuSettings,
const bool exclusive,
const bool is_dialog,
const GHOST_IWindow * parentWindow )
inlineoverridevirtual

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.
gpuSettingsMisc GPU 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 135 of file GHOST_SystemHeadless.hh.

References GHOST_GPUSettings::context_type, GHOST_GPUSettings::flags, GHOST_gpuStereoVisual, and state.

◆ disposeContext()

GHOST_TSuccess GHOST_SystemHeadless::disposeContext ( GHOST_IContext * context)
inlineoverridevirtual

Dispose of a context.

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

Implements GHOST_ISystem.

Definition at line 113 of file GHOST_SystemHeadless.hh.

References GHOST_kSuccess.

◆ getAllDisplayDimensions()

void GHOST_SystemHeadless::getAllDisplayDimensions ( uint32_t & width,
uint32_t & height ) const
inlineoverridevirtual

Returns the combine dimensions of all monitors.

Returns
The dimension of the workspace.

Implements GHOST_ISystem.

Definition at line 82 of file GHOST_SystemHeadless.hh.

◆ getButtons()

GHOST_TSuccess GHOST_SystemHeadless::getButtons ( GHOST_Buttons & buttons) const
inlineoverridevirtual

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 43 of file GHOST_SystemHeadless.hh.

References GHOST_kSuccess.

◆ getCapabilities()

GHOST_TCapabilityFlag GHOST_SystemHeadless::getCapabilities ( ) const
inlineoverridevirtual

Return features supported by the system back-end.

The resulting value doesn't change at run-time.

Implements GHOST_ISystem.

Definition at line 47 of file GHOST_SystemHeadless.hh.

References GHOST_CAPABILITY_FLAG_ALL, GHOST_kCapabilityClipboardImages, GHOST_kCapabilityCursorWarp, GHOST_kCapabilityDesktopSample, GHOST_kCapabilityInputIME, GHOST_kCapabilityPrimaryClipboard, and GHOST_kCapabilityWindowPosition.

◆ getClipboard()

char * GHOST_SystemHeadless::getClipboard ( bool selection) const
inlineoverridevirtual

Returns the selection buffer

Parameters
selectionOnly used on X11.
Returns
Returns the clipboard data

Implements GHOST_System.

Definition at line 56 of file GHOST_SystemHeadless.hh.

◆ getCursorPosition()

GHOST_TSuccess GHOST_SystemHeadless::getCursorPosition ( int32_t & x,
int32_t & y ) const
inlineoverridevirtual

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 71 of file GHOST_SystemHeadless.hh.

References GHOST_kFailure.

◆ getMainDisplayDimensions()

void GHOST_SystemHeadless::getMainDisplayDimensions ( uint32_t & width,
uint32_t & height ) const
inlineoverridevirtual

Returns the dimensions of the main display on this system.

Returns
The dimension of the main display.

Implements GHOST_ISystem.

Definition at line 79 of file GHOST_SystemHeadless.hh.

◆ getMilliSeconds()

uint64_t GHOST_SystemHeadless::getMilliSeconds ( ) const
inlineoverridevirtual

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 63 of file GHOST_SystemHeadless.hh.

◆ getModifierKeys()

GHOST_TSuccess GHOST_SystemHeadless::getModifierKeys ( GHOST_ModifierKeys & keys) const
inlineoverridevirtual

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 39 of file GHOST_SystemHeadless.hh.

References GHOST_kSuccess.

◆ getNumDisplays()

uint8_t GHOST_SystemHeadless::getNumDisplays ( ) const
inlineoverridevirtual

Returns the number of displays on this system.

Returns
The number of displays.

Implements GHOST_ISystem.

Definition at line 67 of file GHOST_SystemHeadless.hh.

◆ getWindowUnderCursor()

GHOST_IWindow * GHOST_SystemHeadless::getWindowUnderCursor ( int32_t x,
int32_t y )
inlineoverridevirtual

Get the Window under the cursor.

Parameters
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns
The window under the cursor or nullptr if none.

Reimplemented from GHOST_System.

Definition at line 157 of file GHOST_SystemHeadless.hh.

◆ init()

GHOST_TSuccess GHOST_SystemHeadless::init ( )
inlineoverridevirtual

Initialize the system.

Returns
Indication of success.

Reimplemented from GHOST_System.

Definition at line 120 of file GHOST_SystemHeadless.hh.

References GHOST_kFailure, GHOST_kSuccess, GHOST_System::init(), and GHOST_System::m_displayManager.

◆ processEvents()

bool GHOST_SystemHeadless::processEvents ( bool waitForEvent)
inlineoverridevirtual

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 31 of file GHOST_SystemHeadless.hh.

◆ putClipboard()

void GHOST_SystemHeadless::putClipboard ( const char * buffer,
bool selection ) const
inlineoverridevirtual

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 60 of file GHOST_SystemHeadless.hh.

◆ setConsoleWindowState()

bool GHOST_SystemHeadless::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 35 of file GHOST_SystemHeadless.hh.

◆ setCursorPosition()

GHOST_TSuccess GHOST_SystemHeadless::setCursorPosition ( int32_t x,
int32_t y )
inlineoverridevirtual

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 75 of file GHOST_SystemHeadless.hh.

References GHOST_kFailure.


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