Blender V2.61 - r43446
|
#include <GHOST_ISystem.h>
Interface for classes that provide access to the operating system. There should be only one system class in an application. Therefore, the routines to create and dispose the system are static. Provides:
Definition at line 127 of file GHOST_ISystem.h.
GHOST_ISystem::GHOST_ISystem | ( | ) | [inline, protected] |
Constructor. Protected default constructor to force use of static createSystem member.
Definition at line 153 of file GHOST_ISystem.h.
virtual GHOST_ISystem::~GHOST_ISystem | ( | ) | [inline, protected, virtual] |
Destructor. Protected default constructor to force use of static dispose member.
Definition at line 159 of file GHOST_ISystem.h.
virtual GHOST_TSuccess GHOST_ISystem::addEventConsumer | ( | GHOST_IEventConsumer * | consumer | ) | [pure virtual] |
Adds the given event consumer to our list.
consumer | The event consumer to add. |
Implemented in GHOST_System.
Referenced by GHOST_AddEventConsumer(), BSP_GhostTestApp3D::InitApp(), LOD_GhostTestApp::InitApp(), and main().
virtual GHOST_TSuccess GHOST_ISystem::beginFullScreen | ( | const GHOST_DisplaySetting & | setting, |
GHOST_IWindow ** | window, | ||
const bool | stereoVisual, | ||
const GHOST_TUns16 | numOfAASamples = 0 |
||
) | [pure virtual] |
Begins full screen mode.
setting | The new setting of the display. |
window | Window displayed in full screen. This window is invalid after full screen has been ended. |
Implemented in GHOST_System.
Referenced by GHOST_BeginFullScreen(), Application::processEvent(), and GPG_Application::startFullScreen().
GHOST_TSuccess GHOST_ISystem::createSystem | ( | ) | [static] |
Creates the one and only system.
Definition at line 64 of file GHOST_ISystem.cpp.
References GHOST_kFailure, GHOST_kSuccess, init(), and m_system.
Referenced by GHOST_CreateSystem(), BSP_GhostTestApp3D::InitApp(), LOD_GhostTestApp::InitApp(), and main().
virtual GHOST_IWindow* GHOST_ISystem::createWindow | ( | const STR_String & | title, |
GHOST_TInt32 | left, | ||
GHOST_TInt32 | top, | ||
GHOST_TUns32 | width, | ||
GHOST_TUns32 | height, | ||
GHOST_TWindowState | state, | ||
GHOST_TDrawingContextType | type, | ||
const bool | stereoVisual = false , |
||
const GHOST_TUns16 | numOfAASamples = 0 , |
||
const GHOST_TEmbedderWindowID | parentWindow = 0 |
||
) | [pure virtual] |
Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.
title | The name of the window (displayed in the title bar of the window if the OS supports it). |
left | The coordinate of the left edge of the window. |
top | The coordinate of the top edge of the window. |
width | The width the window. |
height | The height the window. |
state | The state of the window when opened. |
type | The type of drawing context installed in this window. |
stereoVisual | Create a stereo visual for quad buffered stereo. |
numOfAASamples | Number of samples used for AA (zero if no AA) |
parentWindow | Parent (embedder) window |
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by Application::Application(), GHOST_System::createFullScreenWindow(), GHOST_CreateWindow(), BSP_GhostTestApp3D::InitApp(), LOD_GhostTestApp::InitApp(), GPG_Application::startEmbeddedWindow(), and GPG_Application::startWindow().
virtual bool GHOST_ISystem::dispatchEvents | ( | ) | [pure virtual] |
Retrieves events from the queue and send them to the event consumers.
Implemented in GHOST_System.
Referenced by GHOST_DispatchEvents(), main(), BSP_GhostTestApp3D::Run(), and LOD_GhostTestApp::Run().
GHOST_TSuccess GHOST_ISystem::disposeSystem | ( | ) | [static] |
Disposes the one and only system.
Definition at line 96 of file GHOST_ISystem.cpp.
References GHOST_kFailure, GHOST_kSuccess, and m_system.
Referenced by GHOST_DisposeSystem(), BSP_GhostTestApp3D::InitApp(), LOD_GhostTestApp::InitApp(), main(), BSP_GhostTestApp3D::~BSP_GhostTestApp3D(), and LOD_GhostTestApp::~LOD_GhostTestApp().
virtual GHOST_TSuccess GHOST_ISystem::disposeWindow | ( | GHOST_IWindow * | window | ) | [pure virtual] |
Dispose a window.
window | Pointer to the window to be disposed. |
Implemented in GHOST_System.
Referenced by GHOST_DisposeWindow(), Application::processEvent(), Application::~Application(), BSP_GhostTestApp3D::~BSP_GhostTestApp3D(), GPG_Application::~GPG_Application(), and LOD_GhostTestApp::~LOD_GhostTestApp().
virtual GHOST_TSuccess GHOST_ISystem::endFullScreen | ( | void | ) | [pure virtual] |
Ends full screen mode.
Implemented in GHOST_System, and GHOST_SystemCarbon.
Referenced by GHOST_EndFullScreen(), and Application::processEvent().
virtual GHOST_TSuccess GHOST_ISystem::exit | ( | ) | [protected, pure virtual] |
Shut the system down.
Implemented in GHOST_System, GHOST_SystemCarbon, and GHOST_SystemWin32.
virtual GHOST_TSuccess GHOST_ISystem::getButtonState | ( | GHOST_TButtonMask | mask, |
bool & | isDown | ||
) | const [pure virtual] |
Returns the state of a mouse button (ouside the message queue).
mask | The button state to retrieve. |
isDown | Button state. |
Implemented in GHOST_System.
Referenced by GHOST_GetButtonState().
virtual GHOST_TUns8* GHOST_ISystem::getClipboard | ( | bool | selection | ) | const [pure virtual] |
Returns the selection buffer
Implemented in GHOST_System, GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_getClipboard().
virtual GHOST_TSuccess GHOST_ISystem::getCursorPosition | ( | GHOST_TInt32 & | x, |
GHOST_TInt32 & | y | ||
) | const [pure virtual] |
Returns the current location of the cursor (location in screen coordinates)
x | The x-coordinate of the cursor. |
y | The y-coordinate of the cursor. |
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_GetCursorPosition().
virtual bool GHOST_ISystem::getFullScreen | ( | void | ) | [pure virtual] |
Returns current full screen mode status.
Implemented in GHOST_System.
Referenced by GHOST_GetFullScreen(), and Application::processEvent().
virtual void GHOST_ISystem::getMainDisplayDimensions | ( | GHOST_TUns32 & | width, |
GHOST_TUns32 & | height | ||
) | const [pure virtual] |
Returns the dimensions of the main display on this system.
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_GetMainDisplayDimensions(), main(), and GPG_Application::startFullScreen().
virtual GHOST_TUns64 GHOST_ISystem::getMilliSeconds | ( | ) | const [pure virtual] |
Returns the system time. Returns the number of milliseconds since the start of the system process. Based on ANSI clock() routine.
Implemented in GHOST_System, GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GPG_System::GetTimeInSeconds(), and GHOST_GetMilliSeconds().
virtual GHOST_TSuccess GHOST_ISystem::getModifierKeyState | ( | GHOST_TModifierKeyMask | mask, |
bool & | isDown | ||
) | const [pure virtual] |
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). |
Implemented in GHOST_System.
Referenced by GHOST_GetModifierKeyState(), and Application::processEvent().
virtual GHOST_TUns8 GHOST_ISystem::getNumDisplays | ( | ) | const [pure virtual] |
Returns the number of displays on this system.
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_GetNumDisplays().
GHOST_ISystem * GHOST_ISystem::getSystem | ( | ) | [static] |
Returns a pointer to the one and only system (nil if it hasn't been created).
Definition at line 110 of file GHOST_ISystem.cpp.
References m_system.
Referenced by GHOST_SystemWin32::convertKey(), GHOST_CreateSystem(), GHOST_getClipboard(), GHOST_putClipboard(), GHOST_toggleConsole(), GHOST_SystemWin32::hardKey(), BSP_GhostTestApp3D::InitApp(), LOD_GhostTestApp::InitApp(), GHOST_WindowWin32::installDrawingContext(), main(), GHOST_SystemWin32::processButtonEvent(), GHOST_SystemWin32::processCursorEvent(), GHOST_SystemWin32::processKeyEvent(), GHOST_SystemWin32::processWheelEvent(), GHOST_SystemWin32::processWindowEvent(), GHOST_SystemWin32::pushDragDropEvent(), GHOST_SystemWin32::s_wndProc(), and GPG_Canvas::SetMousePosition().
virtual GHOST_TSuccess GHOST_ISystem::init | ( | ) | [protected, pure virtual] |
Initialize the system.
Implemented in GHOST_System, GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by createSystem().
virtual GHOST_ITimerTask* GHOST_ISystem::installTimer | ( | GHOST_TUns64 | delay, |
GHOST_TUns64 | interval, | ||
GHOST_TimerProcPtr | timerProc, | ||
GHOST_TUserDataPtr | userData = 0 |
||
) | [pure 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 (in milliseconds) |
timerProc | The callback invoked when the interval expires, |
userData | Placeholder for user data. |
Implemented in GHOST_System.
Referenced by Application::Application(), GHOST_InstallTimer(), Application::processEvent(), and GPG_Application::startEngine().
virtual bool GHOST_ISystem::processEvents | ( | bool | waitForEvent | ) | [pure virtual] |
Retrieves events from the system and stores them in the queue.
waitForEvent | Flag to wait for an event (or return immediately). |
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_ProcessEvents(), main(), BSP_GhostTestApp3D::Run(), and LOD_GhostTestApp::Run().
virtual void GHOST_ISystem::putClipboard | ( | GHOST_TInt8 * | buffer, |
bool | selection | ||
) | const [pure virtual] |
Put data to the Clipboard
Implemented in GHOST_System, GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_putClipboard().
virtual GHOST_TSuccess GHOST_ISystem::removeEventConsumer | ( | GHOST_IEventConsumer * | consumer | ) | [pure virtual] |
Removes the given event consumer to our list.
consumer | The event consumer to remove. |
Implemented in GHOST_System.
Referenced by GHOST_RemoveEventConsumer(), and main().
virtual GHOST_TSuccess GHOST_ISystem::removeTimer | ( | GHOST_ITimerTask * | timerTask | ) | [pure virtual] |
Removes a timer.
timerTask | Timer task to be removed. |
Implemented in GHOST_System.
Referenced by GHOST_RemoveTimer(), Application::processEvent(), and GPG_Application::stopEngine().
virtual GHOST_TSuccess GHOST_ISystem::setCursorPosition | ( | GHOST_TInt32 | x, |
GHOST_TInt32 | y | ||
) | [pure virtual] |
Updates the location of the cursor (location in screen coordinates). Not all operating systems allow the cursor to be moved (without the input device being moved).
x | The x-coordinate of the cursor. |
y | The y-coordinate of the cursor. |
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_SetCursorPosition(), Application::processEvent(), and GPG_Canvas::SetMousePosition().
virtual int GHOST_ISystem::toggleConsole | ( | int | action | ) | [pure virtual] |
Toggles console 0 - Hides 1 - Shows 2 - Toggles 3 - Hides if it runs not from command line
Implemented in GHOST_SystemCarbon, GHOST_SystemCocoa, GHOST_SystemNULL, GHOST_SystemSDL, GHOST_SystemWin32, and GHOST_SystemX11.
Referenced by GHOST_toggleConsole().
virtual bool GHOST_ISystem::validWindow | ( | GHOST_IWindow * | window | ) | [pure virtual] |
Returns whether a window is valid.
window | Pointer to the window to be checked. |
Implemented in GHOST_System.
Referenced by frameTimerProc(), gearsTimerProc(), GHOST_ValidWindow(), GPG_Application::processEvent(), Application::processEvent(), and Application::~Application().
GHOST_ISystem * GHOST_ISystem::m_system = 0 [static, protected] |
The one and only system
Copyright (C) 2001 NaN Technologies B.V.
Definition at line 386 of file GHOST_ISystem.h.
Referenced by createSystem(), disposeSystem(), and getSystem().