Blender
V3.3
|
#include <GHOST_System.h>
Public Attributes | |
bool | m_nativePixel |
bool | m_windowFocus |
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, const bool alphaBackground=0) |
![]() | |
GHOST_ISystem () | |
virtual | ~GHOST_ISystem () |
Additional Inherited Members | |
![]() | |
static GHOST_TSuccess | createSystem () |
static GHOST_TSuccess | disposeSystem () |
static GHOST_ISystem * | getSystem () |
static GHOST_TBacktraceFn | getBacktraceFn () |
static void | setBacktraceFn (GHOST_TBacktraceFn backtrace_fn) |
![]() | |
static GHOST_ISystem * | m_system = 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.h.
|
protected |
Constructor. Protected default constructor to force use of static createSystem member.
Definition at line 23 of file GHOST_System.cpp.
|
protectedvirtual |
Destructor. Protected default constructor to force use of static dispose member.
Definition at line 39 of file GHOST_System.cpp.
References exit().
|
virtual |
Adds the given event consumer to our list.
consumer | The event consumer to add. |
Implements GHOST_ISystem.
Definition at line 228 of file GHOST_System.cpp.
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 112 of file GHOST_System.cpp.
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 fullscreen window.
window | The window created. |
Definition at line 380 of file GHOST_System.cpp.
References GHOST_ISystem::createWindow(), GHOST_GLSettings::flags, GHOST_ASSERT, GHOST_glAlphaBackground, GHOST_glStereoVisual, GHOST_kDrawingContextTypeOpenGL, 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_SystemWayland, GHOST_SystemX11, GHOST_SystemWin32, GHOST_SystemSDL, GHOST_SystemNULL, and GHOST_SystemCocoa.
|
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 212 of file GHOST_System.cpp.
References GHOST_EventManager::dispatchEvents(), GHOST_TimerManager::fireTimers(), 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 80 of file GHOST_System.cpp.
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 162 of file GHOST_System.cpp.
References GHOST_WindowManager::endFullScreen(), GHOST_WindowManager::getFullScreen(), GHOST_ASSERT, GHOST_kFailure, 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 354 of file GHOST_System.cpp.
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_SystemWayland, GHOST_SystemX11, GHOST_SystemWin32, GHOST_SystemSDL, GHOST_SystemNULL, and GHOST_SystemCocoa.
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 299 of file GHOST_System.cpp.
References GHOST_Buttons::get(), getButtons(), and mask().
|
pure virtual |
Returns the selection buffer
selection | Only used on X11. |
Implements GHOST_ISystem.
Implemented in GHOST_SystemWayland, GHOST_SystemX11, GHOST_SystemWin32, GHOST_SystemSDL, GHOST_SystemNULL, and GHOST_SystemCocoa.
|
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 264 of file GHOST_System.cpp.
References GHOST_ISystem::getCursorPosition(), GHOST_kSuccess, GHOST_IWindow::screenToClient(), x, and y.
|
inline |
Definition at line 427 of file GHOST_System.h.
References m_eventManager.
Referenced by GHOST_SystemWayland::processEvents(), and GHOST_SystemWin32::s_wndProc().
Returns current full screen mode status.
Implements GHOST_ISystem.
Definition at line 181 of file GHOST_System.cpp.
References GHOST_WindowManager::getFullScreen(), and m_windowManager.
Referenced by exit().
|
virtual |
Returns the system time. Returns the number of milliseconds since the start of the system process. Based on ANSI clock() routine.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemX11, GHOST_SystemWin32, GHOST_SystemNULL, and GHOST_SystemCocoa.
Definition at line 44 of file GHOST_System.cpp.
Referenced by GHOST_WindowWayland::activate(), GHOST_WindowWayland::close(), GHOST_SystemWayland::createWindow(), data_device_handle_drop(), GHOST_WindowWayland::deactivate(), dispatchEvents(), installTimer(), keyboard_handle_key(), GHOST_WindowWayland::notify_size(), GHOST_NDOFManagerUnix::processEvents(), and GHOST_SystemWayland::processEvents().
|
pure virtual |
Returns the state of all modifier keys.
keys | The state of all modifier keys (true == pressed). |
Implemented in GHOST_SystemWayland, GHOST_SystemX11, GHOST_SystemWin32, GHOST_SystemSDL, GHOST_SystemNULL, and GHOST_SystemCocoa.
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 287 of file GHOST_System.cpp.
References GHOST_ModifierKeys::get(), getModifierKeys(), and mask().
GHOST_TTabletAPI GHOST_System::getTabletAPI | ( | void | ) |
Definition at line 321 of file GHOST_System.cpp.
References m_tabletAPI.
Referenced by GHOST_WindowWin32::GHOST_WindowWin32(), and GHOST_WindowWin32::usingTabletAPI().
|
inline |
Definition at line 422 of file GHOST_System.h.
References m_timerManager.
Referenced by GHOST_SystemCocoa::processEvents(), GHOST_SystemSDL::processEvents(), GHOST_SystemWin32::processEvents(), GHOST_SystemX11::processEvents(), and GHOST_SystemWayland::processEvents().
|
inline |
Definition at line 432 of file GHOST_System.h.
References m_windowManager.
Referenced by GHOST_WindowWayland::activate(), GHOST_SystemWayland::createWindow(), GHOST_WindowWayland::deactivate(), GHOST_SystemWin32::driveTrackpad(), GHOST_WindowWayland::GHOST_WindowWayland(), GHOST_SystemWin32::processTrackpad(), GHOST_SystemWin32::processWindowEvent(), GHOST_NDOFManager::sendMotionEvent(), GHOST_DisplayManagerSDL::setCurrentDisplaySetting(), GHOST_SystemWin32::setTabletAPI(), 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_SystemNULL, and GHOST_SystemCocoa.
Definition at line 193 of file GHOST_System.cpp.
References bounds(), GHOST_WindowManager::getWindows(), GHOST_kWindowStateMinimized, m_windowManager, x, and y.
|
protectedvirtual |
Initialize the system.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemX11, GHOST_SystemWin32, GHOST_SystemNULL, and GHOST_SystemCocoa.
Definition at line 335 of file GHOST_System.cpp.
References GHOST_EventManager::addConsumer(), GHOST_kFailure, GHOST_kSuccess, m_eventManager, m_timerManager, and m_windowManager.
Referenced by GHOST_SystemCocoa::init(), GHOST_SystemNULL::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 432 of file GHOST_System.cpp.
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 51 of file GHOST_System.cpp.
References GHOST_TimerManager::addTimer(), GHOST_TimerManager::fireTimers(), getMilliSeconds(), GHOST_kSuccess, and m_timerManager.
Referenced by keyboard_handle_key_repeat_reset().
|
virtual |
Check whether debug messages are to be shown.
Implements GHOST_ISystem.
Definition at line 437 of file GHOST_System.cpp.
References m_is_debug_enabled.
GHOST_TSuccess GHOST_System::pushEvent | ( | 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 252 of file GHOST_System.cpp.
References GHOST_kFailure, m_eventManager, and GHOST_EventManager::pushEvent().
Referenced by GHOST_WindowWayland::activate(), GHOST_WindowWayland::close(), GHOST_SystemWayland::createWindow(), GHOST_SystemX11::createWindow(), GHOST_SystemCocoa::createWindow(), data_device_handle_drop(), GHOST_WindowWayland::deactivate(), GHOST_SystemCocoa::handleApplicationBecomeActiveEvent(), GHOST_SystemCocoa::handleDraggingEvent(), GHOST_SystemCocoa::handleKeyEvent(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemCocoa::handleOpenDocumentRequest(), GHOST_SystemCocoa::handleQuitRequest(), GHOST_SystemCocoa::handleWindowEvent(), keyboard_handle_key(), GHOST_WindowWayland::notify_size(), GHOST_SystemWin32::processButtonEvent(), GHOST_SystemX11::processEvents(), GHOST_SystemWin32::processPointerEvent(), GHOST_SystemWin32::processTrackpad(), GHOST_SystemWin32::processWheelEvent(), GHOST_SystemWin32::processWindowSizeEvent(), GHOST_SystemWin32::processWintabEvent(), GHOST_SystemWin32::pushDragDropEvent(), GHOST_SystemWin32::s_wndProc(), GHOST_NDOFManager::sendMotionEvent(), and GHOST_SystemCocoa::setCursorPosition().
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_SystemWayland, GHOST_SystemX11, GHOST_SystemWin32, GHOST_SystemSDL, GHOST_SystemNULL, and GHOST_SystemCocoa.
|
virtual |
Remove the given event consumer to our list.
consumer | The event consumer to remove. |
Implements GHOST_ISystem.
Definition at line 240 of file GHOST_System.cpp.
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 71 of file GHOST_System.cpp.
References GHOST_kFailure, m_timerManager, and GHOST_TimerManager::removeTimer().
|
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 277 of file GHOST_System.cpp.
References GHOST_IWindow::clientToScreen(), GHOST_ISystem::setCursorPosition(), x, and y.
Enable multitouch gestures if supported.
use | Enable or disable. |
Implements GHOST_ISystem.
Definition at line 311 of file GHOST_System.cpp.
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 316 of file GHOST_System.cpp.
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_SystemX11, and GHOST_SystemWin32.
Definition at line 340 of file GHOST_System.h.
References GHOST_kFailure.
Return true when warping the cursor is supported.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWayland.
Definition at line 422 of file GHOST_System.cpp.
Return true getting/setting the window position is supported.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemWayland.
Definition at line 427 of file GHOST_System.cpp.
|
virtual |
Updates the resolution while in fullscreen mode.
setting | The new setting of the display. |
window | Window displayed in full screen. |
Implements GHOST_ISystem.
Definition at line 147 of file GHOST_System.cpp.
References GHOST_WindowManager::getFullScreen(), GHOST_ASSERT, GHOST_kFailure, GHOST_DisplayManager::kMainDisplay, m_displayManager, m_windowManager, and GHOST_DisplayManager::setCurrentDisplaySetting().
Native pixel size support (MacBook 'retina').
Implements GHOST_ISystem.
Definition at line 411 of file GHOST_System.cpp.
References m_nativePixel.
Focus window after opening, or put them in the background.
Implements GHOST_ISystem.
Definition at line 417 of file GHOST_System.cpp.
References m_windowFocus.
|
virtual |
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.cpp.
References GHOST_WindowManager::getWindowFound(), and m_windowManager.
Referenced by GHOST_SystemCocoa::handleDraggingEvent(), and GHOST_SystemCocoa::handleWindowEvent().
|
protected |
The display manager (platform dependent).
Definition at line 389 of file GHOST_System.h.
Referenced by beginFullScreen(), createFullScreenWindow(), endFullScreen(), exit(), GHOST_SystemWin32::getNumDisplays(), GHOST_SystemCocoa::GHOST_SystemCocoa(), GHOST_SystemWin32::GHOST_SystemWin32(), GHOST_SystemNULL::init(), GHOST_SystemX11::init(), and updateFullScreen().
|
protected |
The event manager.
Definition at line 398 of file GHOST_System.h.
Referenced by addEventConsumer(), dispatchEvents(), disposeWindow(), exit(), getEventManager(), init(), GHOST_SystemWin32::processEvents(), pushEvent(), and removeEventConsumer().
|
protected |
Definition at line 419 of file GHOST_System.h.
Referenced by initDebug(), and isDebugEnabled().
|
protected |
Definition at line 414 of file GHOST_System.h.
Referenced by GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemWin32::s_wndProc(), and setMultitouchGestures().
bool GHOST_System::m_nativePixel |
Definition at line 152 of file GHOST_System.h.
Referenced by GHOST_WindowCocoa::GHOST_WindowCocoa(), GHOST_SystemCocoa::handleWindowEvent(), and useNativePixel().
|
protected |
Prints all the events. Settings of the display before the display went fullscreen.
Definition at line 411 of file GHOST_System.h.
Referenced by beginFullScreen(), and endFullScreen().
|
protected |
Which tablet API to use.
Definition at line 417 of file GHOST_System.h.
Referenced by getTabletAPI(), and setTabletAPI().
|
protected |
The timer manager.
Definition at line 392 of file GHOST_System.h.
Referenced by dispatchEvents(), exit(), getTimerManager(), init(), installTimer(), and removeTimer().
bool GHOST_System::m_windowFocus |
Definition at line 162 of file GHOST_System.h.
Referenced by GHOST_WindowWin32::GHOST_WindowWin32(), GHOST_WindowX11::GHOST_WindowX11(), and useWindowFocus().
|
protected |
The window manager.
Definition at line 395 of file GHOST_System.h.
Referenced by beginFullScreen(), GHOST_SystemWayland::createWindow(), GHOST_SystemWin32::createWindow(), GHOST_SystemX11::createWindow(), GHOST_SystemCocoa::createWindow(), disposeWindow(), endFullScreen(), exit(), GHOST_SystemX11::getClipboard(), GHOST_SystemX11::getClipboard_xcout(), getFullScreen(), getWindowManager(), getWindowUnderCursor(), GHOST_SystemCocoa::getWindowUnderCursor(), 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().