|
Blender V4.3
|
#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 () | |
| virtual | ~GHOST_System () |
| virtual GHOST_TSuccess | init () |
| 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 () |
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 38 of file GHOST_System.hh.
|
protected |
Constructor. Protected default constructor to force use of static createSystem member.
Definition at line 24 of file GHOST_System.cc.
|
protectedvirtual |
Destructor. Protected default constructor to force use of static dispose member.
Definition at line 42 of file GHOST_System.cc.
References exit().
|
virtual |
Adds the given event consumer to our list.
| consumer | The event consumer to add. |
Implements GHOST_ISystem.
Definition at line 248 of file GHOST_System.cc.
References GHOST_EventManager::addConsumer(), GHOST_kFailure, and m_eventManager.
|
virtual |
Begins full screen mode.
| setting | The new setting of the display. |
| window | Window displayed in full screen. |
| stereoVisual | Stereo visual for quad buffered stereo. This window is invalid after full screen has been ended. |
Implements GHOST_ISystem.
Definition at line 125 of file GHOST_System.cc.
References GHOST_WindowManager::beginFullScreen(), createFullScreenWindow(), GHOST_DisplayManager::getCurrentDisplaySetting(), GHOST_WindowManager::getFullScreen(), GHOST_ASSERT, GHOST_kFailure, GHOST_kSuccess, GHOST_PRINT, GHOST_DisplayManager::kMainDisplay, m_displayManager, m_preFullScreenSetting, m_windowManager, and GHOST_DisplayManager::setCurrentDisplaySetting().
|
protected |
Creates a full-screen window.
| window | The window created. |
Definition at line 405 of file GHOST_System.cc.
References GHOST_GPUSettings::context_type, GHOST_ISystem::createWindow(), GHOST_GPUSettings::flags, GHOST_ASSERT, GHOST_gpuStereoVisual, GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowStateNormal, and m_displayManager.
Referenced by beginFullScreen().
|
pure 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.
|
virtual |
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 232 of file GHOST_System.cc.
References GHOST_EventManager::dispatchEvents(), GHOST_TimerManager::fireTimers(), GHOST_ISystem::getMilliSeconds(), m_eventManager, and m_timerManager.
Referenced by GHOST_SystemWin32::processWindowSizeEvent(), and GHOST_SystemWin32::s_wndProc().
|
virtual |
Dispose a window.
| window | Pointer to the window to be disposed. |
Implements GHOST_ISystem.
Definition at line 93 of file GHOST_System.cc.
References endFullScreen(), GHOST_WindowManager::getFullScreenWindow(), GHOST_WindowManager::getWindowFound(), GHOST_kFailure, m_eventManager, m_windowManager, GHOST_WindowManager::removeWindow(), and GHOST_EventManager::removeWindowEvents().
|
virtual |
Ends full screen mode.
Implements GHOST_ISystem.
Definition at line 173 of file GHOST_System.cc.
References GHOST_WindowManager::endFullScreen(), GHOST_WindowManager::getFullScreen(), GHOST_ASSERT, GHOST_kFailure, GHOST_kSuccess, GHOST_DisplayManager::kMainDisplay, m_displayManager, m_preFullScreenSetting, m_windowManager, and GHOST_DisplayManager::setCurrentDisplaySetting().
Referenced by disposeWindow(), and exit().
|
protectedvirtual |
Shut the system down.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWin32.
Definition at line 379 of file GHOST_System.cc.
References endFullScreen(), getFullScreen(), GHOST_kSuccess, m_displayManager, 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().
|
virtual |
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 319 of file GHOST_System.cc.
References GHOST_Buttons::get(), and getButtons().
|
pure 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.
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 52 of file GHOST_System.cc.
|
virtual |
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 284 of file GHOST_System.cc.
References GHOST_ISystem::getCursorPosition(), GHOST_kSuccess, and GHOST_IWindow::screenToClient().
|
inline |
Definition at line 448 of file GHOST_System.hh.
References m_eventManager.
Referenced by GHOST_SystemWayland::processEvents(), and GHOST_SystemWin32::s_wndProc().
|
virtual |
Returns current full screen mode status.
Implements GHOST_ISystem.
Definition at line 190 of file GHOST_System.cc.
References GHOST_WindowManager::getFullScreen(), and m_windowManager.
Referenced by exit().
|
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().
|
virtual |
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 307 of file GHOST_System.cc.
References GHOST_ModifierKeys::get(), and getModifierKeys().
|
virtual |
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 346 of file GHOST_System.cc.
References GHOST_kFailure.
| GHOST_TTabletAPI GHOST_System::getTabletAPI | ( | ) |
Definition at line 341 of file GHOST_System.cc.
References m_tabletAPI.
Referenced by GHOST_WindowWin32::GHOST_WindowWin32(), and GHOST_WindowWin32::usingTabletAPI().
|
inline |
Definition at line 443 of file GHOST_System.hh.
References m_timerManager.
Referenced by GHOST_SystemSDL::processEvents(), GHOST_SystemWayland::processEvents(), GHOST_SystemWin32::processEvents(), and GHOST_SystemX11::processEvents().
|
inline |
Definition at line 453 of file GHOST_System.hh.
References m_windowManager.
Referenced by GHOST_WindowWayland::activate(), GHOST_WindowWayland::deactivate(), 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(), GHOST_NDOFManager::sendMotionEvent(), GHOST_DisplayManagerSDL::setCurrentDisplaySetting(), GHOST_SystemWin32::setTabletAPI(), GHOST_WindowWayland::setWindowCursorShape(), GHOST_WindowWayland::setWindowCustomCursorShape(), GHOST_NDOFManager::updateButton(), and GHOST_WindowWin32::~GHOST_WindowWin32().
|
virtual |
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 202 of file GHOST_System.cc.
References bounds(), GHOST_IWindow::getClientBounds(), GHOST_IWindow::getState(), GHOST_WindowManager::getWindows(), GHOST_kWindowStateMinimized, and m_windowManager.
|
virtual |
Returns GHOST_kSuccess if the clipboard contains an image.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemWayland, and GHOST_SystemWin32.
Definition at line 47 of file GHOST_System.cc.
References GHOST_kFailure.
|
protectedvirtual |
Initialize the system.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
Definition at line 360 of file GHOST_System.cc.
References GHOST_EventManager::addConsumer(), 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().
|
virtual |
Specify whether debug messages are to be shown.
| debug | Flag for systems to debug. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWin32.
Definition at line 455 of file GHOST_System.cc.
References GHOST_Debug::flags, GHOST_kDebugDefault, and m_is_debug_enabled.
Referenced by GHOST_SystemWin32::initDebug().
|
virtual |
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 64 of file GHOST_System.cc.
References GHOST_TimerManager::addTimer(), GHOST_TimerManager::fireTimers(), GHOST_ISystem::getMilliSeconds(), GHOST_kSuccess, m_timerManager, and timer.
Referenced by gwl_seat_key_repeat_timer_add().
|
virtual |
Check whether debug messages are to be shown.
Implements GHOST_ISystem.
Definition at line 460 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 272 of file GHOST_System.cc.
References GHOST_kFailure, m_eventManager, and GHOST_EventManager::pushEvent().
Referenced by gwl_window_frame_update_from_pending_no_lock(), GHOST_SystemWin32::processButtonEvent(), GHOST_SystemWin32::processPointerEvent(), GHOST_SystemWin32::processTrackpad(), GHOST_SystemWin32::processWheelEvent(), GHOST_SystemWin32::processWindowSizeEvent(), GHOST_SystemWin32::processWintabEvent(), GHOST_SystemWin32::pushDragDropEvent(), GHOST_SystemWin32::s_wndProc(), and GHOST_NDOFManager::sendMotionEvent().
|
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. |
Implements GHOST_ISystem.
Implemented in GHOST_SystemCocoa, GHOST_SystemHeadless, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
|
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. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCocoa, GHOST_SystemWayland, and GHOST_SystemWin32.
Definition at line 57 of file GHOST_System.cc.
References GHOST_kFailure.
|
virtual |
Remove the given event consumer to our list.
| consumer | The event consumer to remove. |
Implements GHOST_ISystem.
Definition at line 260 of file GHOST_System.cc.
References GHOST_kFailure, m_eventManager, and GHOST_EventManager::removeConsumer().
|
virtual |
Removes a timer.
| timerTask | Timer task to be removed. |
Implements GHOST_ISystem.
Definition at line 84 of file GHOST_System.cc.
References GHOST_kFailure, m_timerManager, and GHOST_TimerManager::removeTimer().
Referenced by gwl_seat_key_repeat_timer_remove().
|
virtual |
Focus and raise windows on mouse hover.
Implements GHOST_ISystem.
Definition at line 450 of file GHOST_System.cc.
References m_autoFocus.
|
virtual |
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 297 of file GHOST_System.cc.
References GHOST_IWindow::clientToScreen(), and GHOST_ISystem::setCursorPosition().
|
virtual |
Enable multi-touch gestures if supported.
| use | Enable or disable. |
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWayland.
Definition at line 331 of file GHOST_System.cc.
References m_multitouchGestures.
|
virtual |
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 336 of file GHOST_System.cc.
References m_tabletAPI.
Referenced by GHOST_SystemWin32::setTabletAPI().
|
inlinevirtual |
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 362 of file GHOST_System.hh.
References GHOST_kFailure.
|
virtual |
Updates the resolution while in full-screen mode.
| setting | The new setting of the display. |
| window | Window displayed in full screen. |
Implements GHOST_ISystem.
Definition at line 158 of file GHOST_System.cc.
References GHOST_WindowManager::getFullScreen(), GHOST_ASSERT, GHOST_kFailure, GHOST_DisplayManager::kMainDisplay, m_displayManager, m_windowManager, and GHOST_DisplayManager::setCurrentDisplaySetting().
|
virtual |
Native pixel size support (MacBook 'retina').
Implements GHOST_ISystem.
Definition at line 439 of file GHOST_System.cc.
References m_nativePixel.
|
virtual |
Focus window after opening, or put them in the background.
Implements GHOST_ISystem.
Definition at line 445 of file GHOST_System.cc.
References m_windowFocus.
|
virtual |
Returns whether a window is valid.
| window | Pointer to the window to be checked. |
Implements GHOST_ISystem.
Definition at line 120 of file GHOST_System.cc.
References GHOST_WindowManager::getWindowFound(), and m_windowManager.
| bool GHOST_System::m_autoFocus |
Definition at line 157 of file GHOST_System.hh.
Referenced by GHOST_SystemWin32::s_wndProc(), and setAutoFocus().
|
protected |
The display manager (platform dependent).
Definition at line 410 of file GHOST_System.hh.
Referenced by beginFullScreen(), createFullScreenWindow(), endFullScreen(), exit(), GHOST_SystemWin32::getNumDisplays(), GHOST_SystemWin32::GHOST_SystemWin32(), GHOST_SystemHeadless::init(), GHOST_SystemX11::init(), and updateFullScreen().
|
protected |
The event manager.
Definition at line 419 of file GHOST_System.hh.
Referenced by addEventConsumer(), dispatchEvents(), disposeWindow(), exit(), getEventManager(), init(), GHOST_SystemWin32::processEvents(), pushEvent(), and removeEventConsumer().
|
protected |
Definition at line 440 of file GHOST_System.hh.
Referenced by initDebug(), and isDebugEnabled().
|
protected |
Definition at line 435 of file GHOST_System.hh.
Referenced by GHOST_SystemWin32::s_wndProc(), setMultitouchGestures(), and GHOST_SystemWayland::setMultitouchGestures().
| bool GHOST_System::m_nativePixel |
Definition at line 144 of file GHOST_System.hh.
Referenced by GHOST_WindowCocoa::GHOST_WindowCocoa(), and useNativePixel().
|
protected |
Prints all the events. Settings of the display before the display went full-screen.
Definition at line 432 of file GHOST_System.hh.
Referenced by beginFullScreen(), and endFullScreen().
|
protected |
Which tablet API to use.
Definition at line 438 of file GHOST_System.hh.
Referenced by getTabletAPI(), and setTabletAPI().
|
protected |
The timer manager.
Definition at line 413 of file GHOST_System.hh.
Referenced by dispatchEvents(), exit(), getTimerManager(), init(), installTimer(), and removeTimer().
| bool GHOST_System::m_windowFocus |
Definition at line 151 of file GHOST_System.hh.
Referenced by GHOST_WindowWin32::GHOST_WindowWin32(), GHOST_WindowX11::GHOST_WindowX11(), and useWindowFocus().
|
protected |
The window manager.
Definition at line 416 of file GHOST_System.hh.
Referenced by beginFullScreen(), GHOST_SystemWayland::createWindow(), GHOST_SystemWin32::createWindow(), GHOST_SystemX11::createWindow(), disposeWindow(), endFullScreen(), exit(), GHOST_SystemX11::getClipboard(), GHOST_SystemX11::getClipboard_xcout(), getFullScreen(), getWindowManager(), getWindowUnderCursor(), GHOST_SystemWin32::getWindowUnderCursor(), init(), GHOST_SystemX11::putClipboard(), updateFullScreen(), and validWindow().