Commit 1ad868ac authored by Daniel Amm's avatar Daniel Amm Committed by Jean-Baptiste Kempf

Win32: support the attribute 'branding'

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent c906bad1
......@@ -662,6 +662,11 @@ library AXVLC
[propget, helpstring("Returns the media description object.")]
HRESULT mediaDescription([out, retval] IVLCMediaDescription** obj);
[propget, helpstring("Returns/sets visibility of the VLC branding.")]
HRESULT Branding([out, retval] VARIANT_BOOL* visible);
[propput, helpstring("Returns/sets visibility of the VLC branding.")]
HRESULT Branding([in] VARIANT_BOOL visible);
};
[
......
......@@ -261,6 +261,13 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
}
}
V_VT(&value) = VT_BOOL;
if( S_OK == pPropBag->Read(OLESTR("Branding"), &value, pErrorLog) )
{
_p_instance->get_options().set_enable_branding(V_BOOL(&value) != VARIANT_FALSE);
VariantClear(&value);
}
return _p_instance->onLoad();
};
......@@ -332,6 +339,11 @@ STDMETHODIMP VLCPersistPropertyBag::Save(LPPROPERTYBAG pPropBag, BOOL fClearDirt
pPropBag->Write(OLESTR("FullscreenEnabled"), &value);
VariantClear(&value);
V_VT(&value) = VT_BOOL;
V_BOOL(&value) = _p_instance->get_options().get_enable_branding()? VARIANT_TRUE : VARIANT_FALSE;
pPropBag->Write(OLESTR("Branding"), &value);
VariantClear(&value);
if( fClearDirty )
_p_instance->setDirty(FALSE);
......
......@@ -1690,6 +1690,21 @@ STDMETHODIMP VLCControl2::put_BackColor(OLE_COLOR backcolor)
return S_OK;
};
STDMETHODIMP VLCControl2::get_Branding(VARIANT_BOOL *visible)
{
if( NULL == visible )
return E_POINTER;
*visible = varbool( _p_instance->get_options().get_enable_branding() );
return S_OK;
};
STDMETHODIMP VLCControl2::put_Branding(VARIANT_BOOL visible)
{
_p_instance->get_options().set_enable_branding( VARIANT_FALSE != visible );
return S_OK;
};
STDMETHODIMP VLCControl2::get_audio(IVLCAudio** obj)
{
return object_get(obj,_p_vlcaudio);
......
......@@ -449,6 +449,8 @@ public:
STDMETHODIMP put_BackColor(OLE_COLOR backcolor) override;
STDMETHODIMP get_FullscreenEnabled(VARIANT_BOOL* enabled) override;
STDMETHODIMP put_FullscreenEnabled(VARIANT_BOOL enabled) override;
STDMETHODIMP get_Branding(VARIANT_BOOL* visible) override;
STDMETHODIMP put_Branding(VARIANT_BOOL visible) override;
STDMETHODIMP get_audio(IVLCAudio**) override;
STDMETHODIMP get_input(IVLCInput**) override;
......
......@@ -556,11 +556,14 @@ LRESULT VLCHolderWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_PAINT:{
PAINTSTRUCT PaintStruct;
HDC hDC = BeginPaint(hWnd(), &PaintStruct);
RECT rect;
GetClientRect(hWnd(), &rect);
int IconX = ((rect.right - rect.left) - GetSystemMetrics(SM_CXICON))/2;
int IconY = ((rect.bottom - rect.top) - GetSystemMetrics(SM_CYICON))/2;
DrawIcon(hDC, IconX, IconY, RC().hBackgroundIcon);
if( PO() && PO()->get_enable_branding() )
{
RECT rect;
GetClientRect(hWnd(), &rect);
int IconX = ((rect.right - rect.left) - GetSystemMetrics(SM_CXICON))/2;
int IconY = ((rect.bottom - rect.top) - GetSystemMetrics(SM_CYICON))/2;
DrawIcon(hDC, IconX, IconY, RC().hBackgroundIcon);
}
EndPaint(hWnd(), &PaintStruct);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment