VirtualBox

source: vbox/trunk/src/VBox/Main/include/FramebufferImpl.h@ 16560

Last change on this file since 16560 was 14972, checked in by vboxsync, 15 years ago

#3285: Improve error handling API to include unique error numbers

The mega commit that implements Main-wide usage of new CheckCom*
macros, mostly CheckComArgNotNull, CheckComArgStrNotEmptyOrNull,
CheckComArgOutSafeArrayPointerValid, CheckComArgExpr.
Note that some methods incorrectly returned E_INVALIDARG where they
should have returned E_POINTER and vice versa. If any higher level
function tests these, they will behave differently now...

Special thanks to: vi macros, making it easy to semi-automatically
find and replace several hundred instances of if (!aName) ...

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/** @file
2 *
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef ____H_FRAMEBUFFERIMPL
23#define ____H_FRAMEBUFFERIMPL
24
25#include "VirtualBoxBase.h"
26
27
28class ATL_NO_VTABLE InternalFramebuffer :
29 public VirtualBoxBase,
30 public IFramebuffer
31{
32public:
33 InternalFramebuffer();
34 virtual ~InternalFramebuffer();
35
36 DECLARE_NOT_AGGREGATABLE(InternalFramebuffer)
37
38 DECLARE_PROTECT_FINAL_CONSTRUCT()
39
40 BEGIN_COM_MAP(InternalFramebuffer)
41 COM_INTERFACE_ENTRY(IFramebuffer)
42 END_COM_MAP()
43
44 NS_DECL_ISUPPORTS
45
46 // public methods only for internal purposes
47 HRESULT init (ULONG width, ULONG height, ULONG depth);
48
49 // IFramebuffer properties
50 STDMETHOD(COMGETTER(Address)) (BYTE **address);
51 STDMETHOD(COMGETTER(Width)) (ULONG *width);
52 STDMETHOD(COMGETTER(Height)) (ULONG *height);
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)) (ULONG64 *winId);
60
61 // IFramebuffer methods
62 STDMETHOD(Lock)();
63 STDMETHOD(Unlock)();
64 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y,
65 ULONG w, ULONG h,
66 BOOL *finished);
67 STDMETHOD(RequestResize)(ULONG uScreenId, ULONG pixelFormat, BYTE *vram,
68 ULONG bpp, ULONG bpl, ULONG w, ULONG h,
69 BOOL *finished);
70 STDMETHOD(OperationSupported)(FramebufferAccelerationOperation_T operation,
71 BOOL *supported);
72 STDMETHOD(VideoModeSupported)(ULONG width, ULONG height, ULONG bpp, BOOL *supported);
73 STDMETHOD(SolidFill)(ULONG x, ULONG y, ULONG width, ULONG height,
74 ULONG color, BOOL *handled);
75 STDMETHOD(CopyScreenBits)(ULONG xDst, ULONG yDst, ULONG xSrc, ULONG ySrc,
76 ULONG width, ULONG height, BOOL *handled);
77
78 STDMETHOD(GetVisibleRegion)(BYTE *aRectangles, ULONG aCount, ULONG *aCountCopied);
79 STDMETHOD(SetVisibleRegion)(BYTE *aRectangles, ULONG aCount);
80
81private:
82 // FIXME: declare these here until VBoxSupportsTranslation base
83 // is available in this class.
84 static const char *tr (const char *a) { return a; }
85 static HRESULT setError (HRESULT rc, const char *a,
86 const char *b, void *c) { return rc; }
87
88 int mWidth;
89 int mHeight;
90 int mBitsPerPixel;
91 int mBytesPerLine;
92 uint8_t *mData;
93 RTSEMMUTEX mMutex;
94};
95
96
97#endif // ____H_FRAMEBUFFERIMPL
98/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use