[vlc-devel] [PATCH 2/2] ActiveX: Added "FullscreenEnabled" property

Sergey Radionov rsatom at gmail.com
Wed Feb 15 13:01:56 CET 2012


---
 activex/axvlc.idl          |    8 +++++++-
 activex/persistpropbag.cpp |   12 ++++++++++++
 activex/vlccontrol2.cpp    |   15 +++++++++++++++
 activex/vlccontrol2.h      |    2 ++
 4 files changed, 36 insertions(+), 1 deletions(-)

diff --git a/activex/axvlc.idl b/activex/axvlc.idl
index 2c5b4c8..e8dc3af 100644
--- a/activex/axvlc.idl
+++ b/activex/axvlc.idl
@@ -79,7 +79,8 @@ library AXVLC
     const int DISPID_AutoLoop   = 108;
     const int DISPID_StartTime  = 109;
     const int DISPID_BaseURL    = 110;
-    const int DISPID_Toolbar     = 111;
+    const int DISPID_Toolbar    = 111;
+    const int DISPID_FSEnabled  = 112;
 
     [
       odl,
@@ -630,6 +631,11 @@ library AXVLC
         [id(DISPID_Toolbar), propput, helpstring("Returns/sets visibility of the toolbar")]
         HRESULT Toolbar([in] VARIANT_BOOL visible);
 
+        [id(DISPID_FSEnabled), propget, helpstring("Returns/sets availability of fullscreen mode.")]
+        HRESULT FullscreenEnabled([out, retval] VARIANT_BOOL* enabled);
+        [id(DISPID_FSEnabled), propput, helpstring("Returns/sets availability of fullscreen mode.")]
+        HRESULT FullscreenEnabled([in] VARIANT_BOOL enabled);
+
         [propget, helpstring("Returns the audio object.")]
         HRESULT audio([out, retval] IVLCAudio** obj);
 
diff --git a/activex/persistpropbag.cpp b/activex/persistpropbag.cpp
index 5b0331b..2e17d5b 100644
--- a/activex/persistpropbag.cpp
+++ b/activex/persistpropbag.cpp
@@ -212,6 +212,13 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
         }
     }
 
+    V_VT(&value) = VT_BOOL;
+    if( S_OK == pPropBag->Read(OLESTR("FullscreenEnabled"), &value, pErrorLog) )
+    {
+        _p_instance->set_enable_fs(V_BOOL(&value) != VARIANT_FALSE);
+        VariantClear(&value);
+    }
+
     return _p_instance->onLoad();
 };
 
@@ -278,6 +285,11 @@ STDMETHODIMP VLCPersistPropertyBag::Save(LPPROPERTYBAG pPropBag, BOOL fClearDirt
     pPropBag->Write(OLESTR("BackColor"), &value);
     VariantClear(&value);
 
+    V_VT(&value) = VT_BOOL;
+    V_BOOL(&value) = _p_instance->get_enable_fs()? VARIANT_TRUE : VARIANT_FALSE;
+    pPropBag->Write(OLESTR("FullscreenEnabled"), &value);
+    VariantClear(&value);
+
     if( fClearDirty )
         _p_instance->setDirty(FALSE);
 
diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index dcdb17b..b20bf93 100644
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -1380,6 +1380,21 @@ STDMETHODIMP VLCControl2::put_Toolbar(VARIANT_BOOL visible)
     return S_OK;
 };
 
+STDMETHODIMP VLCControl2::get_FullscreenEnabled(VARIANT_BOOL* enabled)
+{
+    if( NULL == enabled )
+        return E_POINTER;
+
+    *enabled = varbool( _p_instance->get_enable_fs() );
+
+    return S_OK;
+}
+
+STDMETHODIMP VLCControl2::put_FullscreenEnabled(VARIANT_BOOL enabled)
+{
+    _p_instance->set_enable_fs( VARIANT_FALSE != enabled );
+    return S_OK;
+}
 
 STDMETHODIMP VLCControl2::get_StartTime(long *seconds)
 {
diff --git a/activex/vlccontrol2.h b/activex/vlccontrol2.h
index 4e7cb67..6303c2b 100644
--- a/activex/vlccontrol2.h
+++ b/activex/vlccontrol2.h
@@ -381,6 +381,8 @@ public:
     STDMETHODIMP put_Volume(long volume);
     STDMETHODIMP get_BackColor(OLE_COLOR *backcolor);
     STDMETHODIMP put_BackColor(OLE_COLOR backcolor);
+    STDMETHODIMP get_FullscreenEnabled(VARIANT_BOOL* enabled);
+    STDMETHODIMP put_FullscreenEnabled(VARIANT_BOOL enabled);
 
     STDMETHODIMP get_audio(IVLCAudio**);
     STDMETHODIMP get_input(IVLCInput**);
-- 
1.7.7.1.msysgit.0




More information about the vlc-devel mailing list