VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxBFE/Display.h@ 99548

Last change on this file since 99548 was 99546, checked in by vboxsync, 22 months ago

FE/VBoxBFE: Some very simple SDL based display output and add more devices, bugref:10397

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/* $Id: Display.h 99546 2023-04-27 12:33:12Z vboxsync $ */
2/** @file
3 * VBox frontends: Basic Frontend (BFE):
4 * Declaration of Display class
5 */
6
7/*
8 * Copyright (C) 2023 Oracle and/or its affiliates.
9 *
10 * This file is part of VirtualBox base platform packages, as
11 * available from https://www.virtualbox.org.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation, in version 3 of the
16 * License.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, see <https://www.gnu.org/licenses>.
25 *
26 * SPDX-License-Identifier: GPL-3.0-only
27 */
28
29#ifndef VBOX_INCLUDED_SRC_VBoxBFE_Display_h
30#define VBOX_INCLUDED_SRC_VBoxBFE_Display_h
31
32#include <iprt/semaphore.h>
33#include <VBox/vmm/pdm.h>
34
35#include <VBox/com/defs.h>
36#include "Framebuffer.h"
37
38class Display
39{
40
41public:
42
43 Display();
44 ~Display();
45
46 // public methods only for internal purposes
47 static const PDMDRVREG DrvReg;
48
49 uint32_t getWidth();
50 uint32_t getHeight();
51 uint32_t getBitsPerPixel();
52
53 int SetFramebuffer(unsigned iScreenID, Framebuffer *pFramebuffer);
54 void getFramebufferDimensions(int32_t *px1, int32_t *py1, int32_t *px2,
55 int32_t *py2);
56
57 void resetFramebuffer();
58
59 void setRunning(void) { mfMachineRunning = true; };
60
61 int i_handleDisplayResize(unsigned uScreenId, uint32_t bpp, void *pvVRAM,
62 uint32_t cbLine, uint32_t w, uint32_t h, uint16_t flags,
63 int32_t xOrigin, int32_t yOrigin, bool fVGAResize);
64 void i_handleDisplayUpdate (int x, int y, int w, int h);
65
66 int i_invalidateAndUpdateScreen(uint32_t aScreenId);
67
68
69private:
70
71 void updateDisplayData();
72
73 static DECLCALLBACK(void*) i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
74 static DECLCALLBACK(int) i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
75 static DECLCALLBACK(void) i_drvDestruct(PPDMDRVINS pDrvIns);
76 static DECLCALLBACK(void) i_drvPowerOff(PPDMDRVINS pDrvIns);
77 static DECLCALLBACK(int) i_displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy);
78 static DECLCALLBACK(void) i_displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
79 uint32_t x, uint32_t y, uint32_t cx, uint32_t cy);
80 static DECLCALLBACK(void) i_displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface);
81 static DECLCALLBACK(void) i_displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface);
82 static DECLCALLBACK(void) i_displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled);
83 static DECLCALLBACK(void) i_displayProcessAdapterDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize);
84 static DECLCALLBACK(void) i_displayProcessDisplayDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId);
85
86 static DECLCALLBACK(void) i_doInvalidateAndUpdate(struct DRVMAINDISPLAY *mpDrv);
87 /** Pointer to the associated display driver. */
88 struct DRVMAINDISPLAY *mpDrv;
89
90 Framebuffer *m_pFramebuffer;
91 bool mFramebufferOpened;
92
93 bool mfMachineRunning;
94 volatile bool fVGAResizing;
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
106#define DISPLAY_OID "e2ff0c7b-c02b-46d0-aa90-b9caf0f60561"
107
108#endif /* !VBOX_INCLUDED_SRC_VBoxBFE_Display_h */
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