VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h@ 43138

Last change on this file since 43138 was 42526, checked in by vboxsync, 12 years ago

FE/Qt: 6234: Support for VM groups: Initial commit. GUI-3 branch reintegrated to trunk.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.4 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * Global declarations and functions
5 */
6
7/*
8 * Copyright (C) 2006-2012 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 __UIDefs_h__
20#define __UIDefs_h__
21
22/* Qt includes: */
23#include <QEvent>
24#include <QStringList>
25
26/* COM includes: */
27#include "COMEnums.h"
28
29/* Other VBox defines: */
30#define LOG_GROUP LOG_GROUP_GUI
31
32/* Other VBox includes: */
33#include <VBox/log.h>
34#include <iprt/assert.h>
35#include <iprt/alloc.h>
36
37/* Defines: */
38#define MAC_LEOPARD_STYLE defined(Q_WS_MAC) && (QT_VERSION >= 0x040300)
39
40#ifdef DEBUG
41# define AssertWrapperOk(w) \
42 AssertMsg (w.isOk(), (#w " is not okay (RC=0x%08X)", w.lastRC()))
43# define AssertWrapperOkMsg(w, m) \
44 AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC()))
45#else /* !DEBUG */
46# define AssertWrapperOk(w) do {} while (0)
47# define AssertWrapperOkMsg(w, m) do {} while (0)
48#endif /* DEBUG */
49
50#ifndef SIZEOF_ARRAY
51# define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
52#endif /* SIZEOF_ARRAY */
53
54/* Global UI namespace: */
55namespace UIDefs
56{
57 /* VM display rendering mode: */
58 enum RenderMode
59 {
60 InvalidRenderMode
61 , TimerMode
62 , QImageMode
63 , SDLMode
64 , DDRAWMode
65 , Quartz2DMode
66#ifdef VBOX_GUI_USE_QGLFB
67 , QGLMode
68#endif /* VBOX_GUI_USE_QGLFB */
69 };
70
71 /* Additional Qt event types: */
72 enum UIEventType
73 {
74 ResizeEventType = QEvent::User + 101
75 , RepaintEventType
76 , SetRegionEventType
77 , ModifierKeyChangeEventType
78 , MediaEnumEventType
79#ifdef Q_WS_WIN
80 , ShellExecuteEventType
81#endif /* Q_WS_WIN */
82 , ActivateActionEventType
83#ifdef Q_WS_MAC
84 , ShowWindowEventType
85#endif /* Q_WS_MAC */
86 , AddVDMUrlsEventType
87#ifdef VBOX_GUI_USE_QGL
88 , VHWACommandProcessType
89#endif /* VBOX_GUI_USE_QGL */
90 };
91
92 /* Size formatting types: */
93 enum FormatSize
94 {
95 FormatSize_Round,
96 FormatSize_RoundDown,
97 FormatSize_RoundUp
98 };
99
100 /* Global declarations: */
101 extern const char* GUI_RenderMode;
102 extern const char* GUI_LanguageId;
103 extern const char* GUI_ExtPackName;
104 extern const char* GUI_PreventBetaWarning;
105 extern const char* GUI_RecentFolderHD;
106 extern const char* GUI_RecentFolderCD;
107 extern const char* GUI_RecentFolderFD;
108 extern const char* GUI_RecentListHD;
109 extern const char* GUI_RecentListCD;
110 extern const char* GUI_RecentListFD;
111
112 /* Selector-window declarations: */
113 extern const char* GUI_Input_SelectorShortcuts;
114 extern const char* GUI_LastSelectorWindowPosition;
115 extern const char* GUI_SplitterSizes;
116 extern const char* GUI_Toolbar;
117 extern const char* GUI_Statusbar;
118 extern const char* GUI_PreviewUpdate;
119 extern const char* GUI_DetailsPageBoxes;
120 extern const char* GUI_SelectorVMPositions;
121 extern const char* GUI_LastVMSelected;
122 extern const char* GUI_LastItemSelected;
123 extern const char* GUI_GroupDefinitions;
124
125 /* Machine-window declarations: */
126 extern const char* GUI_Input_MachineShortcuts;
127 extern const char* GUI_LastNormalWindowPosition;
128 extern const char* GUI_LastScaleWindowPosition;
129 extern const char* GUI_LastWindowState_Max;
130 extern const char* GUI_LastGuestSizeHint;
131 extern const char* GUI_LastGuestSizeHintWasFullscreen;
132 extern const char* GUI_Fullscreen;
133 extern const char* GUI_Seamless;
134 extern const char* GUI_Scale;
135 extern const char* GUI_VirtualScreenToHostScreen;
136 extern const char* GUI_AutoresizeGuest;
137 extern const char* GUI_SaveMountedAtRuntime;
138 extern const char* GUI_PassCAD;
139
140 /* Mini tool-bar declarations: */
141 extern const char* GUI_ShowMiniToolBar;
142 extern const char* GUI_MiniToolBarAlignment;
143 extern const char* GUI_MiniToolBarAutoHide;
144
145 /* Close-dialog declarations: */
146 extern const char* GUI_RestrictedCloseActions;
147 extern const char* GUI_LastCloseAction;
148 extern const char* GUI_CloseActionHook;
149
150 /* Wizards declarations: */
151 extern const char* GUI_FirstRun;
152 extern const char* GUI_HideDescriptionForWizards;
153 extern const char* GUI_Export_StorageType;
154 extern const char* GUI_Export_Username;
155 extern const char* GUI_Export_Hostname;
156 extern const char* GUI_Export_Bucket;
157
158 /* Message-center declarations: */
159 extern const char* GUI_SuppressMessages;
160 extern const char* GUI_InvertMessageOption;
161
162 /* Registration dialog declarations: */
163 extern const char* GUI_RegistrationDlgWinID;
164 extern const char* GUI_RegistrationData;
165
166 /* Update manager declarations: */
167 extern const char* GUI_UpdateDate;
168 extern const char* GUI_UpdateCheckCount;
169
170 /* Information dialog declarations: */
171 extern const char* GUI_InfoDlgState;
172
173#ifdef VBOX_WITH_DEBUGGER_GUI
174 /* Debugger GUI declarations: */
175 extern const char* GUI_DbgEnabled;
176 extern const char* GUI_DbgAutoShow;
177#endif /* VBOX_WITH_DEBUGGER_GUI */
178
179#ifdef Q_WS_X11
180 /* License GUI declarations: */
181 extern const char* GUI_LicenseKey;
182#endif /* Q_WS_X11 */
183
184#ifdef Q_WS_MAC
185 /* Mac dock declarations: */
186 extern const char* GUI_RealtimeDockIconUpdateEnabled;
187 extern const char* GUI_RealtimeDockIconUpdateMonitor;
188 extern const char* GUI_PresentationModeEnabled;
189#endif /* Q_WS_MAC */
190
191#ifdef VBOX_WITH_VIDEOHWACCEL
192 /* Video-acceleration declarations: */
193 extern const char* GUI_Accelerate2D_StretchLinear;
194 extern const char* GUI_Accelerate2D_PixformatYV12;
195 extern const char* GUI_Accelerate2D_PixformatUYVY;
196 extern const char* GUI_Accelerate2D_PixformatYUY2;
197 extern const char* GUI_Accelerate2D_PixformatAYUV;
198#endif /* VBOX_WITH_VIDEOHWACCEL */
199
200#ifdef VBOX_GUI_WITH_SYSTRAY
201 /* Tray icon declarations: */
202 extern const char* GUI_TrayIconWinID;
203 extern const char* GUI_TrayIconEnabled;
204 extern const char* GUI_MainWindowCount;
205#endif /* VBOX_GUI_WITH_SYSTRAY */
206
207 /* File extensions declarations: */
208 extern QStringList VBoxFileExts;
209 extern QStringList VBoxExtPackFileExts;
210 extern QStringList OVFFileExts;
211}
212using namespace UIDefs /* globally */;
213
214struct StorageSlot
215{
216 StorageSlot() : bus(KStorageBus_Null), port(0), device(0) {}
217 StorageSlot(const StorageSlot &other) : bus(other.bus), port(other.port), device(other.device) {}
218 StorageSlot(KStorageBus otherBus, LONG iPort, LONG iDevice) : bus(otherBus), port(iPort), device(iDevice) {}
219 StorageSlot& operator=(const StorageSlot &other) { bus = other.bus; port = other.port; device = other.device; return *this; }
220 bool operator==(const StorageSlot &other) const { return bus == other.bus && port == other.port && device == other.device; }
221 bool operator!=(const StorageSlot &other) const { return bus != other.bus || port != other.port || device != other.device; }
222 bool operator<(const StorageSlot &other) const { return (bus < other.bus) ||
223 (bus == other.bus && port < other.port) ||
224 (bus == other.bus && port == other.port && device < other.device); }
225 bool operator>(const StorageSlot &other) const { return (bus > other.bus) ||
226 (bus == other.bus && port > other.port) ||
227 (bus == other.bus && port == other.port && device > other.device); }
228 bool isNull() const { return bus == KStorageBus_Null; }
229 KStorageBus bus; LONG port; LONG device;
230};
231Q_DECLARE_METATYPE(StorageSlot);
232
233/* Details element type: */
234enum DetailsElementType
235{
236 DetailsElementType_General,
237 DetailsElementType_System,
238 DetailsElementType_Preview,
239 DetailsElementType_Display,
240 DetailsElementType_Storage,
241 DetailsElementType_Audio,
242 DetailsElementType_Network,
243 DetailsElementType_Serial,
244#ifdef VBOX_WITH_PARALLEL_PORTS
245 DetailsElementType_Parallel,
246#endif /* VBOX_WITH_PARALLEL_PORTS */
247 DetailsElementType_USB,
248 DetailsElementType_SF,
249 DetailsElementType_Description
250};
251Q_DECLARE_METATYPE(DetailsElementType);
252
253#endif // __UIDefs_h__
254
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use