Blender V5.0
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 gpu_settings) 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 gpu_settings, const bool, const bool, const GHOST_IWindow *parent_window) 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 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
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
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
GHOST_TSuccess pushEvent (const GHOST_IEvent *event)
GHOST_TimerManagergetTimerManager () const
GHOST_EventManagergetEventManager () const
GHOST_WindowManagergetWindowManager () 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, 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)
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_
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_TimerManagertimer_manager_
GHOST_WindowManagerwindow_manager_
GHOST_EventManagerevent_manager_
bool multitouch_gestures_
GHOST_TTabletAPI tablet_api_
bool is_debug_enabled_
Static Protected Attributes inherited from GHOST_ISystem
static GHOST_ISystemsystem_ = 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 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 gpu_settings)
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 114 of file GHOST_SystemHeadless.hh.

References GHOST_GPUSettings::context_type, GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS_OFFSCREEN, 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 gpu_settings,
const bool exclusive,
const bool is_dialog,
const GHOST_IWindow * parent_window )
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.
gpu_settingsMisc 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.
parent_windowParent (embedder) window
Returns
The new window (or 0 if creation failed).

Implements GHOST_ISystem.

Definition at line 202 of file GHOST_SystemHeadless.hh.

References GHOST_GPUSettings::context_type, GHOST_CONTEXT_PARAMS_FROM_GPU_SETTINGS, 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 184 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 111 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()

◆ getClipboard()

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

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 85 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 100 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 108 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 92 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 96 of file GHOST_SystemHeadless.hh.

◆ getWindowUnderCursor()

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

Get the Window under the cursor. Although coordinates of the mouse are supplied, platform- specific implementations are free to ignore these and query the mouse location themselves, due to them possibly being incorrect under certain conditions, for example when using multiple monitors that vary in scale and/or DPI.

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 226 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 191 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 89 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 104 of file GHOST_SystemHeadless.hh.

References GHOST_kFailure.


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