1 | /* $Id: UIMachineLogicSeamless.h 76553 2019-01-01 01:45:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineLogicSeamless class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___UIMachineLogicSeamless_h___
|
---|
19 | #define ___UIMachineLogicSeamless_h___
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* Local includes: */
|
---|
25 | #include "UIMachineLogic.h"
|
---|
26 |
|
---|
27 | /* Forward declarations: */
|
---|
28 | class UIMultiScreenLayout;
|
---|
29 |
|
---|
30 | /* Seamless machine logic implementation: */
|
---|
31 | class UIMachineLogicSeamless : public UIMachineLogic
|
---|
32 | {
|
---|
33 | Q_OBJECT;
|
---|
34 |
|
---|
35 | protected:
|
---|
36 |
|
---|
37 | /* Constructor/destructor: */
|
---|
38 | UIMachineLogicSeamless(QObject *pParent, UISession *pSession);
|
---|
39 | ~UIMachineLogicSeamless();
|
---|
40 |
|
---|
41 | /* Check if this logic is available: */
|
---|
42 | bool checkAvailability();
|
---|
43 |
|
---|
44 | /** Returns machine-window flags for 'Seamless' machine-logic and passed @a uScreenId. */
|
---|
45 | virtual Qt::WindowFlags windowFlags(ulong uScreenId) const { Q_UNUSED(uScreenId); return Qt::FramelessWindowHint; }
|
---|
46 |
|
---|
47 | /** Adjusts machine-window geometry if necessary for 'Seamless'. */
|
---|
48 | virtual void adjustMachineWindowsGeometry();
|
---|
49 |
|
---|
50 | /* Helpers: Multi-screen stuff: */
|
---|
51 | int hostScreenForGuestScreen(int iScreenId) const;
|
---|
52 | bool hasHostScreenForGuestScreen(int iScreenId) const;
|
---|
53 |
|
---|
54 | /* API: 3D overlay visibility stuff: */
|
---|
55 | void notifyAbout3DOverlayVisibilityChange(bool fVisible);
|
---|
56 |
|
---|
57 | private slots:
|
---|
58 |
|
---|
59 | /** Checks if some visual-state type was requested. */
|
---|
60 | void sltCheckForRequestedVisualStateType();
|
---|
61 |
|
---|
62 | /* Handler: Console callback stuff: */
|
---|
63 | void sltMachineStateChanged();
|
---|
64 |
|
---|
65 | /** Updates machine-window(s) location/size on screen-layout changes. */
|
---|
66 | void sltScreenLayoutChanged();
|
---|
67 |
|
---|
68 | /** Handles guest-screen count change. */
|
---|
69 | virtual void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
|
---|
70 | /** Handles host-screen count change. */
|
---|
71 | virtual void sltHostScreenCountChange();
|
---|
72 | /** Handles additions-state change. */
|
---|
73 | virtual void sltAdditionsStateChanged();
|
---|
74 |
|
---|
75 | #ifndef RT_OS_DARWIN
|
---|
76 | /** Invokes popup-menu. */
|
---|
77 | void sltInvokePopupMenu();
|
---|
78 | #endif /* !RT_OS_DARWIN */
|
---|
79 |
|
---|
80 | private:
|
---|
81 |
|
---|
82 | /* Prepare helpers: */
|
---|
83 | void prepareActionGroups();
|
---|
84 | void prepareActionConnections();
|
---|
85 | void prepareMachineWindows();
|
---|
86 | #ifndef VBOX_WS_MAC
|
---|
87 | void prepareMenu();
|
---|
88 | #endif /* !VBOX_WS_MAC */
|
---|
89 |
|
---|
90 | /* Cleanup helpers: */
|
---|
91 | #ifndef VBOX_WS_MAC
|
---|
92 | void cleanupMenu();
|
---|
93 | #endif /* !VBOX_WS_MAC */
|
---|
94 | void cleanupMachineWindows();
|
---|
95 | void cleanupActionConnections();
|
---|
96 | void cleanupActionGroups();
|
---|
97 |
|
---|
98 | /* Variables: */
|
---|
99 | UIMultiScreenLayout *m_pScreenLayout;
|
---|
100 |
|
---|
101 | #ifndef RT_OS_DARWIN
|
---|
102 | /** Holds the popup-menu instance. */
|
---|
103 | QMenu *m_pPopupMenu;
|
---|
104 | #endif /* !RT_OS_DARWIN */
|
---|
105 |
|
---|
106 | /* Friend classes: */
|
---|
107 | friend class UIMachineLogic;
|
---|
108 | friend class UIMachineWindowSeamless;
|
---|
109 | friend class UIMachineViewSeamless;
|
---|
110 | };
|
---|
111 |
|
---|
112 | #endif /* !___UIMachineLogicSeamless_h___ */
|
---|
113 |
|
---|