Blender V4.5
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 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) 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
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 &isDown) const override
GHOST_TSuccess getButtonState (GHOST_TButton mask, bool &isDown) 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 pushEvent (const GHOST_IEvent *event)
GHOST_TimerManagergetTimerManager () const
GHOST_EventManagergetEventManager () const
GHOST_WindowManagergetWindowManager () const
GHOST_TSuccess hasClipboardImage () const override
uintgetClipboardImage (int *r_width, int *r_height) const override
GHOST_TSuccess putClipboardImage (uint *rgba, int width, int height) const override
GHOST_TSuccess showMessageBox (const char *, const char *, const char *, const char *, const char *, GHOST_DialogOptions) const override
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, 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 ()
 ~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_TimerManagerm_timerManager
GHOST_WindowManagerm_windowManager
GHOST_EventManagerm_eventManager
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 26 of file GHOST_SystemHeadless.hh.

Constructor & Destructor Documentation

◆ GHOST_SystemHeadless()

GHOST_SystemHeadless::GHOST_SystemHeadless ( )
inline

Definition at line 28 of file GHOST_SystemHeadless.hh.

References GHOST_System::GHOST_System().

◆ ~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 88 of file GHOST_SystemHeadless.hh.

References GHOST_GPUSettings::context_type, GHOST_GPUSettings::flags, GHOST_gpuDebugContext, GHOST_kVulkanPlatformHeadless, GHOST_OPENGL_EGL_CONTEXT_FLAGS, GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY, GHOST_System::GHOST_System(), and GHOST_GPUSettings::preferred_device.

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

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

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

References GHOST_kSuccess.

◆ getCapabilities()

GHOST_TCapabilityFlag GHOST_SystemHeadless::getCapabilities ( ) const
inlineoverridevirtual

◆ 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 59 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 74 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 82 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 66 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 41 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 70 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 195 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 162 of file GHOST_SystemHeadless.hh.

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

◆ 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 33 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 63 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 37 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 78 of file GHOST_SystemHeadless.hh.

References GHOST_kFailure.


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