1 | /* $Id: VBoxConsole.cpp 95966 2022-08-01 15:40:29Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxConsole.cpp - Console APIs.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.alldomusa.eu.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 | #include "VBoxTray.h"
|
---|
19 | #include "VBoxTrayInternal.h"
|
---|
20 |
|
---|
21 |
|
---|
22 | /** @todo r=andy Lacks documentation / Doxygen headers. What does this, and why? */
|
---|
23 |
|
---|
24 | BOOL VBoxConsoleIsAllowed()
|
---|
25 | {
|
---|
26 | return vboxDtIsInputDesktop() && vboxStIsActiveConsole();
|
---|
27 | }
|
---|
28 |
|
---|
29 | void VBoxConsoleEnable(BOOL fEnable)
|
---|
30 | {
|
---|
31 | if (fEnable)
|
---|
32 | VBoxCapsAcquireAllSupported();
|
---|
33 | else
|
---|
34 | VBoxCapsReleaseAll();
|
---|
35 | }
|
---|
36 |
|
---|
37 | void VBoxConsoleCapSetSupported(uint32_t iCap, BOOL fSupported)
|
---|
38 | {
|
---|
39 | if (fSupported)
|
---|
40 | {
|
---|
41 | VBoxCapsEntryFuncStateSet(iCap, VBOXCAPS_ENTRY_FUNCSTATE_SUPPORTED);
|
---|
42 |
|
---|
43 | if (VBoxConsoleIsAllowed())
|
---|
44 | VBoxCapsEntryAcquire(iCap);
|
---|
45 | }
|
---|
46 | else
|
---|
47 | {
|
---|
48 | VBoxCapsEntryFuncStateSet(iCap, VBOXCAPS_ENTRY_FUNCSTATE_UNSUPPORTED);
|
---|
49 |
|
---|
50 | VBoxCapsEntryRelease(iCap);
|
---|
51 | }
|
---|
52 | }
|
---|
53 |
|
---|