Blender V2.61 - r43446
|
#include <GHOST_System.h>
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 62 of file GHOST_System.h.
GHOST_System::GHOST_System | ( | ) | [protected] |
Constructor. Protected default constructor to force use of static createSystem member.
Definition at line 47 of file GHOST_System.cpp.
GHOST_System::~GHOST_System | ( | ) | [protected, virtual] |
Destructor. Protected default constructor to force use of static dispose member.
Definition at line 59 of file GHOST_System.cpp.
References exit().
GHOST_TSuccess GHOST_System::addEventConsumer | ( | GHOST_IEventConsumer * | consumer | ) | [virtual] |
Adds the given event consumer to our list.
consumer | The event consumer to add. |
Implements GHOST_ISystem.
Definition at line 223 of file GHOST_System.cpp.
References GHOST_EventManager::addConsumer(), GHOST_kFailure, and m_eventManager.
GHOST_TSuccess GHOST_System::beginFullScreen | ( | const GHOST_DisplaySetting & | setting, |
GHOST_IWindow ** | window, | ||
const bool | stereoVisual, | ||
const GHOST_TUns16 | numOfAASamples = 0 |
||
) | [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 141 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().
GHOST_TSuccess GHOST_System::createFullScreenWindow | ( | GHOST_Window ** | window, |
const bool | stereoVisual, | ||
const GHOST_TUns16 | numOfAASamples = 0 |
||
) | [protected, virtual] |
Creates a fullscreen window.
window | The window created. |
Definition at line 336 of file GHOST_System.cpp.
References GHOST_ISystem::createWindow(), GHOST_DisplayManager::getCurrentDisplaySetting(), GHOST_ASSERT, GHOST_kDrawingContextTypeOpenGL, GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowStateFullScreen, GHOST_DisplayManager::kMainDisplay, m_displayManager, GHOST_DisplaySetting::xPixels, and GHOST_DisplaySetting::yPixels.
Referenced by beginFullScreen().
bool GHOST_System::dispatchEvents | ( | ) | [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 203 of file GHOST_System.cpp.
References GHOST_EventManager::dispatchEvents(), GHOST_TimerManager::fireTimers(), getMilliSeconds(), m_eventManager, and m_timerManager.
GHOST_TSuccess GHOST_System::disposeWindow | ( | GHOST_IWindow * | window | ) | [virtual] |
Inherited from GHOST_ISystem but left pure virtual
virtual GHOST_TUns8 getNumDisplays() const = 0; virtual void getMainDisplayDimensions(...) const = 0; virtual GHOST_IWindow* createWindow(..) Dispose a window.
window | Pointer to the window to be disposed. |
Implements GHOST_ISystem.
Definition at line 107 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().
GHOST_TSuccess GHOST_System::endFullScreen | ( | void | ) | [virtual] |
Ends full screen mode.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCarbon.
Definition at line 171 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().
GHOST_TSuccess GHOST_System::exit | ( | ) | [protected, virtual] |
Shut the system down.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCarbon, and GHOST_SystemWin32.
Definition at line 305 of file GHOST_System.cpp.
References endFullScreen(), getFullScreen(), GHOST_kSuccess, m_displayManager, m_eventManager, m_timerManager, and m_windowManager.
Referenced by ~GHOST_System().
virtual GHOST_TSuccess GHOST_System::getButtons | ( | GHOST_Buttons & | buttons | ) | const [pure virtual] |
Returns the state of the mouse buttons (ouside the message queue).
buttons | The state of the buttons. |
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by getButtonState().
GHOST_TSuccess GHOST_System::getButtonState | ( | GHOST_TButtonMask | mask, |
bool & | isDown | ||
) | const [virtual] |
Returns the state of a mouse button (ouside 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(), and getButtons().
virtual GHOST_TUns8* GHOST_System::getClipboard | ( | bool | selection | ) | const [pure virtual] |
Returns the selection buffer
selection | Only used on X11 |
Implements GHOST_ISystem.
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
GHOST_EventManager * GHOST_System::getEventManager | ( | ) | const [inline, virtual] |
Returns a pointer to our event manager.
Definition at line 344 of file GHOST_System.h.
References m_eventManager.
bool GHOST_System::getFullScreen | ( | void | ) | [virtual] |
Returns current full screen mode status.
Implements GHOST_ISystem.
Definition at line 190 of file GHOST_System.cpp.
References GHOST_WindowManager::getFullScreen(), and m_windowManager.
Referenced by exit(), and GHOST_SystemCarbon::processEvents().
GHOST_TUns64 GHOST_System::getMilliSeconds | ( | ) | const [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_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemWin32, and GHOST_SystemX11.
Definition at line 65 of file GHOST_System.cpp.
Referenced by dispatchEvents(), installTimer(), and GHOST_SystemWin32::processWindowEvent().
virtual GHOST_TSuccess GHOST_System::getModifierKeys | ( | GHOST_ModifierKeys & | keys | ) | const [pure virtual] |
Returns the state of all modifier keys.
keys | The state of all modifier keys (true == pressed). |
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by getModifierKeyState().
GHOST_TSuccess GHOST_System::getModifierKeyState | ( | GHOST_TModifierKeyMask | mask, |
bool & | isDown | ||
) | const [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 (ouside 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 259 of file GHOST_System.cpp.
References GHOST_ModifierKeys::get(), and getModifierKeys().
GHOST_TimerManager * GHOST_System::getTimerManager | ( | ) | const [inline, virtual] |
Returns the timer manager.
Definition at line 339 of file GHOST_System.h.
References m_timerManager.
Referenced by GHOST_SystemWin32::processEvents(), GHOST_SystemCarbon::processEvents(), GHOST_SystemX11::processEvents(), and GHOST_SystemSDL::processEvents().
GHOST_WindowManager * GHOST_System::getWindowManager | ( | ) | const [inline, virtual] |
Returns a pointer to our window manager.
Definition at line 349 of file GHOST_System.h.
References m_windowManager.
Referenced by GHOST_SystemWin32::processWindowEvent(), GHOST_NDOFManager::sendMotionEvent(), and GHOST_NDOFManager::updateButton().
GHOST_TSuccess GHOST_System::init | ( | ) | [protected, virtual] |
Initialize the system.
Implements GHOST_ISystem.
Reimplemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemWin32, and GHOST_SystemX11.
Definition at line 284 of file GHOST_System.cpp.
References GHOST_EventManager::addConsumer(), GHOST_kFailure, GHOST_kSuccess, m_eventManager, m_timerManager, and m_windowManager.
GHOST_ITimerTask * GHOST_System::installTimer | ( | GHOST_TUns64 | delay, |
GHOST_TUns64 | interval, | ||
GHOST_TimerProcPtr | timerProc, | ||
GHOST_TUserDataPtr | userData = 0 |
||
) | [virtual] |
Installs a timer. Note that, on most operating systems, messages need to be processed in order for the timer callbacks to be invoked.
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 76 of file GHOST_System.cpp.
References GHOST_TimerManager::addTimer(), GHOST_TimerManager::fireTimers(), getMilliSeconds(), GHOST_kSuccess, and m_timerManager.
GHOST_TSuccess GHOST_System::pushEvent | ( | GHOST_IEvent * | event | ) | [virtual] |
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 247 of file GHOST_System.cpp.
References GHOST_kFailure, m_eventManager, and GHOST_EventManager::pushEvent().
Referenced by GHOST_SystemCocoa::createWindow(), GHOST_SystemCarbon::createWindow(), GHOST_SystemX11::createWindow(), GHOST_SystemCocoa::handleApplicationBecomeActiveEvent(), GHOST_SystemCocoa::handleDraggingEvent(), GHOST_SystemCarbon::handleKeyEvent(), GHOST_SystemCocoa::handleKeyEvent(), GHOST_SystemCarbon::handleMouseDown(), GHOST_SystemCarbon::handleMouseEvent(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemCocoa::handleOpenDocumentRequest(), GHOST_SystemCocoa::handleQuitRequest(), GHOST_SystemCocoa::handleWindowEvent(), GHOST_SystemCarbon::handleWindowEvent(), GHOST_SystemCarbon::processEvents(), GHOST_SystemWin32::pushDragDropEvent(), GHOST_SystemWin32::s_wndProc(), GHOST_SystemCarbon::sAEHandlerQuit(), GHOST_NDOFManager::sendMotionEvent(), and GHOST_SystemCocoa::setCursorPosition().
virtual void GHOST_System::putClipboard | ( | GHOST_TInt8 * | buffer, |
bool | selection | ||
) | const [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_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
GHOST_TSuccess GHOST_System::removeEventConsumer | ( | GHOST_IEventConsumer * | consumer | ) | [virtual] |
Remove the given event consumer to our list.
consumer | The event consumer to remove. |
Implements GHOST_ISystem.
Definition at line 235 of file GHOST_System.cpp.
References GHOST_kFailure, m_eventManager, and GHOST_EventManager::removeConsumer().
GHOST_TSuccess GHOST_System::removeTimer | ( | GHOST_ITimerTask * | timerTask | ) | [virtual] |
Removes a timer.
timerTask | Timer task to be removed. |
Implements GHOST_ISystem.
Definition at line 97 of file GHOST_System.cpp.
References GHOST_kFailure, m_timerManager, and GHOST_TimerManager::removeTimer().
bool GHOST_System::validWindow | ( | GHOST_IWindow * | window | ) | [virtual] |
Returns whether a window is valid.
window | Pointer to the window to be checked. |
Implements GHOST_ISystem.
Definition at line 135 of file GHOST_System.cpp.
References GHOST_WindowManager::getWindowFound(), and m_windowManager.
Referenced by GHOST_SystemCocoa::handleDraggingEvent(), GHOST_SystemCarbon::handleMouseDown(), GHOST_SystemCocoa::handleWindowEvent(), and GHOST_SystemCarbon::handleWindowEvent().
GHOST_DisplayManager* GHOST_System::m_displayManager [protected] |
The display manager (platform dependant).
Definition at line 314 of file GHOST_System.h.
Referenced by beginFullScreen(), createFullScreenWindow(), endFullScreen(), exit(), GHOST_SystemWin32::getNumDisplays(), GHOST_SystemCarbon::GHOST_SystemCarbon(), GHOST_SystemCocoa::GHOST_SystemCocoa(), GHOST_SystemWin32::GHOST_SystemWin32(), GHOST_SystemNULL::init(), and GHOST_SystemX11::init().
GHOST_EventManager* GHOST_System::m_eventManager [protected] |
The event manager.
Definition at line 323 of file GHOST_System.h.
Referenced by addEventConsumer(), dispatchEvents(), disposeWindow(), exit(), getEventManager(), init(), pushEvent(), removeEventConsumer(), and GHOST_SystemCarbon::sEventHandlerProc().
Prints all the events. Settings of the display before the display went fullscreen.
Definition at line 336 of file GHOST_System.h.
Referenced by beginFullScreen(), and endFullScreen().
GHOST_TimerManager* GHOST_System::m_timerManager [protected] |
The timer manager.
Definition at line 317 of file GHOST_System.h.
Referenced by dispatchEvents(), exit(), getTimerManager(), init(), installTimer(), and removeTimer().
GHOST_WindowManager* GHOST_System::m_windowManager [protected] |
The window manager.
Definition at line 320 of file GHOST_System.h.
Referenced by beginFullScreen(), GHOST_SystemCocoa::createWindow(), GHOST_SystemWin32::createWindow(), GHOST_SystemCarbon::createWindow(), GHOST_SystemX11::createWindow(), disposeWindow(), endFullScreen(), exit(), GHOST_SystemX11::getClipboard(), GHOST_SystemX11::getClipboard_xcout(), getFullScreen(), getWindowManager(), GHOST_SystemCocoa::handleApplicationBecomeActiveEvent(), GHOST_SystemCarbon::handleKeyEvent(), GHOST_SystemCocoa::handleKeyEvent(), GHOST_SystemCarbon::handleMouseEvent(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemCocoa::handleOpenDocumentRequest(), GHOST_SystemCocoa::handleQuitRequest(), GHOST_SystemCocoa::handleTabletEvent(), GHOST_SystemCarbon::handleTabletEvent(), GHOST_SystemCocoa::handleWindowEvent(), GHOST_SystemCarbon::handleWindowEvent(), init(), GHOST_SystemCarbon::processEvents(), GHOST_SystemX11::putClipboard(), GHOST_SystemCocoa::setCursorPosition(), GHOST_SystemCocoa::setMouseCursorPosition(), GHOST_SystemCarbon::sEventHandlerProc(), and validWindow().