1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * Header with common definitions and global functions
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2008 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __VBoxDefs_h__
|
---|
24 | #define __VBoxDefs_h__
|
---|
25 |
|
---|
26 | /* Qt includes */
|
---|
27 | #include <qevent.h>
|
---|
28 | #include <QUuid>
|
---|
29 |
|
---|
30 | #define LOG_GROUP LOG_GROUP_GUI
|
---|
31 | #include <VBox/log.h>
|
---|
32 | #include <iprt/assert.h>
|
---|
33 | #include <iprt/alloc.h>
|
---|
34 |
|
---|
35 | #ifdef DEBUG
|
---|
36 |
|
---|
37 | #define AssertWrapperOk(w) \
|
---|
38 | AssertMsg (w.isOk(), (#w " is not okay (RC=0x%08X)", w.lastRC()))
|
---|
39 | #define AssertWrapperOkMsg(w, m) \
|
---|
40 | AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC()))
|
---|
41 |
|
---|
42 | #else /* #ifdef DEBUG */
|
---|
43 |
|
---|
44 | #define AssertWrapperOk(w) do {} while (0)
|
---|
45 | #define AssertWrapperOkMsg(w, m) do {} while (0)
|
---|
46 |
|
---|
47 | #endif /* #ifdef DEBUG */
|
---|
48 |
|
---|
49 | #ifndef SIZEOF_ARRAY
|
---|
50 | #define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
|
---|
51 | #endif
|
---|
52 |
|
---|
53 | #if defined (VBOX_GUI_USE_QIMAGE) || \
|
---|
54 | defined (VBOX_GUI_USE_SDL) || \
|
---|
55 | defined (VBOX_GUI_USE_DDRAW)
|
---|
56 | #if !defined (VBOX_GUI_USE_EXT_FRAMEBUFFER)
|
---|
57 | #define VBOX_GUI_USE_EXT_FRAMEBUFFER
|
---|
58 | #endif
|
---|
59 | #else
|
---|
60 | #if defined (VBOX_GUI_USE_EXT_FRAMEBUFFER)
|
---|
61 | #undef VBOX_GUI_USE_EXT_FRAMEBUFFER
|
---|
62 | #endif
|
---|
63 | #endif
|
---|
64 |
|
---|
65 | /** Null UUID constant to be used as a default value for reference parameters */
|
---|
66 | extern const QUuid QUuid_null;
|
---|
67 |
|
---|
68 | /** Common namespace for all enums */
|
---|
69 | struct VBoxDefs
|
---|
70 | {
|
---|
71 | /** Media type. */
|
---|
72 | enum MediaType
|
---|
73 | {
|
---|
74 | MediaType_Invalid,
|
---|
75 | MediaType_HardDisk,
|
---|
76 | MediaType_DVD,
|
---|
77 | MediaType_Floppy,
|
---|
78 | MediaType_All
|
---|
79 | };
|
---|
80 |
|
---|
81 | /** VM display rendering mode. */
|
---|
82 | enum RenderMode
|
---|
83 | {
|
---|
84 | InvalidRenderMode, TimerMode, QImageMode, SDLMode, DDRAWMode, Quartz2DMode
|
---|
85 | };
|
---|
86 |
|
---|
87 | /** Additional Qt event types. */
|
---|
88 | enum
|
---|
89 | {
|
---|
90 | AsyncEventType = QEvent::User + 100,
|
---|
91 | ResizeEventType,
|
---|
92 | RepaintEventType,
|
---|
93 | SetRegionEventType,
|
---|
94 | MouseCapabilityEventType,
|
---|
95 | MousePointerChangeEventType,
|
---|
96 | MachineStateChangeEventType,
|
---|
97 | AdditionsStateChangeEventType,
|
---|
98 | MediaDriveChangeEventType,
|
---|
99 | MachineDataChangeEventType,
|
---|
100 | MachineRegisteredEventType,
|
---|
101 | SessionStateChangeEventType,
|
---|
102 | SnapshotEventType,
|
---|
103 | CanShowRegDlgEventType,
|
---|
104 | CanShowUpdDlgEventType,
|
---|
105 | NetworkAdapterChangeEventType,
|
---|
106 | USBCtlStateChangeEventType,
|
---|
107 | USBDeviceStateChangeEventType,
|
---|
108 | SharedFolderChangeEventType,
|
---|
109 | RuntimeErrorEventType,
|
---|
110 | ModifierKeyChangeEventType,
|
---|
111 | MediaEnumEventType,
|
---|
112 | #if defined (Q_WS_WIN)
|
---|
113 | ShellExecuteEventType,
|
---|
114 | #endif
|
---|
115 | ActivateMenuEventType,
|
---|
116 | #if defined (Q_WS_MAC)
|
---|
117 | ShowWindowEventType,
|
---|
118 | #endif
|
---|
119 | ChangeGUILanguageEventType,
|
---|
120 | #if defined (VBOX_GUI_WITH_SYSTRAY)
|
---|
121 | CanShowTrayIconEventType,
|
---|
122 | ChangeTrayIconEventType,
|
---|
123 | #endif
|
---|
124 | AddVDMUrlsEventType
|
---|
125 | };
|
---|
126 |
|
---|
127 | /** Size formatting types. */
|
---|
128 | enum FormatSize
|
---|
129 | {
|
---|
130 | FormatSize_Round,
|
---|
131 | FormatSize_RoundDown,
|
---|
132 | FormatSize_RoundUp
|
---|
133 | };
|
---|
134 |
|
---|
135 | static const char* GUI_LastWindowPosition;
|
---|
136 | static const char* GUI_LastWindowPosition_Max;
|
---|
137 | static const char* GUI_Fullscreen;
|
---|
138 | static const char* GUI_Seamless;
|
---|
139 | static const char* GUI_AutoresizeGuest;
|
---|
140 | static const char* GUI_FirstRun;
|
---|
141 | static const char* GUI_SaveMountedAtRuntime;
|
---|
142 | static const char* GUI_LastCloseAction;
|
---|
143 | static const char* GUI_SuppressMessages;
|
---|
144 | static const char* GUI_PermanentSharedFoldersAtRuntime;
|
---|
145 | #ifdef Q_WS_X11
|
---|
146 | static const char* GUI_LicenseKey;
|
---|
147 | #endif
|
---|
148 | static const char* GUI_RegistrationDlgWinID;
|
---|
149 | static const char* GUI_RegistrationData;
|
---|
150 | static const char* GUI_UpdateDlgWinID;
|
---|
151 | static const char* GUI_UpdateDate;
|
---|
152 | static const char* GUI_UpdateCheckCount;
|
---|
153 | static const char* GUI_LastVMSelected;
|
---|
154 | static const char* GUI_InfoDlgState;
|
---|
155 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
156 | static const char* GUI_TrayIconWinID;
|
---|
157 | #endif
|
---|
158 | };
|
---|
159 |
|
---|
160 | #define MAC_LEOPARD_STYLE defined(Q_WS_MAC) && (QT_VERSION >= 0x040300)
|
---|
161 |
|
---|
162 | #endif // __VBoxDefs_h__
|
---|
163 |
|
---|