Blender  V2.59
Public Member Functions | Protected Member Functions | Protected Attributes
GHOST_System Class Reference

#include <GHOST_System.h>

Inheritance diagram for GHOST_System:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual GHOST_TUns64 getMilliSeconds () const
virtual GHOST_ITimerTaskinstallTimer (GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=0)
virtual GHOST_TSuccess removeTimer (GHOST_ITimerTask *timerTask)
virtual GHOST_TSuccess disposeWindow (GHOST_IWindow *window)
virtual bool validWindow (GHOST_IWindow *window)
virtual GHOST_TSuccess beginFullScreen (const GHOST_DisplaySetting &setting, GHOST_IWindow **window, const bool stereoVisual)
virtual GHOST_TSuccess endFullScreen (void)
virtual bool getFullScreen (void)
virtual bool dispatchEvents ()
virtual GHOST_TSuccess addEventConsumer (GHOST_IEventConsumer *consumer)
virtual GHOST_TSuccess removeEventConsumer (GHOST_IEventConsumer *consumer)
virtual GHOST_TSuccess getModifierKeyState (GHOST_TModifierKeyMask mask, bool &isDown) const
virtual GHOST_TSuccess getButtonState (GHOST_TButtonMask mask, bool &isDown) const
virtual GHOST_TSuccess pushEvent (GHOST_IEvent *event)
virtual GHOST_TimerManagergetTimerManager () const
virtual GHOST_EventManagergetEventManager () const
virtual GHOST_WindowManagergetWindowManager () const
virtual GHOST_TSuccess getModifierKeys (GHOST_ModifierKeys &keys) const =0
virtual GHOST_TSuccess getButtons (GHOST_Buttons &buttons) const =0
virtual GHOST_TUns8getClipboard (bool selection) const =0
virtual void putClipboard (GHOST_TInt8 *buffer, bool selection) const =0

Protected Member Functions

 GHOST_System ()
virtual ~GHOST_System ()
virtual GHOST_TSuccess init ()
virtual GHOST_TSuccess exit ()
virtual GHOST_TSuccess createFullScreenWindow (GHOST_Window **window, const bool stereoVisual)

Protected Attributes

GHOST_DisplayManagerm_displayManager
GHOST_TimerManagerm_timerManager
GHOST_WindowManagerm_windowManager
GHOST_EventManagerm_eventManager
GHOST_DisplaySetting m_preFullScreenSetting

Detailed Description

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.

See also:
GHOST_ISystem.
Author:
Maarten Gribnau
Date:
May 7, 2001

Definition at line 63 of file GHOST_System.h.


Constructor & Destructor Documentation

GHOST_System::GHOST_System ( ) [protected]

Constructor. Protected default constructor to force use of static createSystem member.

Definition at line 48 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 60 of file GHOST_System.cpp.

References exit().


Member Function Documentation

GHOST_TSuccess GHOST_System::addEventConsumer ( GHOST_IEventConsumer consumer) [virtual]

Adds the given event consumer to our list.

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

Implements GHOST_ISystem.

Definition at line 221 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 
) [virtual]

Begins full screen mode.

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

Implements GHOST_ISystem.

Reimplemented in GHOST_SystemCarbon.

Definition at line 139 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 
) [protected, virtual]
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.

Returns:
Indication as to whether any of the consumers handled the events.

Implements GHOST_ISystem.

Definition at line 201 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.

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

Implements GHOST_ISystem.

Definition at line 105 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]
GHOST_TSuccess GHOST_System::exit ( ) [protected, virtual]

Shut the system down.

Returns:
Indication of success.

Implements GHOST_ISystem.

Reimplemented in GHOST_SystemWin32, and GHOST_SystemCarbon.

Definition at line 303 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).

Parameters:
buttonsThe state of the buttons.
Returns:
Indication of success.

