|
Blender V5.0
|
#include <GHOST_ISystem.hh>
Inherited by GHOST_System.
Public Member Functions | |
| virtual uint64_t | getMilliSeconds () const =0 |
| virtual GHOST_ITimerTask * | installTimer (uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timer_proc, GHOST_TUserDataPtr user_data=nullptr)=0 |
| virtual GHOST_TSuccess | removeTimer (GHOST_ITimerTask *timerTask)=0 |
| virtual uint8_t | getNumDisplays () const =0 |
| virtual void | getMainDisplayDimensions (uint32_t &width, uint32_t &height) const =0 |
| virtual void | getAllDisplayDimensions (uint32_t &width, uint32_t &height) const =0 |
| virtual GHOST_IWindow * | 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=false, const bool is_dialog=false, const GHOST_IWindow *parent_window=nullptr)=0 |
| virtual GHOST_TSuccess | disposeWindow (GHOST_IWindow *window)=0 |
| virtual GHOST_IContext * | createOffscreenContext (GHOST_GPUSettings gpu_settings)=0 |
| virtual GHOST_TSuccess | disposeContext (GHOST_IContext *context)=0 |
| virtual bool | validWindow (GHOST_IWindow *window)=0 |
| virtual bool | useNativePixel ()=0 |
| virtual GHOST_TCapabilityFlag | getCapabilities () const =0 |
| virtual void | useWindowFocus (const bool use_focus)=0 |
| virtual void | setAutoFocus (const bool auto_focus)=0 |
| virtual GHOST_IWindow * | getWindowUnderCursor (int32_t x, int32_t y)=0 |
| virtual bool | processEvents (bool waitForEvent)=0 |
| virtual void | dispatchEvents ()=0 |
| virtual GHOST_TSuccess | addEventConsumer (GHOST_IEventConsumer *consumer)=0 |
| virtual GHOST_TSuccess | removeEventConsumer (GHOST_IEventConsumer *consumer)=0 |
| virtual GHOST_TSuccess | getCursorPositionClientRelative (const GHOST_IWindow *window, int32_t &x, int32_t &y) const =0 |
| virtual GHOST_TSuccess | setCursorPositionClientRelative (GHOST_IWindow *window, int32_t x, int32_t y)=0 |
| virtual GHOST_TSuccess | getCursorPosition (int32_t &x, int32_t &y) const =0 |
| virtual uint32_t | getCursorPreferredLogicalSize () const =0 |
| virtual GHOST_TSuccess | setCursorPosition (int32_t x, int32_t y)=0 |
| virtual GHOST_TSuccess | getModifierKeyState (GHOST_TModifierKey mask, bool &is_down) const =0 |
| virtual GHOST_TSuccess | getButtonState (GHOST_TButton mask, bool &is_down) const =0 |
| virtual void | setMultitouchGestures (const bool use)=0 |
| virtual void | setTabletAPI (GHOST_TTabletAPI api)=0 |
| virtual GHOST_TSuccess | getPixelAtCursor (float r_color[3]) const =0 |
| virtual bool | setConsoleWindowState (GHOST_TConsoleWindowState action)=0 |
| virtual char * | getClipboard (bool selection) const =0 |
| virtual void | putClipboard (const char *buffer, bool selection) const =0 |
| virtual GHOST_TSuccess | hasClipboardImage () const =0 |
| virtual uint * | getClipboardImage (int *r_width, int *r_height) const =0 |
| virtual GHOST_TSuccess | putClipboardImage (uint *rgba, int width, int height) const =0 |
| virtual GHOST_TSuccess | showMessageBox (const char *, const char *, const char *, const char *, const char *, GHOST_DialogOptions) const =0 |
| virtual void | initDebug (GHOST_Debug debug)=0 |
| virtual bool | isDebugEnabled ()=0 |
Static Public Member Functions | |
| static GHOST_TSuccess | createSystem (bool verbose, bool background) |
| 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) |
Protected Member Functions | |
| GHOST_ISystem () | |
| virtual | ~GHOST_ISystem ()=default |
| virtual GHOST_TSuccess | init ()=0 |
| virtual GHOST_TSuccess | exit ()=0 |
Static Protected Attributes | |
| static GHOST_ISystem * | system_ = nullptr |
| static const char * | system_backend_id_ = nullptr |
| static GHOST_TBacktraceFn | backtrace_fn_ = nullptr |
| static bool | use_window_frame_ = true |
Interface for classes that provide access to the operating system. There should be only one system class in an application. Therefore, the routines to create and dispose the system are static. Provides:
Definition at line 117 of file GHOST_ISystem.hh.
|
inlineprotected |
Constructor. Protected default constructor to force use of static createSystem member.
Definition at line 161 of file GHOST_ISystem.hh.
Referenced by getSystem().
|
protectedvirtualdefault |
Destructor. Protected default constructor to force use of static dispose member.
|
pure virtual |
Adds the given event consumer to our list.
| consumer | The event consumer to add. |
Implemented in GHOST_System.
Referenced by GHOST_AddEventConsumer().
|
pure virtual |
Create a new off-screen context. Never explicitly delete the context, use disposeContext() instead.
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_CreateGPUContext().
|
static |
Creates the one and only system.
| verbose | report back-ends that were attempted no back-end could be loaded. |
| background | loading the system for background rendering (no visible windows). |
The cause of the failure.
Definition at line 44 of file GHOST_ISystem.cc.
References CLG_LEVEL_INFO, CLOG_CHECK, CLOG_INFO, CLOG_STR_INFO_NOCHECK, e, getUseWindowFrame(), GHOST_kFailure, GHOST_kSuccess, i, LOG, system_, system_backend_id_, and verbose.
Referenced by createSystemBackground(), GHOST_CreateSystem(), and main().
|
static |
Definition at line 209 of file GHOST_ISystem.cc.
References CLOG_INFO, createSystem(), GHOST_kFailure, GHOST_kSuccess, LOG, and system_.
Referenced by GHOST_CreateSystemBackground().
|
pure virtual |
Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.
| title | The name of the window (displayed in the title bar of the window if the OS supports it). |
| left | The coordinate of the left edge of the window. |
| top | The coordinate of the top edge of the window. |
| width | The width the window. |
| height | The height the window. |
| state | The state of the window when opened. |
| gpu_settings | Misc GPU settings. |
| exclusive | Use to show the window on top and ignore others (used full-screen). |
| is_dialog | Stay on top of parent window, no icon in taskbar, can't be minimized. |
| parent_window | Parent (embedder) window |
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
References left, state, and top.
Referenced by Application::Application(), and GHOST_CreateWindow().
|
pure virtual |
Retrieves events from the queue and send them to the event consumers. The event stack will be empty afterwards.
Implemented in GHOST_System.
Referenced by GHOST_DispatchEvents().
|
pure virtual |
Dispose of a context.
| context | Pointer to the context to be disposed. |
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_DisposeGPUContext().
|
static |
Disposes the one and only system.
Definition at line 235 of file GHOST_ISystem.cc.
References CLOG_DEBUG, GHOST_kFailure, GHOST_kSuccess, LOG, and system_.
Referenced by GHOST_DisposeSystem(), and main().
|
pure virtual |
Dispose a window.
| window | Pointer to the window to be disposed. |
Implemented in GHOST_System.
Referenced by GHOST_DisposeWindow().
|
protectedpure virtual |
Shut the system down.
Implemented in GHOST_System, and GHOST_SystemWin32.
|
pure virtual |
Returns the combine dimensions of all monitors.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_GetAllDisplayDimensions().
|
static |
Definition at line 259 of file GHOST_ISystem.cc.
References backtrace_fn_.
Referenced by ghost_wayland_log_handler().
|
pure virtual |
Returns the state of a mouse button (outside the message queue).
| mask | The button state to retrieve. |
| is_down | Button state. |
Implemented in GHOST_System.
References mask().
Referenced by GHOST_GetButtonState().
|
pure virtual |
Return features supported by the system back-end.
The resulting value doesn't change at run-time.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_GetCapabilities().
|
pure virtual |
Return the clipboard buffer or null.
| selection | Use the "primary" selection. Check the GHOST_kCapabilityClipboardPrimary for backends that support this. |
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_getClipboard().
|
pure virtual |
Get image data from the Clipboard
| r_width | the returned image width in pixels. |
| r_height | the returned image height in pixels. |
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemWayland, and GHOST_SystemWin32.
Referenced by GHOST_getClipboardImage().
|
pure virtual |
Returns the current location of the cursor (location in screen coordinates)
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_System::getCursorPositionClientRelative().
|
pure virtual |
Returns the current location of the cursor (location in window coordinates)
Implemented in GHOST_System, and GHOST_SystemWayland.
Referenced by GHOST_GetCursorPosition().
|
pure virtual |
Implemented in GHOST_System, GHOST_SystemWayland, and GHOST_SystemWin32.
Referenced by GHOST_GetCursorPreferredLogicalSize().
|
pure virtual |
Returns the dimensions of the main display on this system.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_GetMainDisplayDimensions().
|
pure virtual |
Returns the system time. Returns the number of milliseconds since the start of the system.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_System::dispatchEvents(), GHOST_GetMilliSeconds(), and GHOST_System::installTimer().
|
pure virtual |
Returns the state of a modifier key (outside the message queue).
| mask | The modifier key state to retrieve. |
| is_down | The state of a modifier key (true == pressed). |
Implemented in GHOST_System.
References mask().
Referenced by GHOST_GetModifierKeyState().
|
pure virtual |
Returns the number of displays on this system.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_GetNumDisplays().
|
pure virtual |
Get the color of the pixel at the current mouse cursor location
| r_color | returned sRGB float colors |
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_GetPixelAtCursor().
|
static |
Returns a pointer to the one and only system (nil if it hasn't been created).
Definition at line 249 of file GHOST_ISystem.cc.
References GHOST_ISystem(), and system_.
Referenced by GHOST_SystemWin32::convertKey(), GHOST_WindowWin32::getPointerInfo(), GHOST_CreateSystem(), GHOST_CreateSystemBackground(), GHOST_GetCapabilities(), GHOST_getClipboard(), GHOST_getClipboardImage(), GHOST_GetPixelAtCursor(), GHOST_hasClipboardImage(), GHOST_putClipboard(), GHOST_putClipboardImage(), GHOST_SetAutoFocus(), GHOST_setConsoleWindowState(), GHOST_UseNativePixels(), GHOST_UseWindowFocus(), GHOST_X11_ApplicationErrorHandler(), GHOST_X11_ApplicationIOErrorHandler(), main(), GHOST_SystemWin32::processButtonEvent(), GHOST_SystemWin32::processCursorEvent(), GHOST_SystemWin32::processKeyEvent(), GHOST_SystemWin32::processPointerEvent(), GHOST_SystemWin32::processTrackpad(), GHOST_SystemWin32::processWheelEventHorizontal(), GHOST_SystemWin32::processWheelEventVertical(), GHOST_SystemWin32::processWindowEvent(), GHOST_SystemWin32::processWindowSizeEvent(), GHOST_SystemWin32::processWintabEvent(), GHOST_SystemWin32::pushDragDropEvent(), and GHOST_SystemWin32::s_wndProc().
|
static |
Return an identifier for the one and only system.
Definition at line 254 of file GHOST_ISystem.cc.
References system_backend_id_.
Referenced by GHOST_SystemBackend().
|
static |
Definition at line 269 of file GHOST_ISystem.cc.
References use_window_frame_.
Referenced by createSystem(), GHOST_SystemWayland::GHOST_SystemWayland(), and GHOST_WindowX11::GHOST_WindowX11().
|
pure virtual |
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.
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemHeadless, and GHOST_SystemWin32.
Referenced by GHOST_GetWindowUnderCursor().
|
pure virtual |
Returns GHOST_kSuccess if the clipboard contains an image.
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemWayland, and GHOST_SystemWin32.
Referenced by GHOST_hasClipboardImage().
|
protectedpure virtual |
Initialize the system.
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
|
pure virtual |
Specify whether debug messages are to be shown.
| debug | Flag for systems to debug. |
Implemented in GHOST_System, and GHOST_SystemWin32.
Referenced by GHOST_SystemInitDebug().
|
pure virtual |
Installs a timer.
| delay | The time to wait for the first call to the #timer_proc (in milliseconds). |
| interval | The interval between calls to the #timer_proc. |
| timer_proc | The callback invoked when the interval expires. |
| user_data | Placeholder for user data. |
Implemented in GHOST_System.
Referenced by Application::Application(), and GHOST_InstallTimer().
|
pure virtual |
Check whether debug messages are to be shown.
Implemented in GHOST_System.
Referenced by GHOST_X11_ApplicationErrorHandler(), and GHOST_X11_ApplicationIOErrorHandler().
|
pure virtual |
Retrieves events from the system and stores them in the queue.
| waitForEvent | Flag to wait for an event (or return immediately). |
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_ProcessEvents().
|
pure virtual |
Put data to the Clipboard
| buffer | The buffer to copy to the clipboard. |
| selection | The clipboard to copy too only used on X11. |
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_putClipboard().
|
pure virtual |
Put image data to the Clipboard
| rgba | uint array in RGBA byte order. |
| width | the image width in pixels. |
| height | the image height in pixels. |
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemWayland, and GHOST_SystemWin32.
Referenced by GHOST_putClipboardImage().
|
pure virtual |
Removes the given event consumer to our list.
| consumer | The event consumer to remove. |
Implemented in GHOST_System.
Referenced by GHOST_RemoveEventConsumer().
|
pure virtual |
Removes a timer.
| timerTask | Timer task to be removed. |
Implemented in GHOST_System.
Referenced by GHOST_RemoveTimer().
|
pure virtual |
Focus and raise windows on mouse hover.
Implemented in GHOST_System.
Referenced by GHOST_SetAutoFocus().
|
static |
Definition at line 264 of file GHOST_ISystem.cc.
References backtrace_fn_.
Referenced by GHOST_SetBacktraceHandler().
|
pure virtual |
Set the Console State
| action | console state |
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_setConsoleWindowState().
|
pure virtual |
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).
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_System::setCursorPositionClientRelative().
|
pure virtual |
Updates the location of the cursor (location in window coordinates).
Implemented in GHOST_System, and GHOST_SystemWayland.
Referenced by GHOST_SetCursorPosition().
|
pure virtual |
Enable multi-touch gestures if supported.
| use | Enable or disable. |
Implemented in GHOST_System, and GHOST_SystemWayland.
Referenced by GHOST_SetMultitouchGestures().
|
pure virtual |
Set which tablet API to use. Only affects Windows, other platforms have a single API.
| api | Enum indicating which API to use. |
Implemented in GHOST_System, and GHOST_SystemWin32.
Referenced by GHOST_SetTabletAPI().
|
static |
Definition at line 274 of file GHOST_ISystem.cc.
References use_window_frame_.
Referenced by GHOST_UseWindowFrame().
|
pure virtual |
Show a system message box
| title | The title of the message box. |
| message | The message to display. |
| help_label | Help button label. |
| continue_label | Continue button label. |
| link | An optional hyperlink. |
| dialog_options | Options how to display the message. |
Implemented in GHOST_System, GHOST_SystemCocoa, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_ShowMessageBox().
|
pure virtual |
Native pixel size support (MacBook 'retina').
Implemented in GHOST_System.
Referenced by GHOST_UseNativePixels().
|
pure virtual |
Focus window after opening, or put them in the background.
Implemented in GHOST_System.
Referenced by GHOST_UseWindowFocus().
|
pure virtual |
Returns whether a window is valid.
| window | Pointer to the window to be checked. |
Implemented in GHOST_System.
Referenced by GHOST_ValidWindow().
|
staticprotected |
Function to call that sets the back-trace.
Definition at line 545 of file GHOST_ISystem.hh.
Referenced by getBacktraceFn(), and setBacktraceFn().
|
staticprotected |
The one and only system
Definition at line 541 of file GHOST_ISystem.hh.
Referenced by createSystem(), createSystemBackground(), disposeSystem(), and getSystem().
|
staticprotected |
Definition at line 542 of file GHOST_ISystem.hh.
Referenced by createSystem(), and getSystemBackend().
|
staticprotected |
When false, don't use window frame.
Definition at line 554 of file GHOST_ISystem.hh.
Referenced by getUseWindowFrame(), and setUseWindowFrame().