[vlc-commits] ActiveX: Add "FullscreenEnabled" property

Sergey Radionov git at videolan.org
Wed Feb 15 19:10:22 CET 2012


npapi-vlc | branch: master | Sergey Radionov <rsatom at gmail.com> | Wed Feb 15 19:09:27 2012 +0100| [8ac6231f1b74494d80e451594c68a2350f7be9fd] | committer: Jean-Baptiste Kempf

ActiveX: Add "FullscreenEnabled" property

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=8ac6231f1b74494d80e451594c68a2350f7be9fd
---

 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..60fb294 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,
@@ -642,6 +643,11 @@ library AXVLC
         [propget, helpstring("Returns the audio object.")]
         HRESULT subtitle([out, retval] IVLCSubtitle** obj);
 
+        [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 video([out, retval] IVLCVideo** 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**);



More information about the vlc-commits mailing list