VirtualBox

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

Last change on this file since 40257 was 33591, checked in by vboxsync, 14 years ago

VBoxHeadless: export Framebuffer.h, .cpp to OSE.

  • 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 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
72private:
73 /* If the format is Opaque, then internal memory buffer is used.
74 * Otherwise guest VRAM is used directly.
75 */
76 ULONG mPixelFormat;
77
78 void *mBuffer;
79
80 uint8_t *mScreen;
81 ULONG mWidth;
82 ULONG mHeight;
83 ULONG mBitsPerPixel;
84 ULONG mBytesPerLine;
85
86 BOOL mUsesGuestVRAM;
87
88 RTCRITSECT m_CritSect;
89
90#ifndef VBOX_WITH_XPCOM
91 long refcnt;
92#endif
93};
94
95
96#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