1 | /* $Id: GraphicsAdapterImpl.h 106080 2024-09-18 12:38:27Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Implementation of IGraphicsAdapter in VBoxSVC - Header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-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 MAIN_INCLUDED_GraphicsAdapterImpl_h
|
---|
29 | #define MAIN_INCLUDED_GraphicsAdapterImpl_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "GraphicsAdapterWrap.h"
|
---|
35 |
|
---|
36 |
|
---|
37 | namespace settings
|
---|
38 | {
|
---|
39 | struct GraphicsAdapter;
|
---|
40 | };
|
---|
41 |
|
---|
42 |
|
---|
43 | class ATL_NO_VTABLE GraphicsAdapter :
|
---|
44 | public GraphicsAdapterWrap
|
---|
45 | {
|
---|
46 | public:
|
---|
47 |
|
---|
48 | DECLARE_COMMON_CLASS_METHODS(GraphicsAdapter)
|
---|
49 |
|
---|
50 | HRESULT FinalConstruct();
|
---|
51 | void FinalRelease();
|
---|
52 |
|
---|
53 | // public initializer/uninitializer for internal purposes only
|
---|
54 | HRESULT init(Machine *aParent);
|
---|
55 | HRESULT init(Machine *aParent, GraphicsAdapter *aThat);
|
---|
56 | HRESULT initCopy(Machine *aParent, GraphicsAdapter *aThat);
|
---|
57 | void uninit();
|
---|
58 |
|
---|
59 |
|
---|
60 | // public methods only for internal purposes
|
---|
61 | HRESULT i_loadSettings(const settings::GraphicsAdapter &data);
|
---|
62 | HRESULT i_saveSettings(settings::GraphicsAdapter &data);
|
---|
63 |
|
---|
64 | void i_rollback();
|
---|
65 | void i_commit();
|
---|
66 | void i_copyFrom(GraphicsAdapter *aThat);
|
---|
67 | bool *i_getFeatureMemberBool(GraphicsFeature_T aFeature);
|
---|
68 | void i_updateFeatures();
|
---|
69 |
|
---|
70 | private:
|
---|
71 |
|
---|
72 | // wrapped IGraphicsAdapter properties
|
---|
73 | HRESULT getGraphicsControllerType(GraphicsControllerType_T *aGraphicsControllerType);
|
---|
74 | HRESULT setGraphicsControllerType(GraphicsControllerType_T aGraphicsControllerType);
|
---|
75 | HRESULT getVRAMSize(ULONG *aVRAMSize);
|
---|
76 | HRESULT setVRAMSize(ULONG aVRAMSize);
|
---|
77 | HRESULT setFeature(GraphicsFeature_T aFeature, BOOL aEnabled);
|
---|
78 | HRESULT isFeatureEnabled(GraphicsFeature_T aFeature, BOOL *aEnabled);
|
---|
79 | HRESULT getMonitorCount(ULONG *aMonitorCount);
|
---|
80 | HRESULT setMonitorCount(ULONG aMonitorCount);
|
---|
81 |
|
---|
82 | Machine * const mParent;
|
---|
83 | const ComObjPtr<GraphicsAdapter> mPeer;
|
---|
84 | Backupable<settings::GraphicsAdapter> mData;
|
---|
85 | };
|
---|
86 |
|
---|
87 | #endif /* !MAIN_INCLUDED_GraphicsAdapterImpl_h */
|
---|
88 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|