|
Blender V4.5
|
#include <GHOST_System.hh>
Inherits GHOST_ISystem.
Inherited by GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Public Attributes | |
| bool | m_nativePixel |
| bool | m_windowFocus |
| bool | m_autoFocus |
Protected Member Functions | |
| GHOST_System () | |
| ~GHOST_System () override | |
| GHOST_TSuccess | init () override |
| GHOST_TSuccess | exit () override |
| Protected Member Functions inherited from GHOST_ISystem | |
| GHOST_ISystem () | |
| virtual | ~GHOST_ISystem ()=default |
Protected Attributes | |
| GHOST_TimerManager * | m_timerManager |
| GHOST_WindowManager * | m_windowManager |
| GHOST_EventManager * | m_eventManager |
| bool | m_multitouchGestures |
| GHOST_TTabletAPI | m_tabletAPI |
| bool | m_is_debug_enabled |
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_ISystem * | getSystem () |
| static const char * | getSystemBackend () |
| static GHOST_TBacktraceFn | getBacktraceFn () |
| static void | setBacktraceFn (GHOST_TBacktraceFn backtrace_fn) |
| Static Protected Attributes inherited from GHOST_ISystem | |
| static GHOST_ISystem * | m_system = nullptr |
| static const char * | m_system_backend_id = nullptr |
| static GHOST_TBacktraceFn | m_backtrace_fn = nullptr |
Implementation of platform independent functionality of the GHOST_ISystem interface. GHOST_System is an abstract class because not all methods of GHOST_ISystem are implemented.
Definition at line 37 of file GHOST_System.hh.
|
protected |
Constructor. Protected default constructor to force use of static createSystem member.
Definition at line 20 of file GHOST_System.cc.
References false, GHOST_kTabletAutomatic, m_autoFocus, m_eventManager, m_is_debug_enabled, m_multitouchGestures, m_nativePixel, m_tabletAPI, m_timerManager, m_windowFocus, m_windowManager, nullptr, and true.
Referenced by GHOST_SystemHeadless::createOffscreenContext(), GHOST_SystemHeadless::GHOST_SystemHeadless(), GHOST_SystemSDL::GHOST_SystemSDL(), GHOST_SystemWayland::GHOST_SystemWayland(), and GHOST_SystemX11::GHOST_SystemX11().
|
overrideprotected |
Destructor. Protected default constructor to force use of static dispose member.
Definition at line 36 of file GHOST_System.cc.
References exit().
|
overridevirtual |
Adds the given event consumer to our list.
| consumer | The event consumer to add. |
Implements GHOST_ISystem.
Definition at line 158 of file GHOST_System.cc.
References GHOST_kFailure, and m_eventManager.
|
overridepure virtual |
Create a new off-screen context. Never explicitly delete the context, use disposeContext() instead.
Implements GHOST_ISystem.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
|
overridevirtual |
Inherited from GHOST_ISystem but left pure virtual
virtual bool processEvents(bool waitForEvent) = 0; Dispatches all the events on the stack. The event stack will be empty afterwards.
Implements GHOST_ISystem.
Definition at line 142 of file GHOST_System.cc.
References GHOST_ISystem::getMilliSeconds(), m_eventManager, and m_timerManager.
Referenced by GHOST_SystemWin32::processWindowSizeEvent(), and GHOST_SystemWin32::s_wndProc().
|
overridevirtual |
Dispose a window.
| window | Pointer to the window to be disposed. |
Implements GHOST_ISystem.
Definition at line 87 of file GHOST_System.cc.
References GHOST_kFailure, m_eventManager, and m_windowManager.
|
overrideprotectedvirtual |
Shut the system down.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWin32.
Definition at line 294 of file GHOST_System.cc.
References GHOST_kSuccess, m_eventManager, m_timerManager, and m_windowManager.
Referenced by GHOST_SystemWin32::exit(), and ~GHOST_System().
|
pure virtual |
Returns the state of the mouse buttons (outside the message queue).
| buttons | The state of the buttons. |
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by getButtonState().
|
overridevirtual |
Returns the state of a mouse button (outside the message queue).
| mask | The button state to retrieve. |
| isDown | Button state. |
Implements GHOST_ISystem.
Definition at line 234 of file GHOST_System.cc.
References GHOST_Buttons::get(), getButtons(), and mask().
|
overridepure virtual |
Returns the selection buffer
| selection | Only used on X11. |
Implements GHOST_ISystem.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
|
overridevirtual |
Get image data from the Clipboard
| r_width | the returned image width in pixels. |
| r_height | the returned image height in pixels. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemWayland, and GHOST_SystemWin32.
Definition at line 46 of file GHOST_System.cc.
|
overridevirtual |
Returns the current location of the cursor (location in window coordinates)
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWayland.
Definition at line 194 of file GHOST_System.cc.
References GHOST_ISystem::getCursorPosition(), GHOST_kSuccess, GHOST_IWindow::screenToClient(), x, and y.
|
overridevirtual |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWayland.
Definition at line 217 of file GHOST_System.cc.
|
inline |
Definition at line 403 of file GHOST_System.hh.
References m_eventManager.
Referenced by GHOST_SystemWayland::processEvents(), and GHOST_SystemWin32::s_wndProc().
|
pure virtual |
Returns the state of all modifier keys.
| keys | The state of all modifier keys (true == pressed). |
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by getModifierKeyState().
|
overridevirtual |
Inherited from GHOST_ISystem but left pure virtual
GHOST_TSuccess getCursorPosition(int32_t& x, int32_t& y) const = 0; GHOST_TSuccess setCursorPosition(int32_t x, int32_t y)
Returns the state of a modifier key (outside the message queue).
| mask | The modifier key state to retrieve. |
| isDown | The state of a modifier key (true == pressed). |
Implements GHOST_ISystem.
Definition at line 222 of file GHOST_System.cc.
References GHOST_ModifierKeys::get(), getModifierKeys(), and mask().
|
overridevirtual |
Get the color of the pixel at the current mouse cursor location
| r_color | returned sRGB float colors |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemWin32, and GHOST_SystemX11.
Definition at line 261 of file GHOST_System.cc.
References GHOST_kFailure.
| GHOST_TTabletAPI GHOST_System::getTabletAPI | ( | ) |
Definition at line 256 of file GHOST_System.cc.
References m_tabletAPI.
Referenced by GHOST_WindowWin32::GHOST_WindowWin32().
|
inline |
Definition at line 398 of file GHOST_System.hh.
References m_timerManager.
Referenced by GHOST_SystemCocoa::processEvents(), GHOST_SystemSDL::processEvents(), GHOST_SystemWayland::processEvents(), GHOST_SystemWin32::processEvents(), and GHOST_SystemX11::processEvents().
|
inline |
Definition at line 408 of file GHOST_System.hh.
References m_windowManager.
Referenced by GHOST_SystemWin32::driveTrackpad(), gwl_window_activate(), gwl_window_frame_update_from_pending_no_lock(), GHOST_SystemWayland::output_scale_update(), GHOST_SystemWayland::output_unref(), GHOST_SystemWayland::processEvents(), GHOST_SystemWin32::processTrackpad(), GHOST_SystemWin32::processWindowEvent(), and GHOST_SystemWin32::setTabletAPI().
|
overridevirtual |
Get the Window under the cursor.
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemHeadless, and GHOST_SystemWin32.
Definition at line 112 of file GHOST_System.cc.
References bounds(), GHOST_IWindow::getClientBounds(), GHOST_IWindow::getState(), GHOST_kWindowStateMinimized, m_windowManager, x, and y.
|
overridevirtual |
Returns GHOST_kSuccess if the clipboard contains an image.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemWayland, and GHOST_SystemWin32.
Definition at line 41 of file GHOST_System.cc.
References GHOST_kFailure.
|
overrideprotectedvirtual |
Initialize the system.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Definition at line 275 of file GHOST_System.cc.
References GHOST_kFailure, GHOST_kSuccess, m_eventManager, m_timerManager, and m_windowManager.
Referenced by GHOST_SystemCocoa::init(), GHOST_SystemHeadless::init(), GHOST_SystemWayland::init(), GHOST_SystemWin32::init(), and GHOST_SystemX11::init().
|
overridevirtual |
Specify whether debug messages are to be shown.
| debug | Flag for systems to debug. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWin32.
Definition at line 329 of file GHOST_System.cc.
References GHOST_Debug::flags, GHOST_kDebugDefault, and m_is_debug_enabled.
Referenced by GHOST_SystemWin32::initDebug().
|
overridevirtual |
Installs a timer.
| delay | The time to wait for the first call to the #timerProc (in milliseconds). |
| interval | The interval between calls to the #timerProc. |
| timerProc | The callback invoked when the interval expires. |
| userData | Placeholder for user data. |
Implements GHOST_ISystem.
Definition at line 58 of file GHOST_System.cc.
References GHOST_ISystem::getMilliSeconds(), GHOST_kSuccess, m_timerManager, and timer.
Referenced by gwl_seat_key_repeat_timer_add().
|
overridevirtual |
Check whether debug messages are to be shown.
Implements GHOST_ISystem.
Definition at line 334 of file GHOST_System.cc.
References m_is_debug_enabled.
| GHOST_TSuccess GHOST_System::pushEvent | ( | const GHOST_IEvent * | event | ) |
Pushes an event on the stack. To dispatch it, call dispatchEvent() or dispatchEvents(). Do not delete the event!
| event | The event to push on the stack. |
Definition at line 182 of file GHOST_System.cc.
References GHOST_kFailure, and m_eventManager.
Referenced by gwl_window_frame_update_from_pending_no_lock(), GHOST_SystemWin32::processButtonEvent(), GHOST_SystemWin32::processPointerEvent(), GHOST_SystemWin32::processTrackpad(), GHOST_SystemWin32::processWheelEventHorizontal(), GHOST_SystemWin32::processWheelEventVertical(), GHOST_SystemWin32::processWindowSizeEvent(), GHOST_SystemWin32::processWintabEvent(), GHOST_SystemWin32::pushDragDropEvent(), and GHOST_SystemWin32::s_wndProc().
|
overridepure virtual |
Put data to the Clipboard
| buffer | The buffer to copy to the clipboard. |
| selection | The clipboard to copy too only used on X11. |
Implements GHOST_ISystem.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
|
overridevirtual |
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. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemWayland, and GHOST_SystemWin32.
Definition at line 51 of file GHOST_System.cc.
References GHOST_kFailure.
|
overridevirtual |
Remove the given event consumer to our list.
| consumer | The event consumer to remove. |
Implements GHOST_ISystem.
Definition at line 170 of file GHOST_System.cc.
References GHOST_kFailure, and m_eventManager.
|
overridevirtual |
Removes a timer.
| timerTask | Timer task to be removed. |
Implements GHOST_ISystem.
Definition at line 78 of file GHOST_System.cc.
References GHOST_kFailure, and m_timerManager.
Referenced by gwl_seat_key_repeat_timer_remove().
|
overridevirtual |
Focus and raise windows on mouse hover.
Implements GHOST_ISystem.
Definition at line 324 of file GHOST_System.cc.
References m_autoFocus.
|
overridevirtual |
Updates the location of the cursor (location in window coordinates).
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWayland.
Definition at line 207 of file GHOST_System.cc.
References GHOST_IWindow::clientToScreen(), GHOST_ISystem::setCursorPosition(), x, and y.
|
overridevirtual |
Enable multi-touch gestures if supported.
| use | Enable or disable. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWayland.
Definition at line 246 of file GHOST_System.cc.
References m_multitouchGestures.
|
overridevirtual |
Set which tablet API to use. Only affects Windows, other platforms have a single API.
| api | Enum indicating which API to use. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWin32.
Definition at line 251 of file GHOST_System.cc.
References m_tabletAPI.
Referenced by GHOST_SystemWin32::setTabletAPI().
|
inlineoverridevirtual |
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. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemWin32, and GHOST_SystemX11.
Definition at line 332 of file GHOST_System.hh.
References GHOST_kFailure.
|
overridevirtual |
Native pixel size support (MacBook 'retina').
Implements GHOST_ISystem.
Definition at line 313 of file GHOST_System.cc.
References m_nativePixel.
|
overridevirtual |
Focus window after opening, or put them in the background.
Implements GHOST_ISystem.
Definition at line 319 of file GHOST_System.cc.
References m_windowFocus.
|
overridevirtual |
Returns whether a window is valid.
| window | Pointer to the window to be checked. |
Implements GHOST_ISystem.
Definition at line 107 of file GHOST_System.cc.
References m_windowManager.
Referenced by GHOST_SystemCocoa::handleDraggingEvent(), and GHOST_SystemCocoa::handleWindowEvent().
| bool GHOST_System::m_autoFocus |
Definition at line 123 of file GHOST_System.hh.
Referenced by GHOST_System(), GHOST_SystemWin32::s_wndProc(), and setAutoFocus().
|
protected |
The event manager.
Definition at line 377 of file GHOST_System.hh.
Referenced by addEventConsumer(), dispatchEvents(), disposeWindow(), exit(), getEventManager(), GHOST_System(), init(), GHOST_SystemWin32::processEvents(), pushEvent(), and removeEventConsumer().
|
protected |
Definition at line 395 of file GHOST_System.hh.
Referenced by GHOST_System(), initDebug(), and isDebugEnabled().
|
protected |
Prints all the events.
Definition at line 390 of file GHOST_System.hh.
Referenced by GHOST_System(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemWin32::s_wndProc(), setMultitouchGestures(), and GHOST_SystemWayland::setMultitouchGestures().
| bool GHOST_System::m_nativePixel |
Definition at line 110 of file GHOST_System.hh.
Referenced by GHOST_System(), GHOST_SystemCocoa::handleWindowEvent(), and useNativePixel().
|
protected |
Which tablet API to use.
Definition at line 393 of file GHOST_System.hh.
Referenced by getTabletAPI(), GHOST_System(), and setTabletAPI().
|
protected |
The timer manager.
Definition at line 371 of file GHOST_System.hh.
Referenced by dispatchEvents(), exit(), getTimerManager(), GHOST_System(), init(), installTimer(), and removeTimer().
| bool GHOST_System::m_windowFocus |
Definition at line 117 of file GHOST_System.hh.
Referenced by GHOST_System(), GHOST_WindowX11::GHOST_WindowX11(), and useWindowFocus().
|
protected |
The window manager.
Definition at line 374 of file GHOST_System.hh.
Referenced by GHOST_SystemCocoa::createWindow(), GHOST_SystemWayland::createWindow(), GHOST_SystemWin32::createWindow(), GHOST_SystemX11::createWindow(), disposeWindow(), exit(), GHOST_SystemX11::getClipboard(), GHOST_SystemX11::getClipboard_xcout(), getWindowManager(), getWindowUnderCursor(), GHOST_SystemCocoa::getWindowUnderCursor(), GHOST_SystemWin32::getWindowUnderCursor(), GHOST_System(), GHOST_SystemCocoa::handleApplicationBecomeActiveEvent(), GHOST_SystemCocoa::handleKeyEvent(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemCocoa::handleOpenDocumentRequest(), GHOST_SystemCocoa::handleQuitRequest(), GHOST_SystemCocoa::handleTabletEvent(), GHOST_SystemCocoa::handleWindowEvent(), GHOST_SystemCocoa::hasDialogWindow(), init(), GHOST_SystemX11::putClipboard(), GHOST_SystemCocoa::setCursorPosition(), GHOST_SystemCocoa::setMouseCursorPosition(), and validWindow().