1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * Header with common definitions and global functions
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2009 Oracle Corporation
|
---|
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 |
|
---|
19 | #ifndef __VBoxDefs_h__
|
---|
20 | #define __VBoxDefs_h__
|
---|
21 |
|
---|
22 | /* Qt includes */
|
---|
23 | #include <QEvent>
|
---|
24 | #include <QUuid>
|
---|
25 | #include <QMetaType>
|
---|
26 |
|
---|
27 | #define LOG_GROUP LOG_GROUP_GUI
|
---|
28 | #include <VBox/log.h>
|
---|
29 | #include <iprt/assert.h>
|
---|
30 | #include <iprt/alloc.h>
|
---|
31 |
|
---|
32 | #ifdef DEBUG
|
---|
33 |
|
---|
34 | #define AssertWrapperOk(w) \
|
---|
35 | AssertMsg (w.isOk(), (#w " is not okay (RC=0x%08X)", w.lastRC()))
|
---|
36 | #define AssertWrapperOkMsg(w, m) \
|
---|
37 | AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC()))
|
---|
38 |
|
---|
39 | #else /* #ifdef DEBUG */
|
---|
40 |
|
---|
41 | #define AssertWrapperOk(w) do {} while (0)
|
---|
42 | #define AssertWrapperOkMsg(w, m) do {} while (0)
|
---|
43 |
|
---|
44 | #endif /* #ifdef DEBUG */
|
---|
45 |
|
---|
46 | #ifndef SIZEOF_ARRAY
|
---|
47 | #define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
|
---|
48 | #endif
|
---|
49 |
|
---|
50 | /** Common namespace for all enums */
|
---|
51 | struct VBoxDefs
|
---|
52 | {
|
---|
53 | /** Medium type. */
|
---|
54 | enum MediumType
|
---|
55 | {
|
---|
56 | MediumType_Invalid,
|
---|
57 | MediumType_HardDisk,
|
---|
58 | MediumType_DVD,
|
---|
59 | MediumType_Floppy,
|
---|
60 | MediumType_All
|
---|
61 | };
|
---|
62 |
|
---|
63 | /** VM display rendering mode. */
|
---|
64 | enum RenderMode
|
---|
65 | {
|
---|
66 | InvalidRenderMode, TimerMode, QImageMode, SDLMode, DDRAWMode, Quartz2DMode
|
---|
67 | #ifdef VBOX_GUI_USE_QGLFB
|
---|
68 | , QGLMode
|
---|
69 | #endif
|
---|
70 | };
|
---|
71 |
|
---|
72 | /** Additional Qt event types. */
|
---|
73 | enum
|
---|
74 | {
|
---|
75 | ResizeEventType = QEvent::User + 101
|
---|
76 | , RepaintEventType
|
---|
77 | , SetRegionEventType
|
---|
78 | , ModifierKeyChangeEventType
|
---|
79 | , MediaEnumEventType
|
---|
80 | #if defined (Q_WS_WIN)
|
---|
81 | , ShellExecuteEventType
|
---|
82 | #endif
|
---|
83 | , ActivateActionEventType
|
---|
84 | #if defined (Q_WS_MAC)
|
---|
85 | , ShowWindowEventType
|
---|
86 | #endif
|
---|
87 | , AddVDMUrlsEventType
|
---|
88 | #ifdef VBOX_GUI_USE_QGL
|
---|
89 | , VHWACommandProcessType
|
---|
90 | #endif
|
---|
91 | };
|
---|
92 |
|
---|
93 | /** Size formatting types. */
|
---|
94 | enum FormatSize
|
---|
95 | {
|
---|
96 | FormatSize_Round,
|
---|
97 | FormatSize_RoundDown,
|
---|
98 | FormatSize_RoundUp
|
---|
99 | };
|
---|
100 |
|
---|
101 | static const char* GUI_LastWindowPosition;
|
---|
102 | static const char* GUI_LastNormalWindowPosition;
|
---|
103 | static const char* GUI_LastScaleWindowPosition;
|
---|
104 | static const char* GUI_LastWindowState_Max;
|
---|
105 | static const char* GUI_SplitterSizes;
|
---|
106 | static const char* GUI_Toolbar;
|
---|
107 | static const char* GUI_Statusbar;
|
---|
108 | static const char* GUI_LastGuestSizeHint;
|
---|
109 | static const char* GUI_Fullscreen;
|
---|
110 | static const char* GUI_Seamless;
|
---|
111 | static const char* GUI_Scale;
|
---|
112 | static const char* GUI_VirtualScreenToHostScreen;
|
---|
113 | static const char* GUI_AutoresizeGuest;
|
---|
114 | static const char* GUI_FirstRun;
|
---|
115 | static const char* GUI_SaveMountedAtRuntime;
|
---|
116 | static const char* GUI_ShowMiniToolBar;
|
---|
117 | static const char* GUI_MiniToolBarAlignment;
|
---|
118 | static const char* GUI_MiniToolBarAutoHide;
|
---|
119 | static const char* GUI_LastCloseAction;
|
---|
120 | static const char* GUI_RestrictedCloseActions;
|
---|
121 | static const char* GUI_SuppressMessages;
|
---|
122 | static const char* GUI_PermanentSharedFoldersAtRuntime;
|
---|
123 | static const char* GUI_LanguageId;
|
---|
124 | static const char* GUI_PreviewUpdate;
|
---|
125 | static const char* GUI_DetailsPageBoxes;
|
---|
126 | static const char* GUI_SelectorVMPositions;
|
---|
127 | static const char* GUI_Input_MachineShortcuts;
|
---|
128 | static const char* GUI_Input_SelectorShortcuts;
|
---|
129 | #ifdef Q_WS_X11
|
---|
130 | static const char* GUI_LicenseKey;
|
---|
131 | #endif
|
---|
132 | static const char* GUI_RegistrationDlgWinID;
|
---|
133 | static const char* GUI_RegistrationData;
|
---|
134 | static const char* GUI_UpdateDlgWinID;
|
---|
135 | static const char* GUI_UpdateDate;
|
---|
136 | static const char* GUI_UpdateCheckCount;
|
---|
137 | static const char* GUI_LastVMSelected;
|
---|
138 | static const char* GUI_InfoDlgState;
|
---|
139 | static const char* GUI_RenderMode;
|
---|
140 | #ifdef VBOX_GUI_WITH_SYSTRAY
|
---|
141 | static const char* GUI_TrayIconWinID;
|
---|
142 | static const char* GUI_TrayIconEnabled;
|
---|
143 | static const char* GUI_MainWindowCount;
|
---|
144 | #endif
|
---|
145 | #ifdef Q_WS_MAC
|
---|
146 | static const char* GUI_RealtimeDockIconUpdateEnabled;
|
---|
147 | static const char* GUI_RealtimeDockIconUpdateMonitor;
|
---|
148 | static const char* GUI_PresentationModeEnabled;
|
---|
149 | #endif /* Q_WS_MAC */
|
---|
150 | static const char* GUI_PassCAD;
|
---|
151 | static const char* GUI_Export_StorageType;
|
---|
152 | static const char* GUI_Export_Username;
|
---|
153 | static const char* GUI_Export_Hostname;
|
---|
154 | static const char* GUI_Export_Bucket;
|
---|
155 | static const char* GUI_PreventBetaWarning;
|
---|
156 |
|
---|
157 | static const char* GUI_RecentListHD;
|
---|
158 | static const char* GUI_RecentListCD;
|
---|
159 | static const char* GUI_RecentListFD;
|
---|
160 |
|
---|
161 | #ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
162 | static const char* GUI_Accelerate2D_StretchLinear;
|
---|
163 | static const char* GUI_Accelerate2D_PixformatYV12;
|
---|
164 | static const char* GUI_Accelerate2D_PixformatUYVY;
|
---|
165 | static const char* GUI_Accelerate2D_PixformatYUY2;
|
---|
166 | static const char* GUI_Accelerate2D_PixformatAYUV;
|
---|
167 | #endif
|
---|
168 |
|
---|
169 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
170 | static const char* GUI_DbgEnabled;
|
---|
171 | static const char* GUI_DbgAutoShow;
|
---|
172 | #endif
|
---|
173 |
|
---|
174 | static QStringList VBoxFileExts;
|
---|
175 | static QStringList VBoxExtPackFileExts;
|
---|
176 | static QStringList OVFFileExts;
|
---|
177 | };
|
---|
178 |
|
---|
179 | Q_DECLARE_METATYPE(VBoxDefs::MediumType);
|
---|
180 |
|
---|
181 | #define MAC_LEOPARD_STYLE defined(Q_WS_MAC) && (QT_VERSION >= 0x040300)
|
---|
182 |
|
---|
183 | #endif /* __VBoxDefs_h__ */
|
---|
184 |
|
---|