VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxHeadless/Framebuffer.h@ 49432

Last change on this file since 49432 was 45940, checked in by vboxsync, 12 years ago

crOpenGL->Fe/Qt notification mechanism

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1/** @file
2 *
3 * VBox Remote Desktop Framebuffer.
4 */
5
6/*
7 * Copyright (C) 2010-2012 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.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#ifndef __VRDP__FRAMEBUFFER__H
19#define __VRDP__FRAMEBUFFER__H
20
21#include <VBox/com/VirtualBox.h>
22
23#include <iprt/critsect.h>
24
25class VRDPFramebuffer :
26 VBOX_SCRIPTABLE_IMPL(IFramebuffer)
27{
28public:
29 VRDPFramebuffer();
30 virtual ~VRDPFramebuffer();
31
32#ifndef VBOX_WITH_XPCOM
33 STDMETHOD_(ULONG, AddRef)() {
34 return ::InterlockedIncrement (&refcnt);
35 }
36 STDMETHOD_(ULONG, Release)()
37 {
38 long cnt = ::InterlockedDecrement (&refcnt);
39 if (cnt == 0)
40 delete this;
41 return cnt;
42 }
43#endif
44 VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer)
45
46 NS_DECL_ISUPPORTS
47
48 STDMETHOD(COMGETTER(Width))(ULONG *width);
49 STDMETHOD(COMGETTER(Height))(ULONG *height);
50 STDMETHOD(Lock)();
51 STDMETHOD(Unlock)();
52 STDMETHOD(COMGETTER(Address))(BYTE **address);
53 STDMETHOD(COMGETTER(BitsPerPixel))(ULONG *bitsPerPixel);
54 STDMETHOD(COMGETTER(BytesPerLine))(ULONG *bytesPerLine);
55 STDMETHOD(COMGETTER(PixelFormat)) (ULONG *pixelFormat);
56 STDMETHOD(COMGETTER(UsesGuestVRAM)) (BOOL *usesGuestVRAM);
57 STDMETHOD(COMGETTER(HeightReduction)) (ULONG *heightReduction);
58 STDMETHOD(COMGETTER(Overlay)) (IFramebufferOverlay **aOverlay);
59 STDMETHOD(COMGETTER(WinId)) (LONG64 *winId);
60
61 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h);
62 STDMETHOD(RequestResize)(ULONG aScreenId, ULONG pixelFormat, BYTE *vram,
63 ULONG bitsPerPixel, ULONG bytesPerLine, ULONG w, ULONG h,
64 BOOL *finished);
65 STDMETHOD(VideoModeSupported)(ULONG width, ULONG height, ULONG bpp, BOOL *supported);
66
67 STDMETHOD(GetVisibleRegion)(BYTE *aRectangles, ULONG aCount, ULONG *aCountCopied);
68 STDMETHOD(SetVisibleRegion)(BYTE *aRectangles, ULONG aCount);
69
70 STDMETHOD(ProcessVHWACommand)(BYTE *pCommand);
71
72 STDMETHOD(Notify3DEvent)(ULONG uType, BYTE *pReserved);
73private:
74 /* If the format is Opaque, then internal memory buffer is used.
75 * Otherwise guest VRAM is used directly.
76 */
77 ULONG mPixelFormat;
78
79 void *mBuffer;
80
81 uint8_t *mScreen;
82 ULONG mWidth;
83 ULONG mHeight;
84 ULONG mBitsPerPixel;
85 ULONG mBytesPerLine;
86
87 BOOL mUsesGuestVRAM;
88
89 RTCRITSECT m_CritSect;
90
91#ifndef VBOX_WITH_XPCOM
92 long refcnt;
93#endif
94};
95
96
97#endif /* __VRDP__FRAMEBUFFER__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