VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h@ 4781

最後變更 在這個檔案從4781是 4514,由 vboxsync 提交於 18 年 前

2223: Improve Visual Mode change:

  1. Definite resize mode integrated into Toggle Seamless/Fullscreen Mode Mechanism. This is resize-controlled mechanism to make sure the dialog will be resize only to awaited size (full/available-geometry during entering fullscreen/seamless and previous-geometry during exiting these modes) and not to any other.
  2. Guest resizing (if available) also performs just for the desired size, not for the size at the end of the resize-timer timeout (which could be any of incorrect value do to timing).
  3. Seamless mode exiting to maximize screen workaround for (at least) KDE (where the window manager thinks the seamless mode equal maximized window state).
  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 8.3 KB
 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxConsoleWnd class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.alldomusa.eu.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 as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __VBoxConsoleWnd_h__
20#define __VBoxConsoleWnd_h__
21
22#include "COMDefs.h"
23
24#include <qmainwindow.h>
25
26#include <qmap.h>
27#include <qobjectlist.h>
28#include <qcolor.h>
29#include <qdialog.h>
30
31#ifdef VBOX_WITH_DEBUGGER_GUI
32# include <VBox/dbggui.h>
33#endif
34#ifdef Q_WS_MAC
35# undef PAGE_SIZE
36# undef PAGE_SHIFT
37# include <Carbon/Carbon.h>
38#endif
39
40class QAction;
41class QActionGroup;
42class QHBox;
43class QLabel;
44
45class VBoxConsoleView;
46class QIStateIndicator;
47
48class VBoxUSBMenu;
49class VBoxSwitchMenu;
50
51class VBoxConsoleWnd : public QMainWindow
52{
53 Q_OBJECT
54
55public:
56
57 VBoxConsoleWnd (VBoxConsoleWnd **aSelf,
58 QWidget* aParent = 0, const char* aName = 0,
59 WFlags aFlags = WType_TopLevel);
60 virtual ~VBoxConsoleWnd();
61
62 bool openView (const CSession &session);
63 void closeView();
64
65 void refreshView();
66
67 bool isTrueFullscreen() const { return mIsFullscreen; }
68
69 bool isTrueSeamless() const { return mIsSeamless; }
70
71 bool isManualResize() const { return mManualResize; }
72
73 void setMouseIntegrationLocked (bool aDisabled);
74
75 void popupMainMenu (bool aCenter);
76
77 void installGuestAdditionsFrom (const QString &aSource);
78
79#ifdef Q_WS_WIN32
80 void setMask (const QRegion &aRegion);
81#endif
82
83public slots:
84
85protected:
86
87 // events
88 bool event (QEvent *e);
89 void resizeEvent (QResizeEvent *e);
90 void closeEvent (QCloseEvent *e);
91#if defined(Q_WS_X11)
92 bool x11Event (XEvent *event);
93#endif
94#ifdef VBOX_WITH_DEBUGGER_GUI
95 bool dbgCreated();
96 void dbgDestroy();
97 void dbgAdjustRelativePos();
98#endif
99
100protected slots:
101
102private:
103
104 enum /* Stuff */
105 {
106 FloppyStuff = 0x01,
107 DVDStuff = 0x02,
108 HardDiskStuff = 0x04,
109 PauseAction = 0x08,
110 NetworkStuff = 0x10,
111 DisableMouseIntegrAction = 0x20,
112 Caption = 0x40,
113 USBStuff = 0x80,
114 VRDPStuff = 0x100,
115 SharedFolderStuff = 0x200,
116 AllStuff = 0xFFFF,
117 };
118
119 void languageChange();
120
121 void updateAppearanceOf (int element);
122
123 void toggleFullscreenMode (bool, bool);
124
125private slots:
126
127 void finalizeOpenView();
128
129 void activateUICustomizations();
130
131 void vmFullscreen (bool on);
132 void vmSeamless (bool on);
133 void vmAutoresizeGuest (bool on);
134 void vmAdjustWindow();
135
136 void vmTypeCAD();
137 void vmTypeCABS();
138 void vmReset();
139 void vmPause(bool);
140 void vmACPIShutdown();
141 void vmClose();
142 void vmTakeSnapshot();
143 void vmDisableMouseIntegr (bool);
144
145 void devicesMountFloppyImage();
146 void devicesUnmountFloppy();
147 void devicesMountDVDImage();
148 void devicesUnmountDVD();
149 void devicesSwitchVrdp (bool);
150 void devicesOpenSFDialog();
151 void devicesInstallGuestAdditions();
152
153 void prepareFloppyMenu();
154 void prepareDVDMenu();
155 void prepareNetworkMenu();
156
157 void setDynamicMenuItemStatusTip (int aId);
158
159 void captureFloppy (int aId);
160 void captureDVD (int aId);
161 void activateNetworkMenu (int aId);
162 void switchUSB (int aId);
163
164 void statusTipChanged (const QString &);
165 void clearStatusBar();
166
167 void showIndicatorContextMenu (QIStateIndicator *ind, QContextMenuEvent *e);
168
169 void updateDeviceLights();
170 void updateMachineState (CEnums::MachineState state);
171 void updateMouseState (int state);
172 void updateAdditionsState (const QString&, bool, bool);
173 void updateNetworkAdarptersState();
174 void updateUsbState();
175 void updateMediaState (VBoxDefs::DiskType aType);
176 void updateSharedFoldersState();
177
178 void tryClose();
179
180 void processGlobalSettingChange (const char *publicName, const char *name);
181
182 void dbgShowStatistics();
183 void dbgShowCommandLine();
184
185 void onEnterFullscreen();
186 void onExitFullscreen();
187
188private:
189
190 /** Popup version of the main menu */
191 QPopupMenu *mMainMenu;
192
193 QActionGroup *mRunningActions;
194 QActionGroup *mRunningOrPausedActions;
195
196 // Machine actions
197 QAction *vmFullscreenAction;
198 QAction *vmSeamlessAction;
199 QAction *vmAutoresizeGuestAction;
200 QAction *vmAdjustWindowAction;
201 QAction *vmTypeCADAction;
202#if defined(Q_WS_X11)
203 QAction *vmTypeCABSAction;
204#endif
205 QAction *vmResetAction;
206 QAction *vmPauseAction;
207 QAction *vmACPIShutdownAction;
208 QAction *vmCloseAction;
209 QAction *vmTakeSnapshotAction;
210 QAction *vmDisableMouseIntegrAction;
211
212 // Devices actions
213 QAction *devicesMountFloppyImageAction;
214 QAction *devicesUnmountFloppyAction;
215 QAction *devicesMountDVDImageAction;
216 QAction *devicesUnmountDVDAction;
217 QAction *devicesSwitchVrdpAction;
218 QAction *devicesSFDialogAction;
219 QAction *devicesInstallGuestToolsAction;
220
221#ifdef VBOX_WITH_DEBUGGER_GUI
222 // Debugger actions
223 QAction *dbgStatisticsAction;
224 QAction *dbgCommandLineAction;
225#endif
226
227 // Help actions
228 QAction *helpWebAction;
229 QAction *helpAboutAction;
230 QAction *helpResetMessagesAction;
231
232 // Machine popup menus
233 VBoxSwitchMenu *vmAutoresizeMenu;
234 VBoxSwitchMenu *vmDisMouseIntegrMenu;
235
236 // Devices popup menus
237 QPopupMenu *devicesMenu;
238 QPopupMenu *devicesMountFloppyMenu;
239 QPopupMenu *devicesMountDVDMenu;
240 QPopupMenu *devicesSFMenu;
241 QPopupMenu *devicesNetworkMenu;
242 VBoxUSBMenu *devicesUSBMenu;
243 VBoxSwitchMenu *devicesVRDPMenu;
244
245 int devicesUSBMenuSeparatorId;
246 int devicesVRDPMenuSeparatorId;
247 int devicesSFMenuSeparatorId;
248
249 bool waitForStatusBarChange;
250 bool statusBarChangedInside;
251
252#ifdef VBOX_WITH_DEBUGGER_GUI
253 // Debugger popup menu
254 QPopupMenu *dbgMenu;
255#endif
256
257 // Menu identifiers
258 enum {
259 vmMenuId = 1,
260 devicesMenuId,
261 devicesMountFloppyMenuId,
262 devicesMountDVDMenuId,
263 devicesUSBMenuId,
264 devicesNetworkMenuId,
265#ifdef VBOX_WITH_DEBUGGER_GUI
266 dbgMenuId,
267#endif
268 helpMenuId,
269 };
270
271 CSession csession;
272
273 // widgets
274 VBoxConsoleView *console;
275 QIStateIndicator *hd_light, *cd_light, *fd_light, *net_light, *usb_light, *sf_light;
276 QIStateIndicator *mouse_state, *hostkey_state;
277 QIStateIndicator *autoresize_state;
278 QIStateIndicator *vrdp_state;
279 QHBox *hostkey_hbox;
280 QLabel *hostkey_name;
281
282 QTimer *idle_timer;
283 CEnums::MachineState machine_state;
284 QString caption_prefix;
285
286 bool no_auto_close : 1;
287
288 QMap <int, CHostDVDDrive> hostDVDMap;
289 QMap <int, CHostFloppyDrive> hostFloppyMap;
290
291 QPoint normal_pos;
292 QSize normal_size;
293 QSize prev_min_size;
294 QSize mPrevSize;
295 QSize mAwaitingSize;
296
297#ifdef Q_WS_WIN32
298 QRegion mPrevRegion;
299#endif
300
301 // variables for dealing with true fullscreen
302 bool mDoMaximize : 1;
303 bool mManualResize : 1;
304 bool mAllowOneResize : 1;
305 bool mIsFullscreen : 1;
306 bool mIsSeamless : 1;
307 bool mIsSeamlessSupported : 1;
308 int normal_wflags;
309 bool was_max : 1;
310 QObjectList hidden_children;
311 int console_style;
312 QColor erase_color;
313
314 bool mIsOpenViewFinished : 1;
315 bool mIsFirstTimeStarted : 1;
316 bool mIsAutoSaveMedia : 1;
317
318#ifdef VBOX_WITH_DEBUGGER_GUI
319 // Debugger GUI
320 PDBGGUI dbg_gui;
321#endif
322
323#ifdef Q_WS_MAC
324 // Dock images.
325 CGImageRef dockImgStateRunning;
326 CGImageRef dockImgStatePaused;
327 CGImageRef dockImgStateSaving;
328 CGImageRef dockImgStateRestoring;
329 CGImageRef dockImgBack75x75;
330 CGImageRef dockImgBack100x75;
331 CGImageRef dockImgOS;
332#endif
333};
334
335
336class VBoxSharedFoldersSettings;
337class VBoxSFDialog : public QDialog
338{
339 Q_OBJECT
340
341public:
342
343 VBoxSFDialog (QWidget*, CSession&);
344
345protected slots:
346
347 virtual void accept();
348
349protected:
350
351 void showEvent (QShowEvent*);
352
353private:
354
355 VBoxSharedFoldersSettings *mSettings;
356 CSession &mSession;
357};
358
359
360#endif // __VBoxConsoleWnd_h__
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette