Blender V2.61 - r43446
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes

GHOST_ISystem Interface Reference

#include <GHOST_ISystem.h>

Inheritance diagram for GHOST_ISystem:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual GHOST_TUns64 getMilliSeconds () const =0
virtual GHOST_ITimerTaskinstallTimer (GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=0)=0
virtual GHOST_TSuccess removeTimer (GHOST_ITimerTask *timerTask)=0
virtual GHOST_TUns8 getNumDisplays () const =0
virtual void getMainDisplayDimensions (GHOST_TUns32 &width, GHOST_TUns32 &height) const =0
virtual GHOST_IWindowcreateWindow (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)=0
virtual GHOST_TSuccess disposeWindow (GHOST_IWindow *window)=0
virtual bool validWindow (GHOST_IWindow *window)=0
virtual GHOST_TSuccess beginFullScreen (const GHOST_DisplaySetting &setting, GHOST_IWindow **window, const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0)=0
virtual GHOST_TSuccess endFullScreen (void)=0
virtual bool getFullScreen (void)=0
virtual bool processEvents (bool waitForEvent)=0
virtual bool dispatchEvents ()=0
virtual GHOST_TSuccess addEventConsumer (GHOST_IEventConsumer *consumer)=0
virtual GHOST_TSuccess removeEventConsumer (GHOST_IEventConsumer *consumer)=0
virtual GHOST_TSuccess getCursorPosition (GHOST_TInt32 &x, GHOST_TInt32 &y) const =0
virtual GHOST_TSuccess setCursorPosition (GHOST_TInt32 x, GHOST_TInt32 y)=0
virtual GHOST_TSuccess getModifierKeyState (GHOST_TModifierKeyMask mask, bool &isDown) const =0
virtual GHOST_TSuccess getButtonState (GHOST_TButtonMask mask, bool &isDown) const =0
virtual int toggleConsole (int action)=0
virtual GHOST_TUns8getClipboard (bool selection) const =0
virtual void putClipboard (GHOST_TInt8 *buffer, bool selection) const =0

Static Public Member Functions

static GHOST_TSuccess createSystem ()
static GHOST_TSuccess disposeSystem ()
static GHOST_ISystemgetSystem ()

Protected Member Functions

 GHOST_ISystem ()
virtual ~GHOST_ISystem ()
virtual GHOST_TSuccess init ()=0
virtual GHOST_TSuccess exit ()=0

Static Protected Attributes

static GHOST_ISystemm_system = 0

Detailed Description

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:

  1. Time(r) management.
  2. Display/window management (windows are only created on the main display).
  3. Event management.
  4. Cursor shape management (no custom cursors for now).
  5. Access to the state of the mouse buttons and the keyboard.
  6. Menus for windows with events generated when they are accessed (this is work in progress).
    Author:
    Maarten Gribnau
    Date:
    May 30, 2001

Definition at line 127 of file GHOST_ISystem.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

virtual GHOST_TSuccess GHOST_ISystem::addEventConsumer ( GHOST_IEventConsumer consumer) [pure virtual]

Adds the given event consumer to our list.

Parameters:
consumerThe event consumer to add.
Returns:
Indication of success.

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.

Parameters:
settingThe new setting of the display.
windowWindow displayed in full screen. This window is invalid after full screen has been ended.
Returns:
Indication of success.

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.

Returns:
An indication of success.

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.

Parameters:
titleThe name of the window (displayed in the title bar of the window if the OS supports it).
leftThe coordinate of the left edge of the window.
topThe coordinate of the top edge of the window.
widthThe width the window.
heightThe height the window.
stateThe state of the window when opened.
typeThe type of drawing context installed in this window.
stereoVisualCreate a stereo visual for quad buffered stereo.
numOfAASamplesNumber of samples used for AA (zero if no AA)
parentWindowParent (embedder) window
Returns:
The new window (or 0 if creation failed).

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.

Returns:
Indication of the presence of events.

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.

Returns:
An indication of success.

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.

Parameters:
windowPointer to the window to be disposed.
Returns:
Indication of success.

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.

Returns:
Indication of success.

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.

Returns:
Indication of success.

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).

Parameters:
maskThe button state to retrieve.
isDownButton state.
Returns:
Indication of success.

Implemented in GHOST_System.

Referenced by GHOST_GetButtonState().

virtual GHOST_TUns8* GHOST_ISystem::getClipboard ( bool  selection) const [pure virtual]

Returns the selection buffer

Returns:
Returns "unsinged char" from X11 XA_CUT_BUFFER0 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)

Parameters:
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns:
Indication of success.

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.

Returns:
The current 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.

Returns:
The dimension of the main display.

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.

Returns:
The number of milliseconds.

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).

Parameters:
maskThe modifier key state to retrieve.
isDownThe state of a modifier key (true == pressed).
Returns:
Indication of success.

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.

Returns:
The number of displays.

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]
virtual GHOST_TSuccess GHOST_ISystem::init ( ) [protected, pure virtual]

Initialize the system.

Returns:
Indication of success.

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.

Parameters:
delayThe time to wait for the first call to the timerProc (in milliseconds)
intervalThe interval between calls to the timerProc (in milliseconds)
timerProcThe callback invoked when the interval expires,
userDataPlaceholder for user data.
Returns:
A timer task (0 if timer task installation failed).

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.

Parameters:
waitForEventFlag to wait for an event (or return immediately).
Returns:
Indication of the presence of events.

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]
virtual GHOST_TSuccess GHOST_ISystem::removeEventConsumer ( GHOST_IEventConsumer consumer) [pure virtual]

Removes the given event consumer to our list.

Parameters:
consumerThe event consumer to remove.
Returns:
Indication of success.

Implemented in GHOST_System.

Referenced by GHOST_RemoveEventConsumer(), and main().

virtual GHOST_TSuccess GHOST_ISystem::removeTimer ( GHOST_ITimerTask timerTask) [pure virtual]

Removes a timer.

Parameters:
timerTaskTimer task to be removed.
Returns:
Indication of success.

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).

Parameters:
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns:
Indication of success.

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

  • Does nothing
    Returns:
    current status (1 -visible, 0 - hidden)

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.

Parameters:
windowPointer to the window to be checked.
Returns:
Indication of validity.

Implemented in GHOST_System.

Referenced by frameTimerProc(), gearsTimerProc(), GHOST_ValidWindow(), GPG_Application::processEvent(), Application::processEvent(), and Application::~Application().


Member Data Documentation

GHOST_ISystem * GHOST_ISystem::m_system = 0 [static, protected]

The one and only system

Copyright (C) 2001 NaN Technologies B.V.

Author:
Maarten Gribnau
Date:
May 7, 2001

Definition at line 386 of file GHOST_ISystem.h.

Referenced by createSystem(), disposeSystem(), and getSystem().


The documentation for this interface was generated from the following files: