VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.h@ 1628

Last change on this file since 1628 was 1550, checked in by vboxsync, 18 years ago

don't include VBoxGuest.h if we don't need to because it drags in ostypes.h and that conflicts with a core darwin type.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/** @file
2 *
3 * VBox frontends: Basic Frontend (BFE):
4 * Declaration of VMDisplay class
5 */
6
7/*
8 * Copyright (C) 2006 InnoTek Systemberatung GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * If you received this file as part of a commercial VirtualBox
19 * distribution, then only the terms of your commercial VirtualBox
20 * license agreement apply instead of the previous paragraph.
21 */
22
23#ifndef ____H_DISPLAYIMPL
24#define ____H_DISPLAYIMPL
25
26#include <iprt/semaphore.h>
27#include <VBox/pdm.h>
28
29#include "Framebuffer.h"
30struct _VBVACMDHDR;
31
32class VMDisplay
33{
34
35public:
36
37 VMDisplay();
38 ~VMDisplay();
39
40 // public methods only for internal purposes
41 void handleDisplayResize (int w, int h);
42 void handleDisplayUpdate (int x, int y, int cx, int cy);
43
44 int VideoAccelEnable (bool fEnable, struct _VBVAMEMORY *pVbvaMemory);
45 void VideoAccelFlush (void);
46 bool VideoAccelAllowed (void);
47
48 void updatePointerShape(bool fVisible, bool fAlpha, uint32_t xHot, uint32_t yHot, uint32_t width, uint32_t height, void *pShape);
49
50 static const PDMDRVREG DrvReg;
51
52 uint32_t getWidth();
53 uint32_t getHeight();
54 uint32_t getColorDepth();
55
56 STDMETHODIMP RegisterExternalFramebuffer(Framebuffer *Framebuffer);
57 STDMETHODIMP InvalidateAndUpdate();
58 STDMETHODIMP ResizeCompleted();
59
60 void resetFramebuffer();
61
62
63private:
64
65 void updateDisplayData();
66
67 static DECLCALLBACK(void*) drvQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface);
68 static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle);
69 static DECLCALLBACK(void) displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy);
70 static DECLCALLBACK(void) displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
71 uint32_t x, uint32_t y, uint32_t cx, uint32_t cy);
72 static DECLCALLBACK(void) displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface);
73 static DECLCALLBACK(void) displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface);
74 static DECLCALLBACK(void) displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled);
75
76 static DECLCALLBACK(void) doInvalidateAndUpdate(struct DRVMAINDISPLAY *mpDrv);
77 /** Pointer to the associated display driver. */
78 struct DRVMAINDISPLAY *mpDrv;
79
80 Framebuffer *mFramebuffer;
81 bool mInternalFramebuffer, mFramebufferOpened;
82
83 ULONG mSupportedAccelOps;
84 RTSEMEVENTMULTI mResizeSem;
85 RTSEMEVENTMULTI mUpdateSem;
86
87 struct _VBVAMEMORY *mpVbvaMemory;
88 bool mfVideoAccelEnabled;
89
90 struct _VBVAMEMORY *mpPendingVbvaMemory;
91 bool mfPendingVideoAccelEnable;
92 bool mfMachineRunning;
93
94 uint8_t *mpu8VbvaPartial;
95 uint32_t mcbVbvaPartial;
96
97 bool vbvaFetchCmd (struct _VBVACMDHDR **ppHdr, uint32_t *pcbCmd);
98 void vbvaReleaseCmd (struct _VBVACMDHDR *pHdr, int32_t cbCmd);
99};
100
101extern VMDisplay *gDisplay;
102
103#endif // ____H_DISPLAYIMPL
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette