Blender  V2.59
GHOST_SystemNULL.h
Go to the documentation of this file.
00001 /*
00002  * $Id: GHOST_SystemNULL.h 37194 2011-06-05 00:10:20Z gsrb3d $
00003  * ***** BEGIN GPL LICENSE BLOCK *****
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software Foundation,
00017  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  *
00019  * Contributor(s): Campbell Barton
00020  *
00021  * ***** END GPL LICENSE BLOCK *****
00022  */
00023 
00029 #ifndef _GHOST_SYSTEM_NULL_H_
00030 #define _GHOST_SYSTEM_NULL_H_
00031 
00032 #include "GHOST_System.h"
00033 #include "../GHOST_Types.h"
00034 #include "GHOST_DisplayManagerNULL.h"
00035 #include "GHOST_WindowNULL.h"
00036 
00037 class GHOST_WindowNULL;
00038 
00039 class GHOST_SystemNULL : public GHOST_System {
00040 public:
00041 
00042         GHOST_SystemNULL( ) : GHOST_System() { /* nop */ }
00043         ~GHOST_SystemNULL() { /* nop */ }
00044         bool processEvents(bool waitForEvent) { return false; }
00045         int toggleConsole(int action) { return 0; }
00046         GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys& keys) const { return GHOST_kSuccess; }
00047         GHOST_TSuccess getButtons(GHOST_Buttons& buttons) const { return GHOST_kSuccess; }
00048         GHOST_TUns8 *getClipboard(bool selection) const { return NULL; }
00049         void putClipboard(GHOST_TInt8 *buffer, bool selection) const { /* nop */ }
00050         GHOST_TUns64 getMilliSeconds( ) const { return 0; }
00051         GHOST_TUns8 getNumDisplays( ) const { return GHOST_TUns8(1); }
00052         GHOST_TSuccess getCursorPosition( GHOST_TInt32& x, GHOST_TInt32& y ) const { return GHOST_kFailure; }
00053         GHOST_TSuccess setCursorPosition( GHOST_TInt32 x, GHOST_TInt32 y ) { return GHOST_kFailure; }
00054         void getMainDisplayDimensions( GHOST_TUns32& width, GHOST_TUns32& height ) const { /* nop */ }
00055 
00056         GHOST_TSuccess init() {
00057                 GHOST_TSuccess success = GHOST_System::init();
00058 
00059                 if (success) {
00060                         m_displayManager = new GHOST_DisplayManagerNULL(this);
00061 
00062                         if (m_displayManager) {
00063                                 return GHOST_kSuccess;
00064                         }
00065                 }
00066 
00067                 return GHOST_kFailure;
00068         }
00069 
00070         GHOST_IWindow* createWindow(
00071             const STR_String& title,
00072             GHOST_TInt32 left,
00073             GHOST_TInt32 top,
00074             GHOST_TUns32 width,
00075             GHOST_TUns32 height,
00076             GHOST_TWindowState state,
00077             GHOST_TDrawingContextType type,
00078             bool stereoVisual,
00079             const GHOST_TUns16 numOfAASamples,
00080             const GHOST_TEmbedderWindowID parentWindow
00081             ) {
00082                 return new GHOST_WindowNULL (this, title, left, top, width, height, state, parentWindow, type, stereoVisual, 1);
00083         }
00084 };
00085 
00086 #endif
00087 
00088 
00089 
00090 
00091 
00092 
00093