VirtualBox

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

Last change on this file since 4225 was 4071, checked in by vboxsync, 18 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • 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-2007 innotek 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
19#ifndef ____H_DISPLAYIMPL
20#define ____H_DISPLAYIMPL
21
22#include <iprt/semaphore.h>
23#include <VBox/pdm.h>
24
25#include "Framebuffer.h"
26struct _VBVACMDHDR;
27
28class VMDisplay
29{
30
31public:
32
33 VMDisplay();
34 ~VMDisplay();
35
36 // public methods only for internal purposes
37 int handleDisplayResize (int w, int h);
38 void handleDisplayUpdate (int x, int y, int cx, int cy);
39
40 int VideoAccelEnable (bool fEnable, struct _VBVAMEMORY *pVbvaMemory);
41 void VideoAccelFlush (void);
42 bool VideoAccelAllowed (void);
43
44 void updatePointerShape(bool fVisible, bool fAlpha, uint32_t xHot, uint32_t yHot, uint32_t width, uint32_t height, void *pShape);
45 void SetVideoModeHint(ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel, ULONG aDisplay);
46
47 static const PDMDRVREG DrvReg;
48
49 uint32_t getWidth();
50 uint32_t getHeight();
51 uint32_t getBitsPerPixel();
52
53 STDMETHODIMP RegisterExternalFramebuffer(Framebuffer *Framebuffer);
54 STDMETHODIMP InvalidateAndUpdate();
55 STDMETHODIMP ResizeCompleted();
56
57 void resetFramebuffer();
58
59
60private:
61
62 void updateDisplayData();
63
64 static DECLCALLBACK(void*) drvQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface);
65 static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle);
66 static DECLCALLBACK(int) displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy);
67 static DECLCALLBACK(void) displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
68 uint32_t x, uint32_t y, uint32_t cx, uint32_t cy);
69 static DECLCALLBACK(void) displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface);
70 static DECLCALLBACK(void) displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface);
71 static DECLCALLBACK(void) displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled);
72
73 static DECLCALLBACK(void) doInvalidateAndUpdate(struct DRVMAINDISPLAY *mpDrv);
74 /** Pointer to the associated display driver. */
75 struct DRVMAINDISPLAY *mpDrv;
76
77 Framebuffer *mFramebuffer;
78 bool mInternalFramebuffer, mFramebufferOpened;
79
80 ULONG mSupportedAccelOps;
81 RTSEMEVENTMULTI mUpdateSem;
82
83 struct _VBVAMEMORY *mpVbvaMemory;
84 bool mfVideoAccelEnabled;
85
86 struct _VBVAMEMORY *mpPendingVbvaMemory;
87 bool mfPendingVideoAccelEnable;
88 bool mfMachineRunning;
89
90 uint8_t *mpu8VbvaPartial;
91 uint32_t mcbVbvaPartial;
92
93 bool vbvaFetchCmd (struct _VBVACMDHDR **ppHdr, uint32_t *pcbCmd);
94 void vbvaReleaseCmd (struct _VBVACMDHDR *pHdr, int32_t cbCmd);
95
96 void handleResizeCompletedEMT (void);
97 volatile uint32_t mu32ResizeStatus;
98
99 enum {
100 ResizeStatus_Void,
101 ResizeStatus_InProgress,
102 ResizeStatus_UpdateDisplayData
103 };
104};
105
106extern VMDisplay *gDisplay;
107
108#endif // ____H_DISPLAYIMPL
Note: See TracBrowser for help on using the repository browser.

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