Medical Imaging Interaction Toolkit  2021.10.99-1c4db16f
Medical Imaging Interaction Toolkit
berryPlatform.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef BERRY_Platform_INCLUDED
14 #define BERRY_Platform_INCLUDED
15 
16 
17 //
18 // Platform Identification
19 //
20 #define BERRY_OS_FREE_BSD 0x0001
21 #define BERRY_OS_AIX 0x0002
22 #define BERRY_OS_HPUX 0x0003
23 #define BERRY_OS_TRU64 0x0004
24 #define BERRY_OS_LINUX 0x0005
25 #define BERRY_OS_MAC_OS_X 0x0006
26 #define BERRY_OS_NET_BSD 0x0007
27 #define BERRY_OS_OPEN_BSD 0x0008
28 #define BERRY_OS_IRIX 0x0009
29 #define BERRY_OS_SOLARIS 0x000a
30 #define BERRY_OS_QNX 0x000b
31 #define BERRY_OS_VXWORKS 0x000c
32 #define BERRY_OS_CYGWIN 0x000d
33 #define BERRY_OS_UNKNOWN_UNIX 0x00ff
34 #define BERRY_OS_WINDOWS_NT 0x1001
35 #define BERRY_OS_WINDOWS_CE 0x1011
36 #define BERRY_OS_VMS 0x2001
37 
38 
39 #if defined(__FreeBSD__)
40  #define BERRY_OS_FAMILY_UNIX 1
41  #define BERRY_OS_FAMILY_BSD 1
42  #define BERRY_OS BERRY_OS_FREE_BSD
43 #elif defined(_AIX) || defined(__TOS_AIX__)
44  #define BERRY_OS_FAMILY_UNIX 1
45  #define BERRY_OS BERRY_OS_AIX
46 #elif defined(hpux) || defined(_hpux)
47  #define BERRY_OS_FAMILY_UNIX 1
48  #define BERRY_OS BERRY_OS_HPUX
49 #elif defined(__digital__) || defined(__osf__)
50  #define BERRY_OS_FAMILY_UNIX 1
51  #define BERRY_OS BERRY_OS_TRU64
52 #elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__TOS_LINUX__)
53  #define BERRY_OS_FAMILY_UNIX 1
54  #define BERRY_OS BERRY_OS_LINUX
55 #elif defined(__APPLE__) || defined(__TOS_MACOS__)
56  #define BERRY_OS_FAMILY_UNIX 1
57  #define BERRY_OS_FAMILY_BSD 1
58  #define BERRY_OS BERRY_OS_MAC_OS_X
59 #elif defined(__NetBSD__)
60  #define BERRY_OS_FAMILY_UNIX 1
61  #define BERRY_OS_FAMILY_BSD 1
62  #define BERRY_OS BERRY_OS_NET_BSD
63 #elif defined(__OpenBSD__)
64  #define BERRY_OS_FAMILY_UNIX 1
65  #define BERRY_OS_FAMILY_BSD 1
66  #define BERRY_OS BERRY_OS_OPEN_BSD
67 #elif defined(sgi) || defined(__sgi)
68  #define BERRY_OS_FAMILY_UNIX 1
69  #define BERRY_OS BERRY_OS_IRIX
70 #elif defined(sun) || defined(__sun)
71  #define BERRY_OS_FAMILY_UNIX 1
72  #define BERRY_OS BERRY_OS_SOLARIS
73 #elif defined(__QNX__)
74  #define BERRY_OS_FAMILY_UNIX 1
75  #define BERRY_OS BERRY_OS_QNX
76 #elif defined(unix) || defined(__unix) || defined(__unix__)
77  #define BERRY_OS_FAMILY_UNIX 1
78  #define BERRY_OS BERRY_OS_UNKNOWN_UNIX
79 #elif defined(_WIN32_WCE)
80  #define BERRY_OS_FAMILY_WINDOWS 1
81  #define BERRY_OS BERRY_OS_WINDOWS_CE
82 #elif defined(_WIN32) || defined(_WIN64)
83  #define BERRY_OS_FAMILY_WINDOWS 1
84  #define BERRY_OS BERRY_OS_WINDOWS_NT
85 #elif defined(__CYGWIN__)
86  #define BERRY_OS_FAMILY_UNIX 1
87  #define BERRY_OS BERRY_OS_CYGWIN
88 #elif defined(__VMS)
89  #define BERRY_OS_FAMILY_VMS 1
90  #define BERRY_OS BERRY_OS_VMS
91 #endif
92 
93 
94 //
95 // Hardware Architecture and Byte Order
96 //
97 #define BERRY_ARCH_ALPHA 0x01
98 #define BERRY_ARCH_IA32 0x02
99 #define BERRY_ARCH_IA64 0x03
100 #define BERRY_ARCH_MIPS 0x04
101 #define BERRY_ARCH_HPPA 0x05
102 #define BERRY_ARCH_PPC 0x06
103 #define BERRY_ARCH_POWER 0x07
104 #define BERRY_ARCH_SPARC 0x08
105 #define BERRY_ARCH_AMD64 0x09
106 #define BERRY_ARCH_ARM 0x0a
107 
108 
109 #if defined(__ALPHA) || defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
110  #define BERRY_ARCH BERRY_ARCH_ALPHA
111  #define BERRY_ARCH_LITTLE_ENDIAN 1
112 #elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86)
113  #define BERRY_ARCH BERRY_ARCH_IA32
114  #define BERRY_ARCH_LITTLE_ENDIAN 1
115 #elif defined(_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
116  #define BERRY_ARCH BERRY_ARCH_IA64
117  #if defined(hpux) || defined(_hpux)
118  #define BERRY_ARCH_BIG_ENDIAN 1
119  #else
120  #define BERRY_ARCH_LITTLE_ENDIAN 1
121  #endif
122 #elif defined(__x86_64__)
123  #define BERRY_ARCH BERRY_ARCH_AMD64
124  #define BERRY_ARCH_LITTLE_ENDIAN 1
125 #elif defined(_M_X64)
126 #define BERRY_ARCH BERRY_ARCH_AMD64
127 #define BERRY_ARCH_LITTLE_ENDIAN 1
128 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(_M_MRX000)
129  #define BERRY_ARCH BERRY_ARCH_MIPS
130  #define BERRY_ARCH_BIG_ENDIAN 1
131 #elif defined(__hppa) || defined(__hppa__)
132  #define BERRY_ARCH BERRY_ARCH_HPPA
133  #define BERRY_ARCH_BIG_ENDIAN 1
134 #elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \
135  defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC) || defined(_M_PPC)
136  #define BERRY_ARCH BERRY_ARCH_PPC
137  #define BERRY_ARCH_BIG_ENDIAN 1
138 #elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \
139  defined(_ARCH_PWR4) || defined(__THW_RS6000)
140  #define BERRY_ARCH BERRY_ARCH_POWER
141  #define BERRY_ARCH_BIG_ENDIAN 1
142 #elif defined(__sparc__) || defined(__sparc) || defined(sparc)
143  #define BERRY_ARCH BERRY_ARCH_SPARC
144  #define BERRY_ARCH_BIG_ENDIAN 1
145 #elif defined(__arm__) || defined(__arm) || defined(ARM) || defined(_ARM_) || defined(__ARM__) || defined(_M_ARM)
146  #define BERRY_ARCH BERRY_ARCH_ARM
147  #if defined(__ARMEB__)
148  #define BERRY_ARCH_BIG_ENDIAN 1
149  #else
150  #define BERRY_ARCH_LITTLE_ENDIAN 1
151  #endif
152 #endif
153 
154 
156 
157 #include <berrySmartPointer.h>
158 
159 #include <QDir>
160 #include <QSharedPointer>
161 
162 struct ctkLocation;
163 class ctkPlugin;
164 
165 namespace Poco {
166 
167 class Path;
168 
169 }
170 
171 namespace berry {
172 
173 struct IAdapterManager;
174 struct IBundle;
175 struct IExtensionPointService;
176 struct IExtensionRegistry;
177 struct IPreferencesService;
178 struct IProduct;
179 
180 
199 {
200 public:
201 
202  static const QString PI_RUNTIME;
203 
204  static const int OS_FREE_BSD;
205  static const int OS_AIX;
206  static const int OS_HPUX;
207  static const int OS_TRU64;
208  static const int OS_LINUX;
209  static const int OS_MAC_OS_X;
210  static const int OS_NET_BSD;
211  static const int OS_OPEN_BSD;
212  static const int OS_IRIX;
213  static const int OS_SOLARIS;
214  static const int OS_QNX;
215  static const int OS_VXWORKS;
216  static const int OS_CYGWIN;
217  static const int OS_UNKNOWN_UNIX;
218  static const int OS_WINDOWS_NT;
219  static const int OS_WINDOWS_CE;
220  static const int OS_VMS;
221 
222  static const int ARCH_ALPHA;
223  static const int ARCH_IA32;
224  static const int ARCH_IA64;
225  static const int ARCH_MIPS;
226  static const int ARCH_HPPA;
227  static const int ARCH_PPC;
228  static const int ARCH_POWER;
229  static const int ARCH_SPARC;
230  static const int ARCH_AMD64;
231  static const int ARCH_ARM;
232 
233  static const QString PROP_QTPLUGIN_PATH;
234 
235  static const QString PROP_NEWINSTANCE;
236  static const QString PROP_PLUGIN_DIRS;
237  static const QString PROP_FORCE_PLUGIN_INSTALL;
238 
239  static const QString PROP_APPLICATION;
240  static const QString PROP_IGNOREAPP;
241 
242  static const QString PROP_XARGS;
243 
251  static IAdapterManager* GetAdapterManager();
252 
260  static IExtensionRegistry* GetExtensionRegistry();
261 
273  static IPreferencesService* GetPreferencesService();
274 
280  static SmartPointer<IProduct> GetProduct();
281 
294  static QVariant GetDebugOption(const QString& option);
295 
308  QT_DEPRECATED static QDir GetConfigurationPath();
309 
324  static ctkLocation* GetConfigurationLocation();
325 
332  QT_DEPRECATED static QDir GetInstallPath();
333 
344  static ctkLocation* GetInstallLocation();
345 
353  QT_DEPRECATED static QDir GetInstancePath();
354 
365  static ctkLocation* GetInstanceLocation();
366 
388  QT_DEPRECATED static bool GetStatePath(QDir& statePath, const QSharedPointer<ctkPlugin>& plugin, bool create = true);
389 
409  static QDir GetStateLocation(const QSharedPointer<ctkPlugin>& plugin);
410 
420  QT_DEPRECATED static QDir GetUserPath();
421 
434  static ctkLocation* GetUserLocation();
435 
436 
437  static int GetOS();
438  static int GetOSArch();
439  static bool IsUnix();
440  static bool IsWindows();
441  static bool IsBSD();
442  static bool IsLinux();
443  static bool IsVMS();
444 
445  static bool IsRunning();
446 
451  static QStringList GetApplicationArgs();
452 
465  static QSharedPointer<ctkPlugin> GetPlugin(const QString& symbolicName);
466 
484  static QList<QSharedPointer<ctkPlugin> > GetPlugins(const QString& symbolicName,
485  const QString& version = QString());
486 
487 
488 private:
489  Platform();
490 };
491 
492 } // namespace
493 
494 #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
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 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