npapi-vlc | branch: master | Sergey Radionov <[email protected]> | Sat Jan 14 22:54:21 2012 +0700| [812ea80e3f1c7b51c844693997a1f71448af2795] | committer: Cheng Sun
win32: added support of background color changing > http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=812ea80e3f1c7b51c844693997a1f71448af2795 --- common/win32_fullscreen.cpp | 12 +++++++++++- common/win32_fullscreen.h | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp index 0943849..24bbdf3 100644 --- a/common/win32_fullscreen.cpp +++ b/common/win32_fullscreen.cpp @@ -607,6 +607,10 @@ VLCHolderWnd::CreateHolderWindow(HINSTANCE hInstance, VLCHolderWnd::~VLCHolderWnd() { + if(_hBgBrush) { + DeleteObject(_hBgBrush); + _hBgBrush = 0; + } } bool VLCHolderWnd::Create(HWND hWndParent) @@ -618,7 +622,13 @@ bool VLCHolderWnd::Create(HWND hWndParent) void VLCHolderWnd::PreRegisterWindowClass(WNDCLASS* wc) { - wc->hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); + if( !_hBgBrush){ + BYTE r = 0, g = 0, b = 0; + HtmlColor2RGB(PO()->get_bg_color(), &r, &g, &b); + _hBgBrush = CreateSolidBrush(RGB(r, g, b)); + } + + wc->hbrBackground = _hBgBrush; wc->lpszClassName = TEXT("Web Plugin VLC Window Holder Class"); } diff --git a/common/win32_fullscreen.h b/common/win32_fullscreen.h index 0024d1a..ea41231 100644 --- a/common/win32_fullscreen.h +++ b/common/win32_fullscreen.h @@ -145,7 +145,7 @@ public: protected: VLCHolderWnd(HINSTANCE hInstance, VLCWindowsManager* WM) : VLCWnd(hInstance), _hMouseHook(NULL), _MouseHookThreadId(0), - _wm(WM), _CtrlsWnd(0) {}; + _wm(WM), _CtrlsWnd(0), _hBgBrush(0) {}; bool Create(HWND hWndParent); virtual void PreRegisterWindowClass(WNDCLASS* wc); @@ -184,6 +184,7 @@ private: private: VLCWindowsManager* _wm; + HBRUSH _hBgBrush; VLCControlsWnd* _CtrlsWnd; }; _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
