Cleanup: remove redundant doxygen \file argument
[blender.git] / intern / ghost / intern / GHOST_ISystem.cpp
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19
20 /** \file \ingroup GHOST
21  */
22
23
24 /**
25  * Copyright (C) 2001 NaN Technologies B.V.
26  */
27
28 #include "GHOST_ISystem.h"
29
30 #ifdef WITH_X11
31 #  include "GHOST_SystemX11.h"
32 #else
33 #  ifdef WITH_HEADLESS
34 #    include "GHOST_SystemNULL.h"
35 #  elif defined(WITH_GHOST_SDL)
36 #    include "GHOST_SystemSDL.h"
37 #  elif defined(WIN32)
38 #    include "GHOST_SystemWin32.h"
39 #  else
40 #    ifdef __APPLE__
41 #      include "GHOST_SystemCocoa.h"
42 #    endif
43 #  endif
44 #endif
45
46 GHOST_ISystem *GHOST_ISystem::m_system = NULL;
47
48
49 GHOST_TSuccess GHOST_ISystem::createSystem()
50 {
51         GHOST_TSuccess success;
52         if (!m_system) {
53 #ifdef WITH_X11
54                 m_system = new GHOST_SystemX11();
55 #else
56 #  ifdef WITH_HEADLESS
57                 m_system = new GHOST_SystemNULL();
58 #  elif defined(WITH_GHOST_SDL)
59                 m_system = new GHOST_SystemSDL();
60 #  elif defined(WIN32)
61                 m_system = new GHOST_SystemWin32();
62 #  else
63 #    ifdef __APPLE__
64                 m_system = new GHOST_SystemCocoa();
65 #    endif
66 #  endif
67 #endif
68                 success = m_system != NULL ? GHOST_kSuccess : GHOST_kFailure;
69         }
70         else {
71                 success = GHOST_kFailure;
72         }
73         if (success) {
74                 success = m_system->init();
75         }
76         return success;
77 }
78
79 GHOST_TSuccess GHOST_ISystem::disposeSystem()
80 {
81         GHOST_TSuccess success = GHOST_kSuccess;
82         if (m_system) {
83                 delete m_system;
84                 m_system = NULL;
85         }
86         else {
87                 success = GHOST_kFailure;
88         }
89         return success;
90 }
91
92
93 GHOST_ISystem *GHOST_ISystem::getSystem()
94 {
95         return m_system;
96 }