|
Blender
V2.93
|
#include <GHOST_System.h>
Inherits GHOST_ISystem.
Inherited by GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWayland, GHOST_SystemWin32, and GHOST_SystemX11.
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) |
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 () |
| static GHOST_TSuccess | disposeSystem () |
| static GHOST_ISystem * | getSystem () |
Static Protected Attributes inherited from GHOST_ISystem | |
| static GHOST_ISystem * | m_system = NULL |
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 53 of file GHOST_System.h.
|
protected |
Constructor. Protected default constructor to force use of static createSystem member.
Definition at line 39 of file GHOST_System.cpp.
|
protectedvirtual |
Destructor. Protected default constructor to force use of static dispose member.
Definition at line 54 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 224 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 127 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 350 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, NULL, GHOST_DisplaySetting::xPixels, and GHOST_DisplaySetting::yPixels.
Referenced by beginFullScreen().
|
pure virtual |
Create a new offscreen 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 208 of file GHOST_System.cpp.
References GHOST_EventManager::dispatchEvents(), GHOST_TimerManager::fireTimers(), getMilliSeconds(), m_eventManager, and m_timerManager.
Referenced by GHOST_SystemWin32::s_wndProc().
|
virtual |
Dispose a window.
| window | Pointer to the window to be disposed. |
Implements GHOST_ISystem.
Definition at line 95 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 177 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 324 of file GHOST_System.cpp.
References endFullScreen(), getFullScreen(), GHOST_kSuccess, m_displayManager, m_eventManager, m_timerManager, m_windowManager, and NULL.
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 272 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.
|
inline |
Definition at line 412 of file GHOST_System.h.
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 196 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 59 of file GHOST_System.cpp.
Referenced by GHOST_WindowWayland::activate(), GHOST_WindowWayland::close(), GHOST_SystemWayland::createWindow(), data_device_drop(), GHOST_WindowWayland::deactivate(), dispatchEvents(), dnd_events(), installTimer(), keyboard_key(), GHOST_WindowWayland::notify_size(), pointer_axis(), pointer_button(), pointer_enter(), pointer_motion(), GHOST_NDOFManagerUnix::processEvents(), GHOST_SystemWayland::processEvents(), and relative_pointer_relative_motion().
|
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(GHOST_TInt32& x, GHOST_TInt32& y) const = 0; GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 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 260 of file GHOST_System.cpp.
References GHOST_ModifierKeys::get(), getModifierKeys(), and mask().
| GHOST_TTabletAPI GHOST_System::getTabletAPI | ( | void | ) |
Definition at line 289 of file GHOST_System.cpp.
References m_tabletAPI.
Referenced by GHOST_WindowWin32::GHOST_WindowWin32(), and GHOST_WindowWin32::useTabletAPI().
|
inline |
Definition at line 407 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 417 of file GHOST_System.h.
References m_windowManager.
Referenced by GHOST_WindowWayland::activate(), GHOST_WindowWayland::deactivate(), GHOST_SystemWin32::processWindowEvent(), GHOST_NDOFManager::sendMotionEvent(), GHOST_DisplayManagerSDL::setCurrentDisplaySetting(), GHOST_NDOFManager::updateButton(), and GHOST_WindowWin32::~GHOST_WindowWin32().
|
protectedvirtual |
Initialize the system.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemX11, GHOST_SystemWin32, GHOST_SystemNULL, and GHOST_SystemCocoa.
Definition at line 303 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.
Implements GHOST_ISystem.
Definition at line 390 of file GHOST_System.cpp.
References m_is_debug_enabled.
|
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 66 of file GHOST_System.cpp.
References GHOST_TimerManager::addTimer(), GHOST_TimerManager::fireTimers(), getMilliSeconds(), GHOST_kSuccess, m_timerManager, and NULL.
Referenced by keyboard_key().
|
virtual |
Check whether debug messages are to be shown.
Implements GHOST_ISystem.
Definition at line 395 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 248 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_drop(), GHOST_WindowWayland::deactivate(), dnd_events(), GHOST_SystemCocoa::handleApplicationBecomeActiveEvent(), GHOST_SystemCocoa::handleDraggingEvent(), GHOST_SystemCocoa::handleKeyEvent(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemCocoa::handleOpenDocumentRequest(), GHOST_SystemCocoa::handleQuitRequest(), GHOST_SystemCocoa::handleWindowEvent(), keyboard_key(), GHOST_WindowWayland::notify_size(), pointer_axis(), pointer_button(), pointer_enter(), pointer_motion(), GHOST_SystemX11::processEvents(), GHOST_SystemWin32::processPointerEvent(), GHOST_SystemWin32::processWheelEvent(), GHOST_SystemWin32::pushDragDropEvent(), relative_pointer_relative_motion(), GHOST_SystemWin32::s_wndProc(), GHOST_NDOFManager::sendMotionEvent(), and GHOST_SystemCocoa::setCursorPosition().
|
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_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 236 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 86 of file GHOST_System.cpp.
References GHOST_kFailure, m_timerManager, and GHOST_TimerManager::removeTimer().
Referenced by display_destroy(), and keyboard_key().
|
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.
Definition at line 284 of file GHOST_System.cpp.
References m_tabletAPI.
|
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 329 of file GHOST_System.h.
References GHOST_kFailure.
|
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 162 of file GHOST_System.cpp.
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 379 of file GHOST_System.cpp.
References m_nativePixel.
|
virtual |
Focus window after opening, or put them in the background.
Implements GHOST_ISystem.
Definition at line 385 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 122 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 377 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 386 of file GHOST_System.h.
Referenced by addEventConsumer(), dispatchEvents(), disposeWindow(), exit(), getEventManager(), init(), GHOST_SystemWin32::processEvents(), pushEvent(), and removeEventConsumer().
|
protected |
Definition at line 404 of file GHOST_System.h.
Referenced by initDebug(), and isDebugEnabled().
| bool GHOST_System::m_nativePixel |
Definition at line 168 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 399 of file GHOST_System.h.
Referenced by beginFullScreen(), and endFullScreen().
|
protected |
Which tablet API to use.
Definition at line 402 of file GHOST_System.h.
Referenced by getTabletAPI(), and setTabletAPI().
|
protected |
The timer manager.
Definition at line 380 of file GHOST_System.h.
Referenced by dispatchEvents(), exit(), getTimerManager(), init(), installTimer(), and removeTimer().
| bool GHOST_System::m_windowFocus |
Definition at line 174 of file GHOST_System.h.
Referenced by GHOST_WindowWin32::GHOST_WindowWin32(), GHOST_WindowX11::GHOST_WindowX11(), and useWindowFocus().
|
protected |
The window manager.
Definition at line 383 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(), 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().