Implemented in GHOST_SystemCocoa, GHOST_SystemX11, GHOST_SystemCarbon, GHOST_SystemWin32, GHOST_SystemSDL, and GHOST_SystemNULL.

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

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

Implements GHOST_ISystem.

Definition at line 270 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

Parameters:
selectionOnly used on X11
Returns:
Returns the clipboard data

Implements GHOST_ISystem.

Implemented in GHOST_SystemX11, GHOST_SystemCocoa, GHOST_SystemCarbon, GHOST_SystemWin32, GHOST_SystemSDL, and GHOST_SystemNULL.

GHOST_EventManager * GHOST_System::getEventManager ( ) const [inline, virtual]

Returns a pointer to our event manager.

Returns:
A pointer to our event manager.

Definition at line 342 of file GHOST_System.h.

References m_eventManager.

bool GHOST_System::getFullScreen ( void  ) [virtual]

Returns current full screen mode status.

Returns:
The current status.

Implements GHOST_ISystem.

Definition at line 188 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.

Returns:
The number of milliseconds.

Implements GHOST_ISystem.

Reimplemented in GHOST_SystemWin32, GHOST_SystemX11, GHOST_SystemCarbon, GHOST_SystemCocoa, and GHOST_SystemNULL.

Definition at line 66 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.

Parameters:
keysThe state of all modifier keys (true == pressed).
Returns:
Indication of success.

Implemented in GHOST_SystemCocoa, GHOST_SystemX11, GHOST_SystemCarbon, GHOST_SystemWin32, GHOST_SystemSDL, and GHOST_SystemNULL.

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

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

Implements GHOST_ISystem.

Definition at line 257 of file GHOST_System.cpp.

References GHOST_ModifierKeys::get(), and getModifierKeys().

GHOST_TimerManager * GHOST_System::getTimerManager ( ) const [inline, virtual]

Returns the timer manager.

Returns:
The timer manager.

Definition at line 337 of file GHOST_System.h.

References m_timerManager.

Referenced by GHOST_SystemSDL::processEvents(), GHOST_SystemWin32::processEvents(), GHOST_SystemCarbon::processEvents(), and GHOST_SystemX11::processEvents().

GHOST_WindowManager * GHOST_System::getWindowManager ( ) const [inline, virtual]

Returns a pointer to our window manager.

Returns:
A pointer to our window manager.

Definition at line 347 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.

Returns:
Indication of success.

Implements GHOST_ISystem.

Reimplemented in GHOST_SystemCocoa, GHOST_SystemWin32, GHOST_SystemCarbon, GHOST_SystemX11, and GHOST_SystemNULL.

Definition at line 282 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.

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

Implements GHOST_ISystem.

Definition at line 77 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]
virtual void GHOST_System::putClipboard ( GHOST_TInt8 buffer,
bool  selection 
) const [pure virtual]

Put data to the Clipboard

Parameters:
bufferThe buffer to copy to the clipboard
selectionThe clipboard to copy too only used on X11

Implements GHOST_ISystem.

Implemented in GHOST_SystemX11, GHOST_SystemCocoa, GHOST_SystemCarbon, GHOST_SystemWin32, GHOST_SystemSDL, and GHOST_SystemNULL.

GHOST_TSuccess GHOST_System::removeEventConsumer ( GHOST_IEventConsumer consumer) [virtual]

Remove the given event consumer to our list.

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

Implements GHOST_ISystem.

Definition at line 233 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.

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

Implements GHOST_ISystem.

Definition at line 95 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.

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

Implements GHOST_ISystem.

Definition at line 133 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().


Member Data Documentation

Prints all the events. Settings of the display before the display went fullscreen.

Definition at line 334 of file GHOST_System.h.

Referenced by beginFullScreen(), and endFullScreen().

The timer manager.

Definition at line 315 of file GHOST_System.h.

Referenced by dispatchEvents(), exit(), getTimerManager(), init(), installTimer(), and removeTimer().


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