Medical Imaging Interaction Toolkit  2025.08.99-f7084adb
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 #define BERRY_ARCH_ARM64 0x0b
108 
109 
110 #if defined(__ALPHA) || defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
111  #define BERRY_ARCH BERRY_ARCH_ALPHA
112  #define BERRY_ARCH_LITTLE_ENDIAN 1
113 #elif defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86)
114  #define BERRY_ARCH BERRY_ARCH_IA32
115  #define BERRY_ARCH_LITTLE_ENDIAN 1
116 #elif defined(_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
117  #define BERRY_ARCH BERRY_ARCH_IA64
118  #if defined(hpux) || defined(_hpux)
119  #define BERRY_ARCH_BIG_ENDIAN 1
120  #else
121  #define BERRY_ARCH_LITTLE_ENDIAN 1
122  #endif
123 #elif defined(__x86_64__)
124  #define BERRY_ARCH BERRY_ARCH_AMD64
125  #define BERRY_ARCH_LITTLE_ENDIAN 1
126 #elif defined(_M_X64)
127 #define BERRY_ARCH BERRY_ARCH_AMD64
128 #define BERRY_ARCH_LITTLE_ENDIAN 1
129 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(_M_MRX000)
130  #define BERRY_ARCH BERRY_ARCH_MIPS
131  #define BERRY_ARCH_BIG_ENDIAN 1
132 #elif defined(__hppa) || defined(__hppa__)
133  #define BERRY_ARCH BERRY_ARCH_HPPA
134  #define BERRY_ARCH_BIG_ENDIAN 1
135 #elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \
136  defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC) || defined(_M_PPC)
137  #define BERRY_ARCH BERRY_ARCH_PPC
138  #define BERRY_ARCH_BIG_ENDIAN 1
139 #elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \
140  defined(_ARCH_PWR4) || defined(__THW_RS6000)
141  #define BERRY_ARCH BERRY_ARCH_POWER
142  #define BERRY_ARCH_BIG_ENDIAN 1
143 #elif defined(__sparc__) || defined(__sparc) || defined(sparc)
144  #define BERRY_ARCH BERRY_ARCH_SPARC
145  #define BERRY_ARCH_BIG_ENDIAN 1
146 #elif defined(__arm__) || defined(__arm) || defined(ARM) || defined(_ARM_) || defined(__ARM__) || defined(_M_ARM)
147  #define BERRY_ARCH BERRY_ARCH_ARM
148  #if defined(__ARMEB__)
149  #define BERRY_ARCH_BIG_ENDIAN 1
150  #else
151  #define BERRY_ARCH_LITTLE_ENDIAN 1
152  #endif
153 #elif defined(__aarch64__)
154  #define BERRY_ARCH BERRY_ARCH_ARM64
155  #define BERRY_ARCH_LITTLE_ENDIAN 1
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 mitk
176 {
177  class IPreferencesService;
178 }
179 
180 namespace berry {
181 
182 struct IAdapterManager;
183 struct IBundle;
184 struct IExtensionPointService;
185 struct IExtensionRegistry;
186 struct IProduct;
187 
188 
207 {
208 public:
209 
210  static const QString PI_RUNTIME;
211 
212  static const int OS_FREE_BSD;
213  static const int OS_AIX;
214  static const int OS_HPUX;
215  static const int OS_TRU64;
216  static const int OS_LINUX;
217  static const int OS_MAC_OS_X;
218  static const int OS_NET_BSD;
219  static const int OS_OPEN_BSD;
220  static const int OS_IRIX;
221  static const int OS_SOLARIS;
222  static const int OS_QNX;
223  static const int OS_VXWORKS;
224  static const int OS_CYGWIN;
225  static const int OS_UNKNOWN_UNIX;
226  static const int OS_WINDOWS_NT;
227  static const int OS_WINDOWS_CE;
228  static const int OS_VMS;
229 
230  static const int ARCH_ALPHA;
231  static const int ARCH_IA32;
232  static const int ARCH_IA64;
233  static const int ARCH_MIPS;
234  static const int ARCH_HPPA;
235  static const int ARCH_PPC;
236  static const int ARCH_POWER;
237  static const int ARCH_SPARC;
238  static const int ARCH_AMD64;
239  static const int ARCH_ARM;
240  static const int ARCH_ARM64;
241 
242  static const QString PROP_QTPLUGIN_PATH;
243 
244  static const QString PROP_NEWINSTANCE;
245  static const QString PROP_PLUGIN_DIRS;
246  static const QString PROP_FORCE_PLUGIN_INSTALL;
247 
248  static const QString PROP_APPLICATION;
249  static const QString PROP_IGNOREAPP;
250 
251  static const QString PROP_XARGS;
252 
260  static IAdapterManager* GetAdapterManager();
261 
269  static IExtensionRegistry* GetExtensionRegistry();
270 
278  static mitk::IPreferencesService* GetPreferencesService();
279 
285  static SmartPointer<IProduct> GetProduct();
286 
299  static QVariant GetDebugOption(const QString& option);
300 
313  QT_DEPRECATED static QDir GetConfigurationPath();
314 
329  static ctkLocation* GetConfigurationLocation();
330 
337  QT_DEPRECATED static QDir GetInstallPath();
338 
349  static ctkLocation* GetInstallLocation();
350 
358  QT_DEPRECATED static QDir GetInstancePath();
359 
370  static ctkLocation* GetInstanceLocation();
371 
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
berry::Platform::ARCH_ARM64
static const int ARCH_ARM64
Definition: berryPlatform.h:240
org_blueberry_core_runtime_Export.h
berry::Platform::ARCH_IA32
static const int ARCH_IA32
Definition: berryPlatform.h:231
berry::Platform::ARCH_AMD64
static const int ARCH_AMD64
Definition: berryPlatform.h:238
berry::Platform::ARCH_PPC
static const int ARCH_PPC
Definition: berryPlatform.h:235
berry::Platform::OS_IRIX
static const int OS_IRIX
Definition: berryPlatform.h:220
berry::Platform::OS_FREE_BSD
static const int OS_FREE_BSD
Definition: berryPlatform.h:212
berry::Platform::PROP_NEWINSTANCE
static const QString PROP_NEWINSTANCE
Definition: berryPlatform.h:244
berry::Platform::OS_VMS
static const int OS_VMS
Definition: berryPlatform.h:228
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berry::Platform::OS_VXWORKS
static const int OS_VXWORKS
Definition: berryPlatform.h:223
berry::Platform::OS_MAC_OS_X
static const int OS_MAC_OS_X
Definition: berryPlatform.h:217
berry::Platform::OS_UNKNOWN_UNIX
static const int OS_UNKNOWN_UNIX
Definition: berryPlatform.h:225
berry::Platform::OS_AIX
static const int OS_AIX
Definition: berryPlatform.h:213
berry::Platform::ARCH_MIPS
static const int ARCH_MIPS
Definition: berryPlatform.h:233
berry::Platform::OS_LINUX
static const int OS_LINUX
Definition: berryPlatform.h:216
berry::IExtensionRegistry
Definition: berryIExtensionRegistry.h:72
Poco
Definition: berryElementHandler.h:20
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
berry::Platform::ARCH_SPARC
static const int ARCH_SPARC
Definition: berryPlatform.h:237
berry::IAdapterManager
Definition: berryIAdapterManager.h:80
org_blueberry_core_runtime_EXPORT
#define org_blueberry_core_runtime_EXPORT
Definition: org_blueberry_core_runtime_Export.h:26
berry::Platform::PI_RUNTIME
static const QString PI_RUNTIME
Definition: berryPlatform.h:210
berry::Platform::OS_HPUX
static const int OS_HPUX
Definition: berryPlatform.h:214
berry::Platform
Definition: berryPlatform.h:206
QSharedPointer
Definition: berryILog.h:16
berry::Platform::ARCH_HPPA
static const int ARCH_HPPA
Definition: berryPlatform.h:234
berry::Platform::PROP_FORCE_PLUGIN_INSTALL
static const QString PROP_FORCE_PLUGIN_INSTALL
Definition: berryPlatform.h:246
berry::Platform::OS_OPEN_BSD
static const int OS_OPEN_BSD
Definition: berryPlatform.h:219
berry::Platform::OS_WINDOWS_CE
static const int OS_WINDOWS_CE
Definition: berryPlatform.h:227
berry::Platform::OS_QNX
static const int OS_QNX
Definition: berryPlatform.h:222
berry::Platform::OS_NET_BSD
static const int OS_NET_BSD
Definition: berryPlatform.h:218
berry::Platform::ARCH_IA64
static const int ARCH_IA64
Definition: berryPlatform.h:232
berry::Platform::PROP_IGNOREAPP
static const QString PROP_IGNOREAPP
Definition: berryPlatform.h:249
berry::Platform::ARCH_ALPHA
static const int ARCH_ALPHA
Definition: berryPlatform.h:230
berry::Platform::PROP_QTPLUGIN_PATH
static const QString PROP_QTPLUGIN_PATH
Definition: berryPlatform.h:242
berry::Platform::ARCH_POWER
static const int ARCH_POWER
Definition: berryPlatform.h:236
berry::Platform::ARCH_ARM
static const int ARCH_ARM
Definition: berryPlatform.h:239
berry::Platform::PROP_APPLICATION
static const QString PROP_APPLICATION
Definition: berryPlatform.h:248
berry::Platform::PROP_PLUGIN_DIRS
static const QString PROP_PLUGIN_DIRS
Definition: berryPlatform.h:245
berrySmartPointer.h
berry::Platform::PROP_XARGS
static const QString PROP_XARGS
Definition: berryPlatform.h:251
mitk::IPreferencesService
A service for persistent application preferences.
Definition: mitkIPreferencesService.h:33
berry::Platform::OS_WINDOWS_NT
static const int OS_WINDOWS_NT
Definition: berryPlatform.h:226
berry::Platform::OS_SOLARIS
static const int OS_SOLARIS
Definition: berryPlatform.h:221
berry
Definition: QmitkPropertyItemModel.h:24
berry::Platform::OS_TRU64
static const int OS_TRU64
Definition: berryPlatform.h:215
berry::Platform::OS_CYGWIN
static const int OS_CYGWIN
Definition: berryPlatform.h:224