|
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.
References false, GHOST_kTabletAutomatic, m_autoFocus, m_displayManager, m_eventManager, m_is_debug_enabled, m_multitouchGestures, m_nativePixel, m_preFullScreenSetting, m_tabletAPI, m_timerManager, m_windowFocus, m_windowManager, and true.
Referenced by GHOST_SystemHeadless::createOffscreenContext(), GHOST_SystemHeadless::GHOST_SystemHeadless(), GHOST_SystemSDL::GHOST_SystemSDL(), GHOST_SystemWayland::GHOST_SystemWayland(), and GHOST_SystemX11::GHOST_SystemX11().
|
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_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 createFullScreenWindow(), GHOST_ASSERT, GHOST_kFailure, GHOST_kSuccess, GHOST_PRINT, GHOST_DisplayManager::kMainDisplay, m_displayManager, m_preFullScreenSetting, and m_windowManager.
|
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, m_displayManager, GHOST_DisplaySetting::xPixels, and GHOST_DisplaySetting::yPixels.
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_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_kFailure, m_eventManager, and m_windowManager.
|
virtual |
Ends full screen mode.
Implements GHOST_ISystem.
Definition at line 173 of file GHOST_System.cc.
References GHOST_ASSERT, GHOST_kFailure, GHOST_kSuccess, GHOST_DisplayManager::kMainDisplay, m_displayManager, m_preFullScreenSetting, and m_windowManager.
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(), getButtons(), and mask().
|
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.
References selection.
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, GHOST_IWindow::screenToClient(), x, and y.
|
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 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(), getModifierKeys(), and mask().
|
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().
|
inline |
Definition at line 443 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 453 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().
|
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_kWindowStateMinimized, m_windowManager, x, and y.
|
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_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_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, and m_eventManager.
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(), and GHOST_SystemWin32::s_wndProc().
|
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.
References selection.
|
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, and m_eventManager.
|
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, and m_timerManager.
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(), GHOST_ISystem::setCursorPosition(), x, and y.
|
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_ASSERT, GHOST_kFailure, GHOST_DisplayManager::kMainDisplay, m_displayManager, and m_windowManager.
|
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 m_windowManager.
Referenced by GHOST_SystemCocoa::handleDraggingEvent(), and GHOST_SystemCocoa::handleWindowEvent().
| bool GHOST_System::m_autoFocus |
Definition at line 157 of file GHOST_System.hh.
Referenced by GHOST_System(), 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_System(), GHOST_SystemCocoa::GHOST_SystemCocoa(), 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(), GHOST_System(), init(), GHOST_SystemWin32::processEvents(), pushEvent(), and removeEventConsumer().
|
protected |
Definition at line 440 of file GHOST_System.hh.
Referenced by GHOST_System(), initDebug(), and isDebugEnabled().
|
protected |
Definition at line 435 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 144 of file GHOST_System.hh.
Referenced by GHOST_System(), GHOST_SystemCocoa::handleWindowEvent(), 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(), endFullScreen(), and GHOST_System().
|
protected |
Which tablet API to use.
Definition at line 438 of file GHOST_System.hh.
Referenced by getTabletAPI(), GHOST_System(), and setTabletAPI().
|
protected |
The timer manager.
Definition at line 413 of file GHOST_System.hh.
Referenced by dispatchEvents(), exit(), getTimerManager(), GHOST_System(), init(), installTimer(), and removeTimer().
| bool GHOST_System::m_windowFocus |
Definition at line 151 of file GHOST_System.hh.
Referenced by GHOST_System(), GHOST_WindowX11::GHOST_WindowX11(), and useWindowFocus().
|
protected |
The window manager.
Definition at line 416 of file GHOST_System.hh.
Referenced by beginFullScreen(), GHOST_SystemCocoa::createWindow(), GHOST_SystemWayland::createWindow(), GHOST_SystemWin32::createWindow(), GHOST_SystemX11::createWindow(), disposeWindow(), endFullScreen(), exit(), GHOST_SystemX11::getClipboard(), GHOST_SystemX11::getClipboard_xcout(), getFullScreen(), 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(), updateFullScreen(), and validWindow().