Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryPlatform.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef BERRY_Platform_INCLUDED
18 #define BERRY_Platform_INCLUDED
19 
20 
21 //
22 // Platform Identification
23 //
24 #define BERRY_OS_FREE_BSD 0x0001
25 #define BERRY_OS_AIX 0x0002
26 #define BERRY_OS_HPUX 0x0003
27 #define BERRY_OS_TRU64 0x0004
28 #define BERRY_OS_LINUX 0x0005
29 #define BERRY_OS_MAC_OS_X 0x0006
30 #define BERRY_OS_NET_BSD 0x0007
31 #define BERRY_OS_OPEN_BSD 0x0008
32 #define BERRY_OS_IRIX 0x0009
33 #define BERRY_OS_SOLARIS 0x000a
34 #define BERRY_OS_QNX 0x000b
35 #define BERRY_OS_VXWORKS 0x000c
36 #define BERRY_OS_CYGWIN 0x000d
37 #define BERRY_OS_UNKNOWN_UNIX 0x00ff
38 #define BERRY_OS_WINDOWS_NT 0x1001
39 #define BERRY_OS_WINDOWS_CE 0x1011
40 #define BERRY_OS_VMS 0x2001
41 
42 
43 #if defined(__FreeBSD__)
44  #define BERRY_OS_FAMILY_UNIX 1
45  #define BERRY_OS_FAMILY_BSD 1
46  #define BERRY_OS BERRY_OS_FREE_BSD
47 #elif defined(_AIX) || defined(__TOS_AIX__)
48  #define BERRY_OS_FAMILY_UNIX 1
49  #define BERRY_OS BERRY_OS_AIX
50 #elif defined(hpux) || defined(_hpux)
51  #define BERRY_OS_FAMILY_UNIX 1
52  #define BERRY_OS BERRY_OS_HPUX
53 #elif defined(__digital__) || defined(__osf__)
54  #define BERRY_OS_FAMILY_UNIX 1
55  #define BERRY_OS BERRY_OS_TRU64
56 #elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__TOS_LINUX__)
57  #define BERRY_OS_FAMILY_UNIX 1
58  #define BERRY_OS BERRY_OS_LINUX
59 #elif defined(__APPLE__) || defined(__TOS_MACOS__)
60  #define BERRY_OS_FAMILY_UNIX 1
61  #define BERRY_OS_FAMILY_BSD 1
62  #define BERRY_OS BERRY_OS_MAC_OS_X
63 #elif defined(__NetBSD__)
64  #define BERRY_OS_FAMILY_UNIX 1
65  #define BERRY_OS_FAMILY_BSD 1
66  #define BERRY_OS BERRY_OS_NET_BSD
67 #elif defined(__OpenBSD__)
68  #define BERRY_OS_FAMILY_UNIX 1
69  #define BERRY_OS_FAMILY_BSD 1
70  #define BERRY_OS BERRY_OS_OPEN_BSD
71 #elif defined(sgi) || defined(__sgi)
72  #define BERRY_OS_FAMILY_UNIX 1
73  #define BERRY_OS BERRY_OS_IRIX
74 #elif defined(sun) || defined(__sun)
75  #define BERRY_OS_FAMILY_UNIX 1
76  #define BERRY_OS BERRY_OS_SOLARIS
77 #elif defined(__QNX__)
78  #define BERRY_OS_FAMILY_UNIX 1
79  #define BERRY_OS BERRY_OS_QNX
80 #elif defined(unix) || defined(__unix) || defined(__unix__)
81  #define BERRY_OS_FAMILY_UNIX 1
82  #define BERRY_OS BERRY_OS_UNKNOWN_UNIX
83 #elif defined(_WIN32_WCE)
84  #define BERRY_OS_FAMILY_WINDOWS 1
85  #define BERRY_OS BERRY_OS_WINDOWS_CE
86 #elif defined(_WIN32) || defined(_WIN64)
87  #define BERRY_OS_FAMILY_WINDOWS 1
88  #define BERRY_OS BERRY_OS_WINDOWS_NT
89 #elif defined(__CYGWIN__)
90  #define BERRY_OS_FAMILY_UNIX 1
91  #define BERRY_OS BERRY_OS_CYGWIN
92 #elif defined(__VMS)
93  #define BERRY_OS_FAMILY_VMS 1
94  #define BERRY_OS BERRY_OS_VMS
95 #endif
96 
97 
98 //
99 // Hardware Architecture and Byte Order
100 //
101 #define BERRY_ARCH_ALPHA 0x01
102 #define BERRY_ARCH_IA32 0x02
103 #define BERRY_ARCH_IA64 0x03
104 #define BERRY_ARCH_MIPS 0x04
105 #define BERRY_ARCH_HPPA 0x05
106 #define BERRY_ARCH_PPC 0x06
107 #define BERRY_ARCH_POWER 0x07
108 #define BERRY_ARCH_SPARC 0x08
109 #define BERRY_ARCH_AMD64 0x09
110 #define BERRY_ARCH_ARM 0x0a
111 
112 
113 #if defined(__ALPHA) || defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
114  #define BERRY_ARCH BERRY_ARCH_ALPHA
115  #define BERRY_ARCH_LITTLE_ENDIAN 1
116 #elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86)
117  #define BERRY_ARCH BERRY_ARCH_IA32
118  #define BERRY_ARCH_LITTLE_ENDIAN 1
119 #elif defined(_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
120  #define BERRY_ARCH BERRY_ARCH_IA64
121  #if defined(hpux) || defined(_hpux)
122  #define BERRY_ARCH_BIG_ENDIAN 1
123  #else
124  #define BERRY_ARCH_LITTLE_ENDIAN 1
125  #endif
126 #elif defined(__x86_64__)
127  #define BERRY_ARCH BERRY_ARCH_AMD64
128  #define BERRY_ARCH_LITTLE_ENDIAN 1
129 #elif defined(_M_X64)
130 #define BERRY_ARCH BERRY_ARCH_AMD64
131 #define BERRY_ARCH_LITTLE_ENDIAN 1
132 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(_M_MRX000)
133  #define BERRY_ARCH BERRY_ARCH_MIPS
134  #define BERRY_ARCH_BIG_ENDIAN 1
135 #elif defined(__hppa) || defined(__hppa__)
136  #define BERRY_ARCH BERRY_ARCH_HPPA
137  #define BERRY_ARCH_BIG_ENDIAN 1
138 #elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \
139  defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC) || defined(_M_PPC)
140  #define BERRY_ARCH BERRY_ARCH_PPC
141  #define BERRY_ARCH_BIG_ENDIAN 1
142 #elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \
143  defined(_ARCH_PWR4) || defined(__THW_RS6000)
144  #define BERRY_ARCH BERRY_ARCH_POWER
145  #define BERRY_ARCH_BIG_ENDIAN 1
146 #elif defined(__sparc__) || defined(__sparc) || defined(sparc)
147  #define BERRY_ARCH BERRY_ARCH_SPARC
148  #define BERRY_ARCH_BIG_ENDIAN 1
149 #elif defined(__arm__) || defined(__arm) || defined(ARM) || defined(_ARM_) || defined(__ARM__) || defined(_M_ARM)
150  #define BERRY_ARCH BERRY_ARCH_ARM
151  #if defined(__ARMEB__)
152  #define BERRY_ARCH_BIG_ENDIAN 1
153  #else
154  #define BERRY_ARCH_LITTLE_ENDIAN 1
155  #endif
156 #endif
157 
158 
160 
161 #include <berrySmartPointer.h>
162 
163 #include <QDir>
164 #include <QSharedPointer>
165 
166 struct ctkLocation;
167 class ctkPlugin;
168 
169 namespace Poco {
170 
171 class Path;
172 
173 }
174 
175 namespace berry {
176 
177 struct IAdapterManager;
178 struct IBundle;
179 struct IExtensionPointService;
180 struct IExtensionRegistry;
181 struct IPreferencesService;
182 struct IProduct;
183 
184 
203 {
204 public:
205 
206  static const QString PI_RUNTIME;
207 
208  static const int OS_FREE_BSD;
209  static const int OS_AIX;
210  static const int OS_HPUX;
211  static const int OS_TRU64;
212  static const int OS_LINUX;
213  static const int OS_MAC_OS_X;
214  static const int OS_NET_BSD;
215  static const int OS_OPEN_BSD;
216  static const int OS_IRIX;
217  static const int OS_SOLARIS;
218  static const int OS_QNX;
219  static const int OS_VXWORKS;
220  static const int OS_CYGWIN;
221  static const int OS_UNKNOWN_UNIX;
222  static const int OS_WINDOWS_NT;
223  static const int OS_WINDOWS_CE;
224  static const int OS_VMS;
225 
226  static const int ARCH_ALPHA;
227  static const int ARCH_IA32;
228  static const int ARCH_IA64;
229  static const int ARCH_MIPS;
230  static const int ARCH_HPPA;
231  static const int ARCH_PPC;
232  static const int ARCH_POWER;
233  static const int ARCH_SPARC;
234  static const int ARCH_AMD64;
235  static const int ARCH_ARM;
236 
237  static const QString PROP_QTPLUGIN_PATH;
238 
239  static const QString PROP_NEWINSTANCE;
240  static const QString PROP_PLUGIN_DIRS;
241  static const QString PROP_FORCE_PLUGIN_INSTALL;
242 
243  static const QString PROP_APPLICATION;
244  static const QString PROP_IGNOREAPP;
245 
246  static const QString PROP_TESTPLUGIN;
247  static const QString PROP_TESTAPPLICATION;
248 
249  static const QString PROP_XARGS;
250 
258  static IAdapterManager* GetAdapterManager();
259 
267  static IExtensionRegistry* GetExtensionRegistry();
268 
280  static IPreferencesService* GetPreferencesService();
281 
287  static SmartPointer<IProduct> GetProduct();
288 
301  static QVariant GetDebugOption(const QString& option);
302 
315  QT_DEPRECATED static QDir GetConfigurationPath();
316 
331  static ctkLocation* GetConfigurationLocation();
332 
339  QT_DEPRECATED static QDir GetInstallPath();
340 
351  static ctkLocation* GetInstallLocation();
352 
360  QT_DEPRECATED static QDir GetInstancePath();
361 
372  static ctkLocation* GetInstanceLocation();
373 
393  QT_DEPRECATED static bool GetStatePath(QDir& statePath, const QSharedPointer<ctkPlugin>& plugin, bool create = true);
394 
414  static QDir GetStateLocation(const QSharedPointer<ctkPlugin>& plugin);
415 
425  QT_DEPRECATED static QDir GetUserPath();
426 
439  static ctkLocation* GetUserLocation();
440 
441 
442  static int GetOS();
443  static int GetOSArch();
444  static bool IsUnix();
445  static bool IsWindows();
446  static bool IsBSD();
447  static bool IsLinux();
448  static bool IsVMS();
449 
450  static bool IsRunning();
451 
456  static QStringList GetApplicationArgs();
457 
470  static QSharedPointer<ctkPlugin> GetPlugin(const QString& symbolicName);
471 
489  static QList<QSharedPointer<ctkPlugin> > GetPlugins(const QString& symbolicName,
490  const QString& version = QString());
491 
492 
493 private:
494  Platform();
495 };
496 
497 } // namespace
498 
499 #endif // BERRY_Platform_INCLUDED
static const int OS_IRIX
static const int OS_UNKNOWN_UNIX
static const int ARCH_PPC
static const int OS_VMS
static const int OS_LINUX
static const int OS_FREE_BSD
static const QString PROP_NEWINSTANCE
static const int ARCH_MIPS
static const int OS_VXWORKS
static const QString PROP_TESTAPPLICATION
Implements transparent reference counting.
static const int OS_AIX
static const int OS_HPUX
#define org_blueberry_core_runtime_EXPORT
static const int OS_MAC_OS_X
static const QString PROP_TESTPLUGIN
static const int ARCH_SPARC
static const int OS_WINDOWS_CE
static const int OS_OPEN_BSD
static const int ARCH_ALPHA
static const QString PROP_APPLICATION
static const QString PI_RUNTIME
static const QString PROP_IGNOREAPP
static const int ARCH_HPPA
static const int OS_QNX
static const QString PROP_PLUGIN_DIRS
static const QString PROP_FORCE_PLUGIN_INSTALL
static const int ARCH_IA64
static const int OS_NET_BSD
static const QString PROP_XARGS
static const int OS_CYGWIN
static const QString PROP_QTPLUGIN_PATH
static const int ARCH_ARM
static const int ARCH_POWER
static const int OS_WINDOWS_NT
static const int ARCH_AMD64
static const int OS_TRU64
static const int OS_SOLARIS
static const int ARCH_IA32