VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

Last change on this file was 104374, checked in by vboxsync, 4 weeks ago

FE/Qt. Build fix.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 48.1 KB
Line 
1/* $Id: UIMachine.h 104374 2024-04-19 09:45:23Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIMachine class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_runtime_UIMachine_h
29#define FEQT_INCLUDED_SRC_runtime_UIMachine_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QObject>
36#include <QPixmap>
37
38/* GUI includes: */
39#include "UIAddDiskEncryptionPasswordDialog.h"
40#include "UIExtraDataDefs.h"
41#include "UIMachineDefs.h"
42#include "UIMediumDefs.h"
43#include "UIMousePointerShapeData.h"
44#include "UITextTable.h"
45
46/* COM includes: */
47#include "KBitmapFormat.h"
48#include "KChipsetType.h"
49#include "KClipboardMode.h"
50#include "KDeviceActivity.h"
51#include "KDnDMode.h"
52#include "KGraphicsControllerType.h"
53#include "KGuestMonitorChangedEventType.h"
54#include "KGuestMonitorStatus.h"
55#include "KMachineState.h"
56#include "KParavirtProvider.h"
57#include "KPlatformArchitecture.h"
58#include "KVMExecutionEngine.h"
59
60/* Forward declarations: */
61class QMenu;
62class QWidget;
63class UIActionPool;
64class UIFrameBuffer;
65class UIMachineLogic;
66class UISession;
67class CMediumAttachment;
68class CNetworkAdapter;
69class CUSBDevice;
70class CVirtualBoxErrorInfo;
71#ifdef VBOX_WS_MAC
72 class QMenuBar;
73 class QTimer;
74#endif
75
76/** Singleton QObject extension
77 * used as virtual machine (VM) singleton instance. */
78class UIMachine : public QObject
79{
80 Q_OBJECT;
81
82signals:
83
84 /** Notifies listeners about machine initialized. */
85 void sigInitialized();
86
87 /** Requests async visual-state change. */
88 void sigRequestAsyncVisualStateChange(UIVisualStateType enmVisualStateType);
89
90 /** @name COM events stuff.
91 ** @{ */
92 /** Notifies about additions state change. */
93 void sigAdditionsStateChange();
94 /** Notifies about additions state actually change. */
95 void sigAdditionsStateActualChange();
96 /** Notifies about audio adapter change. */
97 void sigAudioAdapterChange();
98 /** Notifies about clipboard mode change. */
99 void sigClipboardModeChange(KClipboardMode enmMode);
100 /** Notifies about a clipboard error. */
101 void sigClipboardError(QString strId, QString strMsg, long rcError);
102 /** Notifies about CPU execution cap change. */
103 void sigCPUExecutionCapChange();
104 /** Notifies about DnD mode change. */
105 void sigDnDModeChange(KDnDMode enmMode);
106 /** Notifies about guest monitor change. */
107 void sigGuestMonitorChange(KGuestMonitorChangedEventType emnChangeType, ulong uScreenId, QRect screenGeo);
108 /** Notifies about machine change. */
109 void sigMachineStateChange();
110 /** Notifies about medium change. */
111 void sigMediumChange(const CMediumAttachment &comMediumAttachment);
112 /** Notifies about network adapter change. */
113 void sigNetworkAdapterChange(const CNetworkAdapter &comNetworkAdapter);
114 /** Notifies about recording change. */
115 void sigRecordingChange();
116 /** Notifies about shared folder change. */
117 void sigSharedFolderChange();
118 /** Handles storage device change signal. */
119 void sigStorageDeviceChange(const CMediumAttachment &comAttachment, bool fRemoved, bool fSilent);
120 /** Handles USB controller change signal. */
121 void sigUSBControllerChange();
122 /** Handles USB device state change signal. */
123 void sigUSBDeviceStateChange(const CUSBDevice &comDevice, bool fAttached, const CVirtualBoxErrorInfo &comError);
124 /** Notifies about VRDE change. */
125 void sigVRDEChange();
126
127 /** Notifies about runtime error happened. */
128 void sigRuntimeError(bool bIsFatal, const QString &strErrorId, const QString &strMessage);
129
130#ifdef VBOX_WS_MAC
131 /** macOS X: Notifies about VM window should be shown. */
132 void sigShowWindows();
133#endif
134 /** @} */
135
136 /** @name Keyboard stuff.
137 ** @{ */
138 /** Notifies about keyboard LEDs change. */
139 void sigKeyboardLedsChange();
140
141 /** Notifies listeners about keyboard state-change. */
142 void sigKeyboardStateChange(int iState);
143 /** @} */
144
145 /** @name Mouse stuff.
146 ** @{ */
147 /** Notifies listeners about mouse pointer shape change. */
148 void sigMousePointerShapeChange();
149 /** Notifies listeners about mouse capability change. */
150 void sigMouseCapabilityChange();
151 /** Notifies listeners about cursor position change. */
152 void sigCursorPositionChange();
153
154 /** Notifies listeners about mouse state-change. */
155 void sigMouseStateChange(int iState);
156 /** @} */
157
158 /** @name Host-screen stuff.
159 ** @{ */
160 /** Notifies about host-screen count change. */
161 void sigHostScreenCountChange();
162 /** Notifies about host-screen geometry change. */
163 void sigHostScreenGeometryChange();
164 /** Notifies about host-screen available-area change. */
165 void sigHostScreenAvailableAreaChange();
166 /** @} */
167
168public:
169
170 /** Static factory to start machine. */
171 static bool startMachine();
172 /** Static constructor. */
173 static bool create();
174 /** Static destructor. */
175 static void destroy();
176 /** Static instance. */
177 static UIMachine *instance() { return s_pInstance; }
178
179 /** Returns whether machine is initialized. */
180 bool isInitialized() const { return m_fInitialized; }
181
182 /** Returns session UI instance. */
183 UISession *uisession() const { return m_pSession; }
184 /** Returns machine-logic instance. */
185 UIMachineLogic *machineLogic() const { return m_pMachineLogic; }
186 /** Returns frame-buffer reference for screen with @a uScreenId specified. */
187 UIFrameBuffer *frameBuffer(ulong uScreenId);
188 /** Returns active machine-window reference (if possible). */
189 QWidget *activeWindow() const;
190
191 /** Returns whether session UI is valid. */
192 bool isSessionValid() const;
193
194 /** Returns whether requested visual @a state allowed. */
195 bool isVisualStateAllowed(UIVisualStateType state) const { return m_enmAllowedVisualStates & state; }
196
197 /** Requests async visual-state change. */
198 void asyncChangeVisualState(UIVisualStateType enmVisualStateType);
199
200 /** Requests visual-state to be entered when possible. */
201 void setRequestedVisualState(UIVisualStateType enmVisualStateType);
202 /** Returns requested visual-state to be entered when possible. */
203 UIVisualStateType requestedVisualState() const;
204
205 /** @name General stuff.
206 ** @{ */
207 /** Returns the machine name. */
208 QString machineName() const;
209 /** Returns the OS type id. */
210 QString osTypeId() const;
211
212 /** Acquire machine pixmap. */
213 void acquireMachinePixmap(const QSize &size, QPixmap &pixmap);
214 /** Acquire user machine icon. */
215 void acquireUserMachineIcon(QIcon &icon);
216
217 /** Acquires architecture type. */
218 bool acquireArchitectureType(KPlatformArchitecture &enmType);
219 /** Acquires chipset type. */
220 bool acquireChipsetType(KChipsetType &enmType);
221 /** @} */
222
223 /** @name Branding stuff.
224 ** @{ */
225 /** Returns the cached machine-window icon. */
226 QIcon *machineWindowIcon() const { return m_pMachineWindowIcon; }
227#ifndef VBOX_WS_MAC
228 /** Returns redefined machine-window name postfix. */
229 QString machineWindowNamePostfix() const { return m_strMachineWindowNamePostfix; }
230#endif
231 /** @} */
232
233 /** @name Actions stuff.
234 ** @{ */
235 /** Returns the action-pool instance. */
236 UIActionPool *actionPool() const { return m_pActionPool; }
237
238 /** Updates additions actions state. */
239 void updateStateAdditionsActions();
240 /** Updates Audio action state. */
241 void updateStateAudioActions();
242 /** Updates Recording action state. */
243 void updateStateRecordingAction();
244 /** Updates VRDE server action state. */
245 void updateStateVRDEServerAction();
246 /** @} */
247
248 /** @name Machine-state stuff.
249 ** @{ */
250 /** Returns previous machine state. */
251 KMachineState machineStatePrevious() const;
252 /** Returns cached machine state. */
253 KMachineState machineState() const;
254
255 /** Resets previous state to be the same as current one. */
256 void forgetPreviousMachineState();
257
258 /** Acquire live machine state. */
259 bool acquireLiveMachineState(KMachineState &enmState);
260
261 /** Returns whether VM is in one of turned off states. */
262 bool isTurnedOff() const;
263 /** Returns whether VM is in one of paused states. */
264 bool isPaused() const;
265 /** Returns whether VM was in one of paused states. */
266 bool wasPaused() const;
267 /** Returns whether VM is in one of running states. */
268 bool isRunning() const;
269 /** Returns whether VM is in one of stuck states. */
270 bool isStuck() const;
271 /** Returns whether VM is one of states where guest-screen is undrawable. */
272 bool isGuestScreenUnDrawable() const;
273
274 /** Resets VM. */
275 bool reset();
276 /** Performes VM pausing. */
277 bool pause();
278 /** Performes VM resuming. */
279 bool unpause();
280 /** Performes VM pausing/resuming depending on @a fPause state. */
281 bool setPause(bool fPause);
282 /** @} */
283
284 /** @name Machine-data stuff.
285 ** @{ */
286 /** Acquires settings file path. */
287 bool acquireSettingsFilePath(QString &strPath);
288
289 /** Saves machine data. */
290 bool saveSettings();
291 /** @} */
292
293 /** @name Snapshot stuff.
294 ** @{ */
295 /** Acquires snapshot count. */
296 bool acquireSnapshotCount(ulong &uCount);
297 /** Acquires current snapshot name. */
298 bool acquireCurrentSnapshotName(QString &strName);
299
300 /** Recursively searches for a first snapshot matching name template conditions. */
301 bool acquireMaxSnapshotIndex(const QString &strNameTemplate, ulong &uIndex);
302
303 /** Takes snapshot with name & description specified. */
304 void takeSnapshot(const QString &strName, const QString &strDescription);
305 /** @} */
306
307 /** @name Audio stuff.
308 ** @{ */
309 /** Acquires whether audio adapter is present. */
310 bool acquireWhetherAudioAdapterPresent(bool &fPresent);
311 /** Acquires whether audio adapter is enabled. */
312 bool acquireWhetherAudioAdapterEnabled(bool &fEnabled);
313 /** Acquires whether audio adapter output is enabled. */
314 bool acquireWhetherAudioAdapterOutputEnabled(bool &fEnabled);
315 /** Acquires whether audio adapter input is enabled. */
316 bool acquireWhetherAudioAdapterInputEnabled(bool &fEnabled);
317 /** Defines whether audio adapter output is enabled. */
318 bool setAudioAdapterOutputEnabled(bool fEnabled);
319 /** Defines whether audio adapter input is enabled. */
320 bool setAudioAdapterInputEnabled(bool fEnabled);
321 /** @} */
322
323 /** @name Host-screen stuff.
324 ** @{ */
325 /** Returns the list of host-screen geometries we currently have. */
326 QList<QRect> hostScreens() const { return m_hostScreens; }
327 /** @} */
328
329 /** @name Guest-screen stuff.
330 ** @{ */
331 /** Returns whether guest-screen with @a uScreenId specified is expected to be visible. */
332 bool isScreenVisibleHostDesires(ulong uScreenId) const;
333 /** Defines whether guest-screen with @a uScreenId specified is expected to be @a fVisible. */
334 void setScreenVisibleHostDesires(ulong uScreenId, bool fVisible);
335
336 /** Returns whether guest-screen with @a uScreenId specified is actually visible. */
337 bool isScreenVisible(ulong uScreenId) const;
338 /** Defines whether guest-screen with @a uScreenId specified is actually @a fVisible. */
339 void setScreenVisible(ulong uScreenId, bool fIsMonitorVisible);
340
341 /** Returns a number of visible guest-windows. */
342 int countOfVisibleWindows();
343 /** Returns the list of visible guest-windows. */
344 QList<int> listOfVisibleWindows() const;
345
346 /** Returns size for guest-screen with index @a uScreenId. */
347 QSize guestScreenSize(ulong uScreenId) const;
348
349 /** Returns last full-screen size for guest-screen with index @a uScreenId. */
350 QSize lastFullScreenSize(ulong uScreenId) const;
351 /** Defines last full-screen @a size for guest-screen with index @a uScreenId. */
352 void setLastFullScreenSize(ulong uScreenId, QSize size);
353
354 /** Returns whether guest screen resize should be ignored. */
355 bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; }
356 /** Defines whether guest screen resize should be @a fIgnored. */
357 void setGuestResizeIgnored(bool fIgnored) { m_fIsGuestResizeIgnored = fIgnored; }
358
359 /** Acquires graphics controller type. */
360 bool acquireGraphicsControllerType(KGraphicsControllerType &enmType);
361 /** Acquires VRAM size. */
362 bool acquireVRAMSize(ulong &uSize);
363 /** Acquires whether accelerate 3D is enabled. */
364 bool acquireWhetherAccelerate3DEnabled(bool &fEnabled);
365 /** Acquires monitor count. */
366 bool acquireMonitorCount(ulong &uCount);
367
368 /** Acquires parameters for guest-screen with passed uScreenId. */
369 bool acquireGuestScreenParameters(ulong uScreenId,
370 ulong &uWidth, ulong &uHeight, ulong &uBitsPerPixel,
371 long &xOrigin, long &yOrigin, KGuestMonitorStatus &enmMonitorStatus);
372 /** Acquires saved info for guest-screen with passed uScreenId. */
373 bool acquireSavedGuestScreenInfo(ulong uScreenId,
374 long &xOrigin, long &yOrigin,
375 ulong &uWidth, ulong &uHeight, bool &fEnabled);
376 /** Defines video mode hint for guest-screen with passed uScreenId. */
377 bool setVideoModeHint(ulong uScreenId, bool fEnabled, bool fChangeOrigin,
378 long xOrigin, long yOrigin, ulong uWidth, ulong uHeight,
379 ulong uBitsPerPixel, bool fNotify);
380 /** Acquires video mode hint for guest-screen with passed uScreenId. */
381 bool acquireVideoModeHint(ulong uScreenId, bool &fEnabled, bool &fChangeOrigin,
382 long &xOrigin, long &yOrigin, ulong &uWidth, ulong &uHeight,
383 ulong &uBitsPerPixel);
384 /** Acquires screen-shot for guest-screen with passed uScreenId. */
385 bool acquireScreenShot(ulong uScreenId, ulong uWidth, ulong uHeight, KBitmapFormat enmFormat, uchar *pBits);
386 /** Acquires saved screen-shot info for guest-screen with passed uScreenId. */
387 bool acquireSavedScreenshotInfo(ulong uScreenId, ulong &uWidth, ulong &uHeight, QVector<KBitmapFormat> &formats);
388 /** Acquires saved screen-shot for guest-screen with passed uScreenId. */
389 bool acquireSavedScreenshot(ulong uScreenId, KBitmapFormat enmFormat,
390 ulong &uWidth, ulong &uHeight, QVector<BYTE> &screenshot);
391 /** Notifies guest-screen with passed uScreenId about scale-factor change. */
392 bool notifyScaleFactorChange(ulong uScreenId, ulong uScaleFactorWMultiplied, ulong uScaleFactorHMultiplied);
393 /** Notifies display about unscaled HiDPI policy change. */
394 bool notifyHiDPIOutputPolicyChange(bool fUnscaledHiDPI);
395 /** Defines whether seamless mode is enabled for display. */
396 bool setSeamlessMode(bool fEnabled);
397 /** Notifies display about viewport changes. */
398 bool viewportChanged(ulong uScreenId, ulong xOrigin, ulong yOrigin, ulong uWidth, ulong uHeight);
399 /** Notifies display about all screens were invalidated. */
400 bool invalidateAndUpdate();
401 /** Notifies display about screen with passed uScreenId was invalidated. */
402 bool invalidateAndUpdateScreen(ulong uScreenId);
403
404 /** Acquires whether VRDE server is present. */
405 bool acquireWhetherVRDEServerPresent(bool &fPresent);
406 /** Acquires whether VRDE server is enabled. */
407 bool acquireWhetherVRDEServerEnabled(bool &fEnabled);
408 /** Defines whether VRDE server is enabled. */
409 bool setVRDEServerEnabled(bool fEnabled);
410 /** Acquires VRDE server port. */
411 bool acquireVRDEServerPort(long &iPort);
412
413 /** Acquires whether recording settings is present. */
414 bool acquireWhetherRecordingSettingsPresent(bool &fPresent);
415 /** Acquires whether recording settings is enabled. */
416 bool acquireWhetherRecordingSettingsEnabled(bool &fEnabled);
417 /** Defines whether recording settings is enabled. */
418 bool setRecordingSettingsEnabled(bool fEnabled);
419 /** @} */
420
421 /** @name Guest additions stuff.
422 ** @{ */
423 /** Returns whether guest additions is active. */
424 bool isGuestAdditionsActive() const;
425 /** Returns whether guest additions supports graphics. */
426 bool isGuestSupportsGraphics() const;
427 /** Returns whether guest additions supports seamless. */
428 bool isGuestSupportsSeamless() const;
429 /** Acquires the guest addition's version. */
430 bool acquireGuestAdditionsVersion(QString &strVersion);
431 /** Acquires the guest addition's revision. */
432 bool acquireGuestAdditionsRevision(ulong &uRevision);
433 /** Notifies guest about VM window focus changes. */
434 bool notifyGuiFocusChange(bool fInfocus);
435 /** @} */
436
437 /** @name Keyboard stuff.
438 ** @{ */
439 /** Returns the NUM lock status. */
440 bool isNumLock() const { return m_fNumLock; }
441 /** Returns the CAPS lock status. */
442 bool isCapsLock() const { return m_fCapsLock; }
443 /** Returns the SCROLL lock status. */
444 bool isScrollLock() const { return m_fScrollLock; }
445
446 /** Returns the NUM lock adaption count. */
447 uint numLockAdaptionCnt() const { return m_uNumLockAdaptionCnt; }
448 /** Defines the NUM lock adaption @a uCount. */
449 void setNumLockAdaptionCnt(uint uCount) { m_uNumLockAdaptionCnt = uCount; }
450
451 /** Returns the CAPS lock adaption count. */
452 uint capsLockAdaptionCnt() const { return m_uCapsLockAdaptionCnt; }
453 /** Defines the CAPS lock adaption @a uCount. */
454 void setCapsLockAdaptionCnt(uint uCount) { m_uCapsLockAdaptionCnt = uCount; }
455
456 /** Returns whether VM should perform HID LEDs synchronization. */
457 bool isHidLedsSyncEnabled() const { return m_fIsHidLedsSyncEnabled; }
458
459 /** Returns whether auto-capture is disabled. */
460 bool isAutoCaptureDisabled() const { return m_fIsAutoCaptureDisabled; }
461 /** Defines whether auto-capture is @a fDisabled. */
462 void setAutoCaptureDisabled(bool fDisabled) { m_fIsAutoCaptureDisabled = fDisabled; }
463
464 /** Returns the keyboard-state. */
465 int keyboardState() const { return m_iKeyboardState; }
466
467 /** Sends a scan @a iCode to VM's keyboard. */
468 bool putScancode(LONG iCode);
469 /** Sends a list of scan @a codes to VM's keyboard. */
470 bool putScancodes(const QVector<LONG> &codes);
471 /** Sends the CAD sequence to VM's keyboard. */
472 bool putCAD();
473 /** Releases all keys. */
474 bool releaseKeys();
475 /** Sends a USB HID @a iUsageCode and @a iUsagePage to VM's keyboard.
476 * The @a fKeyRelease flag is set when the key is being released. */
477 bool putUsageCode(LONG iUsageCode, LONG iUsagePage, bool fKeyRelease);
478 /** @} */
479
480 /** @name Mouse stuff.
481 ** @{ */
482 /** Returns whether we should hide host mouse pointer. */
483 bool isHidingHostPointer() const { return m_fIsHidingHostPointer; }
484 /** Returns whether there is valid mouse pointer shape present. */
485 bool isValidPointerShapePresent() const { return m_fIsValidPointerShapePresent; }
486 /** Returns whether the @a cursorPosition() is valid and could be used by the GUI now. */
487 bool isValidCursorPositionPresent() const { return m_fIsValidCursorPositionPresent; }
488
489 /** Returns whether mouse supports absolute coordinates. */
490 bool isMouseSupportsAbsolute() const { return m_fIsMouseSupportsAbsolute; }
491 /** Returns whether mouse supports relative coordinates. */
492 bool isMouseSupportsRelative() const { return m_fIsMouseSupportsRelative; }
493 /** Returns whether touch screen is supported. */
494 bool isMouseSupportsTouchScreen() const { return m_fIsMouseSupportsTouchScreen; }
495 /** Returns whether touch pad is supported. */
496 bool isMouseSupportsTouchPad() const { return m_fIsMouseSupportsTouchPad; }
497 /** Returns whether guest requires host cursor to be shown. */
498 bool isMouseHostCursorNeeded() const { return m_fIsMouseHostCursorNeeded; }
499
500 /** Returns whether mouse is captured. */
501 bool isMouseCaptured() const { return m_fIsMouseCaptured; }
502 /** Returns whether mouse is integrated. */
503 bool isMouseIntegrated() const { return m_fIsMouseIntegrated; }
504 /** Defines whether mouse is @a fCaptured. */
505 void setMouseCaptured(bool fCaptured) { m_fIsMouseCaptured = fCaptured; }
506 /** Defines whether mouse is @a fIntegrated. */
507 void setMouseIntegrated(bool fIntegrated) { m_fIsMouseIntegrated = fIntegrated; }
508
509 /** Returns currently cached mouse cursor shape pixmap. */
510 QPixmap cursorShapePixmap() const { return m_cursorShapePixmap; }
511 /** Returns currently cached mouse cursor mask pixmap. */
512 QPixmap cursorMaskPixmap() const { return m_cursorMaskPixmap; }
513 /** Returns currently cached mouse cursor size. */
514 QSize cursorSize() const { return m_cursorSize; }
515 /** Returns currently cached mouse cursor hotspot. */
516 QPoint cursorHotspot() const { return m_cursorHotspot; }
517 /** Returns currently cached mouse cursor position. */
518 QPoint cursorPosition() const { return m_cursorPosition; }
519
520 /** Returns mouse-state. */
521 int mouseState() const { return m_iMouseState; }
522
523 /** Sends relative mouse move event to VM's mouse. */
524 bool putMouseEvent(long iDx, long iDy, long iDz, long iDw, long iButtonState);
525 /** Sends absolute mouse move event to VM's mouse. */
526 bool putMouseEventAbsolute(long iX, long iY, long iDz, long iDw, long iButtonState);
527 /** Sends multi-touch event to VM's mouse. */
528 bool putEventMultiTouch(long iCount, const QVector<LONG64> &contacts, bool fIsTouchScreen, ulong uScanTime);
529
530 /** Acquires clipboard mode. */
531 bool acquireClipboardMode(KClipboardMode &enmMode);
532 /** Defines clipboard mode. */
533 bool setClipboardMode(KClipboardMode enmMode);
534 /** En/disables guest clipboard file transfers. */
535 bool toggleClipboardFileTransfer(bool fEnabled);
536 /** Returns true if clipboard file transfer is enabled. Returns false otherwise or in case of an error. */
537 bool isClipboardFileTransferEnabled();
538
539 /** Acquires D&D mode. */
540 bool acquireDnDMode(KDnDMode &enmMode);
541 /** Defines D&D mode. */
542 bool setDnDMode(KDnDMode enmMode);
543 /** @} */
544
545 /** @name Storage stuff.
546 ** @{ */
547 /** Enumerates amount of storage devices. */
548 bool acquireAmountOfStorageDevices(ulong &cHardDisks, ulong &cOpticalDrives, ulong &cFloppyDrives);
549
550 /** Returns a list of storage devices. */
551 bool storageDevices(KDeviceType enmDeviceType, QList<StorageDeviceInfo> &guiStorageDevices);
552
553 /** Acquires encrypted media map. */
554 bool acquireEncryptedMedia(EncryptedMediumMap &media);
555 /** Adds encryption password. */
556 bool addEncryptionPassword(const QString &strId, const QString &strPassword, bool fClearOnSuspend);
557
558 /** Calculates @a cAmount of immutable images. */
559 bool acquireAmountOfImmutableImages(ulong &cAmount);
560
561 /** Attempts to mount medium with @p uMediumId to the machine
562 * if it can find an appropriate controller and port. */
563 bool mountBootMedium(const QUuid &uMediumId);
564
565 /** Prepares storage menu. */
566 void prepareStorageMenu(QMenu *pMenu,
567 QObject *pListener, const char *pszSlotName,
568 const QString &strControllerName, const StorageSlot &storageSlot);
569 /** Updates machine storage with data described by target. */
570 void updateMachineStorage(const UIMediumTarget &target, UIActionPool *pActionPool);
571 /** @} */
572
573 /** @name USB stuff.
574 ** @{ */
575 /** Acquires whether USB controller is enabled. */
576 void acquireWhetherUSBControllerEnabled(bool &fEnabled);
577 /** Acquires whether video input devices are enabled. */
578 void acquireWhetherVideoInputDevicesEnabled(bool &fEnabled);
579
580 /** Returns a list of USB devices. */
581 bool usbDevices(QList<USBDeviceInfo> &guiUSBDevices);
582 /** Attaches USB device with passed @a uId. */
583 bool attachUSBDevice(const QUuid &uId);
584 /** Detaches USB device with passed @a uId. */
585 bool detachUSBDevice(const QUuid &uId);
586
587 /** Returns a list of web cam devices. */
588 bool webcamDevices(QList<WebcamDeviceInfo> &guiWebcamDevices);
589 /** Attaches web cam device with passed @a strName and @a strPath. */
590 bool webcamAttach(const QString &strPath, const QString &strName);
591 /** Detaches web cam device with passed @a strName and @a strPath. */
592 bool webcamDetach(const QString &strPath, const QString &strName);
593 /** @} */
594
595 /** @name Network stuff.
596 ** @{ */
597 /** Acquires whether network adapter is enabled. */
598 bool acquireWhetherNetworkAdapterEnabled(ulong uSlot, bool &fEnabled);
599 /** Acquires whether at leasst one network adapter is enabled. */
600 bool acquireWhetherAtLeastOneNetworkAdapterEnabled(bool &fEnabled);
601 /** Acquires whether network adapter cable is connected. */
602 bool acquireWhetherNetworkCableConnected(ulong uSlot, bool &fConnected);
603 /** Set whether network adapter cable is connected. */
604 bool setNetworkCableConnected(ulong uSlot, bool fConnected);
605 /** @} */
606
607 /** @name Virtualization stuff.
608 ** @{ */
609 /** Returns IMachineDebugger::ExecutionEngine reference. */
610 KVMExecutionEngine vmExecutionEngine() const { return m_enmVMExecutionEngine; }
611
612 /** Returns whether nested-paging CPU hardware virtualization extension is enabled. */
613 bool isHWVirtExNestedPagingEnabled() const { return m_fIsHWVirtExNestedPagingEnabled; }
614 /** Returns whether the VM is currently making use of the unrestricted execution feature of VT-x. */
615 bool isHWVirtExUXEnabled() const { return m_fIsHWVirtExUXEnabled; }
616
617 /** Returns VM's effective paravirtualization provider. */
618 KParavirtProvider paravirtProvider() const { return m_enmParavirtProvider; }
619 /** @} */
620
621 /** @name Status-bar stuff.
622 ** @{ */
623 /** Acquires device activity composing a vector of current @a states for device with @a deviceTypes specified. */
624 bool acquireDeviceActivity(const QVector<KDeviceType> &deviceTypes, QVector<KDeviceActivity> &states);
625
626 /** Acquires status info for hard disk indicator. */
627 void acquireHardDiskStatusInfo(QString &strInfo, bool &fAttachmentsPresent);
628 /** Acquires status info for optical disk indicator. */
629 void acquireOpticalDiskStatusInfo(QString &strInfo, bool &fAttachmentsPresent, bool &fAttachmentsMounted);
630 /** Acquires status info for floppy disk indicator. */
631 void acquireFloppyDiskStatusInfo(QString &strInfo, bool &fAttachmentsPresent, bool &fAttachmentsMounted);
632 /** Acquires status info for audio indicator. */
633 void acquireAudioStatusInfo(QString &strInfo, bool &fAudioEnabled, bool &fEnabledOutput, bool &fEnabledInput);
634 /** Acquires status info for network indicator. */
635 void acquireNetworkStatusInfo(QString &strInfo, bool &fAdaptersPresent, bool &fCablesDisconnected);
636 /** Acquires status info for USB indicator. */
637 void acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnableds);
638 /** Acquires status info for Shared Folders indicator. */
639 void acquireSharedFoldersStatusInfo(QString &strInfo, bool &fFoldersPresent);
640 /** Acquires status info for Display indicator. */
641 void acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D);
642 /** Acquires status info for Recording indicator. */
643 void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused);
644 /** Acquires status info for Features indicator. */
645 void acquireFeaturesStatusInfo(QString &strInfo, KVMExecutionEngine &enmEngine);
646 /** @} */
647
648 /** @name Debugger stuff.
649 ** @{ */
650 /** Defines whether log is @a fEnabled. */
651 bool setLogEnabled(bool fEnabled);
652 /** Acquires whether log is @a fEnabled. */
653 bool acquireWhetherLogEnabled(bool &fEnabled);
654
655 /** Acquire log folder. */
656 bool acquireLogFolder(QString &strFolder);
657
658 /** Acquires effective CPU @a uLoad. */
659 bool acquireEffectiveCPULoad(ulong &uLoad);
660 /** Acquires uptime @a iUpTime as milliseconds. */
661 bool acquireUptime(LONG64 &iUpTime);
662
663#ifdef VBOX_WITH_DEBUGGER_GUI
664 /** Makes sure debugger GUI is created. */
665 bool dbgCreated(void *pActionDebug);
666 /** Makes sure debugger GUI is destroyed. */
667 void dbgDestroy();
668
669 /** Shows debugger UI statistics window. */
670 void dbgShowStatistics();
671 /** Shows debugger UI command line window. */
672 void dbgShowCommandLine();
673
674 /** Adjusts relative position for debugger window. */
675 void dbgAdjustRelativePos();
676#endif /* VBOX_WITH_DEBUGGER_GUI */
677 /** @} */
678
679 /** @name Close stuff.
680 ** @{ */
681 /** Returns whether VM is in 'manual-override' mode.
682 * @note S.a. #m_fIsManualOverride description for more information. */
683 bool isManualOverrideMode() const { return m_fIsManualOverride; }
684 /** Defines whether VM is in 'manual-override' mode.
685 * @note S.a. #m_fIsManualOverride description for more information. */
686 void setManualOverrideMode(bool fIsManualOverride) { m_fIsManualOverride = fIsManualOverride; }
687
688 /** Returns default close action. */
689 MachineCloseAction defaultCloseAction() const { return m_defaultCloseAction; }
690 /** Returns merged restricted close actions. */
691 MachineCloseAction restrictedCloseActions() const { return m_restrictedCloseActions; }
692
693 /** Acquires whether guest @a fEntered ACPI mode. */
694 bool acquireWhetherGuestEnteredACPIMode(bool &fEntered);
695
696 /** Returns whether qpp quit is requested. */
697 bool isQuitRequested() const { return m_fQuitRequested; }
698
699 /** Detaches and closes Runtime UI. */
700 void detachUi();
701 /** Saves VM state, then closes Runtime UI. */
702 void saveState();
703 /** Calls for guest shutdown to close Runtime UI. */
704 void shutdown();
705 /** Powers VM off, then closes Runtime UI. */
706 void powerOff(bool fIncludingDiscard);
707 /** @} */
708
709 /** @name VM information stuff.
710 ** @{ */
711 /** Return general info. of the machine(). */
712 void generateMachineInformationGeneral(const UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral &fOptions,
713 UITextTable &returnTable);
714 /** Return system info. of the machine(). */
715 void generateMachineInformationSystem(const UIExtraDataMetaDefs::DetailsElementOptionTypeSystem &fOptions,
716 UITextTable &returnTable);
717 /** Returns system info. of the machine(). */
718 void generateMachineInformationDisplay(const UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay &fOptions,
719 UITextTable &returnTable);
720 /** Returns storage info. of the machine(). */
721 void generateMachineInformationStorage(const UIExtraDataMetaDefs::DetailsElementOptionTypeStorage &fOptions,
722 UITextTable &returnTable);
723 /** Returns audio info. of the machine(). */
724 void generateMachineInformationAudio(const UIExtraDataMetaDefs::DetailsElementOptionTypeAudio &fOptions,
725 UITextTable &returnTable);
726 /** Returns network info. of the machine(). */
727 void generateMachineInformationNetwork(const UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork &fOptions,
728 UITextTable &returnTable);
729 /** Returns serial info. of the machine(). */
730 void generateMachineInformationSerial(const UIExtraDataMetaDefs::DetailsElementOptionTypeSerial &fOptions,
731 UITextTable &returnTable);
732 /** Returns USB info. of the machine(). */
733 void generateMachineInformationUSB(const UIExtraDataMetaDefs::DetailsElementOptionTypeUsb &fOptions,
734 UITextTable &returnTable);
735 /** Returns shared folders info. of the machine(). */
736 void generateMachineInformationSharedFolders(const UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders &fOptions,
737 UITextTable &returnTable);
738 /** @} */
739
740public slots:
741
742 /** @name Guest additions stuff.
743 ** @{ */
744 /** Handles request to install guest additions image.
745 * @param strSource Brings the source of image being installed. */
746 void sltInstallGuestAdditionsFrom(const QString &strSource);
747 /** Mounts DVD adhoc.
748 * @param strSource Brings the source of image being mounted. */
749 void sltMountDVDAdHoc(const QString &strSource);
750 /** @} */
751
752 /** @name Clipboard stuff.
753 ** @{ */
754 /** Handles clipboard errors. */
755 void sltClipboardError(QString strId, QString strMsg, long rcError);
756 /** @} */
757
758 /** @name Keyboard stuff.
759 ** @{ */
760 /** Defines @a iKeyboardState. */
761 void setKeyboardState(int iKeyboardState) { m_iKeyboardState = iKeyboardState; emit sigKeyboardStateChange(m_iKeyboardState); }
762 /** @} */
763
764 /** @name Mouse stuff.
765 ** @{ */
766 /** Defines @a iMouseState. */
767 void setMouseState(int iMouseState) { m_iMouseState = iMouseState; emit sigMouseStateChange(m_iMouseState); }
768 /** @} */
769
770 /** @name Close stuff.
771 ** @{ */
772 /** Closes Runtime UI. */
773 void closeRuntimeUI();
774 /** @} */
775
776private slots:
777
778 /** Visual state-change handler. */
779 void sltChangeVisualState(UIVisualStateType enmVisualStateType);
780
781 /** @name COM events stuff.
782 ** @{ */
783 /** Handles additions state actual change signal. */
784 void sltHandleAdditionsActualChange();
785 /** Handles audio adapter change signal. */
786 void sltHandleAudioAdapterChange();
787 /** Handles recording change signal. */
788 void sltHandleRecordingChange();
789 /** Handles storage device change for @a attachment, which was @a fRemoved and it was @a fSilent for guest. */
790 void sltHandleStorageDeviceChange(const CMediumAttachment &comAttachment, bool fRemoved, bool fSilent);
791 /** Handles VRDE change signal. */
792 void sltHandleVRDEChange();
793 /** @} */
794
795 /** @name Actions stuff.
796 ** @{ */
797#ifdef VBOX_WS_MAC
798 /** macOS X: Handles menu-bar configuration-change. */
799 void sltHandleMenuBarConfigurationChange(const QUuid &uMachineID);
800#endif
801 /** @} */
802
803 /** @name Host-screen stuff.
804 ** @{ */
805 /** Handles host-screen count change. */
806 void sltHandleHostScreenCountChange();
807 /** Handles host-screen geometry change. */
808 void sltHandleHostScreenGeometryChange();
809 /** Handles host-screen available-area change. */
810 void sltHandleHostScreenAvailableAreaChange();
811#ifdef VBOX_WS_MAC
812 /** macOS X: Restarts display-reconfiguration watchdog timer from the beginning.
813 * @note Watchdog is trying to determine display reconfiguration in
814 * UISession::sltCheckIfHostDisplayChanged() slot every 500ms for 40 tries. */
815 void sltHandleHostDisplayAboutToChange();
816 /** MacOS X: Determines display reconfiguration.
817 * @note Calls for UISession::sltHandleHostScreenCountChange() if screen count changed.
818 * @note Calls for UISession::sltHandleHostScreenGeometryChange() if screen geometry changed. */
819 void sltCheckIfHostDisplayChanged();
820#endif /* VBOX_WS_MAC */
821 /** @} */
822
823 /** @name Guest-screen stuff.
824 ** @{ */
825 /** Handles guest-monitor state change. */
826 void sltHandleGuestMonitorChange(KGuestMonitorChangedEventType enmChangeType, ulong uScreenId, QRect screenGeo);
827 /** @} */
828
829 /** @name Keyboard stuff.
830 ** @{ */
831 /** Handles signal about keyboard LEDs change.
832 * @param fNumLock Brings NUM lock status.
833 * @param fCapsLock Brings CAPS lock status.
834 * @param fScrollLock Brings SCROLL lock status. */
835 void sltHandleKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock);
836
837 /** Handles signal about keyboard LEDs sync state change.
838 * @param fEnabled Brings sync status. */
839 void sltHidLedsSyncStateChanged(bool fEnabled) { m_fIsHidLedsSyncEnabled = fEnabled; }
840 /** @} */
841
842 /** @name Mouse stuff.
843 ** @{ */
844 /** Handles signal about mouse pointer shape data change.
845 * @param shapeData Brings complex struct describing mouse pointer shape aspects. */
846 void sltMousePointerShapeChange(const UIMousePointerShapeData &shapeData);
847 /** Handles signal about mouse capability change.
848 * @param fSupportsAbsolute Brings whether mouse supports absolute coordinates.
849 * @param fSupportsRelative Brings whether mouse supports relative coordinates.
850 * @param fSupportsTouchScreen Brings whether touch screen is supported.
851 * @param fSupportsTouchPad Brings whether touch pad is supported.
852 * @param fNeedsHostCursor Brings whether guest requires host cursor to be shown. */
853 void sltMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative,
854 bool fSupportsTouchScreen, bool fSupportsTouchPad,
855 bool fNeedsHostCursor);
856 /** Handles signal about guest request to change the cursor position to @a uX * @a uY.
857 * @param fContainsData Brings whether the @a uX and @a uY values are valid and could be used by the GUI now.
858 * @param uX Brings cursor position X origin.
859 * @param uY Brings cursor position Y origin. */
860 void sltCursorPositionChange(bool fContainsData,
861 unsigned long uX,
862 unsigned long uY);
863 /** @} */
864
865private:
866
867 /** Constructs machine UI singleton. */
868 UIMachine();
869 /** Destructs machine UI singleton. */
870 virtual ~UIMachine() RT_OVERRIDE RT_FINAL;
871
872 /** Prepare routine. */
873 bool prepare();
874 /** Prepares notification-center. */
875 void prepareNotificationCenter();
876 /** Prepare routine: Session stuff. */
877 bool prepareSession();
878 /** Prepare routine: Actions stuff. */
879 void prepareActions();
880 /** Prepare routine: Host-screen data stuff. */
881 void prepareHostScreenData();
882 /** Prepare routine: Keyboard stuff. */
883 void prepareKeyboard();
884 /** Prepare routine: Close stuff. */
885 void prepareClose();
886 /** Prepare routine: Visual-state stuff. */
887 void prepareVisualState();
888
889 /** Update routine: Branding. */
890 void updateBranding();
891 /** Update routine: Guest screen data stuff. */
892 void updateGuestScreenData();
893
894 /** Moves VM to initial state. */
895 void enterInitialVisualState();
896
897 /** Cleanup routine: Machine-logic stuff. */
898 void cleanupMachineLogic();
899 /** Cleanup routine: Branding. */
900 void cleanupBranding();
901 /** Cleanup routine: Host-screen data stuff. */
902 void cleanupHostScreenData();
903 /** Cleanup routine: Actions stuff. */
904 void cleanupActions();
905 /** Cleanup routine: Session stuff. */
906 void cleanupSession();
907 /** Cleanups notification-center. */
908 void cleanupNotificationCenter();
909 /** Cleanup routine. */
910 void cleanup();
911
912 /** @name Actions stuff.
913 ** @{ */
914 /** Updates action restrictions. */
915 void updateActionRestrictions();
916
917#ifdef VBOX_WS_MAC
918 /** macOS X: Updates menu-bar content. */
919 void updateMenu();
920#endif
921 /** @} */
922
923 /** @name Host-screen stuff.
924 ** @{ */
925 /** Update host-screen data. */
926 void updateHostScreenData();
927 /** @} */
928
929 /** @name Mouse stuff.
930 ** @{ */
931 /** Updates mouse pointer shape. */
932 void updateMousePointerShape();
933
934 /** Updates mouse states. */
935 void updateMouseState();
936
937#if defined(VBOX_WS_NIX) || defined(VBOX_WS_MAC)
938 /** Generate a BGRA bitmap which approximates a XOR/AND mouse pointer.
939 *
940 * Pixels which has 1 in the AND mask and not 0 in the XOR mask are replaced by
941 * the inverted pixel and 8 surrounding pixels with the original color.
942 * Fort example a white pixel (W) is replaced with a black (B) pixel:
943 * WWW
944 * W -> WBW
945 * WWW
946 * The surrounding pixels are written only if the corresponding source pixel
947 * does not affect the screen, i.e. AND bit is 1 and XOR value is 0. */
948 static void renderCursorPixels(const uint32_t *pu32XOR, const uint8_t *pu8AND,
949 uint32_t u32Width, uint32_t u32Height,
950 uint32_t *pu32Pixels, uint32_t cbPixels);
951#endif /* VBOX_WS_NIX || VBOX_WS_MAC */
952
953#ifdef VBOX_WS_WIN
954 /** Windows: Returns whether pointer of 1bpp depth. */
955 static bool isPointer1bpp(const uint8_t *pu8XorMask,
956 uint uWidth,
957 uint uHeight);
958#endif /* VBOX_WS_WIN */
959 /** @} */
960
961 /** @name Virtualization stuff.
962 ** @{ */
963 /** Updates virtualization state. */
964 void updateVirtualizationState();
965 /** @} */
966
967 /** Holds the static instance. */
968 static UIMachine *s_pInstance;
969
970 /** Holds whether machine is initialized. */
971 bool m_fInitialized;
972
973 /** Holds the session UI instance. */
974 UISession *m_pSession;
975
976 /** Holds allowed visual states. */
977 UIVisualStateType m_enmAllowedVisualStates;
978 /** Holds initial visual state. */
979 UIVisualStateType m_enmInitialVisualState;
980 /** Holds current visual state. */
981 UIVisualStateType m_enmVisualState;
982 /** Holds visual state which should be entered when possible. */
983 UIVisualStateType m_enmRequestedVisualState;
984 /** Holds current machine-logic. */
985 UIMachineLogic *m_pMachineLogic;
986
987 /** @name Branding stuff.
988 ** @{ */
989 /** Holds the cached machine-window icon. */
990 QIcon *m_pMachineWindowIcon;
991
992#ifndef VBOX_WS_MAC
993 /** Holds redefined machine-window name postfix. */
994 QString m_strMachineWindowNamePostfix;
995#endif
996 /** @} */
997
998 /** @name Actions stuff.
999 ** @{ */
1000 /** Holds the action-pool instance. */
1001 UIActionPool *m_pActionPool;
1002
1003#ifdef VBOX_WS_MAC
1004 /** macOS X: Holds the menu-bar instance. */
1005 QMenuBar *m_pMenuBar;
1006#endif
1007 /** @} */
1008
1009 /** @name Host-screen stuff.
1010 ** @{ */
1011 /** Holds the list of host-screen geometries we currently have. */
1012 QList<QRect> m_hostScreens;
1013
1014#ifdef VBOX_WS_MAC
1015 /** macOS X: Watchdog timer looking for display reconfiguration. */
1016 QTimer *m_pWatchdogDisplayChange;
1017#endif
1018 /** @} */
1019
1020 /** @name Guest-screen stuff.
1021 ** @{ */
1022 /** Holds the list of desired guest-screen visibility flags. */
1023 QVector<bool> m_guestScreenVisibilityVectorHostDesires;
1024 /** Holds the list of actual guest-screen visibility flags. */
1025 QVector<bool> m_guestScreenVisibilityVector;
1026
1027 /** Holds the list of guest-screen full-screen sizes. */
1028 QVector<QSize> m_monitorLastFullScreenSizeVector;
1029
1030 /** Holds whether guest screen resize should be ignored. */
1031 bool m_fIsGuestResizeIgnored;
1032 /** @} */
1033
1034 /** @name Keyboard stuff.
1035 ** @{ */
1036 /** Holds the NUM lock status. */
1037 bool m_fNumLock;
1038 /** Holds the CAPS lock status. */
1039 bool m_fCapsLock;
1040 /** Holds the SCROLL lock status. */
1041 bool m_fScrollLock;
1042
1043 /** Holds the NUM lock adaption count. */
1044 uint m_uNumLockAdaptionCnt;
1045 /** Holds the CAPS lock adaption count. */
1046 uint m_uCapsLockAdaptionCnt;
1047
1048 /** Holds whether VM should perform HID LEDs synchronization. */
1049 bool m_fIsHidLedsSyncEnabled;
1050
1051 /** Holds whether auto-capture is disabled. */
1052 bool m_fIsAutoCaptureDisabled;
1053
1054 /** Holds the keyboard-state. */
1055 int m_iKeyboardState;
1056 /** @} */
1057
1058 /** @name Mouse stuff.
1059 ** @{ */
1060 /** Holds whether we should hide host mouse pointer. */
1061 bool m_fIsHidingHostPointer;
1062 /** Holds whether there is valid mouse pointer shape present. */
1063 bool m_fIsValidPointerShapePresent;
1064 /** Holds whether the @a m_cursorPosition is valid and could be used by the GUI now. */
1065 bool m_fIsValidCursorPositionPresent;
1066
1067 /** Holds whether mouse supports absolute coordinates. */
1068 bool m_fIsMouseSupportsAbsolute;
1069 /** Holds whether mouse supports relative coordinates. */
1070 bool m_fIsMouseSupportsRelative;
1071 /** Holds whether touch screen is supported. */
1072 bool m_fIsMouseSupportsTouchScreen;
1073 /** Holds whether touch pad is supported. */
1074 bool m_fIsMouseSupportsTouchPad;
1075 /** Holds whether guest requires host cursor to be shown. */
1076 bool m_fIsMouseHostCursorNeeded;
1077
1078 /** Holds whether mouse is captured. */
1079 bool m_fIsMouseCaptured;
1080 /** Holds whether mouse is integrated. */
1081 bool m_fIsMouseIntegrated;
1082
1083 /** Holds the mouse pointer shape data. */
1084 UIMousePointerShapeData m_shapeData;
1085
1086 /** Holds cached mouse cursor shape pixmap. */
1087 QPixmap m_cursorShapePixmap;
1088 /** Holds cached mouse cursor mask pixmap. */
1089 QPixmap m_cursorMaskPixmap;
1090 /** Holds cached mouse cursor size. */
1091 QSize m_cursorSize;
1092 /** Holds cached mouse cursor hotspot. */
1093 QPoint m_cursorHotspot;
1094 /** Holds cached mouse cursor position. */
1095 QPoint m_cursorPosition;
1096
1097 /** Holds the mouse-state. */
1098 int m_iMouseState;
1099 /** @} */
1100
1101 /** @name Virtualization stuff.
1102 ** @{ */
1103 /** Holds the IMachineDebugger::ExecutionEngine reference. */
1104 KVMExecutionEngine m_enmVMExecutionEngine;
1105
1106 /** Holds whether nested-paging CPU hardware virtualization extension is enabled. */
1107 bool m_fIsHWVirtExNestedPagingEnabled;
1108 /** Holds whether the VM is currently making use of the unrestricted execution feature of VT-x. */
1109 bool m_fIsHWVirtExUXEnabled;
1110
1111 /** Holds the VM's effective paravirtualization provider. */
1112 KParavirtProvider m_enmParavirtProvider;
1113 /** @} */
1114
1115 /** @name Close stuff.
1116 ** @{ */
1117 /** Holds whether VM is in 'manual-override' mode
1118 * which means there will be no automatic UI shutdowns,
1119 * visual representation mode changes and other stuff. */
1120 bool m_fIsManualOverride : 1;
1121
1122 /** Default close action. */
1123 MachineCloseAction m_defaultCloseAction;
1124 /** Merged restricted close actions. */
1125 MachineCloseAction m_restrictedCloseActions;
1126
1127 /** Holds whether app quit is requested. */
1128 bool m_fQuitRequested;
1129 /** @} */
1130};
1131
1132#define gpMachine UIMachine::instance()
1133
1134#endif /* !FEQT_INCLUDED_SRC_runtime_UIMachine_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use