- Timestamp:
- May 8, 2012 6:05:41 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/defs.h
r41201 r41216 506 506 kTypeLibraryMajorVersion, kTypeLibraryMinorVersion> 507 507 508 #define VBOX_SCRIPTABLE_DISPATCH_IMPL(iface) \ 509 STDMETHOD(QueryInterface)(REFIID riid , void **ppObj) \ 510 { \ 511 if (riid == IID_##iface) \ 512 { \ 513 *ppObj = (iface*)this; \ 514 AddRef(); \ 515 return S_OK; \ 516 } \ 517 if (riid == IID_IUnknown) \ 518 { \ 519 *ppObj = (IUnknown*)this; \ 520 AddRef(); \ 521 return S_OK; \ 522 } \ 523 if (riid == IID_IDispatch) \ 524 { \ 525 *ppObj = (IDispatch*)this; \ 526 AddRef(); \ 527 return S_OK; \ 528 } \ 529 *ppObj = NULL; \ 530 return E_NOINTERFACE; \ 531 } 532 533 508 534 #define VBOX_DEFAULT_INTERFACE_ENTRIES(iface) \ 509 535 COM_INTERFACE_ENTRY(ISupportErrorInfo) \ … … 514 540 #define VBOX_SCRIPTABLE_IMPL(iface) \ 515 541 public iface 542 #define VBOX_SCRIPTABLE_DISPATCH_IMPL(iface) 516 543 #define VBOX_DEFAULT_INTERFACE_ENTRIES(iface) 517 544 #endif -
trunk/src/VBox/Frontends/VBoxHeadless/Framebuffer.h
r41201 r41216 5 5 6 6 /* 7 * Copyright (C) 20 07-2012Oracle Corporation7 * Copyright (C) 2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 42 42 } 43 43 #endif 44 VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer) 44 45 45 BEGIN_COM_MAP(VRDPFramebuffer) 46 VBOX_DEFAULT_INTERFACE_ENTRIES(IFramebuffer) 47 END_COM_MAP() 46 NS_DECL_ISUPPORTS 48 47 49 48 STDMETHOD(COMGETTER(Width))(ULONG *width); -
trunk/src/VBox/Frontends/VBoxHeadless/NullFramebuffer.h
r41201 r41216 1 1 /* 2 * Copyright (C) 20 07-2012Oracle Corporation2 * Copyright (C) 2010 Oracle Corporation 3 3 * 4 4 * This file is part of VirtualBox Open Source Edition (OSE), as … … 46 46 } 47 47 #endif 48 49 BEGIN_COM_MAP(NullFB) 50 VBOX_DEFAULT_INTERFACE_ENTRIES(IFramebuffer) 51 END_COM_MAP() 48 VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer) 49 50 NS_DECL_ISUPPORTS 52 51 53 52 // public methods only for internal purposes -
trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture/FFmpegFB.h
r41203 r41216 6 6 7 7 /* 8 * Copyright (C) 2006-20 12Oracle Corporation8 * Copyright (C) 2006-2007 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 60 60 } 61 61 #endif 62 63 BEGIN_COM_MAP(FFmpegFB) 64 VBOX_DEFAULT_INTERFACE_ENTRIES(IFramebuffer) 65 END_COM_MAP() 62 VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer) 63 64 NS_DECL_ISUPPORTS 66 65 67 66 // public methods only for internal purposes -
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
r41215 r41216 75 75 // 76 76 77 HRESULT VBoxSDLFB::FinalConstruct() 78 { 79 return S_OK; 80 } 81 82 /** 83 * SDL framebuffer init method. It is called from the main 77 /** 78 * SDL framebuffer constructor. It is called from the main 84 79 * (i.e. SDL) thread. Therefore it is safe to use SDL calls 85 80 * here. 86 * @returns COM status code87 81 * @param fFullscreen flag whether we start in fullscreen mode 88 82 * @param fResizable flag whether the SDL window should be resizable … … 93 87 * @param iFixedHeight fixed SDL height (-1 means not set) 94 88 */ 95 HRESULT VBoxSDLFB::init(uint32_t uScreenId,96 97 98 89 VBoxSDLFB::VBoxSDLFB(uint32_t uScreenId, 90 bool fFullscreen, bool fResizable, bool fShowSDLConfig, 91 bool fKeepHostRes, uint32_t u32FixedWidth, 92 uint32_t u32FixedHeight, uint32_t u32FixedBPP) 99 93 { 100 94 int rc; 101 LogFlow(("VBoxSDLFB::init\n")); 95 LogFlow(("VBoxSDLFB::VBoxSDLFB\n")); 96 97 #if defined (RT_OS_WINDOWS) 98 refcnt = 0; 99 #endif 102 100 103 101 mScreenId = uScreenId; … … 140 138 Assert(mScreen); 141 139 mfInitialized = true; 142 143 return S_OK; 144 } 145 146 void VBoxSDLFB::FinalRelease() 147 { 148 uninit(); 149 } 150 151 void VBoxSDLFB::uninit() 152 { 153 LogFlow(("VBoxSDLFB::uninit\n")); 140 } 141 142 VBoxSDLFB::~VBoxSDLFB() 143 { 144 LogFlow(("VBoxSDLFB::~VBoxSDLFB\n")); 154 145 if (mSurfVRAM) 155 146 { … … 169 160 } 170 161 171 bool VBoxSDLFB::init SDL(bool fShowSDLConfig)162 bool VBoxSDLFB::init(bool fShowSDLConfig) 172 163 { 173 164 LogFlow(("VBoxSDLFB::init\n")); … … 249 240 * @remarks must be called from the SDL thread! 250 241 */ 251 void VBoxSDLFB::uninit SDL()242 void VBoxSDLFB::uninit() 252 243 { 253 244 if (gfSdlInitialized) -
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h
r41215 r41216 6 6 7 7 /* 8 * Copyright (C) 2006-20 12Oracle Corporation8 * Copyright (C) 2006-2007 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 43 43 44 44 class VBoxSDLFB : 45 public CComObjectRootEx<CComMultiThreadModelNoCS>,46 45 VBOX_SCRIPTABLE_IMPL(IFramebuffer) 47 46 { 48 47 public: 49 DECLARE_NOT_AGGREGATABLE(VBoxSDLFB) 50 51 DECLARE_PROTECT_FINAL_CONSTRUCT() 52 53 VBoxSDLFB() { /* empty */ } 54 ~VBoxSDLFB() { /* empty */ } 55 56 HRESULT FinalConstruct(); 57 void FinalRelease(); 58 59 HRESULT init(uint32_t uScreenId, 60 bool fFullscreen = false, bool fResizable = true, bool fShowSDLConfig = false, 61 bool fKeepHostRes = false, uint32_t u32FixedWidth = ~(uint32_t)0, 62 uint32_t u32FixedHeight = ~(uint32_t)0, uint32_t u32FixedBPP = ~(uint32_t)0); 63 void uninit(); 64 65 static bool initSDL(bool fShowSDLConfig); 66 static void uninitSDL(); 67 68 BEGIN_COM_MAP(VBoxSDLFB) 69 VBOX_MINIMAL_INTERFACE_ENTRIES(IFramebuffer) 70 END_COM_MAP() 48 VBoxSDLFB(uint32_t uScreenId, 49 bool fFullscreen = false, bool fResizable = true, bool fShowSDLConfig = false, 50 bool fKeepHostRes = false, uint32_t u32FixedWidth = ~(uint32_t)0, 51 uint32_t u32FixedHeight = ~(uint32_t)0, uint32_t u32FixedBPP = ~(uint32_t)0); 52 virtual ~VBoxSDLFB(); 53 54 static bool init(bool fShowSDLConfig); 55 static void uninit(); 56 57 #ifdef RT_OS_WINDOWS 58 STDMETHOD_(ULONG, AddRef)() 59 { 60 return ::InterlockedIncrement (&refcnt); 61 } 62 STDMETHOD_(ULONG, Release)() 63 { 64 long cnt = ::InterlockedDecrement (&refcnt); 65 if (cnt == 0) 66 delete this; 67 return cnt; 68 } 69 #endif 70 VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer) 71 72 NS_DECL_ISUPPORTS 71 73 72 74 STDMETHOD(COMGETTER(Width))(ULONG *width); … … 185 187 /** secure label offset from the top of the secure label */ 186 188 uint32_t mLabelOffs; 187 #endif 188 189 190 #endif 191 #ifdef RT_OS_WINDOWS 192 long refcnt; 193 #endif 189 194 SDL_Surface *mSurfVRAM; 190 195 … … 198 203 199 204 class VBoxSDLFBOverlay : 200 public CComObjectRootEx<CComMultiThreadModelNoCS>, 201 VBOX_SCRIPTABLE_IMPL(IFramebufferOverlay) 205 public IFramebufferOverlay 202 206 { 203 207 public: 204 DECLARE_NOT_AGGREGATABLE(VBoxSDLFBOverlay)205 206 208 VBoxSDLFBOverlay(ULONG x, ULONG y, ULONG width, ULONG height, BOOL visible, 207 209 VBoxSDLFB *aParent); 208 210 virtual ~VBoxSDLFBOverlay(); 209 211 210 BEGIN_COM_MAP(VBoxSDLFBOverlay) 211 VBOX_MINIMAL_INTERFACE_ENTRIES(IFramebufferOverlay) 212 END_COM_MAP() 212 #ifdef RT_OS_WINDOWS 213 STDMETHOD_(ULONG, AddRef)() 214 { 215 return ::InterlockedIncrement (&refcnt); 216 } 217 STDMETHOD_(ULONG, Release)() 218 { 219 long cnt = ::InterlockedDecrement (&refcnt); 220 if (cnt == 0) 221 delete this; 222 return cnt; 223 } 224 #endif 225 VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer) 226 227 NS_DECL_ISUPPORTS 213 228 214 229 STDMETHOD(COMGETTER(X))(ULONG *x); … … 260 275 /** Additional SDL surface used for combining the framebuffer and the overlay */ 261 276 SDL_Surface *mBlendedBits; 277 #ifdef RT_OS_WINDOWS 278 long refcnt; 279 #endif 262 280 }; 263 281 -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r41215 r41216 203 203 204 204 static ULONG gcMonitors = 1; 205 static ComObjPtr<VBoxSDLFB>gpFramebuffer[64];205 static VBoxSDLFB *gpFramebuffer[64]; 206 206 static SDL_Cursor *gpDefaultCursor = NULL; 207 207 #ifdef VBOXSDL_WITH_X11 … … 1780 1780 1781 1781 /* static initialization of the SDL stuff */ 1782 if (!VBoxSDLFB::init SDL(fShowSDLConfig))1782 if (!VBoxSDLFB::init(fShowSDLConfig)) 1783 1783 goto leave; 1784 1784 … … 1790 1790 { 1791 1791 // create our SDL framebuffer instance 1792 rc = gpFramebuffer[i].createObject(); 1793 if (SUCCEEDED(rc)) 1794 rc = gpFramebuffer[i]->init(i, fFullscreen, fResizable, fShowSDLConfig, false, 1795 fixedWidth, fixedHeight, fixedBPP); 1796 1797 if (FAILED(rc) || !gpFramebuffer[i]) 1792 gpFramebuffer[i] = new VBoxSDLFB(i, fFullscreen, fResizable, fShowSDLConfig, false, 1793 fixedWidth, fixedHeight, fixedBPP); 1794 1795 if (!gpFramebuffer[i]) 1798 1796 { 1799 1797 RTPrintf("Error: could not create framebuffer object!\n"); … … 2872 2870 } 2873 2871 2874 VBoxSDLFB::uninit SDL();2872 VBoxSDLFB::uninit(); 2875 2873 2876 2874 #ifdef VBOX_SECURELABEL -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
r41201 r41216 7 7 8 8 /* 9 * Copyright (C) 20 04-2012Oracle Corporation9 * Copyright (C) 2010 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.h
r41201 r41216 6 6 7 7 /* 8 * Copyright (C) 20 04-2012Oracle Corporation8 * Copyright (C) 2010-2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 127 127 void setDeleted(bool fIsDeleted) { m_fIsDeleted = fIsDeleted; } 128 128 129 #if defined(Q_OS_WIN32) 129 NS_DECL_ISUPPORTS 130 131 #if defined (Q_OS_WIN32) 130 132 STDMETHOD_(ULONG, AddRef)() 131 133 { … … 142 144 #endif 143 145 144 BEGIN_COM_MAP(UIFrameBuffer) 145 VBOX_DEFAULT_INTERFACE_ENTRIES(IFramebuffer) 146 END_COM_MAP() 146 VBOX_SCRIPTABLE_DISPATCH_IMPL(IFramebuffer) 147 147 148 148 /* IFramebuffer COM methods */ 149 STDMETHOD(COMGETTER(Address)) (BYTE **ppAddress);150 STDMETHOD(COMGETTER(Width)) (ULONG *puWidth);151 STDMETHOD(COMGETTER(Height)) (ULONG *puHeight);152 STDMETHOD(COMGETTER(BitsPerPixel)) (ULONG *puBitsPerPixel);153 STDMETHOD(COMGETTER(BytesPerLine)) (ULONG *puBytesPerLine);154 STDMETHOD(COMGETTER(PixelFormat)) (ULONG *puPixelFormat);155 STDMETHOD(COMGETTER(UsesGuestVRAM)) (BOOL *pbUsesGuestVRAM);156 STDMETHOD(COMGETTER(HeightReduction)) (ULONG *puHeightReduction);157 STDMETHOD(COMGETTER(Overlay)) (IFramebufferOverlay **ppOverlay);158 STDMETHOD(COMGETTER(WinId)) (LONG64 *pWinId);149 STDMETHOD(COMGETTER(Address)) (BYTE **ppAddress); 150 STDMETHOD(COMGETTER(Width)) (ULONG *puWidth); 151 STDMETHOD(COMGETTER(Height)) (ULONG *puHeight); 152 STDMETHOD(COMGETTER(BitsPerPixel)) (ULONG *puBitsPerPixel); 153 STDMETHOD(COMGETTER(BytesPerLine)) (ULONG *puBytesPerLine); 154 STDMETHOD(COMGETTER(PixelFormat)) (ULONG *puPixelFormat); 155 STDMETHOD(COMGETTER(UsesGuestVRAM)) (BOOL *pbUsesGuestVRAM); 156 STDMETHOD(COMGETTER(HeightReduction)) (ULONG *puHeightReduction); 157 STDMETHOD(COMGETTER(Overlay)) (IFramebufferOverlay **ppOverlay); 158 STDMETHOD(COMGETTER(WinId)) (LONG64 *pWinId); 159 159 160 160 STDMETHOD(Lock)(); 161 161 STDMETHOD(Unlock)(); 162 162 163 STDMETHOD(RequestResize) (ULONG uScreenId, ULONG uPixelFormat,164 BYTE *pVRAM, ULONG uBitsPerPixel, ULONG uBytesPerLine,165 ULONG uWidth, ULONG uHeight,166 BOOL *pbFinished);167 168 STDMETHOD(VideoModeSupported) (ULONG uWidth, ULONG uHeight, ULONG uBPP,169 BOOL *pbSupported);163 STDMETHOD(RequestResize) (ULONG uScreenId, ULONG uPixelFormat, 164 BYTE *pVRAM, ULONG uBitsPerPixel, ULONG uBytesPerLine, 165 ULONG uWidth, ULONG uHeight, 166 BOOL *pbFinished); 167 168 STDMETHOD(VideoModeSupported) (ULONG uWidth, ULONG uHeight, ULONG uBPP, 169 BOOL *pbSupported); 170 170 171 171 STDMETHOD(GetVisibleRegion)(BYTE *pRectangles, ULONG uCount, ULONG *puCountCopied); … … 247 247 bool m_fIsDeleted; 248 248 249 #if defined (Q_OS_WIN32)249 #if defined (Q_OS_WIN32) 250 250 private: 251 251 -
trunk/src/VBox/Main/include/FramebufferImpl.h
r41201 r41216 32 32 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Framebuffer, IFramebuffer) 33 33 34 DECLARE_NOT_AGGREGATABLE (Framebuffer)34 DECLARE_NOT_AGGREGATABLE (Framebuffer) 35 35 36 36 DECLARE_PROTECT_FINAL_CONSTRUCT() 37 37 38 BEGIN_COM_MAP (Framebuffer)39 VBOX_DEFAULT_INTERFACE_ENTRIES (IFramebuffer)38 BEGIN_COM_MAP (Framebuffer) 39 VBOX_DEFAULT_INTERFACE_ENTRIES (IFramebuffer) 40 40 END_COM_MAP() 41 41 42 DECLARE_EMPTY_CTOR_DTOR (Framebuffer)42 DECLARE_EMPTY_CTOR_DTOR (Framebuffer) 43 43 44 44 /* IFramebuffer properties */ 45 STDMETHOD(COMGETTER(Address)) (BYTE **aAddress) = 0;46 STDMETHOD(COMGETTER(Width)) (ULONG *aWidth) = 0;47 STDMETHOD(COMGETTER(Height)) (ULONG *aHeight) = 0;48 STDMETHOD(COMGETTER(BitsPerPixel)) (ULONG *aBitsPerPixel) = 0;49 STDMETHOD(COMGETTER(BytesPerLine)) (ULONG *aBytesPerLine) = 0;50 STDMETHOD(COMGETTER(PixelFormat)) (ULONG *aPixelFormat) = 0;51 STDMETHOD(COMGETTER(UsesGuestVRAM)) (BOOL *aUsesGuestVRAM) = 0;52 STDMETHOD(COMGETTER(HeightReduction)) (ULONG *aHeightReduction) = 0;53 STDMETHOD(COMGETTER(Overlay)) (IFramebufferOverlay **aOverlay) = 0;54 STDMETHOD(COMGETTER(WinId)) (ULONG64 *winId) = 0;45 STDMETHOD(COMGETTER(Address)) (BYTE **aAddress) = 0; 46 STDMETHOD(COMGETTER(Width)) (ULONG *aWidth) = 0; 47 STDMETHOD(COMGETTER(Height)) (ULONG *aHeight) = 0; 48 STDMETHOD(COMGETTER(BitsPerPixel)) (ULONG *aBitsPerPixel) = 0; 49 STDMETHOD(COMGETTER(BytesPerLine)) (ULONG *aBytesPerLine) = 0; 50 STDMETHOD(COMGETTER(PixelFormat)) (ULONG *aPixelFormat) = 0; 51 STDMETHOD(COMGETTER(UsesGuestVRAM)) (BOOL *aUsesGuestVRAM) = 0; 52 STDMETHOD(COMGETTER(HeightReduction)) (ULONG *aHeightReduction) = 0; 53 STDMETHOD(COMGETTER(Overlay)) (IFramebufferOverlay **aOverlay) = 0; 54 STDMETHOD(COMGETTER(WinId)) (ULONG64 *winId) = 0; 55 55 56 56 /* IFramebuffer methods */ … … 58 58 STDMETHOD(Unlock)() = 0; 59 59 60 STDMETHOD(RequestResize) (ULONG aScreenId, ULONG aPixelFormat,61 BYTE *aVRAM, ULONG aBitsPerPixel, ULONG aBytesPerLine,62 ULONG aWidth, ULONG aHeight,63 BOOL *aFinished) = 0;60 STDMETHOD(RequestResize) (ULONG aScreenId, ULONG aPixelFormat, 61 BYTE *aVRAM, ULONG aBitsPerPixel, ULONG aBytesPerLine, 62 ULONG aWidth, ULONG aHeight, 63 BOOL *aFinished) = 0; 64 64 65 STDMETHOD(VideoModeSupported) (ULONG aWidth, ULONG aHeight, ULONG aBPP,66 BOOL *aSupported) = 0;65 STDMETHOD(VideoModeSupported) (ULONG aWidth, ULONG aHeight, ULONG aBPP, 66 BOOL *aSupported) = 0; 67 67 68 68 STDMETHOD(GetVisibleRegion)(BYTE *aRectangles, ULONG aCount, 69 69 ULONG *aCountCopied) = 0; 70 70 STDMETHOD(SetVisibleRegion)(BYTE *aRectangles, ULONG aCount) = 0; 71 71
Note:
See TracChangeset
for help on using the changeset viewer.