CMake option 'WITH_HEADLESS' to build blender in headless mode (no x11/xlib) with...
[blender.git] / intern / ghost / intern / GHOST_SystemNULL.h
1 /*
2  * $Id:
3  * ***** BEGIN GPL LICENSE BLOCK *****
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * Contributor(s): Campbell Barton
20  *
21  * ***** END GPL LICENSE BLOCK *****
22  */
23
24 /** \file ghost/intern/GHOST_SystemNULL.h
25  *  \ingroup GHOST
26  * Declaration of GHOST_SystemNULL class.
27  */
28
29 #ifndef _GHOST_SYSTEM_NULL_H_
30 #define _GHOST_SYSTEM_NULL_H_
31
32 #include "GHOST_System.h"
33 #include "../GHOST_Types.h"
34 #include "GHOST_DisplayManagerNULL.h"
35 #include "GHOST_WindowNULL.h"
36
37 class GHOST_WindowNULL;
38
39 class GHOST_SystemNULL : public GHOST_System {
40 public:
41
42         GHOST_SystemNULL( ) : GHOST_System() { /* nop */ }
43         ~GHOST_SystemNULL() { /* nop */ }
44         bool processEvents(bool waitForEvent) { return false; }
45         int toggleConsole(int action) { return 0; }
46         GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys& keys) const { return GHOST_kSuccess; }
47         GHOST_TSuccess getButtons(GHOST_Buttons& buttons) const { return GHOST_kSuccess; }
48         GHOST_TUns8 *getClipboard(bool selection) const { return NULL; }
49         void putClipboard(GHOST_TInt8 *buffer, bool selection) const { /* nop */ }
50         GHOST_TUns64 getMilliSeconds( ) const { return 0; }
51         GHOST_TUns8 getNumDisplays( ) const { return GHOST_TUns8(1); }
52         GHOST_TSuccess getCursorPosition( GHOST_TInt32& x, GHOST_TInt32& y ) const { return GHOST_kFailure; }
53         GHOST_TSuccess setCursorPosition( GHOST_TInt32 x, GHOST_TInt32 y ) { return GHOST_kFailure; }
54         void getMainDisplayDimensions( GHOST_TUns32& width, GHOST_TUns32& height ) const { /* nop */ }
55
56         GHOST_TSuccess init() {
57                 GHOST_TSuccess success = GHOST_System::init();
58
59                 if (success) {
60                         m_displayManager = new GHOST_DisplayManagerNULL(this);
61
62                         if (m_displayManager) {
63                                 return GHOST_kSuccess;
64                         }
65                 }
66
67                 return GHOST_kFailure;
68         }
69
70         GHOST_IWindow* createWindow(
71             const STR_String& title,
72             GHOST_TInt32 left,
73             GHOST_TInt32 top,
74             GHOST_TUns32 width,
75             GHOST_TUns32 height,
76             GHOST_TWindowState state,
77             GHOST_TDrawingContextType type,
78             bool stereoVisual,
79             const GHOST_TUns16 numOfAASamples,
80             const GHOST_TEmbedderWindowID parentWindow
81             ) {
82                 return new GHOST_WindowNULL (this, title, left, top, width, height, state, parentWindow, type, stereoVisual, 1);
83         }
84 };
85
86 #endif
87
88
89
90
91
92
93