1 | /* $Id: UIMachineWindowSeamless.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineWindowSeamless class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2024 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_seamless_UIMachineWindowSeamless_h
|
---|
29 | #define FEQT_INCLUDED_SRC_runtime_seamless_UIMachineWindowSeamless_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UIMachineWindow.h"
|
---|
36 |
|
---|
37 | #if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
|
---|
38 | /* Forward declarations: */
|
---|
39 | class UIMiniToolBar;
|
---|
40 | #endif /* VBOX_WS_WIN || VBOX_WS_NIX */
|
---|
41 |
|
---|
42 | /** UIMachineWindow subclass used as seamless machine window implementation. */
|
---|
43 | class UIMachineWindowSeamless : public UIMachineWindow
|
---|
44 | {
|
---|
45 | Q_OBJECT;
|
---|
46 |
|
---|
47 | public:
|
---|
48 |
|
---|
49 | /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
|
---|
50 | UIMachineWindowSeamless(UIMachineLogic *pMachineLogic, ulong uScreenId);
|
---|
51 |
|
---|
52 | private slots:
|
---|
53 |
|
---|
54 | #if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
|
---|
55 | /** Handles machine state change event. */
|
---|
56 | void sltMachineStateChanged() RT_OVERRIDE RT_FINAL;
|
---|
57 |
|
---|
58 | /** Revokes window activation. */
|
---|
59 | void sltRevokeWindowActivation();
|
---|
60 |
|
---|
61 | /** Handles signal about mini-toolbar auto-hide toggled.
|
---|
62 | * @param fEnabled Brings whether auto-hide is enabled. */
|
---|
63 | void sltHandleMiniToolBarAutoHideToggled(bool fEnabled);
|
---|
64 | #endif /* VBOX_WS_WIN || VBOX_WS_NIX */
|
---|
65 |
|
---|
66 | /** Shows window in minimized state. */
|
---|
67 | void sltShowMinimized();
|
---|
68 |
|
---|
69 | private:
|
---|
70 |
|
---|
71 | /** Prepare visual-state routine. */
|
---|
72 | void prepareVisualState() RT_OVERRIDE RT_FINAL;
|
---|
73 | #if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
|
---|
74 | /** Prepare mini-toolbar routine. */
|
---|
75 | void prepareMiniToolbar();
|
---|
76 | #endif /* VBOX_WS_WIN || VBOX_WS_NIX */
|
---|
77 |
|
---|
78 | #if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
|
---|
79 | /** Cleanup mini-toolbar routine. */
|
---|
80 | void cleanupMiniToolbar();
|
---|
81 | #endif /* VBOX_WS_WIN || VBOX_WS_NIX */
|
---|
82 | /** Cleanup visual-state routine. */
|
---|
83 | void cleanupVisualState() RT_OVERRIDE RT_FINAL;
|
---|
84 |
|
---|
85 | /** Updates geometry according to visual-state. */
|
---|
86 | void placeOnScreen();
|
---|
87 | /** Updates visibility according to visual-state. */
|
---|
88 | void showInNecessaryMode() RT_OVERRIDE RT_FINAL;
|
---|
89 |
|
---|
90 | #if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
|
---|
91 | /** Common update routine. */
|
---|
92 | void updateAppearanceOf(int iElement) RT_OVERRIDE RT_FINAL;
|
---|
93 | #endif /* VBOX_WS_WIN || VBOX_WS_NIX */
|
---|
94 |
|
---|
95 | #ifdef VBOX_WS_NIX
|
---|
96 | /** X11: Handles @a pEvent about state change. */
|
---|
97 | void changeEvent(QEvent *pEvent) RT_OVERRIDE RT_FINAL;
|
---|
98 | #endif
|
---|
99 |
|
---|
100 | #ifdef VBOX_WS_WIN
|
---|
101 | /** Win: Handles show @a pEvent. */
|
---|
102 | void showEvent(QShowEvent *pEvent);
|
---|
103 | #endif
|
---|
104 |
|
---|
105 | #ifdef VBOX_WITH_MASKED_SEAMLESS
|
---|
106 | /** Assigns guest seamless mask. */
|
---|
107 | void setMask(const QRegion &maskGuest) RT_OVERRIDE RT_FINAL;
|
---|
108 | #endif /* VBOX_WITH_MASKED_SEAMLESS */
|
---|
109 |
|
---|
110 | #if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
|
---|
111 | /** Holds the mini-toolbar instance. */
|
---|
112 | UIMiniToolBar *m_pMiniToolBar;
|
---|
113 | #endif /* VBOX_WS_WIN || VBOX_WS_NIX */
|
---|
114 |
|
---|
115 | #ifdef VBOX_WITH_MASKED_SEAMLESS
|
---|
116 | /** Holds the full seamless mask. */
|
---|
117 | QRegion m_maskFull;
|
---|
118 | /** Holds the guest seamless mask. */
|
---|
119 | QRegion m_maskGuest;
|
---|
120 | #endif /* VBOX_WITH_MASKED_SEAMLESS */
|
---|
121 |
|
---|
122 | /** Holds whether the window was minimized before became hidden.
|
---|
123 | * Used to restore minimized state when the window shown again. */
|
---|
124 | bool m_fWasMinimized;
|
---|
125 | #ifdef VBOX_WS_NIX
|
---|
126 | /** X11: Holds whether the window minimization is currently requested.
|
---|
127 | * Used to prevent accidentally restoring to seamless state. */
|
---|
128 | bool m_fIsMinimizationRequested;
|
---|
129 | /** X11: Holds whether the window is currently minimized.
|
---|
130 | * Used to restore maximized state when the window restored again. */
|
---|
131 | bool m_fIsMinimized;
|
---|
132 | #endif
|
---|
133 | };
|
---|
134 |
|
---|
135 | #endif /* !FEQT_INCLUDED_SRC_runtime_seamless_UIMachineWindowSeamless_h */
|
---|