Avoid \r\n problems between platforms
authorSteve Lhomme <robux@videolan.org>
Wed, 2 Mar 2005 16:47:31 +0000 (16:47 +0000)
committerSteve Lhomme <robux@videolan.org>
Wed, 2 Mar 2005 16:47:31 +0000 (16:47 +0000)
105 files changed:
activex/axvlc_idl.c
activex/axvlc_idl.h
activex/connectioncontainer.cpp
activex/connectioncontainer.h
activex/main.cpp
activex/objectsafety.cpp
activex/objectsafety.h
activex/olecontrol.cpp
activex/olecontrol.h
activex/oleinplaceactiveobject.cpp
activex/oleinplaceactiveobject.h
activex/oleinplaceobject.cpp
activex/oleinplaceobject.h
activex/oleobject.cpp
activex/oleobject.h
activex/persistpropbag.cpp
activex/persistpropbag.h
activex/persiststorage.cpp
activex/persiststorage.h
activex/persiststreaminit.cpp
activex/persiststreaminit.h
activex/plugin.cpp
activex/plugin.h
activex/provideclassinfo.cpp
activex/provideclassinfo.h
activex/utils.cpp
activex/utils.h
activex/vlccontrol.cpp
activex/vlccontrol.h
include/beos_specific.h
include/charset.h
include/intf_eject.h
include/iso_lang.h
include/os_specific.h
include/vlc/aout.h
include/vlc/sout.h
include/vlc_bits.h
include/vlc_cpu.h
include/vlc_error.h
include/vlc_messages.h
include/win32_specific.h
modules/access/screen/beos.cpp
modules/access/v4l/videodev_mjpeg.h
modules/access/vcd/cdrom.c
modules/access/vcd/cdrom.h
modules/access/vcd/cdrom_internals.h
modules/audio_filter/equalizer_presets.h
modules/audio_filter/resampler/bandlimited.h
modules/codec/ffmpeg/video.c
modules/demux/avi/libavi.c
modules/gui/beos/AudioOutput.cpp
modules/gui/beos/Bitmaps.h
modules/gui/beos/DrawingTidbits.cpp
modules/gui/beos/DrawingTidbits.h
modules/gui/beos/PreferencesWindow.cpp
modules/gui/beos/PreferencesWindow.h
modules/gui/beos/TransportButton.cpp
modules/gui/beos/TransportButton.h
modules/gui/gtk/common.h
modules/gui/gtk/control.h
modules/gui/gtk/display.h
modules/gui/gtk/gtk_callbacks.h
modules/gui/gtk/menu.h
modules/gui/gtk/modules.c
modules/gui/gtk/modules.h
modules/gui/gtk/open.h
modules/gui/gtk/playlist.h
modules/gui/gtk/preferences.c
modules/gui/gtk/preferences.h
modules/gui/gtk/sout.c
modules/gui/kde/QConfigItem.cpp
modules/gui/kde/QConfigItem.h
modules/gui/kde/info.h
modules/gui/kde/languagemenu.cpp
modules/gui/kde/languagemenu.h
modules/gui/kde/messages.cpp
modules/gui/kde/messages.h
modules/gui/kde/pluginsbox.cpp
modules/gui/kde/pluginsbox.h
modules/gui/kde/preferences.cpp
modules/gui/kde/preferences.h
modules/gui/pda/pda.h
modules/gui/pda/pda_callbacks.h
modules/gui/qt/intf.h
modules/gui/wxwindows/wizard.cpp
modules/misc/dummy/aout.c
modules/misc/dummy/dummy.h
modules/misc/dummy/encoder.c
modules/misc/dummy/interface.c
modules/misc/gtk_main.c
modules/misc/memcpy/fastmemcpy.h
modules/misc/testsuite/test1.c
modules/misc/testsuite/test2.cpp
modules/misc/testsuite/test4.c
modules/mux/mpeg/bits.h
modules/mux/mpeg/csa.h
modules/stream_out/transrate/block.c
modules/video_chroma/i420_rgb_c.h
modules/video_filter/marq.c
modules/video_output/directx/glwin32.c
modules/video_output/qte/qte.h
modules/video_output/svgalib.c
share/newres.h
share/resource.h
src/input/es_out.c

index ae90e8b..b339abb 100644 (file)
@@ -1,53 +1,53 @@
-/* this file contains the actual definitions of */\r
-/* the IIDs and CLSIDs */\r
-\r
-/* link this file in with the server and any clients */\r
-\r
-\r
-/* File created by MIDL compiler version 5.01.0164 */\r
-/* at Thu Feb 17 09:25:54 2005\r
- */\r
-/* Compiler settings for axvlc.idl:\r
-    Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext\r
-    error checks: allocation ref bounds_check enum stub_data \r
-*/\r
-//@@MIDL_FILE_HEADING(  )\r
-#ifdef __cplusplus\r
-extern "C"{\r
-#endif \r
-\r
-\r
-#ifndef __IID_DEFINED__\r
-#define __IID_DEFINED__\r
-\r
-typedef struct _IID\r
-{\r
-    unsigned long x;\r
-    unsigned short s1;\r
-    unsigned short s2;\r
-    unsigned char  c[8];\r
-} IID;\r
-\r
-#endif // __IID_DEFINED__\r
-\r
-#ifndef CLSID_DEFINED\r
-#define CLSID_DEFINED\r
-typedef IID CLSID;\r
-#endif // CLSID_DEFINED\r
-\r
-const IID LIBID_AXVLC = {0xDF2BBE39,0x40A8,0x433b,{0xA2,0x79,0x07,0x3F,0x48,0xDA,0x94,0xB6}};\r
-\r
-\r
-const IID IID_IVLCControl = {0xC2FA41D0,0xB113,0x476e,{0xAC,0x8C,0x9B,0xD1,0x49,0x99,0xC1,0xC1}};\r
-\r
-\r
-const IID DIID_DVLCEvents = {0xDF48072F,0x5EF8,0x434e,{0x9B,0x40,0xE2,0xF3,0xAE,0x75,0x9B,0x5F}};\r
-\r
-\r
-const CLSID CLSID_VLCPlugin = {0xE23FE9C6,0x778E,0x49D4,{0xB5,0x37,0x38,0xFC,0xDE,0x48,0x87,0xD8}};\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
+/* this file contains the actual definitions of */
+/* the IIDs and CLSIDs */
+
+/* link this file in with the server and any clients */
+
+
+/* File created by MIDL compiler version 5.01.0164 */
+/* at Thu Feb 17 09:25:54 2005
+ */
+/* Compiler settings for axvlc.idl:
+    Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
+    error checks: allocation ref bounds_check enum stub_data 
+*/
+//@@MIDL_FILE_HEADING(  )
+#ifdef __cplusplus
+extern "C"{
+#endif 
+
+
+#ifndef __IID_DEFINED__
+#define __IID_DEFINED__
+
+typedef struct _IID
+{
+    unsigned long x;
+    unsigned short s1;
+    unsigned short s2;
+    unsigned char  c[8];
+} IID;
+
+#endif // __IID_DEFINED__
+
+#ifndef CLSID_DEFINED
+#define CLSID_DEFINED
+typedef IID CLSID;
+#endif // CLSID_DEFINED
+
+const IID LIBID_AXVLC = {0xDF2BBE39,0x40A8,0x433b,{0xA2,0x79,0x07,0x3F,0x48,0xDA,0x94,0xB6}};
+
+
+const IID IID_IVLCControl = {0xC2FA41D0,0xB113,0x476e,{0xAC,0x8C,0x9B,0xD1,0x49,0x99,0xC1,0xC1}};
+
+
+const IID DIID_DVLCEvents = {0xDF48072F,0x5EF8,0x434e,{0x9B,0x40,0xE2,0xF3,0xAE,0x75,0x9B,0x5F}};
+
+
+const CLSID CLSID_VLCPlugin = {0xE23FE9C6,0x778E,0x49D4,{0xB5,0x37,0x38,0xFC,0xDE,0x48,0x87,0xD8}};
+
+
+#ifdef __cplusplus
+}
+#endif
+
index 545e0bd..719c264 100644 (file)
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */\r
-\r
-\r
-/* File created by MIDL compiler version 5.01.0164 */\r
-/* at Thu Feb 17 09:25:54 2005\r
- */\r
-/* Compiler settings for axvlc.idl:\r
-    Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext\r
-    error checks: allocation ref bounds_check enum stub_data \r
-*/\r
-//@@MIDL_FILE_HEADING(  )\r
-\r
-\r
-/* verify that the <rpcndr.h> version is high enough to compile this file*/\r
-#ifndef __REQUIRED_RPCNDR_H_VERSION__\r
-#define __REQUIRED_RPCNDR_H_VERSION__ 440\r
-#endif\r
-\r
-#include "rpc.h"\r
-#include "rpcndr.h"\r
-\r
-#ifndef __axvlc_idl_h__\r
-#define __axvlc_idl_h__\r
-\r
-#ifdef __cplusplus\r
-extern "C"{\r
-#endif \r
-\r
-/* Forward Declarations */ \r
-\r
-#ifndef __IVLCControl_FWD_DEFINED__\r
-#define __IVLCControl_FWD_DEFINED__\r
-typedef interface IVLCControl IVLCControl;\r
-#endif         /* __IVLCControl_FWD_DEFINED__ */\r
-\r
-\r
-#ifndef __DVLCEvents_FWD_DEFINED__\r
-#define __DVLCEvents_FWD_DEFINED__\r
-typedef interface DVLCEvents DVLCEvents;\r
-#endif         /* __DVLCEvents_FWD_DEFINED__ */\r
-\r
-\r
-#ifndef __VLCPlugin_FWD_DEFINED__\r
-#define __VLCPlugin_FWD_DEFINED__\r
-\r
-#ifdef __cplusplus\r
-typedef class VLCPlugin VLCPlugin;\r
-#else\r
-typedef struct VLCPlugin VLCPlugin;\r
-#endif /* __cplusplus */\r
-\r
-#endif         /* __VLCPlugin_FWD_DEFINED__ */\r
-\r
-\r
-void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);\r
-void __RPC_USER MIDL_user_free( void __RPC_FAR * ); \r
-\r
-\r
-#ifndef __AXVLC_LIBRARY_DEFINED__\r
-#define __AXVLC_LIBRARY_DEFINED__\r
-\r
-/* library AXVLC */\r
-/* [helpstring][version][uuid] */ \r
-\r
-\r
-\r
-\r
-enum VLCPlaylistMode\r
-    {  VLCPlayListInsert       = 1,\r
-       VLCPlayListReplace      = 2,\r
-       VLCPlayListAppend       = 4,\r
-       VLCPlayListGo   = 8,\r
-       VLCPlayListCheckInsert  = 16\r
-    };\r
-#define        VLCPlayListEnd  ( -666 )\r
-\r
-#define        DISPID_Visible  ( 1 )\r
-\r
-#define        DISPID_Playing  ( 2 )\r
-\r
-#define        DISPID_Position ( 3 )\r
-\r
-#define        DISPID_Time     ( 4 )\r
-\r
-#define        DISPID_Length   ( 5 )\r
-\r
-#define        DISPID_Volume   ( 6 )\r
-\r
-#define        DISPID_PlayEvent        ( 1 )\r
-\r
-#define        DISPID_PauseEvent       ( 2 )\r
-\r
-#define        DISPID_StopEvent        ( 3 )\r
-\r
-\r
-EXTERN_C const IID LIBID_AXVLC;\r
-\r
-#ifndef __IVLCControl_INTERFACE_DEFINED__\r
-#define __IVLCControl_INTERFACE_DEFINED__\r
-\r
-/* interface IVLCControl */\r
-/* [object][oleautomation][hidden][dual][helpstring][uuid] */ \r
-\r
-\r
-EXTERN_C const IID IID_IVLCControl;\r
-\r
-#if defined(__cplusplus) && !defined(CINTERFACE)\r
-    \r
-    MIDL_INTERFACE("C2FA41D0-B113-476e-AC8C-9BD14999C1C1")\r
-    IVLCControl : public IDispatch\r
-    {\r
-    public:\r
-        virtual /* [helpstring][propget][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Value( \r
-            /* [retval][out] */ VARIANT __RPC_FAR *pvarValue) = 0;\r
-        \r
-        virtual /* [helpstring][propput][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Value( \r
-            /* [in] */ VARIANT pvarValue) = 0;\r
-        \r
-        virtual /* [helpstring][bindable][propget][id] */ HRESULT STDMETHODCALLTYPE get_Visible( \r
-            /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible) = 0;\r
-        \r
-        virtual /* [helpstring][bindable][propput][id] */ HRESULT STDMETHODCALLTYPE put_Visible( \r
-            /* [in] */ VARIANT_BOOL visible) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE play( void) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE pause( void) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE stop( void) = 0;\r
-        \r
-        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Playing( \r
-            /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying) = 0;\r
-        \r
-        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Playing( \r
-            /* [in] */ VARIANT_BOOL isPlaying) = 0;\r
-        \r
-        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Position( \r
-            /* [retval][out] */ float __RPC_FAR *position) = 0;\r
-        \r
-        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Position( \r
-            /* [in] */ float position) = 0;\r
-        \r
-        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Time( \r
-            /* [retval][out] */ int __RPC_FAR *seconds) = 0;\r
-        \r
-        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Time( \r
-            /* [in] */ int seconds) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE shuttle( \r
-            /* [in] */ int seconds) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE fullscreen( void) = 0;\r
-        \r
-        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Length( \r
-            /* [retval][out] */ int __RPC_FAR *seconds) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playFaster( void) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playSlower( void) = 0;\r
-        \r
-        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Volume( \r
-            /* [retval][out] */ int __RPC_FAR *volume) = 0;\r
-        \r
-        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Volume( \r
-            /* [in] */ int volume) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE toggleMute( void) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE addTarget( \r
-            /* [in] */ BSTR uri,\r
-            /* [in] */ VARIANT options,\r
-            /* [in] */ enum VLCPlaylistMode mode,\r
-            /* [in] */ int position) = 0;\r
-        \r
-        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_PlaylistIndex( \r
-            /* [retval][out] */ int __RPC_FAR *index) = 0;\r
-        \r
-        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_PlaylistCount( \r
-            /* [retval][out] */ int __RPC_FAR *index) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playlistNext( void) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playlistPrev( void) = 0;\r
-        \r
-        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playlistClear( void) = 0;\r
-        \r
-        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_VersionInfo( \r
-            /* [retval][out] */ BSTR __RPC_FAR *version) = 0;\r
-        \r
-    };\r
-    \r
-#else  /* C style interface */\r
-\r
-    typedef struct IVLCControlVtbl\r
-    {\r
-        BEGIN_INTERFACE\r
-        \r
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ REFIID riid,\r
-            /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);\r
-        \r
-        ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [out] */ UINT __RPC_FAR *pctinfo);\r
-        \r
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ UINT iTInfo,\r
-            /* [in] */ LCID lcid,\r
-            /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);\r
-        \r
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ REFIID riid,\r
-            /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,\r
-            /* [in] */ UINT cNames,\r
-            /* [in] */ LCID lcid,\r
-            /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);\r
-        \r
-        /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ DISPID dispIdMember,\r
-            /* [in] */ REFIID riid,\r
-            /* [in] */ LCID lcid,\r
-            /* [in] */ WORD wFlags,\r
-            /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,\r
-            /* [out] */ VARIANT __RPC_FAR *pVarResult,\r
-            /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,\r
-            /* [out] */ UINT __RPC_FAR *puArgErr);\r
-        \r
-        /* [helpstring][propget][defaultbind][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Value )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ VARIANT __RPC_FAR *pvarValue);\r
-        \r
-        /* [helpstring][propput][defaultbind][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Value )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ VARIANT pvarValue);\r
-        \r
-        /* [helpstring][bindable][propget][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Visible )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible);\r
-        \r
-        /* [helpstring][bindable][propput][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Visible )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ VARIANT_BOOL visible);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *play )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *pause )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *stop )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Playing )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying);\r
-        \r
-        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Playing )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ VARIANT_BOOL isPlaying);\r
-        \r
-        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Position )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ float __RPC_FAR *position);\r
-        \r
-        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Position )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ float position);\r
-        \r
-        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Time )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ int __RPC_FAR *seconds);\r
-        \r
-        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Time )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ int seconds);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *shuttle )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ int seconds);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *fullscreen )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Length )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ int __RPC_FAR *seconds);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playFaster )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playSlower )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Volume )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ int __RPC_FAR *volume);\r
-        \r
-        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Volume )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ int volume);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *toggleMute )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *addTarget )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [in] */ BSTR uri,\r
-            /* [in] */ VARIANT options,\r
-            /* [in] */ enum VLCPlaylistMode mode,\r
-            /* [in] */ int position);\r
-        \r
-        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_PlaylistIndex )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ int __RPC_FAR *index);\r
-        \r
-        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_PlaylistCount )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ int __RPC_FAR *index);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playlistNext )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playlistPrev )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playlistClear )( \r
-            IVLCControl __RPC_FAR * This);\r
-        \r
-        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_VersionInfo )( \r
-            IVLCControl __RPC_FAR * This,\r
-            /* [retval][out] */ BSTR __RPC_FAR *version);\r
-        \r
-        END_INTERFACE\r
-    } IVLCControlVtbl;\r
-\r
-    interface IVLCControl\r
-    {\r
-        CONST_VTBL struct IVLCControlVtbl __RPC_FAR *lpVtbl;\r
-    };\r
-\r
-    \r
-\r
-#ifdef COBJMACROS\r
-\r
-\r
-#define IVLCControl_QueryInterface(This,riid,ppvObject)        \\r
-    (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)\r
-\r
-#define IVLCControl_AddRef(This)       \\r
-    (This)->lpVtbl -> AddRef(This)\r
-\r
-#define IVLCControl_Release(This)      \\r
-    (This)->lpVtbl -> Release(This)\r
-\r
-\r
-#define IVLCControl_GetTypeInfoCount(This,pctinfo)     \\r
-    (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)\r
-\r
-#define IVLCControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo)      \\r
-    (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)\r
-\r
-#define IVLCControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)    \\r
-    (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)\r
-\r
-#define IVLCControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)      \\r
-    (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)\r
-\r
-\r
-#define IVLCControl_get_Value(This,pvarValue)  \\r
-    (This)->lpVtbl -> get_Value(This,pvarValue)\r
-\r
-#define IVLCControl_put_Value(This,pvarValue)  \\r
-    (This)->lpVtbl -> put_Value(This,pvarValue)\r
-\r
-#define IVLCControl_get_Visible(This,visible)  \\r
-    (This)->lpVtbl -> get_Visible(This,visible)\r
-\r
-#define IVLCControl_put_Visible(This,visible)  \\r
-    (This)->lpVtbl -> put_Visible(This,visible)\r
-\r
-#define IVLCControl_play(This) \\r
-    (This)->lpVtbl -> play(This)\r
-\r
-#define IVLCControl_pause(This)        \\r
-    (This)->lpVtbl -> pause(This)\r
-\r
-#define IVLCControl_stop(This) \\r
-    (This)->lpVtbl -> stop(This)\r
-\r
-#define IVLCControl_get_Playing(This,isPlaying)        \\r
-    (This)->lpVtbl -> get_Playing(This,isPlaying)\r
-\r
-#define IVLCControl_put_Playing(This,isPlaying)        \\r
-    (This)->lpVtbl -> put_Playing(This,isPlaying)\r
-\r
-#define IVLCControl_get_Position(This,position)        \\r
-    (This)->lpVtbl -> get_Position(This,position)\r
-\r
-#define IVLCControl_put_Position(This,position)        \\r
-    (This)->lpVtbl -> put_Position(This,position)\r
-\r
-#define IVLCControl_get_Time(This,seconds)     \\r
-    (This)->lpVtbl -> get_Time(This,seconds)\r
-\r
-#define IVLCControl_put_Time(This,seconds)     \\r
-    (This)->lpVtbl -> put_Time(This,seconds)\r
-\r
-#define IVLCControl_shuttle(This,seconds)      \\r
-    (This)->lpVtbl -> shuttle(This,seconds)\r
-\r
-#define IVLCControl_fullscreen(This)   \\r
-    (This)->lpVtbl -> fullscreen(This)\r
-\r
-#define IVLCControl_get_Length(This,seconds)   \\r
-    (This)->lpVtbl -> get_Length(This,seconds)\r
-\r
-#define IVLCControl_playFaster(This)   \\r
-    (This)->lpVtbl -> playFaster(This)\r
-\r
-#define IVLCControl_playSlower(This)   \\r
-    (This)->lpVtbl -> playSlower(This)\r
-\r
-#define IVLCControl_get_Volume(This,volume)    \\r
-    (This)->lpVtbl -> get_Volume(This,volume)\r
-\r
-#define IVLCControl_put_Volume(This,volume)    \\r
-    (This)->lpVtbl -> put_Volume(This,volume)\r
-\r
-#define IVLCControl_toggleMute(This)   \\r
-    (This)->lpVtbl -> toggleMute(This)\r
-\r
-#define IVLCControl_addTarget(This,uri,options,mode,position)  \\r
-    (This)->lpVtbl -> addTarget(This,uri,options,mode,position)\r
-\r
-#define IVLCControl_get_PlaylistIndex(This,index)      \\r
-    (This)->lpVtbl -> get_PlaylistIndex(This,index)\r
-\r
-#define IVLCControl_get_PlaylistCount(This,index)      \\r
-    (This)->lpVtbl -> get_PlaylistCount(This,index)\r
-\r
-#define IVLCControl_playlistNext(This) \\r
-    (This)->lpVtbl -> playlistNext(This)\r
-\r
-#define IVLCControl_playlistPrev(This) \\r
-    (This)->lpVtbl -> playlistPrev(This)\r
-\r
-#define IVLCControl_playlistClear(This)        \\r
-    (This)->lpVtbl -> playlistClear(This)\r
-\r
-#define IVLCControl_get_VersionInfo(This,version)      \\r
-    (This)->lpVtbl -> get_VersionInfo(This,version)\r
-\r
-#endif /* COBJMACROS */\r
-\r
-\r
-#endif         /* C style interface */\r
-\r
-\r
-\r
-/* [helpstring][propget][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Value_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ VARIANT __RPC_FAR *pvarValue);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_Value_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propput][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Value_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [in] */ VARIANT pvarValue);\r
-\r
-\r
-void __RPC_STUB IVLCControl_put_Value_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][bindable][propget][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Visible_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_Visible_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][bindable][propput][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Visible_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [in] */ VARIANT_BOOL visible);\r
-\r
-\r
-void __RPC_STUB IVLCControl_put_Visible_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_play_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_play_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_pause_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_pause_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_stop_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_stop_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Playing_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_Playing_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Playing_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [in] */ VARIANT_BOOL isPlaying);\r
-\r
-\r
-void __RPC_STUB IVLCControl_put_Playing_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Position_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ float __RPC_FAR *position);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_Position_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Position_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [in] */ float position);\r
-\r
-\r
-void __RPC_STUB IVLCControl_put_Position_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Time_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ int __RPC_FAR *seconds);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_Time_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Time_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [in] */ int seconds);\r
-\r
-\r
-void __RPC_STUB IVLCControl_put_Time_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_shuttle_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [in] */ int seconds);\r
-\r
-\r
-void __RPC_STUB IVLCControl_shuttle_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_fullscreen_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_fullscreen_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Length_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ int __RPC_FAR *seconds);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_Length_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playFaster_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_playFaster_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playSlower_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_playSlower_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Volume_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ int __RPC_FAR *volume);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_Volume_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Volume_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [in] */ int volume);\r
-\r
-\r
-void __RPC_STUB IVLCControl_put_Volume_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_toggleMute_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_toggleMute_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_addTarget_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [in] */ BSTR uri,\r
-    /* [in] */ VARIANT options,\r
-    /* [in] */ enum VLCPlaylistMode mode,\r
-    /* [in] */ int position);\r
-\r
-\r
-void __RPC_STUB IVLCControl_addTarget_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_PlaylistIndex_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ int __RPC_FAR *index);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_PlaylistIndex_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_PlaylistCount_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ int __RPC_FAR *index);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_PlaylistCount_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playlistNext_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_playlistNext_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playlistPrev_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_playlistPrev_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playlistClear_Proxy( \r
-    IVLCControl __RPC_FAR * This);\r
-\r
-\r
-void __RPC_STUB IVLCControl_playlistClear_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_VersionInfo_Proxy( \r
-    IVLCControl __RPC_FAR * This,\r
-    /* [retval][out] */ BSTR __RPC_FAR *version);\r
-\r
-\r
-void __RPC_STUB IVLCControl_get_VersionInfo_Stub(\r
-    IRpcStubBuffer *This,\r
-    IRpcChannelBuffer *_pRpcChannelBuffer,\r
-    PRPC_MESSAGE _pRpcMessage,\r
-    DWORD *_pdwStubPhase);\r
-\r
-\r
-\r
-#endif         /* __IVLCControl_INTERFACE_DEFINED__ */\r
-\r
-\r
-#ifndef __DVLCEvents_DISPINTERFACE_DEFINED__\r
-#define __DVLCEvents_DISPINTERFACE_DEFINED__\r
-\r
-/* dispinterface DVLCEvents */\r
-/* [hidden][helpstring][uuid] */ \r
-\r
-\r
-EXTERN_C const IID DIID_DVLCEvents;\r
-\r
-#if defined(__cplusplus) && !defined(CINTERFACE)\r
-\r
-    MIDL_INTERFACE("DF48072F-5EF8-434e-9B40-E2F3AE759B5F")\r
-    DVLCEvents : public IDispatch\r
-    {\r
-    };\r
-    \r
-#else  /* C style interface */\r
-\r
-    typedef struct DVLCEventsVtbl\r
-    {\r
-        BEGIN_INTERFACE\r
-        \r
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( \r
-            DVLCEvents __RPC_FAR * This,\r
-            /* [in] */ REFIID riid,\r
-            /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);\r
-        \r
-        ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( \r
-            DVLCEvents __RPC_FAR * This);\r
-        \r
-        ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( \r
-            DVLCEvents __RPC_FAR * This);\r
-        \r
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( \r
-            DVLCEvents __RPC_FAR * This,\r
-            /* [out] */ UINT __RPC_FAR *pctinfo);\r
-        \r
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( \r
-            DVLCEvents __RPC_FAR * This,\r
-            /* [in] */ UINT iTInfo,\r
-            /* [in] */ LCID lcid,\r
-            /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);\r
-        \r
-        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( \r
-            DVLCEvents __RPC_FAR * This,\r
-            /* [in] */ REFIID riid,\r
-            /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,\r
-            /* [in] */ UINT cNames,\r
-            /* [in] */ LCID lcid,\r
-            /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);\r
-        \r
-        /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( \r
-            DVLCEvents __RPC_FAR * This,\r
-            /* [in] */ DISPID dispIdMember,\r
-            /* [in] */ REFIID riid,\r
-            /* [in] */ LCID lcid,\r
-            /* [in] */ WORD wFlags,\r
-            /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,\r
-            /* [out] */ VARIANT __RPC_FAR *pVarResult,\r
-            /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,\r
-            /* [out] */ UINT __RPC_FAR *puArgErr);\r
-        \r
-        END_INTERFACE\r
-    } DVLCEventsVtbl;\r
-\r
-    interface DVLCEvents\r
-    {\r
-        CONST_VTBL struct DVLCEventsVtbl __RPC_FAR *lpVtbl;\r
-    };\r
-\r
-    \r
-\r
-#ifdef COBJMACROS\r
-\r
-\r
-#define DVLCEvents_QueryInterface(This,riid,ppvObject) \\r
-    (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)\r
-\r
-#define DVLCEvents_AddRef(This)        \\r
-    (This)->lpVtbl -> AddRef(This)\r
-\r
-#define DVLCEvents_Release(This)       \\r
-    (This)->lpVtbl -> Release(This)\r
-\r
-\r
-#define DVLCEvents_GetTypeInfoCount(This,pctinfo)      \\r
-    (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)\r
-\r
-#define DVLCEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo)       \\r
-    (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)\r
-\r
-#define DVLCEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)     \\r
-    (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)\r
-\r
-#define DVLCEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)       \\r
-    (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)\r
-\r
-#endif /* COBJMACROS */\r
-\r
-\r
-#endif         /* C style interface */\r
-\r
-\r
-#endif         /* __DVLCEvents_DISPINTERFACE_DEFINED__ */\r
-\r
-\r
-EXTERN_C const CLSID CLSID_VLCPlugin;\r
-\r
-#ifdef __cplusplus\r
-\r
-class DECLSPEC_UUID("E23FE9C6-778E-49D4-B537-38FCDE4887D8")\r
-VLCPlugin;\r
-#endif\r
-#endif /* __AXVLC_LIBRARY_DEFINED__ */\r
-\r
-/* Additional Prototypes for ALL interfaces */\r
-\r
-/* end of Additional Prototypes */\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+/* File created by MIDL compiler version 5.01.0164 */
+/* at Thu Feb 17 09:25:54 2005
+ */
+/* Compiler settings for axvlc.idl:
+    Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
+    error checks: allocation ref bounds_check enum stub_data 
+*/
+//@@MIDL_FILE_HEADING(  )
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 440
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __axvlc_idl_h__
+#define __axvlc_idl_h__
+
+#ifdef __cplusplus
+extern "C"{
+#endif 
+
+/* Forward Declarations */ 
+
+#ifndef __IVLCControl_FWD_DEFINED__
+#define __IVLCControl_FWD_DEFINED__
+typedef interface IVLCControl IVLCControl;
+#endif         /* __IVLCControl_FWD_DEFINED__ */
+
+
+#ifndef __DVLCEvents_FWD_DEFINED__
+#define __DVLCEvents_FWD_DEFINED__
+typedef interface DVLCEvents DVLCEvents;
+#endif         /* __DVLCEvents_FWD_DEFINED__ */
+
+
+#ifndef __VLCPlugin_FWD_DEFINED__
+#define __VLCPlugin_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class VLCPlugin VLCPlugin;
+#else
+typedef struct VLCPlugin VLCPlugin;
+#endif /* __cplusplus */
+
+#endif         /* __VLCPlugin_FWD_DEFINED__ */
+
+
+void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
+void __RPC_USER MIDL_user_free( void __RPC_FAR * ); 
+
+
+#ifndef __AXVLC_LIBRARY_DEFINED__
+#define __AXVLC_LIBRARY_DEFINED__
+
+/* library AXVLC */
+/* [helpstring][version][uuid] */ 
+
+
+
+
+enum VLCPlaylistMode
+    {  VLCPlayListInsert       = 1,
+       VLCPlayListReplace      = 2,
+       VLCPlayListAppend       = 4,
+       VLCPlayListGo   = 8,
+       VLCPlayListCheckInsert  = 16
+    };
+#define        VLCPlayListEnd  ( -666 )
+
+#define        DISPID_Visible  ( 1 )
+
+#define        DISPID_Playing  ( 2 )
+
+#define        DISPID_Position ( 3 )
+
+#define        DISPID_Time     ( 4 )
+
+#define        DISPID_Length   ( 5 )
+
+#define        DISPID_Volume   ( 6 )
+
+#define        DISPID_PlayEvent        ( 1 )
+
+#define        DISPID_PauseEvent       ( 2 )
+
+#define        DISPID_StopEvent        ( 3 )
+
+
+EXTERN_C const IID LIBID_AXVLC;
+
+#ifndef __IVLCControl_INTERFACE_DEFINED__
+#define __IVLCControl_INTERFACE_DEFINED__
+
+/* interface IVLCControl */
+/* [object][oleautomation][hidden][dual][helpstring][uuid] */ 
+
+
+EXTERN_C const IID IID_IVLCControl;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+    
+    MIDL_INTERFACE("C2FA41D0-B113-476e-AC8C-9BD14999C1C1")
+    IVLCControl : public IDispatch
+    {
+    public:
+        virtual /* [helpstring][propget][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Value( 
+            /* [retval][out] */ VARIANT __RPC_FAR *pvarValue) = 0;
+        
+        virtual /* [helpstring][propput][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Value( 
+            /* [in] */ VARIANT pvarValue) = 0;
+        
+        virtual /* [helpstring][bindable][propget][id] */ HRESULT STDMETHODCALLTYPE get_Visible( 
+            /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible) = 0;
+        
+        virtual /* [helpstring][bindable][propput][id] */ HRESULT STDMETHODCALLTYPE put_Visible( 
+            /* [in] */ VARIANT_BOOL visible) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE play( void) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE pause( void) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE stop( void) = 0;
+        
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Playing( 
+            /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying) = 0;
+        
+        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Playing( 
+            /* [in] */ VARIANT_BOOL isPlaying) = 0;
+        
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Position( 
+            /* [retval][out] */ float __RPC_FAR *position) = 0;
+        
+        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Position( 
+            /* [in] */ float position) = 0;
+        
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Time( 
+            /* [retval][out] */ int __RPC_FAR *seconds) = 0;
+        
+        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Time( 
+            /* [in] */ int seconds) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE shuttle( 
+            /* [in] */ int seconds) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE fullscreen( void) = 0;
+        
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Length( 
+            /* [retval][out] */ int __RPC_FAR *seconds) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playFaster( void) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playSlower( void) = 0;
+        
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Volume( 
+            /* [retval][out] */ int __RPC_FAR *volume) = 0;
+        
+        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Volume( 
+            /* [in] */ int volume) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE toggleMute( void) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE addTarget( 
+            /* [in] */ BSTR uri,
+            /* [in] */ VARIANT options,
+            /* [in] */ enum VLCPlaylistMode mode,
+            /* [in] */ int position) = 0;
+        
+        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_PlaylistIndex( 
+            /* [retval][out] */ int __RPC_FAR *index) = 0;
+        
+        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_PlaylistCount( 
+            /* [retval][out] */ int __RPC_FAR *index) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playlistNext( void) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playlistPrev( void) = 0;
+        
+        virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playlistClear( void) = 0;
+        
+        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_VersionInfo( 
+            /* [retval][out] */ BSTR __RPC_FAR *version) = 0;
+        
+    };
+    
+#else  /* C style interface */
+
+    typedef struct IVLCControlVtbl
+    {
+        BEGIN_INTERFACE
+        
+        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ REFIID riid,
+            /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
+        
+        ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 
+            IVLCControl __RPC_FAR * This);
+        
+        ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 
+            IVLCControl __RPC_FAR * This);
+        
+        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( 
+            IVLCControl __RPC_FAR * This,
+            /* [out] */ UINT __RPC_FAR *pctinfo);
+        
+        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ UINT iTInfo,
+            /* [in] */ LCID lcid,
+            /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
+        
+        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ REFIID riid,
+            /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
+            /* [in] */ UINT cNames,
+            /* [in] */ LCID lcid,
+            /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
+        
+        /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ DISPID dispIdMember,
+            /* [in] */ REFIID riid,
+            /* [in] */ LCID lcid,
+            /* [in] */ WORD wFlags,
+            /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
+            /* [out] */ VARIANT __RPC_FAR *pVarResult,
+            /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
+            /* [out] */ UINT __RPC_FAR *puArgErr);
+        
+        /* [helpstring][propget][defaultbind][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Value )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ VARIANT __RPC_FAR *pvarValue);
+        
+        /* [helpstring][propput][defaultbind][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Value )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ VARIANT pvarValue);
+        
+        /* [helpstring][bindable][propget][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Visible )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible);
+        
+        /* [helpstring][bindable][propput][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Visible )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ VARIANT_BOOL visible);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *play )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *pause )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *stop )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Playing )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying);
+        
+        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Playing )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ VARIANT_BOOL isPlaying);
+        
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Position )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ float __RPC_FAR *position);
+        
+        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Position )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ float position);
+        
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Time )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ int __RPC_FAR *seconds);
+        
+        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Time )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ int seconds);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *shuttle )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ int seconds);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *fullscreen )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Length )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ int __RPC_FAR *seconds);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playFaster )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playSlower )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Volume )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ int __RPC_FAR *volume);
+        
+        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Volume )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ int volume);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *toggleMute )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *addTarget )( 
+            IVLCControl __RPC_FAR * This,
+            /* [in] */ BSTR uri,
+            /* [in] */ VARIANT options,
+            /* [in] */ enum VLCPlaylistMode mode,
+            /* [in] */ int position);
+        
+        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_PlaylistIndex )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ int __RPC_FAR *index);
+        
+        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_PlaylistCount )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ int __RPC_FAR *index);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playlistNext )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playlistPrev )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playlistClear )( 
+            IVLCControl __RPC_FAR * This);
+        
+        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_VersionInfo )( 
+            IVLCControl __RPC_FAR * This,
+            /* [retval][out] */ BSTR __RPC_FAR *version);
+        
+        END_INTERFACE
+    } IVLCControlVtbl;
+
+    interface IVLCControl
+    {
+        CONST_VTBL struct IVLCControlVtbl __RPC_FAR *lpVtbl;
+    };
+
+    
+
+#ifdef COBJMACROS
+
+
+#define IVLCControl_QueryInterface(This,riid,ppvObject)        \
+    (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
+
+#define IVLCControl_AddRef(This)       \
+    (This)->lpVtbl -> AddRef(This)
+
+#define IVLCControl_Release(This)      \
+    (This)->lpVtbl -> Release(This)
+
+
+#define IVLCControl_GetTypeInfoCount(This,pctinfo)     \
+    (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
+
+#define IVLCControl_GetTypeInfo(This,iTInfo,lcid,ppTInfo)      \
+    (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+
+#define IVLCControl_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)    \
+    (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+
+#define IVLCControl_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)      \
+    (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+
+
+#define IVLCControl_get_Value(This,pvarValue)  \
+    (This)->lpVtbl -> get_Value(This,pvarValue)
+
+#define IVLCControl_put_Value(This,pvarValue)  \
+    (This)->lpVtbl -> put_Value(This,pvarValue)
+
+#define IVLCControl_get_Visible(This,visible)  \
+    (This)->lpVtbl -> get_Visible(This,visible)
+
+#define IVLCControl_put_Visible(This,visible)  \
+    (This)->lpVtbl -> put_Visible(This,visible)
+
+#define IVLCControl_play(This) \
+    (This)->lpVtbl -> play(This)
+
+#define IVLCControl_pause(This)        \
+    (This)->lpVtbl -> pause(This)
+
+#define IVLCControl_stop(This) \
+    (This)->lpVtbl -> stop(This)
+
+#define IVLCControl_get_Playing(This,isPlaying)        \
+    (This)->lpVtbl -> get_Playing(This,isPlaying)
+
+#define IVLCControl_put_Playing(This,isPlaying)        \
+    (This)->lpVtbl -> put_Playing(This,isPlaying)
+
+#define IVLCControl_get_Position(This,position)        \
+    (This)->lpVtbl -> get_Position(This,position)
+
+#define IVLCControl_put_Position(This,position)        \
+    (This)->lpVtbl -> put_Position(This,position)
+
+#define IVLCControl_get_Time(This,seconds)     \
+    (This)->lpVtbl -> get_Time(This,seconds)
+
+#define IVLCControl_put_Time(This,seconds)     \
+    (This)->lpVtbl -> put_Time(This,seconds)
+
+#define IVLCControl_shuttle(This,seconds)      \
+    (This)->lpVtbl -> shuttle(This,seconds)
+
+#define IVLCControl_fullscreen(This)   \
+    (This)->lpVtbl -> fullscreen(This)
+
+#define IVLCControl_get_Length(This,seconds)   \
+    (This)->lpVtbl -> get_Length(This,seconds)
+
+#define IVLCControl_playFaster(This)   \
+    (This)->lpVtbl -> playFaster(This)
+
+#define IVLCControl_playSlower(This)   \
+    (This)->lpVtbl -> playSlower(This)
+
+#define IVLCControl_get_Volume(This,volume)    \
+    (This)->lpVtbl -> get_Volume(This,volume)
+
+#define IVLCControl_put_Volume(This,volume)    \
+    (This)->lpVtbl -> put_Volume(This,volume)
+
+#define IVLCControl_toggleMute(This)   \
+    (This)->lpVtbl -> toggleMute(This)
+
+#define IVLCControl_addTarget(This,uri,options,mode,position)  \
+    (This)->lpVtbl -> addTarget(This,uri,options,mode,position)
+
+#define IVLCControl_get_PlaylistIndex(This,index)      \
+    (This)->lpVtbl -> get_PlaylistIndex(This,index)
+
+#define IVLCControl_get_PlaylistCount(This,index)      \
+    (This)->lpVtbl -> get_PlaylistCount(This,index)
+
+#define IVLCControl_playlistNext(This) \
+    (This)->lpVtbl -> playlistNext(This)
+
+#define IVLCControl_playlistPrev(This) \
+    (This)->lpVtbl -> playlistPrev(This)
+
+#define IVLCControl_playlistClear(This)        \
+    (This)->lpVtbl -> playlistClear(This)
+
+#define IVLCControl_get_VersionInfo(This,version)      \
+    (This)->lpVtbl -> get_VersionInfo(This,version)
+
+#endif /* COBJMACROS */
+
+
+#endif         /* C style interface */
+
+
+
+/* [helpstring][propget][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Value_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ VARIANT __RPC_FAR *pvarValue);
+
+
+void __RPC_STUB IVLCControl_get_Value_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propput][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Value_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [in] */ VARIANT pvarValue);
+
+
+void __RPC_STUB IVLCControl_put_Value_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][bindable][propget][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Visible_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible);
+
+
+void __RPC_STUB IVLCControl_get_Visible_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][bindable][propput][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Visible_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [in] */ VARIANT_BOOL visible);
+
+
+void __RPC_STUB IVLCControl_put_Visible_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_play_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_play_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_pause_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_pause_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_stop_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_stop_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Playing_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying);
+
+
+void __RPC_STUB IVLCControl_get_Playing_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Playing_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [in] */ VARIANT_BOOL isPlaying);
+
+
+void __RPC_STUB IVLCControl_put_Playing_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Position_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ float __RPC_FAR *position);
+
+
+void __RPC_STUB IVLCControl_get_Position_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Position_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [in] */ float position);
+
+
+void __RPC_STUB IVLCControl_put_Position_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Time_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ int __RPC_FAR *seconds);
+
+
+void __RPC_STUB IVLCControl_get_Time_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Time_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [in] */ int seconds);
+
+
+void __RPC_STUB IVLCControl_put_Time_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_shuttle_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [in] */ int seconds);
+
+
+void __RPC_STUB IVLCControl_shuttle_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_fullscreen_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_fullscreen_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Length_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ int __RPC_FAR *seconds);
+
+
+void __RPC_STUB IVLCControl_get_Length_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playFaster_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_playFaster_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playSlower_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_playSlower_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Volume_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ int __RPC_FAR *volume);
+
+
+void __RPC_STUB IVLCControl_get_Volume_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Volume_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [in] */ int volume);
+
+
+void __RPC_STUB IVLCControl_put_Volume_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_toggleMute_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_toggleMute_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_addTarget_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [in] */ BSTR uri,
+    /* [in] */ VARIANT options,
+    /* [in] */ enum VLCPlaylistMode mode,
+    /* [in] */ int position);
+
+
+void __RPC_STUB IVLCControl_addTarget_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_PlaylistIndex_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ int __RPC_FAR *index);
+
+
+void __RPC_STUB IVLCControl_get_PlaylistIndex_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_PlaylistCount_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ int __RPC_FAR *index);
+
+
+void __RPC_STUB IVLCControl_get_PlaylistCount_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playlistNext_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_playlistNext_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playlistPrev_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_playlistPrev_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring] */ HRESULT STDMETHODCALLTYPE IVLCControl_playlistClear_Proxy( 
+    IVLCControl __RPC_FAR * This);
+
+
+void __RPC_STUB IVLCControl_playlistClear_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_VersionInfo_Proxy( 
+    IVLCControl __RPC_FAR * This,
+    /* [retval][out] */ BSTR __RPC_FAR *version);
+
+
+void __RPC_STUB IVLCControl_get_VersionInfo_Stub(
+    IRpcStubBuffer *This,
+    IRpcChannelBuffer *_pRpcChannelBuffer,
+    PRPC_MESSAGE _pRpcMessage,
+    DWORD *_pdwStubPhase);
+
+
+
+#endif         /* __IVLCControl_INTERFACE_DEFINED__ */
+
+
+#ifndef __DVLCEvents_DISPINTERFACE_DEFINED__
+#define __DVLCEvents_DISPINTERFACE_DEFINED__
+
+/* dispinterface DVLCEvents */
+/* [hidden][helpstring][uuid] */ 
+
+
+EXTERN_C const IID DIID_DVLCEvents;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+    MIDL_INTERFACE("DF48072F-5EF8-434e-9B40-E2F3AE759B5F")
+    DVLCEvents : public IDispatch
+    {
+    };
+    
+#else  /* C style interface */
+
+    typedef struct DVLCEventsVtbl
+    {
+        BEGIN_INTERFACE
+        
+        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 
+            DVLCEvents __RPC_FAR * This,
+            /* [in] */ REFIID riid,
+            /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
+        
+        ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 
+            DVLCEvents __RPC_FAR * This);
+        
+        ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 
+            DVLCEvents __RPC_FAR * This);
+        
+        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( 
+            DVLCEvents __RPC_FAR * This,
+            /* [out] */ UINT __RPC_FAR *pctinfo);
+        
+        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( 
+            DVLCEvents __RPC_FAR * This,
+            /* [in] */ UINT iTInfo,
+            /* [in] */ LCID lcid,
+            /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
+        
+        HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( 
+            DVLCEvents __RPC_FAR * This,
+            /* [in] */ REFIID riid,
+            /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
+            /* [in] */ UINT cNames,
+            /* [in] */ LCID lcid,
+            /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
+        
+        /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( 
+            DVLCEvents __RPC_FAR * This,
+            /* [in] */ DISPID dispIdMember,
+            /* [in] */ REFIID riid,
+            /* [in] */ LCID lcid,
+            /* [in] */ WORD wFlags,
+            /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
+            /* [out] */ VARIANT __RPC_FAR *pVarResult,
+            /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
+            /* [out] */ UINT __RPC_FAR *puArgErr);
+        
+        END_INTERFACE
+    } DVLCEventsVtbl;
+
+    interface DVLCEvents
+    {
+        CONST_VTBL struct DVLCEventsVtbl __RPC_FAR *lpVtbl;
+    };
+
+    
+
+#ifdef COBJMACROS
+
+
+#define DVLCEvents_QueryInterface(This,riid,ppvObject) \
+    (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
+
+#define DVLCEvents_AddRef(This)        \
+    (This)->lpVtbl -> AddRef(This)
+
+#define DVLCEvents_Release(This)       \
+    (This)->lpVtbl -> Release(This)
+
+
+#define DVLCEvents_GetTypeInfoCount(This,pctinfo)      \
+    (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
+
+#define DVLCEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo)       \
+    (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+
+#define DVLCEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)     \
+    (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+
+#define DVLCEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)       \
+    (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+
+#endif /* COBJMACROS */
+
+
+#endif         /* C style interface */
+
+
+#endif         /* __DVLCEvents_DISPINTERFACE_DEFINED__ */
+
+
+EXTERN_C const CLSID CLSID_VLCPlugin;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("E23FE9C6-778E-49D4-B537-38FCDE4887D8")
+VLCPlugin;
+#endif
+#endif /* __AXVLC_LIBRARY_DEFINED__ */
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 6fd504a..a18b070 100644 (file)
-/*****************************************************************************\r
- * connectioncontainer.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "connectioncontainer.h"\r
-\r
-#include "utils.h"\r
-\r
-using namespace std;\r
-\r
-////////////////////////////////////////////////////////////////////////////////////////////////\r
-\r
-class VLCEnumConnections : public IEnumConnections\r
-{\r
-public:\r
-    VLCEnumConnections(vector<CONNECTDATA> &v) :\r
-        e(VLCEnum<CONNECTDATA>(IID_IEnumConnections, v))\r
-    { e.setRetainOperation((VLCEnum<CONNECTDATA>::retainer)&retain); };\r
-\r
-    VLCEnumConnections(const VLCEnumConnections &vlcEnum) : e(vlcEnum.e) {};\r
-\r
-    virtual ~VLCEnumConnections() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-        { return e.QueryInterface(riid, ppv); };\r
-    STDMETHODIMP_(ULONG) AddRef(void)\r
-        { return e.AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void)\r
-        {return e.Release(); };\r
-\r
-    //IEnumConnectionPoints\r
-    STDMETHODIMP Next(ULONG celt, LPCONNECTDATA rgelt, ULONG *pceltFetched)\r
-        { return e.Next(celt, rgelt, pceltFetched); };\r
-    STDMETHODIMP Skip(ULONG celt)\r
-        { return e.Skip(celt);};\r
-    STDMETHODIMP Reset(void)\r
-        { return e.Reset();};\r
-    STDMETHODIMP Clone(LPENUMCONNECTIONS *ppenum)\r
-        { if( NULL == ppenum ) return E_POINTER;\r
-          *ppenum = dynamic_cast<LPENUMCONNECTIONS>(new VLCEnumConnections(*this));\r
-          return (NULL != *ppenum) ? S_OK : E_OUTOFMEMORY;\r
-        };\r
-\r
-private:\r
-\r
-    static void retain(CONNECTDATA cd)\r
-    {\r
-        cd.pUnk->AddRef();\r
-    };\r
-\r
-    VLCEnum<CONNECTDATA> e;\r
-};\r
-\r
-////////////////////////////////////////////////////////////////////////////////////////////////\r
-\r
-STDMETHODIMP VLCConnectionPoint::GetConnectionInterface(IID *iid)\r
-{\r
-    if( NULL == iid )\r
-        return E_POINTER;\r
-\r
-    *iid = _iid;\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCConnectionPoint::GetConnectionPointContainer(LPCONNECTIONPOINTCONTAINER *ppCPC)\r
-{\r
-    if( NULL == ppCPC )\r
-        return E_POINTER;\r
-\r
-    _p_cpc->AddRef();\r
-    *ppCPC = _p_cpc;\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCConnectionPoint::Advise(IUnknown *pUnk, DWORD *pdwCookie)\r
-{\r
-    if( (NULL == pUnk) || (NULL == pdwCookie) )\r
-        return E_POINTER;\r
-\r
-    CONNECTDATA cd;\r
-\r
-    pUnk->AddRef();\r
-    cd.pUnk = pUnk;\r
-    *pdwCookie = cd.dwCookie = _connections.size();\r
-\r
-    _connections.push_back(cd);\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCConnectionPoint::Unadvise(DWORD pdwCookie)\r
-{\r
-    if( pdwCookie < _connections.size() )\r
-    {\r
-        CONNECTDATA cd = _connections[pdwCookie];\r
-        if( NULL != cd.pUnk )\r
-        {\r
-            cd.pUnk->Release();\r
-            cd.pUnk = NULL;\r
-            return S_OK;\r
-        }\r
-    }\r
-    return CONNECT_E_NOCONNECTION;\r
-};\r
-\r
-STDMETHODIMP VLCConnectionPoint::EnumConnections(IEnumConnections **ppEnum)\r
-{\r
-    if( NULL == ppEnum )\r
-        return E_POINTER;\r
-\r
-    *ppEnum = dynamic_cast<LPENUMCONNECTIONS>(new VLCEnumConnections(_connections));\r
-\r
-    return (NULL != *ppEnum ) ? S_OK : E_OUTOFMEMORY;\r
-};\r
-\r
-void VLCConnectionPoint::fireEvent(DISPID dispId, DISPPARAMS* pDispParams)\r
-{\r
-    vector<CONNECTDATA>::iterator end = _connections.end();\r
-    vector<CONNECTDATA>::iterator iter = _connections.begin();\r
-\r
-    while( iter != end )\r
-    {\r
-        CONNECTDATA cd = *iter;\r
-        if( NULL != cd.pUnk )\r
-        {\r
-            IDispatch *pDisp;\r
-            if( SUCCEEDED(cd.pUnk->QueryInterface(IID_IDispatch, (LPVOID *)&pDisp)) )\r
-            {\r
-                pDisp->Invoke(dispId, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, pDispParams, NULL, NULL, NULL);\r
-                pDisp->Release();\r
-            }\r
-        }\r
-        ++iter;\r
-    }\r
-};\r
-\r
-void VLCConnectionPoint::firePropChangedEvent(DISPID dispId)\r
-{\r
-    vector<CONNECTDATA>::iterator end = _connections.end();\r
-    vector<CONNECTDATA>::iterator iter = _connections.begin();\r
-\r
-    while( iter != end )\r
-    {\r
-        CONNECTDATA cd = *iter;\r
-        if( NULL != cd.pUnk )\r
-        {\r
-            IPropertyNotifySink *pPropSink;\r
-            if( SUCCEEDED(cd.pUnk->QueryInterface(IID_IPropertyNotifySink, (LPVOID *)&pPropSink)) )\r
-            {\r
-                pPropSink->OnChanged(dispId);\r
-                pPropSink->Release();\r
-            }\r
-        }\r
-        ++iter;\r
-    }\r
-};\r
-\r
-////////////////////////////////////////////////////////////////////////////////////////////////\r
-\r
-class VLCEnumConnectionPoints : public IEnumConnectionPoints\r
-{\r
-public:\r
-    VLCEnumConnectionPoints(vector<LPCONNECTIONPOINT> &v) :\r
-        e(VLCEnum<LPCONNECTIONPOINT>(IID_IEnumConnectionPoints, v))\r
-    { e.setRetainOperation((VLCEnum<LPCONNECTIONPOINT>::retainer)&retain); };\r
-\r
-    VLCEnumConnectionPoints(const VLCEnumConnectionPoints &vlcEnum) : e(vlcEnum.e) {};\r
-\r
-    virtual ~VLCEnumConnectionPoints() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-        { return e.QueryInterface(riid, ppv); };\r
-    STDMETHODIMP_(ULONG) AddRef(void)\r
-        { return e.AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void)\r
-        {return e.Release(); };\r
-\r
-    //IEnumConnectionPoints\r
-    STDMETHODIMP Next(ULONG celt, LPCONNECTIONPOINT *rgelt, ULONG *pceltFetched)\r
-        { return e.Next(celt, rgelt, pceltFetched); };\r
-    STDMETHODIMP Skip(ULONG celt)\r
-        { return e.Skip(celt);};\r
-    STDMETHODIMP Reset(void)\r
-        { return e.Reset();};\r
-    STDMETHODIMP Clone(LPENUMCONNECTIONPOINTS *ppenum)\r
-        { if( NULL == ppenum ) return E_POINTER;\r
-          *ppenum = dynamic_cast<LPENUMCONNECTIONPOINTS>(new VLCEnumConnectionPoints(*this));\r
-          return (NULL != *ppenum) ? S_OK : E_OUTOFMEMORY;\r
-        };\r
-\r
-private:\r
-\r
-    static void retain(LPCONNECTIONPOINT cp)\r
-    {\r
-        cp->AddRef();\r
-    };\r
-\r
-    VLCEnum<LPCONNECTIONPOINT> e;\r
-};\r
-\r
-////////////////////////////////////////////////////////////////////////////////////////////////\r
-\r
-VLCConnectionPointContainer::VLCConnectionPointContainer(VLCPlugin *p_instance) :\r
-    _p_instance(p_instance)\r
-{\r
-    _p_events = new VLCConnectionPoint(dynamic_cast<LPCONNECTIONPOINTCONTAINER>(this),\r
-            _p_instance->getDispEventID());\r
-\r
-    _v_cps.push_back(dynamic_cast<LPCONNECTIONPOINT>(_p_events));\r
-\r
-    _p_props = new VLCConnectionPoint(dynamic_cast<LPCONNECTIONPOINTCONTAINER>(this),\r
-            IID_IPropertyNotifySink);\r
-\r
-    _v_cps.push_back(dynamic_cast<LPCONNECTIONPOINT>(_p_props));\r
-};\r
-\r
-VLCConnectionPointContainer::~VLCConnectionPointContainer()\r
-{\r
-    _v_cps.clear();\r
-    delete _p_props;\r
-    delete _p_events;\r
-};\r
-\r
-STDMETHODIMP VLCConnectionPointContainer::EnumConnectionPoints(LPENUMCONNECTIONPOINTS *ppEnum)\r
-{\r
-    if( NULL == ppEnum )\r
-        return E_POINTER;\r
-\r
-    *ppEnum = dynamic_cast<LPENUMCONNECTIONPOINTS>(new VLCEnumConnectionPoints(_v_cps));\r
-\r
-    return (NULL != *ppEnum ) ? S_OK : E_OUTOFMEMORY;\r
-};\r
-\r
-STDMETHODIMP VLCConnectionPointContainer::FindConnectionPoint(REFIID riid, IConnectionPoint **ppCP)\r
-{\r
-    if( NULL == ppCP )\r
-        return E_POINTER;\r
-\r
-    *ppCP = NULL;\r
-\r
-    if( IID_IPropertyNotifySink == riid )\r
-    {\r
-        _p_props->AddRef();\r
-        *ppCP = dynamic_cast<LPCONNECTIONPOINT>(_p_props);\r
-    }\r
-    else if( _p_instance->getDispEventID() == riid )\r
-    {\r
-        _p_events->AddRef();\r
-        *ppCP = dynamic_cast<LPCONNECTIONPOINT>(_p_events);\r
-    }\r
-    else\r
-        return CONNECT_E_NOCONNECTION;\r
-\r
-    return NOERROR;\r
-};\r
-\r
-void VLCConnectionPointContainer::fireEvent(DISPID dispId, DISPPARAMS* pDispParams)\r
-{\r
-    _p_events->fireEvent(dispId, pDispParams);\r
-};\r
-\r
-void VLCConnectionPointContainer::firePropChangedEvent(DISPID dispId)\r
-{\r
-    _p_props->firePropChangedEvent(dispId);\r
-};\r
-\r
+/*****************************************************************************
+ * connectioncontainer.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "connectioncontainer.h"
+
+#include "utils.h"
+
+using namespace std;
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+
+class VLCEnumConnections : public IEnumConnections
+{
+public:
+    VLCEnumConnections(vector<CONNECTDATA> &v) :
+        e(VLCEnum<CONNECTDATA>(IID_IEnumConnections, v))
+    { e.setRetainOperation((VLCEnum<CONNECTDATA>::retainer)&retain); };
+
+    VLCEnumConnections(const VLCEnumConnections &vlcEnum) : e(vlcEnum.e) {};
+
+    virtual ~VLCEnumConnections() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+        { return e.QueryInterface(riid, ppv); };
+    STDMETHODIMP_(ULONG) AddRef(void)
+        { return e.AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void)
+        {return e.Release(); };
+
+    //IEnumConnectionPoints
+    STDMETHODIMP Next(ULONG celt, LPCONNECTDATA rgelt, ULONG *pceltFetched)
+        { return e.Next(celt, rgelt, pceltFetched); };
+    STDMETHODIMP Skip(ULONG celt)
+        { return e.Skip(celt);};
+    STDMETHODIMP Reset(void)
+        { return e.Reset();};
+    STDMETHODIMP Clone(LPENUMCONNECTIONS *ppenum)
+        { if( NULL == ppenum ) return E_POINTER;
+          *ppenum = dynamic_cast<LPENUMCONNECTIONS>(new VLCEnumConnections(*this));
+          return (NULL != *ppenum) ? S_OK : E_OUTOFMEMORY;
+        };
+
+private:
+
+    static void retain(CONNECTDATA cd)
+    {
+        cd.pUnk->AddRef();
+    };
+
+    VLCEnum<CONNECTDATA> e;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+
+STDMETHODIMP VLCConnectionPoint::GetConnectionInterface(IID *iid)
+{
+    if( NULL == iid )
+        return E_POINTER;
+
+    *iid = _iid;
+    return S_OK;
+};
+
+STDMETHODIMP VLCConnectionPoint::GetConnectionPointContainer(LPCONNECTIONPOINTCONTAINER *ppCPC)
+{
+    if( NULL == ppCPC )
+        return E_POINTER;
+
+    _p_cpc->AddRef();
+    *ppCPC = _p_cpc;
+    return S_OK;
+};
+
+STDMETHODIMP VLCConnectionPoint::Advise(IUnknown *pUnk, DWORD *pdwCookie)
+{
+    if( (NULL == pUnk) || (NULL == pdwCookie) )
+        return E_POINTER;
+
+    CONNECTDATA cd;
+
+    pUnk->AddRef();
+    cd.pUnk = pUnk;
+    *pdwCookie = cd.dwCookie = _connections.size();
+
+    _connections.push_back(cd);
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCConnectionPoint::Unadvise(DWORD pdwCookie)
+{
+    if( pdwCookie < _connections.size() )
+    {
+        CONNECTDATA cd = _connections[pdwCookie];
+        if( NULL != cd.pUnk )
+        {
+            cd.pUnk->Release();
+            cd.pUnk = NULL;
+            return S_OK;
+        }
+    }
+    return CONNECT_E_NOCONNECTION;
+};
+
+STDMETHODIMP VLCConnectionPoint::EnumConnections(IEnumConnections **ppEnum)
+{
+    if( NULL == ppEnum )
+        return E_POINTER;
+
+    *ppEnum = dynamic_cast<LPENUMCONNECTIONS>(new VLCEnumConnections(_connections));
+
+    return (NULL != *ppEnum ) ? S_OK : E_OUTOFMEMORY;
+};
+
+void VLCConnectionPoint::fireEvent(DISPID dispId, DISPPARAMS* pDispParams)
+{
+    vector<CONNECTDATA>::iterator end = _connections.end();
+    vector<CONNECTDATA>::iterator iter = _connections.begin();
+
+    while( iter != end )
+    {
+        CONNECTDATA cd = *iter;
+        if( NULL != cd.pUnk )
+        {
+            IDispatch *pDisp;
+            if( SUCCEEDED(cd.pUnk->QueryInterface(IID_IDispatch, (LPVOID *)&pDisp)) )
+            {
+                pDisp->Invoke(dispId, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, pDispParams, NULL, NULL, NULL);
+                pDisp->Release();
+            }
+        }
+        ++iter;
+    }
+};
+
+void VLCConnectionPoint::firePropChangedEvent(DISPID dispId)
+{
+    vector<CONNECTDATA>::iterator end = _connections.end();
+    vector<CONNECTDATA>::iterator iter = _connections.begin();
+
+    while( iter != end )
+    {
+        CONNECTDATA cd = *iter;
+        if( NULL != cd.pUnk )
+        {
+            IPropertyNotifySink *pPropSink;
+            if( SUCCEEDED(cd.pUnk->QueryInterface(IID_IPropertyNotifySink, (LPVOID *)&pPropSink)) )
+            {
+                pPropSink->OnChanged(dispId);
+                pPropSink->Release();
+            }
+        }
+        ++iter;
+    }
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+
+class VLCEnumConnectionPoints : public IEnumConnectionPoints
+{
+public:
+    VLCEnumConnectionPoints(vector<LPCONNECTIONPOINT> &v) :
+        e(VLCEnum<LPCONNECTIONPOINT>(IID_IEnumConnectionPoints, v))
+    { e.setRetainOperation((VLCEnum<LPCONNECTIONPOINT>::retainer)&retain); };
+
+    VLCEnumConnectionPoints(const VLCEnumConnectionPoints &vlcEnum) : e(vlcEnum.e) {};
+
+    virtual ~VLCEnumConnectionPoints() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+        { return e.QueryInterface(riid, ppv); };
+    STDMETHODIMP_(ULONG) AddRef(void)
+        { return e.AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void)
+        {return e.Release(); };
+
+    //IEnumConnectionPoints
+    STDMETHODIMP Next(ULONG celt, LPCONNECTIONPOINT *rgelt, ULONG *pceltFetched)
+        { return e.Next(celt, rgelt, pceltFetched); };
+    STDMETHODIMP Skip(ULONG celt)
+        { return e.Skip(celt);};
+    STDMETHODIMP Reset(void)
+        { return e.Reset();};
+    STDMETHODIMP Clone(LPENUMCONNECTIONPOINTS *ppenum)
+        { if( NULL == ppenum ) return E_POINTER;
+          *ppenum = dynamic_cast<LPENUMCONNECTIONPOINTS>(new VLCEnumConnectionPoints(*this));
+          return (NULL != *ppenum) ? S_OK : E_OUTOFMEMORY;
+        };
+
+private:
+
+    static void retain(LPCONNECTIONPOINT cp)
+    {
+        cp->AddRef();
+    };
+
+    VLCEnum<LPCONNECTIONPOINT> e;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+
+VLCConnectionPointContainer::VLCConnectionPointContainer(VLCPlugin *p_instance) :
+    _p_instance(p_instance)
+{
+    _p_events = new VLCConnectionPoint(dynamic_cast<LPCONNECTIONPOINTCONTAINER>(this),
+            _p_instance->getDispEventID());
+
+    _v_cps.push_back(dynamic_cast<LPCONNECTIONPOINT>(_p_events));
+
+    _p_props = new VLCConnectionPoint(dynamic_cast<LPCONNECTIONPOINTCONTAINER>(this),
+            IID_IPropertyNotifySink);
+
+    _v_cps.push_back(dynamic_cast<LPCONNECTIONPOINT>(_p_props));
+};
+
+VLCConnectionPointContainer::~VLCConnectionPointContainer()
+{
+    _v_cps.clear();
+    delete _p_props;
+    delete _p_events;
+};
+
+STDMETHODIMP VLCConnectionPointContainer::EnumConnectionPoints(LPENUMCONNECTIONPOINTS *ppEnum)
+{
+    if( NULL == ppEnum )
+        return E_POINTER;
+
+    *ppEnum = dynamic_cast<LPENUMCONNECTIONPOINTS>(new VLCEnumConnectionPoints(_v_cps));
+
+    return (NULL != *ppEnum ) ? S_OK : E_OUTOFMEMORY;
+};
+
+STDMETHODIMP VLCConnectionPointContainer::FindConnectionPoint(REFIID riid, IConnectionPoint **ppCP)
+{
+    if( NULL == ppCP )
+        return E_POINTER;
+
+    *ppCP = NULL;
+
+    if( IID_IPropertyNotifySink == riid )
+    {
+        _p_props->AddRef();
+        *ppCP = dynamic_cast<LPCONNECTIONPOINT>(_p_props);
+    }
+    else if( _p_instance->getDispEventID() == riid )
+    {
+        _p_events->AddRef();
+        *ppCP = dynamic_cast<LPCONNECTIONPOINT>(_p_events);
+    }
+    else
+        return CONNECT_E_NOCONNECTION;
+
+    return NOERROR;
+};
+
+void VLCConnectionPointContainer::fireEvent(DISPID dispId, DISPPARAMS* pDispParams)
+{
+    _p_events->fireEvent(dispId, pDispParams);
+};
+
+void VLCConnectionPointContainer::firePropChangedEvent(DISPID dispId)
+{
+    _p_props->firePropChangedEvent(dispId);
+};
+
index 87d97dc..4bbd696 100644 (file)
-/*****************************************************************************\r
- * connectioncontainer.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __CONNECTIONCONTAINER_H__\r
-#define __CONNECTIONCONTAINER_H__\r
-\r
-#include <ocidl.h>\r
-#include <vector>\r
-\r
-using namespace std;\r
-\r
-class VLCConnectionPoint : public IConnectionPoint\r
-{\r
-\r
-public:\r
-\r
-    VLCConnectionPoint(IConnectionPointContainer *p_cpc, REFIID iid) :\r
-        _iid(iid), _p_cpc(p_cpc) {};\r
-    virtual ~VLCConnectionPoint() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( NULL == ppv ) return E_POINTER;\r
-        if( (IID_IUnknown == riid) \r
-         && (IID_IConnectionPoint == riid) ) {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        // must be a standalone object\r
-        return E_NOINTERFACE;\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_cpc->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_cpc->Release(); };\r
-\r
-    // IConnectionPoint methods\r
-    STDMETHODIMP GetConnectionInterface(IID *);\r
-    STDMETHODIMP GetConnectionPointContainer(LPCONNECTIONPOINTCONTAINER *);\r
-    STDMETHODIMP Advise(IUnknown *, DWORD *);\r
-    STDMETHODIMP Unadvise(DWORD);\r
-    STDMETHODIMP EnumConnections(LPENUMCONNECTIONS *);\r
-\r
-    void fireEvent(DISPID dispIdMember, DISPPARAMS* pDispParams);\r
-    void firePropChangedEvent(DISPID dispId);\r
-\r
-private:\r
-\r
-    REFIID _iid;\r
-    IConnectionPointContainer *_p_cpc;\r
-    vector<CONNECTDATA> _connections;\r
-};\r
-\r
-//////////////////////////////////////////////////////////////////////////\r
-\r
-class VLCConnectionPointContainer : public IConnectionPointContainer\r
-{\r
-\r
-public:\r
-\r
-    VLCConnectionPointContainer(VLCPlugin *p_instance);\r
-    virtual ~VLCConnectionPointContainer();\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid) \r
-         && (IID_IConnectionPointContainer == riid) ) {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IConnectionPointContainer methods\r
-    STDMETHODIMP EnumConnectionPoints(LPENUMCONNECTIONPOINTS *);\r
-    STDMETHODIMP FindConnectionPoint(REFIID, LPCONNECTIONPOINT *);\r
-\r
-    void fireEvent(DISPID, DISPPARAMS*);\r
-    void firePropChangedEvent(DISPID dispId);\r
-\r
-private:\r
-\r
-    VLCPlugin *_p_instance;\r
-    VLCConnectionPoint *_p_events;\r
-    VLCConnectionPoint *_p_props;\r
-    vector<LPCONNECTIONPOINT> _v_cps;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * connectioncontainer.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __CONNECTIONCONTAINER_H__
+#define __CONNECTIONCONTAINER_H__
+
+#include <ocidl.h>
+#include <vector>
+
+using namespace std;
+
+class VLCConnectionPoint : public IConnectionPoint
+{
+
+public:
+
+    VLCConnectionPoint(IConnectionPointContainer *p_cpc, REFIID iid) :
+        _iid(iid), _p_cpc(p_cpc) {};
+    virtual ~VLCConnectionPoint() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( NULL == ppv ) return E_POINTER;
+        if( (IID_IUnknown == riid) 
+         && (IID_IConnectionPoint == riid) ) {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        // must be a standalone object
+        return E_NOINTERFACE;
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_cpc->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_cpc->Release(); };
+
+    // IConnectionPoint methods
+    STDMETHODIMP GetConnectionInterface(IID *);
+    STDMETHODIMP GetConnectionPointContainer(LPCONNECTIONPOINTCONTAINER *);
+    STDMETHODIMP Advise(IUnknown *, DWORD *);
+    STDMETHODIMP Unadvise(DWORD);
+    STDMETHODIMP EnumConnections(LPENUMCONNECTIONS *);
+
+    void fireEvent(DISPID dispIdMember, DISPPARAMS* pDispParams);
+    void firePropChangedEvent(DISPID dispId);
+
+private:
+
+    REFIID _iid;
+    IConnectionPointContainer *_p_cpc;
+    vector<CONNECTDATA> _connections;
+};
+
+//////////////////////////////////////////////////////////////////////////
+
+class VLCConnectionPointContainer : public IConnectionPointContainer
+{
+
+public:
+
+    VLCConnectionPointContainer(VLCPlugin *p_instance);
+    virtual ~VLCConnectionPointContainer();
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid) 
+         && (IID_IConnectionPointContainer == riid) ) {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IConnectionPointContainer methods
+    STDMETHODIMP EnumConnectionPoints(LPENUMCONNECTIONPOINTS *);
+    STDMETHODIMP FindConnectionPoint(REFIID, LPCONNECTIONPOINT *);
+
+    void fireEvent(DISPID, DISPPARAMS*);
+    void firePropChangedEvent(DISPID dispId);
+
+private:
+
+    VLCPlugin *_p_instance;
+    VLCConnectionPoint *_p_events;
+    VLCConnectionPoint *_p_props;
+    vector<LPCONNECTIONPOINT> _v_cps;
+};
+
+#endif
+
index a1500da..258a8ab 100644 (file)
-/*****************************************************************************\r
- * main.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-\r
-#include <comcat.h>\r
-#include <windows.h>\r
-#include <shlwapi.h>\r
-\r
-using namespace std;\r
-\r
-#define THREADING_MODEL "Both"\r
-#define COMPANY_STR "VideoLAN"\r
-#define PROGRAM_STR "VLCPlugin"\r
-#define VERSION_MAJOR_STR "1"\r
-#define VERSION_MINOR_STR "0"\r
-#define DESCRIPTION "VideoLAN VLC ActiveX Plugin"\r
-\r
-#define PROGID_STR COMPANY_STR"."PROGRAM_STR\r
-#define VERS_PROGID_STR COMPANY_STR"."PROGRAM_STR"."VERSION_MAJOR_STR\r
-#define VERSION_STR VERSION_MAJOR_STR"."VERSION_MINOR_STR\r
-\r
-#define GUID_STRLEN 39\r
-\r
-/*\r
-** MingW headers do not declare those\r
-*/\r
-extern const CATID CATID_SafeForInitializing;\r
-extern const CATID CATID_SafeForScripting;\r
-\r
-static LONG i_class_ref= 0;\r
-static HINSTANCE h_instance= 0;\r
-\r
-STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)\r
-{\r
-    HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;\r
-\r
-    *ppv = NULL;\r
-\r
-    if( CLSID_VLCPlugin == rclsid )\r
-    {\r
-        VLCPluginClass *plugin = new VLCPluginClass(&i_class_ref, h_instance);\r
-        hr = plugin->QueryInterface(riid, ppv);\r
-        plugin->Release();\r
-    }\r
-    return hr;\r
-};\r
-\r
-STDAPI DllCanUnloadNow(VOID)\r
-{\r
-    return (0 == i_class_ref) ? S_OK: S_FALSE;\r
-};\r
-\r
-static LPCTSTR TStrFromGUID(REFGUID clsid) {\r
-    LPOLESTR oleStr;\r
-\r
-    if( FAILED(StringFromIID(clsid, &oleStr)) )\r
-        return NULL;\r
-\r
-    //check whether TCHAR and OLECHAR are both either ANSI or UNICODE\r
-    if( sizeof(TCHAR) == sizeof(OLECHAR) )\r
-        return (LPCTSTR)oleStr;\r
-\r
-    LPTSTR pct_CLSID = NULL;\r
-#ifndef OLE2ANSI\r
-    size_t len = WideCharToMultiByte(CP_ACP, 0, oleStr, -1, NULL, 0, NULL, NULL);\r
-    if( len > 0 )\r
-    {\r
-        pct_CLSID = (char *)CoTaskMemAlloc(len);\r
-        WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len, NULL, NULL);\r
-    }\r
-#else\r
-    size_t len = MutiByteToWideChar(CP_ACP, 0, oleStr, -1, NULL, 0);\r
-    if( len > 0 )\r
-    {\r
-        clsidStr = (wchar_t *)CoTaskMemAlloc(len*sizeof(wchar_t));\r
-        WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len);\r
-    }\r
-#endif\r
-    CoTaskMemFree(oleStr);\r
-    return pct_CLSID;\r
-};\r
-\r
-static HKEY keyCreate(HKEY parentKey, LPCTSTR keyName)\r
-{\r
-    HKEY childKey;\r
-    if( ERROR_SUCCESS == RegCreateKeyEx(parentKey, keyName, 0, NULL,\r
-                REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &childKey, NULL) )\r
-    {\r
-        return childKey;\r
-    }\r
-    return NULL;\r
-};\r
-\r
-STDAPI DllUnregisterServer(VOID)\r
-{\r
-    // unregister type lib from the registry\r
-    UnRegisterTypeLib(LIBID_AXVLC, 1, 0, LOCALE_NEUTRAL, SYS_WIN32);\r
-\r
-    // remove component categories we supports\r
-    ICatRegister *pcr;\r
-    if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, \r
-            NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr)) ) {\r
-        CATID implCategories[] = {\r
-            CATID_Control,\r
-            CATID_PersistsToPropertyBag,\r
-            CATID_SafeForInitializing,\r
-            CATID_SafeForScripting,\r
-        };\r
-\r
-        pcr->UnRegisterClassImplCategories(CLSID_VLCPlugin,\r
-                sizeof(implCategories)/sizeof(CATID), implCategories);\r
-        pcr->Release();\r
-    }\r
-\r
-    SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(VERS_PROGID_STR));\r
-    SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(PROGID_STR));\r
-\r
-    LPCTSTR psz_CLSID = TStrFromGUID(CLSID_VLCPlugin);\r
-\r
-    if( NULL == psz_CLSID )\r
-        return E_OUTOFMEMORY;\r
-\r
-    HKEY hClsIDKey;\r
-    if( ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_WRITE, &hClsIDKey) )\r
-    {\r
-        SHDeleteKey(hClsIDKey, psz_CLSID);\r
-        RegCloseKey(hClsIDKey);\r
-    }\r
-    CoTaskMemFree((void *)psz_CLSID);\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDAPI DllRegisterServer(VOID)\r
-{\r
-    DllUnregisterServer();\r
-\r
-    char DllPath[MAX_PATH];\r
-    DWORD DllPathLen= GetModuleFileName(h_instance, DllPath, sizeof(DllPath)) ;\r
-       if( 0 == DllPathLen )\r
-        return E_FAIL;\r
-\r
-    LPCTSTR psz_CLSID = TStrFromGUID(CLSID_VLCPlugin);\r
-\r
-    if( NULL == psz_CLSID )\r
-        return E_OUTOFMEMORY;\r
-\r
-    HKEY hBaseKey;\r
-\r
-    if( ERROR_SUCCESS != RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_CREATE_SUB_KEY, &hBaseKey) )\r
-        return E_FAIL;\r
-\r
-    HKEY hClassKey = keyCreate(hBaseKey, psz_CLSID);\r
-    if( NULL != hClassKey )\r
-    {\r
-        HKEY hSubKey;\r
-\r
-        // default key value\r
-        RegSetValueEx(hClassKey, NULL, 0, REG_SZ,\r
-                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));\r
-\r
-        // Control key value\r
-        hSubKey = keyCreate(hClassKey, TEXT("Control"));\r
-        RegCloseKey(hSubKey);\r
-\r
-        // InprocServer32 key value\r
-        hSubKey = keyCreate(hClassKey, TEXT("InprocServer32"));\r
-        RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
-                (const BYTE*)DllPath, DllPathLen);\r
-        RegSetValueEx(hSubKey, TEXT("ThreadingModel"), 0, REG_SZ,\r
-                (const BYTE*)THREADING_MODEL, sizeof(THREADING_MODEL));\r
-        RegCloseKey(hSubKey);\r
-\r
-        // MiscStatus key value\r
-        hSubKey = keyCreate(hClassKey, TEXT("MiscStatus\\1"));\r
-        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, (const BYTE*)"131473", sizeof("131473"));\r
-        RegCloseKey(hSubKey);\r
-\r
-        // Programmable key value\r
-        hSubKey = keyCreate(hClassKey, TEXT("Programmable"));\r
-        RegCloseKey(hSubKey);\r
-\r
-        // ProgID key value\r
-        hSubKey = keyCreate(hClassKey, TEXT("ProgID"));\r
-        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, \r
-                (const BYTE*)VERS_PROGID_STR, sizeof(VERS_PROGID_STR));\r
-        RegCloseKey(hSubKey);\r
-\r
-        // VersionIndependentProgID key value\r
-        hSubKey = keyCreate(hClassKey, TEXT("VersionIndependentProgID"));\r
-        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, \r
-                (const BYTE*)PROGID_STR, sizeof(PROGID_STR));\r
-        RegCloseKey(hSubKey);\r
-\r
-        // Version key value\r
-        hSubKey = keyCreate(hClassKey, TEXT("Version"));\r
-        RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
-                (const BYTE*)VERSION_STR, sizeof(VERSION_STR));\r
-        RegCloseKey(hSubKey);\r
-\r
-        // TypeLib key value\r
-        LPCTSTR psz_LIBID = TStrFromGUID(LIBID_AXVLC);\r
-        if( NULL != psz_LIBID )\r
-        {\r
-            hSubKey = keyCreate(hClassKey, TEXT("TypeLib"));\r
-            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
-                    (const BYTE*)psz_LIBID, sizeof(TCHAR)*GUID_STRLEN);\r
-            RegCloseKey(hSubKey);\r
-        }\r
-        RegCloseKey(hClassKey);\r
-    }\r
-    RegCloseKey(hBaseKey);\r
-\r
-    hBaseKey = keyCreate(HKEY_CLASSES_ROOT, TEXT(PROGID_STR));\r
-    if( NULL != hBaseKey )\r
-    {\r
-        // default key value\r
-        RegSetValueEx(hBaseKey, NULL, 0, REG_SZ,\r
-                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));\r
-\r
-        HKEY hSubKey = keyCreate(hBaseKey, TEXT("CLSID"));\r
-        if( NULL != hSubKey )\r
-        {\r
-            // default key value\r
-            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
-                    (const BYTE*)psz_CLSID, sizeof(TCHAR)*GUID_STRLEN);\r
-\r
-            RegCloseKey(hSubKey);\r
-        }\r
-        hSubKey = keyCreate(hBaseKey, TEXT("CurVer"));\r
-        if( NULL != hSubKey )\r
-        {\r
-            // default key value\r
-            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
-                    (const BYTE*)VERS_PROGID_STR, sizeof(VERS_PROGID_STR));\r
-\r
-            RegCloseKey(hSubKey);\r
-        }\r
-        RegCloseKey(hBaseKey);\r
-    }\r
-\r
-    hBaseKey = keyCreate(HKEY_CLASSES_ROOT, TEXT(VERS_PROGID_STR));\r
-    if( NULL != hBaseKey )\r
-    {\r
-        // default key value\r
-        RegSetValueEx(hBaseKey, NULL, 0, REG_SZ,\r
-                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));\r
-\r
-        HKEY hSubKey = keyCreate(hBaseKey, TEXT("CLSID"));\r
-        if( NULL != hSubKey )\r
-        {\r
-            // default key value\r
-            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
-                    (const BYTE*)psz_CLSID, sizeof(TCHAR)*GUID_STRLEN);\r
-\r
-            RegCloseKey(hSubKey);\r
-        }\r
-        RegCloseKey(hBaseKey);\r
-    }\r
-\r
-    // indicate which component categories we support\r
-    ICatRegister *pcr;\r
-    if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, \r
-            NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr)) ) {\r
-        CATID implCategories[] = {\r
-            CATID_Control,\r
-            CATID_PersistsToPropertyBag,\r
-            CATID_SafeForInitializing,\r
-            CATID_SafeForScripting,\r
-        };\r
-\r
-        pcr->RegisterClassImplCategories(CLSID_VLCPlugin,\r
-                sizeof(implCategories)/sizeof(CATID), implCategories);\r
-        pcr->Release();\r
-    }\r
-\r
-    // register type lib into the registry\r
-    ITypeLib *typeLib;\r
-#ifndef OLE2ANSI\r
-    size_t typeLibPathLen = MultiByteToWideChar(CP_ACP, 0, DllPath, DllPathLen, NULL, 0);\r
-    if( typeLibPathLen > 0 )\r
-    {\r
-        LPOLESTR typeLibPath = (LPOLESTR)CoTaskMemAlloc(typeLibPathLen*sizeof(wchar_t));\r
-        MultiByteToWideChar(CP_ACP, 0, DllPath, DllPathLen, typeLibPath, typeLibPathLen);\r
-        if( SUCCEEDED(LoadTypeLibEx(typeLibPath, REGKIND_REGISTER, &typeLib)) )\r
-            typeLib->Release();\r
-        CoTaskMemFree((void *)typeLibPath);\r
-    }\r
-#else\r
-    if( SUCCEEDED(LoadTypeLibEx((LPOLESTR)DllPath, REGKIND_REGISTER, &typeLib)) )\r
-        typeLib->Release();\r
-#endif\r
-\r
-    CoTaskMemFree((void *)psz_CLSID);\r
-\r
-    return S_OK;\r
-};\r
-\r
-#ifdef BUILD_LOCALSERVER\r
-\r
-/*\r
-** easier to debug an application than a DLL on cygwin GDB :)\r
-*/\r
-#include <iostream>\r
-\r
-STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)\r
-{\r
-    MSG msg;\r
-\r
-    if( FAILED(OleInitialize(NULL)) )\r
-    {\r
-        cerr << "cannot initialize OLE" << endl;\r
-        return 1;\r
-    }\r
-\r
-    IUnknown *classProc = NULL;\r
-\r
-    if( FAILED(DllGetClassObject(CLSID_VLCPlugin, IID_IUnknown, (LPVOID *)&classProc)) )\r
-        return 0;\r
\r
-    DWORD dwRegisterClassObject;\r
-\r
-    if( FAILED(CoRegisterClassObject(CLSID_VLCPlugin, classProc,\r
-        CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &dwRegisterClassObject)) )\r
-        return 0;\r
-\r
-    DWORD dwRegisterActiveObject;\r
-\r
-    if( FAILED(RegisterActiveObject(classProc, CLSID_VLCPlugin,\r
-                    ACTIVEOBJECT_WEAK, &dwRegisterActiveObject)) )\r
-        return 0;\r
-\r
-    classProc->Release();\r
-\r
-    /*\r
-    * Polling messages from event queue\r
-    */\r
-    while( S_FALSE == DllCanUnloadNow() )\r
-    {\r
-        while( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )\r
-        {\r
-            if( msg.message == WM_QUIT )\r
-                break;  // Leave the PeekMessage while() loop\r
-\r
-            /*if(TranslateAccelerator(ghwndApp, ghAccel, &msg))\r
-                continue;*/\r
-\r
-            TranslateMessage(&msg);\r
-            DispatchMessage(&msg);\r
-        }\r
-\r
-        if(msg.message == WM_QUIT)\r
-            break;  // Leave the for() loop\r
-\r
-        WaitMessage();\r
-    }\r
-\r
-    if( SUCCEEDED(RevokeActiveObject(dwRegisterActiveObject, NULL)) )\r
-        CoRevokeClassObject(dwRegisterClassObject);\r
-\r
-    // Reached on WM_QUIT message\r
-    CoUninitialize();\r
-    return ((int) msg.wParam);\r
-};\r
-\r
-#else\r
-\r
-STDAPI_(BOOL) DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpReserved )\r
-{\r
-    switch( fdwReason )\r
-    {\r
-        case DLL_PROCESS_ATTACH:\r
-            h_instance = (HINSTANCE)hModule;\r
-            break;\r
-\r
-        default:\r
-            break;\r
-    }\r
-    return TRUE;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * main.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+
+#include <comcat.h>
+#include <windows.h>
+#include <shlwapi.h>
+
+using namespace std;
+
+#define THREADING_MODEL "Both"
+#define COMPANY_STR "VideoLAN"
+#define PROGRAM_STR "VLCPlugin"
+#define VERSION_MAJOR_STR "1"
+#define VERSION_MINOR_STR "0"
+#define DESCRIPTION "VideoLAN VLC ActiveX Plugin"
+
+#define PROGID_STR COMPANY_STR"."PROGRAM_STR
+#define VERS_PROGID_STR COMPANY_STR"."PROGRAM_STR"."VERSION_MAJOR_STR
+#define VERSION_STR VERSION_MAJOR_STR"."VERSION_MINOR_STR
+
+#define GUID_STRLEN 39
+
+/*
+** MingW headers do not declare those
+*/
+extern const CATID CATID_SafeForInitializing;
+extern const CATID CATID_SafeForScripting;
+
+static LONG i_class_ref= 0;
+static HINSTANCE h_instance= 0;
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
+{
+    HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;
+
+    *ppv = NULL;
+
+    if( CLSID_VLCPlugin == rclsid )
+    {
+        VLCPluginClass *plugin = new VLCPluginClass(&i_class_ref, h_instance);
+        hr = plugin->QueryInterface(riid, ppv);
+        plugin->Release();
+    }
+    return hr;
+};
+
+STDAPI DllCanUnloadNow(VOID)
+{
+    return (0 == i_class_ref) ? S_OK: S_FALSE;
+};
+
+static LPCTSTR TStrFromGUID(REFGUID clsid) {
+    LPOLESTR oleStr;
+
+    if( FAILED(StringFromIID(clsid, &oleStr)) )
+        return NULL;
+
+    //check whether TCHAR and OLECHAR are both either ANSI or UNICODE
+    if( sizeof(TCHAR) == sizeof(OLECHAR) )
+        return (LPCTSTR)oleStr;
+
+    LPTSTR pct_CLSID = NULL;
+#ifndef OLE2ANSI
+    size_t len = WideCharToMultiByte(CP_ACP, 0, oleStr, -1, NULL, 0, NULL, NULL);
+    if( len > 0 )
+    {
+        pct_CLSID = (char *)CoTaskMemAlloc(len);
+        WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len, NULL, NULL);
+    }
+#else
+    size_t len = MutiByteToWideChar(CP_ACP, 0, oleStr, -1, NULL, 0);
+    if( len > 0 )
+    {
+        clsidStr = (wchar_t *)CoTaskMemAlloc(len*sizeof(wchar_t));
+        WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len);
+    }
+#endif
+    CoTaskMemFree(oleStr);
+    return pct_CLSID;
+};
+
+static HKEY keyCreate(HKEY parentKey, LPCTSTR keyName)
+{
+    HKEY childKey;
+    if( ERROR_SUCCESS == RegCreateKeyEx(parentKey, keyName, 0, NULL,
+                REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &childKey, NULL) )
+    {
+        return childKey;
+    }
+    return NULL;
+};
+
+STDAPI DllUnregisterServer(VOID)
+{
+    // unregister type lib from the registry
+    UnRegisterTypeLib(LIBID_AXVLC, 1, 0, LOCALE_NEUTRAL, SYS_WIN32);
+
+    // remove component categories we supports
+    ICatRegister *pcr;
+    if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, 
+            NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr)) ) {
+        CATID implCategories[] = {
+            CATID_Control,
+            CATID_PersistsToPropertyBag,
+            CATID_SafeForInitializing,
+            CATID_SafeForScripting,
+        };
+
+        pcr->UnRegisterClassImplCategories(CLSID_VLCPlugin,
+                sizeof(implCategories)/sizeof(CATID), implCategories);
+        pcr->Release();
+    }
+
+    SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(VERS_PROGID_STR));
+    SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(PROGID_STR));
+
+    LPCTSTR psz_CLSID = TStrFromGUID(CLSID_VLCPlugin);
+
+    if( NULL == psz_CLSID )
+        return E_OUTOFMEMORY;
+
+    HKEY hClsIDKey;
+    if( ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_WRITE, &hClsIDKey) )
+    {
+        SHDeleteKey(hClsIDKey, psz_CLSID);
+        RegCloseKey(hClsIDKey);
+    }
+    CoTaskMemFree((void *)psz_CLSID);
+
+    return S_OK;
+};
+
+STDAPI DllRegisterServer(VOID)
+{
+    DllUnregisterServer();
+
+    char DllPath[MAX_PATH];
+    DWORD DllPathLen= GetModuleFileName(h_instance, DllPath, sizeof(DllPath)) ;
+       if( 0 == DllPathLen )
+        return E_FAIL;
+
+    LPCTSTR psz_CLSID = TStrFromGUID(CLSID_VLCPlugin);
+
+    if( NULL == psz_CLSID )
+        return E_OUTOFMEMORY;
+
+    HKEY hBaseKey;
+
+    if( ERROR_SUCCESS != RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_CREATE_SUB_KEY, &hBaseKey) )
+        return E_FAIL;
+
+    HKEY hClassKey = keyCreate(hBaseKey, psz_CLSID);
+    if( NULL != hClassKey )
+    {
+        HKEY hSubKey;
+
+        // default key value
+        RegSetValueEx(hClassKey, NULL, 0, REG_SZ,
+                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));
+
+        // Control key value
+        hSubKey = keyCreate(hClassKey, TEXT("Control"));
+        RegCloseKey(hSubKey);
+
+        // InprocServer32 key value
+        hSubKey = keyCreate(hClassKey, TEXT("InprocServer32"));
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ,
+                (const BYTE*)DllPath, DllPathLen);
+        RegSetValueEx(hSubKey, TEXT("ThreadingModel"), 0, REG_SZ,
+                (const BYTE*)THREADING_MODEL, sizeof(THREADING_MODEL));
+        RegCloseKey(hSubKey);
+
+        // MiscStatus key value
+        hSubKey = keyCreate(hClassKey, TEXT("MiscStatus\\1"));
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, (const BYTE*)"131473", sizeof("131473"));
+        RegCloseKey(hSubKey);
+
+        // Programmable key value
+        hSubKey = keyCreate(hClassKey, TEXT("Programmable"));
+        RegCloseKey(hSubKey);
+
+        // ProgID key value
+        hSubKey = keyCreate(hClassKey, TEXT("ProgID"));
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, 
+                (const BYTE*)VERS_PROGID_STR, sizeof(VERS_PROGID_STR));
+        RegCloseKey(hSubKey);
+
+        // VersionIndependentProgID key value
+        hSubKey = keyCreate(hClassKey, TEXT("VersionIndependentProgID"));
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, 
+                (const BYTE*)PROGID_STR, sizeof(PROGID_STR));
+        RegCloseKey(hSubKey);
+
+        // Version key value
+        hSubKey = keyCreate(hClassKey, TEXT("Version"));
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ,
+                (const BYTE*)VERSION_STR, sizeof(VERSION_STR));
+        RegCloseKey(hSubKey);
+
+        // TypeLib key value
+        LPCTSTR psz_LIBID = TStrFromGUID(LIBID_AXVLC);
+        if( NULL != psz_LIBID )
+        {
+            hSubKey = keyCreate(hClassKey, TEXT("TypeLib"));
+            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,
+                    (const BYTE*)psz_LIBID, sizeof(TCHAR)*GUID_STRLEN);
+            RegCloseKey(hSubKey);
+        }
+        RegCloseKey(hClassKey);
+    }
+    RegCloseKey(hBaseKey);
+
+    hBaseKey = keyCreate(HKEY_CLASSES_ROOT, TEXT(PROGID_STR));
+    if( NULL != hBaseKey )
+    {
+        // default key value
+        RegSetValueEx(hBaseKey, NULL, 0, REG_SZ,
+                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));
+
+        HKEY hSubKey = keyCreate(hBaseKey, TEXT("CLSID"));
+        if( NULL != hSubKey )
+        {
+            // default key value
+            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,
+                    (const BYTE*)psz_CLSID, sizeof(TCHAR)*GUID_STRLEN);
+
+            RegCloseKey(hSubKey);
+        }
+        hSubKey = keyCreate(hBaseKey, TEXT("CurVer"));
+        if( NULL != hSubKey )
+        {
+            // default key value
+            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,
+                    (const BYTE*)VERS_PROGID_STR, sizeof(VERS_PROGID_STR));
+
+            RegCloseKey(hSubKey);
+        }
+        RegCloseKey(hBaseKey);
+    }
+
+    hBaseKey = keyCreate(HKEY_CLASSES_ROOT, TEXT(VERS_PROGID_STR));
+    if( NULL != hBaseKey )
+    {
+        // default key value
+        RegSetValueEx(hBaseKey, NULL, 0, REG_SZ,
+                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));
+
+        HKEY hSubKey = keyCreate(hBaseKey, TEXT("CLSID"));
+        if( NULL != hSubKey )
+        {
+            // default key value
+            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,
+                    (const BYTE*)psz_CLSID, sizeof(TCHAR)*GUID_STRLEN);
+
+            RegCloseKey(hSubKey);
+        }
+        RegCloseKey(hBaseKey);
+    }
+
+    // indicate which component categories we support
+    ICatRegister *pcr;
+    if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, 
+            NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr)) ) {
+        CATID implCategories[] = {
+            CATID_Control,
+            CATID_PersistsToPropertyBag,
+            CATID_SafeForInitializing,
+            CATID_SafeForScripting,
+        };
+
+        pcr->RegisterClassImplCategories(CLSID_VLCPlugin,
+                sizeof(implCategories)/sizeof(CATID), implCategories);
+        pcr->Release();
+    }
+
+    // register type lib into the registry
+    ITypeLib *typeLib;
+#ifndef OLE2ANSI
+    size_t typeLibPathLen = MultiByteToWideChar(CP_ACP, 0, DllPath, DllPathLen, NULL, 0);
+    if( typeLibPathLen > 0 )
+    {
+        LPOLESTR typeLibPath = (LPOLESTR)CoTaskMemAlloc(typeLibPathLen*sizeof(wchar_t));
+        MultiByteToWideChar(CP_ACP, 0, DllPath, DllPathLen, typeLibPath, typeLibPathLen);
+        if( SUCCEEDED(LoadTypeLibEx(typeLibPath, REGKIND_REGISTER, &typeLib)) )
+            typeLib->Release();
+        CoTaskMemFree((void *)typeLibPath);
+    }
+#else
+    if( SUCCEEDED(LoadTypeLibEx((LPOLESTR)DllPath, REGKIND_REGISTER, &typeLib)) )
+        typeLib->Release();
+#endif
+
+    CoTaskMemFree((void *)psz_CLSID);
+
+    return S_OK;
+};
+
+#ifdef BUILD_LOCALSERVER
+
+/*
+** easier to debug an application than a DLL on cygwin GDB :)
+*/
+#include <iostream>
+
+STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
+{
+    MSG msg;
+
+    if( FAILED(OleInitialize(NULL)) )
+    {
+        cerr << "cannot initialize OLE" << endl;
+        return 1;
+    }
+
+    IUnknown *classProc = NULL;
+
+    if( FAILED(DllGetClassObject(CLSID_VLCPlugin, IID_IUnknown, (LPVOID *)&classProc)) )
+        return 0;
+    DWORD dwRegisterClassObject;
+
+    if( FAILED(CoRegisterClassObject(CLSID_VLCPlugin, classProc,
+        CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &dwRegisterClassObject)) )
+        return 0;
+
+    DWORD dwRegisterActiveObject;
+
+    if( FAILED(RegisterActiveObject(classProc, CLSID_VLCPlugin,
+                    ACTIVEOBJECT_WEAK, &dwRegisterActiveObject)) )
+        return 0;
+
+    classProc->Release();
+
+    /*
+    * Polling messages from event queue
+    */
+    while( S_FALSE == DllCanUnloadNow() )
+    {
+        while( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
+        {
+            if( msg.message == WM_QUIT )
+                break;  // Leave the PeekMessage while() loop
+
+            /*if(TranslateAccelerator(ghwndApp, ghAccel, &msg))
+                continue;*/
+
+            TranslateMessage(&msg);
+            DispatchMessage(&msg);
+        }
+
+        if(msg.message == WM_QUIT)
+            break;  // Leave the for() loop
+
+        WaitMessage();
+    }
+
+    if( SUCCEEDED(RevokeActiveObject(dwRegisterActiveObject, NULL)) )
+        CoRevokeClassObject(dwRegisterClassObject);
+
+    // Reached on WM_QUIT message
+    CoUninitialize();
+    return ((int) msg.wParam);
+};
+
+#else
+
+STDAPI_(BOOL) DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpReserved )
+{
+    switch( fdwReason )
+    {
+        case DLL_PROCESS_ATTACH:
+            h_instance = (HINSTANCE)hModule;
+            break;
+
+        default:
+            break;
+    }
+    return TRUE;
+};
+
+#endif
+
index 0cfc678..53b4021 100644 (file)
@@ -1,92 +1,92 @@
-/*****************************************************************************\r
- * objectsafety.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "objectsafety.h"\r
-\r
-#include "axvlc_idl.h"\r
-\r
-#if 0\r
-const GUID IID_IObjectSafety = \r
-    {0xCB5BDC81,0x93C1,0x11cf,{0x8F,0x20,0x00,0x80,0x5F,0x2C,0xD0,0x64}}; \r
-#endif\r
-\r
-STDMETHODIMP VLCObjectSafety::GetInterfaceSafetyOptions(      \r
-    REFIID riid,\r
-    DWORD *pdwSupportedOptions,\r
-    DWORD *pdwEnabledOptions\r
-)\r
-{\r
-    if( (NULL == pdwSupportedOptions) || (NULL == pdwEnabledOptions) )\r
-        return E_POINTER;\r
-\r
-    *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACESAFE_FOR_UNTRUSTED_CALLER;\r
-\r
-    if( (IID_IDispatch == riid)\r
-     || (IID_IVLCControl == riid) )\r
-    {\r
-        *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;\r
-        return NOERROR;\r
-    }\r
-    else if( (IID_IPersist == riid)\r
-          || (IID_IPersistStreamInit == riid)\r
-          || (IID_IPersistStorage == riid)\r
-          || (IID_IPersistPropertyBag == riid) )\r
-    {\r
-        *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA;\r
-        return NOERROR;\r
-    }\r
-    *pdwEnabledOptions = 0;\r
-    return E_NOINTERFACE;\r
-};\r
-\r
-STDMETHODIMP VLCObjectSafety::SetInterfaceSafetyOptions(      \r
-    REFIID riid,\r
-    DWORD dwOptionSetMask,\r
-    DWORD dwEnabledOptions\r
-)\r
-{\r
-    if( (IID_IDispatch == riid)\r
-     || (IID_IVLCControl == riid) )\r
-    {\r
-        if( (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwOptionSetMask)\r
-         && (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwEnabledOptions) )\r
-        {\r
-            return NOERROR;\r
-        }\r
-        return E_FAIL;\r
-    }\r
-    else if( (IID_IPersist == riid)\r
-          || (IID_IPersistStreamInit == riid)\r
-          || (IID_IPersistStorage == riid)\r
-          || (IID_IPersistPropertyBag == riid) )\r
-    {\r
-        if( (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwOptionSetMask)\r
-         && (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwEnabledOptions) )\r
-        {\r
-            return NOERROR;\r
-        }\r
-        return E_FAIL;\r
-    }\r
-    return E_FAIL;\r
-};\r
-\r
+/*****************************************************************************
+ * objectsafety.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "objectsafety.h"
+
+#include "axvlc_idl.h"
+
+#if 0
+const GUID IID_IObjectSafety = 
+    {0xCB5BDC81,0x93C1,0x11cf,{0x8F,0x20,0x00,0x80,0x5F,0x2C,0xD0,0x64}}; 
+#endif
+
+STDMETHODIMP VLCObjectSafety::GetInterfaceSafetyOptions(      
+    REFIID riid,
+    DWORD *pdwSupportedOptions,
+    DWORD *pdwEnabledOptions
+)
+{
+    if( (NULL == pdwSupportedOptions) || (NULL == pdwEnabledOptions) )
+        return E_POINTER;
+
+    *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACESAFE_FOR_UNTRUSTED_CALLER;
+
+    if( (IID_IDispatch == riid)
+     || (IID_IVLCControl == riid) )
+    {
+        *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
+        return NOERROR;
+    }
+    else if( (IID_IPersist == riid)
+          || (IID_IPersistStreamInit == riid)
+          || (IID_IPersistStorage == riid)
+          || (IID_IPersistPropertyBag == riid) )
+    {
+        *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA;
+        return NOERROR;
+    }
+    *pdwEnabledOptions = 0;
+    return E_NOINTERFACE;
+};
+
+STDMETHODIMP VLCObjectSafety::SetInterfaceSafetyOptions(      
+    REFIID riid,
+    DWORD dwOptionSetMask,
+    DWORD dwEnabledOptions
+)
+{
+    if( (IID_IDispatch == riid)
+     || (IID_IVLCControl == riid) )
+    {
+        if( (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwOptionSetMask)
+         && (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwEnabledOptions) )
+        {
+            return NOERROR;
+        }
+        return E_FAIL;
+    }
+    else if( (IID_IPersist == riid)
+          || (IID_IPersistStreamInit == riid)
+          || (IID_IPersistStorage == riid)
+          || (IID_IPersistPropertyBag == riid) )
+    {
+        if( (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwOptionSetMask)
+         && (INTERFACESAFE_FOR_UNTRUSTED_DATA == dwEnabledOptions) )
+        {
+            return NOERROR;
+        }
+        return E_FAIL;
+    }
+    return E_FAIL;
+};
+
index 3644050..4f2f784 100644 (file)
@@ -1,99 +1,99 @@
-/*****************************************************************************\r
- * objectsafety.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __OBJECTSAFETY_H__\r
-#define __OBJECTSAFETY_H__\r
-\r
-#if HAVE_OBJSAFE_HEADER\r
-/*\r
-** at last, a version of mingw that supports this header\r
-*/\r
-#include <objsafe.h>\r
-\r
-#else\r
-\r
-// {CB5BDC81-93C1-11cf-8F20-00805F2CD064}\r
-extern "C" const IID IID_IObjectSafety;\r
-\r
-#define INTERFACESAFE_FOR_UNTRUSTED_CALLER 1L\r
-#define INTERFACESAFE_FOR_UNTRUSTED_DATA   2L\r
-\r
-struct IObjectSafety : public IUnknown\r
-{\r
-    virtual STDMETHODIMP GetInterfaceSafetyOptions(      \r
-        REFIID riid,\r
-        DWORD __RPC_FAR *pdwSupportedOptions,\r
-        DWORD __RPC_FAR *pdwEnabledOptions\r
-    ) = 0;\r
-\r
-    virtual STDMETHODIMP SetInterfaceSafetyOptions(      \r
-        REFIID riid,\r
-        DWORD dwSupportedOptions,\r
-        DWORD dwOptionSetMask\r
-    ) = 0;\r
-};\r
-\r
-#endif\r
-\r
-class VLCObjectSafety : public IObjectSafety\r
-{\r
-public:\r
-\r
-    VLCObjectSafety(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
-    virtual ~VLCObjectSafety() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid)\r
-         && (IID_IObjectSafety == riid) ) \r
-        {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP GetInterfaceSafetyOptions(      \r
-        REFIID riid,\r
-        DWORD *pdwSupportedOptions,\r
-        DWORD *pdwEnabledOptions\r
-    );\r
-\r
-    STDMETHODIMP SetInterfaceSafetyOptions(      \r
-        REFIID riid,\r
-        DWORD dwOptionSetMask,\r
-        DWORD dwEnabledOptions\r
-    );\r
-\r
-private: \r
-\r
-    VLCPlugin *_p_instance;\r
-};\r
-\r
-#endif\r
+/*****************************************************************************
+ * objectsafety.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __OBJECTSAFETY_H__
+#define __OBJECTSAFETY_H__
+
+#if HAVE_OBJSAFE_HEADER
+/*
+** at last, a version of mingw that supports this header
+*/
+#include <objsafe.h>
+
+#else
+
+// {CB5BDC81-93C1-11cf-8F20-00805F2CD064}
+extern "C" const IID IID_IObjectSafety;
+
+#define INTERFACESAFE_FOR_UNTRUSTED_CALLER 1L
+#define INTERFACESAFE_FOR_UNTRUSTED_DATA   2L
+
+struct IObjectSafety : public IUnknown
+{
+    virtual STDMETHODIMP GetInterfaceSafetyOptions(      
+        REFIID riid,
+        DWORD __RPC_FAR *pdwSupportedOptions,
+        DWORD __RPC_FAR *pdwEnabledOptions
+    ) = 0;
+
+    virtual STDMETHODIMP SetInterfaceSafetyOptions(      
+        REFIID riid,
+        DWORD dwSupportedOptions,
+        DWORD dwOptionSetMask
+    ) = 0;
+};
+
+#endif
+
+class VLCObjectSafety : public IObjectSafety
+{
+public:
+
+    VLCObjectSafety(VLCPlugin *p_instance) : _p_instance(p_instance) {};
+    virtual ~VLCObjectSafety() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid)
+         && (IID_IObjectSafety == riid) ) 
+        {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IUnknown methods
+    STDMETHODIMP GetInterfaceSafetyOptions(      
+        REFIID riid,
+        DWORD *pdwSupportedOptions,
+        DWORD *pdwEnabledOptions
+    );
+
+    STDMETHODIMP SetInterfaceSafetyOptions(      
+        REFIID riid,
+        DWORD dwOptionSetMask,
+        DWORD dwEnabledOptions
+    );
+
+private: 
+
+    VLCPlugin *_p_instance;
+};
+
+#endif
index 7dde4cc..832613d 100644 (file)
-/*****************************************************************************\r
- * olecontrol.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "olecontrol.h"\r
-\r
-#include "utils.h"\r
-\r
-using namespace std;\r
-\r
-STDMETHODIMP VLCOleControl::GetControlInfo(CONTROLINFO *pCI)\r
-{\r
-    if( NULL == pCI )\r
-        return E_POINTER;\r
-\r
-    pCI->cb      = sizeof(CONTROLINFO);\r
-    pCI->hAccel  = NULL;\r
-    pCI->cAccel  = 0;\r
-    pCI->dwFlags = 0;\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCOleControl::OnMnemonic(LPMSG pMsg)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-static HRESULT getAmbientProperty(VLCPlugin& instance, DISPID dispID, VARIANT& v)\r
-{\r
-    HRESULT hr;\r
-    IOleObject *oleObj;\r
-\r
-    hr = instance.QueryInterface(IID_IOleObject, (LPVOID *)&oleObj);\r
-    if( SUCCEEDED(hr) )\r
-    {\r
-        IOleClientSite *clientSite;\r
-\r
-        hr = oleObj->GetClientSite(&clientSite);\r
-        if( SUCCEEDED(hr) && (NULL != clientSite) )\r
-        {\r
-            hr = GetObjectProperty(clientSite, dispID, v);\r
-            clientSite->Release();\r
-        }\r
-        oleObj->Release();\r
-    }\r
-    return hr;\r
-};\r
-\r
-STDMETHODIMP VLCOleControl::OnAmbientPropertyChange(DISPID dispID)\r
-{\r
-    switch( dispID )\r
-    {\r
-        case DISPID_AMBIENT_BACKCOLOR:\r
-            break;\r
-        case DISPID_AMBIENT_DISPLAYNAME:\r
-            break;\r
-        case DISPID_AMBIENT_FONT:\r
-            break;\r
-        case DISPID_AMBIENT_FORECOLOR:\r
-            break;\r
-        case DISPID_AMBIENT_LOCALEID:\r
-            break;\r
-        case DISPID_AMBIENT_MESSAGEREFLECT:\r
-            break;\r
-        case DISPID_AMBIENT_SCALEUNITS:\r
-            break;\r
-        case DISPID_AMBIENT_TEXTALIGN:\r
-            break;\r
-        case DISPID_AMBIENT_USERMODE:\r
-            break;\r
-        case DISPID_AMBIENT_UIDEAD:\r
-            break;\r
-        case DISPID_AMBIENT_SHOWGRABHANDLES:\r
-            break;\r
-        case DISPID_AMBIENT_SHOWHATCHING:\r
-            break;\r
-        case DISPID_AMBIENT_DISPLAYASDEFAULT:\r
-            break;\r
-        case DISPID_AMBIENT_SUPPORTSMNEMONICS:\r
-            break;\r
-        case DISPID_AMBIENT_AUTOCLIP:\r
-            break;\r
-        case DISPID_AMBIENT_APPEARANCE:\r
-            break;\r
-        case DISPID_AMBIENT_CODEPAGE:\r
-            VARIANT v;\r
-            VariantInit(&v);\r
-            V_VT(&v) = VT_I4;\r
-            if( SUCCEEDED(getAmbientProperty(*_p_instance, dispID, v)) )\r
-            {\r
-                _p_instance->setCodePage(V_I4(&v));\r
-            }\r
-            break;\r
-        case DISPID_AMBIENT_PALETTE:\r
-            break;\r
-        case DISPID_AMBIENT_CHARSET:\r
-            break;\r
-        case DISPID_AMBIENT_RIGHTTOLEFT:\r
-            break;\r
-        case DISPID_AMBIENT_TOPTOBOTTOM:\r
-            break;\r
-        default:\r
-            break;\r
-    }\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCOleControl::FreezeEvents(BOOL bFreeze)\r
-{\r
-    _p_instance->setSendEvents(! bFreeze);\r
-    return S_OK;\r
-};\r
-\r
+/*****************************************************************************
+ * olecontrol.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "olecontrol.h"
+
+#include "utils.h"
+
+using namespace std;
+
+STDMETHODIMP VLCOleControl::GetControlInfo(CONTROLINFO *pCI)
+{
+    if( NULL == pCI )
+        return E_POINTER;
+
+    pCI->cb      = sizeof(CONTROLINFO);
+    pCI->hAccel  = NULL;
+    pCI->cAccel  = 0;
+    pCI->dwFlags = 0;
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCOleControl::OnMnemonic(LPMSG pMsg)
+{
+    return E_NOTIMPL;
+};
+
+static HRESULT getAmbientProperty(VLCPlugin& instance, DISPID dispID, VARIANT& v)
+{
+    HRESULT hr;
+    IOleObject *oleObj;
+
+    hr = instance.QueryInterface(IID_IOleObject, (LPVOID *)&oleObj);
+    if( SUCCEEDED(hr) )
+    {
+        IOleClientSite *clientSite;
+
+        hr = oleObj->GetClientSite(&clientSite);
+        if( SUCCEEDED(hr) && (NULL != clientSite) )
+        {
+            hr = GetObjectProperty(clientSite, dispID, v);
+            clientSite->Release();
+        }
+        oleObj->Release();
+    }
+    return hr;
+};
+
+STDMETHODIMP VLCOleControl::OnAmbientPropertyChange(DISPID dispID)
+{
+    switch( dispID )
+    {
+        case DISPID_AMBIENT_BACKCOLOR:
+            break;
+        case DISPID_AMBIENT_DISPLAYNAME:
+            break;
+        case DISPID_AMBIENT_FONT:
+            break;
+        case DISPID_AMBIENT_FORECOLOR:
+            break;
+        case DISPID_AMBIENT_LOCALEID:
+            break;
+        case DISPID_AMBIENT_MESSAGEREFLECT:
+            break;
+        case DISPID_AMBIENT_SCALEUNITS:
+            break;
+        case DISPID_AMBIENT_TEXTALIGN:
+            break;
+        case DISPID_AMBIENT_USERMODE:
+            break;
+        case DISPID_AMBIENT_UIDEAD:
+            break;
+        case DISPID_AMBIENT_SHOWGRABHANDLES:
+            break;
+        case DISPID_AMBIENT_SHOWHATCHING:
+            break;
+        case DISPID_AMBIENT_DISPLAYASDEFAULT:
+            break;
+        case DISPID_AMBIENT_SUPPORTSMNEMONICS:
+            break;
+        case DISPID_AMBIENT_AUTOCLIP:
+            break;
+        case DISPID_AMBIENT_APPEARANCE:
+            break;
+        case DISPID_AMBIENT_CODEPAGE:
+            VARIANT v;
+            VariantInit(&v);
+            V_VT(&v) = VT_I4;
+            if( SUCCEEDED(getAmbientProperty(*_p_instance, dispID, v)) )
+            {
+                _p_instance->setCodePage(V_I4(&v));
+            }
+            break;
+        case DISPID_AMBIENT_PALETTE:
+            break;
+        case DISPID_AMBIENT_CHARSET:
+            break;
+        case DISPID_AMBIENT_RIGHTTOLEFT:
+            break;
+        case DISPID_AMBIENT_TOPTOBOTTOM:
+            break;
+        default:
+            break;
+    }
+    return S_OK;
+};
+
+STDMETHODIMP VLCOleControl::FreezeEvents(BOOL bFreeze)
+{
+    _p_instance->setSendEvents(! bFreeze);
+    return S_OK;
+};
+
index 7173105..b1603ee 100644 (file)
@@ -1,65 +1,65 @@
-/*****************************************************************************\r
- * olecontrol.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __OLECONTROL_H__\r
-#define __OLECONTROL_H__\r
-\r
-#include <olectl.h>\r
-\r
-class VLCOleControl : public IOleControl\r
-{\r
-\r
-public:\r
-\r
-    VLCOleControl(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
-    virtual ~VLCOleControl() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid)\r
-         && (IID_IOleControl == riid) ) \r
-        {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IOleControl methods\r
-    STDMETHODIMP GetControlInfo(CONTROLINFO *pCI);\r
-    STDMETHODIMP OnMnemonic(LPMSG pMsg);\r
-    STDMETHODIMP OnAmbientPropertyChange(DISPID dispID);\r
-    STDMETHODIMP FreezeEvents(BOOL bFreeze);\r
-\r
-private:\r
-\r
-    VLCPlugin *_p_instance;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * olecontrol.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __OLECONTROL_H__
+#define __OLECONTROL_H__
+
+#include <olectl.h>
+
+class VLCOleControl : public IOleControl
+{
+
+public:
+
+    VLCOleControl(VLCPlugin *p_instance) : _p_instance(p_instance) {};
+    virtual ~VLCOleControl() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid)
+         && (IID_IOleControl == riid) ) 
+        {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IOleControl methods
+    STDMETHODIMP GetControlInfo(CONTROLINFO *pCI);
+    STDMETHODIMP OnMnemonic(LPMSG pMsg);
+    STDMETHODIMP OnAmbientPropertyChange(DISPID dispID);
+    STDMETHODIMP FreezeEvents(BOOL bFreeze);
+
+private:
+
+    VLCPlugin *_p_instance;
+};
+
+#endif
+
index 4239a4d..fcd7f4d 100644 (file)
@@ -1,74 +1,74 @@
-/*****************************************************************************\r
- * oleinplaceactiveobject.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "oleinplaceactiveobject.h"\r
-\r
-using namespace std;\r
-\r
-STDMETHODIMP VLCOleInPlaceActiveObject::GetWindow(HWND *pHwnd)\r
-{\r
-    if( NULL == pHwnd )\r
-        return E_INVALIDARG;\r
-\r
-    if( _p_instance->isInPlaceActive() )\r
-    {\r
-        if( NULL != (*pHwnd = _p_instance->getInPlaceWindow()) )\r
-            return S_OK;\r
-\r
-        return E_FAIL;\r
-    }\r
-    *pHwnd = NULL;\r
-\r
-    return E_UNEXPECTED;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceActiveObject::EnableModeless(BOOL fEnable)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceActiveObject::TranslateAccelerator(LPMSG lpmsg)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceActiveObject::OnFrameWindowActivate(BOOL fActivate)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceActiveObject::OnDocWindowActivate(BOOL fActivate)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceActiveObject::ResizeBorder(LPCRECT prcBorder, LPOLEINPLACEUIWINDOW pUIWindow, BOOL fFrameWindow)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
+/*****************************************************************************
+ * oleinplaceactiveobject.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "oleinplaceactiveobject.h"
+
+using namespace std;
+
+STDMETHODIMP VLCOleInPlaceActiveObject::GetWindow(HWND *pHwnd)
+{
+    if( NULL == pHwnd )
+        return E_INVALIDARG;
+
+    if( _p_instance->isInPlaceActive() )
+    {
+        if( NULL != (*pHwnd = _p_instance->getInPlaceWindow()) )
+            return S_OK;
+
+        return E_FAIL;
+    }
+    *pHwnd = NULL;
+
+    return E_UNEXPECTED;
+};
+
+STDMETHODIMP VLCOleInPlaceActiveObject::EnableModeless(BOOL fEnable)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleInPlaceActiveObject::TranslateAccelerator(LPMSG lpmsg)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleInPlaceActiveObject::OnFrameWindowActivate(BOOL fActivate)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleInPlaceActiveObject::OnDocWindowActivate(BOOL fActivate)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleInPlaceActiveObject::ResizeBorder(LPCRECT prcBorder, LPOLEINPLACEUIWINDOW pUIWindow, BOOL fFrameWindow)
+{
+    return E_NOTIMPL;
+};
+
index 267e9d2..0b3ead3 100644 (file)
@@ -1,71 +1,71 @@
-/*****************************************************************************\r
- * oleinplaceactiveobject.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __OLEINPLACEACTIVEOBJECT_H__\r
-#define __OLEINPLACEACTIVEOBJECT_H__\r
-\r
-#include "oleidl.h"\r
-\r
-class VLCOleInPlaceActiveObject : public IOleInPlaceActiveObject\r
-{\r
-\r
-public:\r
-\r
-    VLCOleInPlaceActiveObject(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
-    virtual ~VLCOleInPlaceActiveObject() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid) \r
-         && (IID_IOleWindow == riid) \r
-         && (IID_IOleInPlaceActiveObject == riid) )\r
-        {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IOleWindow methods\r
-    STDMETHODIMP GetWindow(HWND *);\r
-    STDMETHODIMP ContextSensitiveHelp(BOOL);\r
-\r
-    // IOleInPlaceActiveObject methods\r
-    STDMETHODIMP EnableModeless(BOOL);\r
-    STDMETHODIMP TranslateAccelerator(LPMSG);\r
-    STDMETHODIMP OnFrameWindowActivate(BOOL);\r
-    STDMETHODIMP OnDocWindowActivate(BOOL);\r
-    STDMETHODIMP ResizeBorder(LPCRECT, LPOLEINPLACEUIWINDOW, BOOL);\r
-\r
-private:\r
-\r
-    VLCPlugin *_p_instance;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * oleinplaceactiveobject.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __OLEINPLACEACTIVEOBJECT_H__
+#define __OLEINPLACEACTIVEOBJECT_H__
+
+#include "oleidl.h"
+
+class VLCOleInPlaceActiveObject : public IOleInPlaceActiveObject
+{
+
+public:
+
+    VLCOleInPlaceActiveObject(VLCPlugin *p_instance) : _p_instance(p_instance) {};
+    virtual ~VLCOleInPlaceActiveObject() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid) 
+         && (IID_IOleWindow == riid) 
+         && (IID_IOleInPlaceActiveObject == riid) )
+        {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IOleWindow methods
+    STDMETHODIMP GetWindow(HWND *);
+    STDMETHODIMP ContextSensitiveHelp(BOOL);
+
+    // IOleInPlaceActiveObject methods
+    STDMETHODIMP EnableModeless(BOOL);
+    STDMETHODIMP TranslateAccelerator(LPMSG);
+    STDMETHODIMP OnFrameWindowActivate(BOOL);
+    STDMETHODIMP OnDocWindowActivate(BOOL);
+    STDMETHODIMP ResizeBorder(LPCRECT, LPOLEINPLACEUIWINDOW, BOOL);
+
+private:
+
+    VLCPlugin *_p_instance;
+};
+
+#endif
+
index 97db723..80c4a51 100644 (file)
-/*****************************************************************************\r
- * oleinplaceobject.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "oleinplaceobject.h"\r
-\r
-#include <docobj.h>\r
-\r
-using namespace std;\r
-\r
-STDMETHODIMP VLCOleInPlaceObject::GetWindow(HWND *pHwnd)\r
-{\r
-    if( NULL == pHwnd )\r
-        return E_INVALIDARG;\r
-\r
-    if( _p_instance->isInPlaceActive() )\r
-    {\r
-        if( NULL != (*pHwnd = _p_instance->getInPlaceWindow()) )\r
-            return S_OK;\r
-\r
-        return E_FAIL;\r
-    }\r
-    *pHwnd = NULL;\r
-\r
-    return E_UNEXPECTED;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceObject::ContextSensitiveHelp(BOOL fEnterMode)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceObject::InPlaceDeactivate(void)\r
-{\r
-    if( _p_instance->isInPlaceActive() )\r
-    {\r
-        UIDeactivate();\r
-        _p_instance->onInPlaceDeactivate();\r
-\r
-        LPOLEOBJECT p_oleObject;\r
-        if( SUCCEEDED(QueryInterface(IID_IOleObject, (void**)&p_oleObject)) ) \r
-        {\r
-            LPOLECLIENTSITE p_clientSite;\r
-            if( SUCCEEDED(p_oleObject->GetClientSite(&p_clientSite)) )\r
-            {\r
-                LPOLEINPLACESITE p_inPlaceSite;\r
-\r
-                if( SUCCEEDED(p_clientSite->QueryInterface(IID_IOleInPlaceSite, (void**)&p_inPlaceSite)) )\r
-                {\r
-                    p_inPlaceSite->OnInPlaceDeactivate();\r
-                    p_inPlaceSite->Release();\r
-                }\r
-                p_clientSite->Release();\r
-            }\r
-            p_oleObject->Release();\r
-        }\r
-        return S_OK;\r
-    }\r
-    return E_UNEXPECTED;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceObject::UIDeactivate(void)\r
-{\r
-    if( _p_instance->isInPlaceActive() )\r
-    {\r
-        if( _p_instance->hasFocus() )\r
-        {\r
-            _p_instance->setFocus(FALSE);\r
-\r
-            LPOLEOBJECT p_oleObject;\r
-            if( SUCCEEDED(QueryInterface(IID_IOleObject, (void**)&p_oleObject)) ) \r
-            {\r
-                LPOLECLIENTSITE p_clientSite;\r
-                if( SUCCEEDED(p_oleObject->GetClientSite(&p_clientSite)) )\r
-                {\r
-                    LPOLEINPLACESITE p_inPlaceSite;\r
-\r
-                    if( SUCCEEDED(p_clientSite->QueryInterface(IID_IOleInPlaceSite, (void**)&p_inPlaceSite)) )\r
-                    {\r
-                        p_inPlaceSite->OnUIDeactivate(FALSE);\r
-                        p_inPlaceSite->Release();\r
-                    }\r
-                    p_clientSite->Release();\r
-                }\r
-                p_oleObject->Release();\r
-            }\r
-            return S_OK;\r
-        }\r
-    }\r
-    return E_UNEXPECTED;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceObject::SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect)\r
-{\r
-    if( _p_instance->isInPlaceActive() )\r
-    {\r
-        _p_instance->onPositionChange(lprcPosRect, lprcClipRect);\r
-        return S_OK;\r
-    }\r
-    return E_UNEXPECTED;\r
-};\r
-\r
-STDMETHODIMP VLCOleInPlaceObject::ReactivateAndUndo(void)\r
-{\r
-    return INPLACE_E_NOTUNDOABLE;\r
-};\r
-\r
+/*****************************************************************************
+ * oleinplaceobject.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "oleinplaceobject.h"
+
+#include <docobj.h>
+
+using namespace std;
+
+STDMETHODIMP VLCOleInPlaceObject::GetWindow(HWND *pHwnd)
+{
+    if( NULL == pHwnd )
+        return E_INVALIDARG;
+
+    if( _p_instance->isInPlaceActive() )
+    {
+        if( NULL != (*pHwnd = _p_instance->getInPlaceWindow()) )
+            return S_OK;
+
+        return E_FAIL;
+    }
+    *pHwnd = NULL;
+
+    return E_UNEXPECTED;
+};
+
+STDMETHODIMP VLCOleInPlaceObject::ContextSensitiveHelp(BOOL fEnterMode)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleInPlaceObject::InPlaceDeactivate(void)
+{
+    if( _p_instance->isInPlaceActive() )
+    {
+        UIDeactivate();
+        _p_instance->onInPlaceDeactivate();
+
+        LPOLEOBJECT p_oleObject;
+        if( SUCCEEDED(QueryInterface(IID_IOleObject, (void**)&p_oleObject)) ) 
+        {
+            LPOLECLIENTSITE p_clientSite;
+            if( SUCCEEDED(p_oleObject->GetClientSite(&p_clientSite)) )
+            {
+                LPOLEINPLACESITE p_inPlaceSite;
+
+                if( SUCCEEDED(p_clientSite->QueryInterface(IID_IOleInPlaceSite, (void**)&p_inPlaceSite)) )
+                {
+                    p_inPlaceSite->OnInPlaceDeactivate();
+                    p_inPlaceSite->Release();
+                }
+                p_clientSite->Release();
+            }
+            p_oleObject->Release();
+        }
+        return S_OK;
+    }
+    return E_UNEXPECTED;
+};
+
+STDMETHODIMP VLCOleInPlaceObject::UIDeactivate(void)
+{
+    if( _p_instance->isInPlaceActive() )
+    {
+        if( _p_instance->hasFocus() )
+        {
+            _p_instance->setFocus(FALSE);
+
+            LPOLEOBJECT p_oleObject;
+            if( SUCCEEDED(QueryInterface(IID_IOleObject, (void**)&p_oleObject)) ) 
+            {
+                LPOLECLIENTSITE p_clientSite;
+                if( SUCCEEDED(p_oleObject->GetClientSite(&p_clientSite)) )
+                {
+                    LPOLEINPLACESITE p_inPlaceSite;
+
+                    if( SUCCEEDED(p_clientSite->QueryInterface(IID_IOleInPlaceSite, (void**)&p_inPlaceSite)) )
+                    {
+                        p_inPlaceSite->OnUIDeactivate(FALSE);
+                        p_inPlaceSite->Release();
+                    }
+                    p_clientSite->Release();
+                }
+                p_oleObject->Release();
+            }
+            return S_OK;
+        }
+    }
+    return E_UNEXPECTED;
+};
+
+STDMETHODIMP VLCOleInPlaceObject::SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect)
+{
+    if( _p_instance->isInPlaceActive() )
+    {
+        _p_instance->onPositionChange(lprcPosRect, lprcClipRect);
+        return S_OK;
+    }
+    return E_UNEXPECTED;
+};
+
+STDMETHODIMP VLCOleInPlaceObject::ReactivateAndUndo(void)
+{
+    return INPLACE_E_NOTUNDOABLE;
+};
+
index 96a91f8..4061d9a 100644 (file)
@@ -1,68 +1,68 @@
-/*****************************************************************************\r
- * oleinplaceobject.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __OLEINPLACEOBJECT_H__\r
-#define __OLEINPLACEOBJECT_H__\r
-\r
-class VLCOleInPlaceObject : public IOleInPlaceObject\r
-{\r
-\r
-public:\r
-\r
-    VLCOleInPlaceObject(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
-    virtual ~VLCOleInPlaceObject() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid)\r
-         && (IID_IOleWindow == riid)\r
-         && (IID_IOleInPlaceObject == riid) ) \r
-        {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IOleWindow methods\r
-    STDMETHODIMP GetWindow(HWND *);\r
-    STDMETHODIMP ContextSensitiveHelp(BOOL);\r
-\r
-    // IOleInPlaceObject methods\r
-    STDMETHODIMP InPlaceDeactivate(void);\r
-    STDMETHODIMP UIDeactivate(void);\r
-    STDMETHODIMP SetObjectRects(LPCRECT, LPCRECT);\r
-    STDMETHODIMP ReactivateAndUndo(void);\r
-\r
-private:\r
-\r
-    VLCPlugin *_p_instance;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * oleinplaceobject.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __OLEINPLACEOBJECT_H__
+#define __OLEINPLACEOBJECT_H__
+
+class VLCOleInPlaceObject : public IOleInPlaceObject
+{
+
+public:
+
+    VLCOleInPlaceObject(VLCPlugin *p_instance) : _p_instance(p_instance) {};
+    virtual ~VLCOleInPlaceObject() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid)
+         && (IID_IOleWindow == riid)
+         && (IID_IOleInPlaceObject == riid) ) 
+        {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IOleWindow methods
+    STDMETHODIMP GetWindow(HWND *);
+    STDMETHODIMP ContextSensitiveHelp(BOOL);
+
+    // IOleInPlaceObject methods
+    STDMETHODIMP InPlaceDeactivate(void);
+    STDMETHODIMP UIDeactivate(void);
+    STDMETHODIMP SetObjectRects(LPCRECT, LPCRECT);
+    STDMETHODIMP ReactivateAndUndo(void);
+
+private:
+
+    VLCPlugin *_p_instance;
+};
+
+#endif
+
index 750ac3a..217af46 100644 (file)
-/*****************************************************************************\r
- * oleobject.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "oleobject.h"\r
-\r
-#include "utils.h"\r
-\r
-#include <docobj.h>\r
-\r
-using namespace std;\r
-\r
-VLCOleObject::VLCOleObject(VLCPlugin *p_instance) :\r
-_p_clientsite(NULL), _p_instance(p_instance) \r
-{\r
-    CreateOleAdviseHolder(&_p_advise_holder);\r
-};\r
-\r
-VLCOleObject::~VLCOleObject()\r
-{\r
-    _p_advise_holder->Release();\r
-    SetClientSite(NULL); \r
-};\r
-\r
-STDMETHODIMP VLCOleObject::Advise(IAdviseSink *pAdvSink, DWORD *dwConnection)\r
-{\r
-    return _p_advise_holder->Advise(pAdvSink, dwConnection);\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::Close(DWORD dwSaveOption)\r
-{\r
-    _p_advise_holder->SendOnClose();\r
-    OleFlushClipboard();\r
-    return _p_instance->onClose(dwSaveOption);\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::DoVerb(LONG iVerb, LPMSG lpMsg, LPOLECLIENTSITE pActiveSite,\r
-                                    LONG lIndex, HWND hwndParent, LPCRECT lprcPosRect)\r
-{\r
-    if( 0 != lIndex )\r
-        return DV_E_LINDEX;\r
-\r
-    switch( iVerb )\r
-    {\r
-        case OLEIVERB_PRIMARY:\r
-        case OLEIVERB_SHOW:\r
-        case OLEIVERB_OPEN:\r
-        case OLEIVERB_INPLACEACTIVATE:\r
-            if( NULL == hwndParent )\r
-                return OLEOBJ_S_INVALIDHWND;\r
-\r
-            if( SUCCEEDED(doInPlaceActivate(lpMsg, pActiveSite, hwndParent, lprcPosRect)) )\r
-                return S_OK;\r
-\r
-            return OLEOBJ_S_CANNOT_DOVERB_NOW;\r
-\r
-        case OLEIVERB_HIDE:\r
-            _p_instance->setVisible(FALSE);\r
-            return S_OK;\r
-\r
-        case OLEIVERB_UIACTIVATE:\r
-            return doUIActivate(lpMsg, pActiveSite, hwndParent, lprcPosRect);\r
-\r
-        case OLEIVERB_DISCARDUNDOSTATE:\r
-            return S_OK;\r
-\r
-        default:\r
-            if( NULL == hwndParent )\r
-                return OLEOBJ_S_INVALIDHWND;\r
-\r
-            if( SUCCEEDED(doInPlaceActivate(lpMsg, pActiveSite, hwndParent, lprcPosRect)) )\r
-                return OLEOBJ_S_INVALIDVERB;\r
-\r
-            return OLEOBJ_S_CANNOT_DOVERB_NOW;\r
-    }\r
-};\r
-\r
-HRESULT VLCOleObject::doInPlaceActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite, HWND hwndParent, LPCRECT lprcPosRect)\r
-{\r
-    RECT posRect;\r
-    RECT clipRect;\r
-    LPCRECT lprcClipRect = lprcPosRect;\r
-\r
-    if( NULL != pActiveSite )\r
-    {\r
-        // check if already activated\r
-        if( _p_instance->isInPlaceActive() )\r
-        {\r
-            // just attempt to show object then\r
-            pActiveSite->ShowObject();\r
-            _p_instance->setVisible(TRUE);\r
-            return S_OK;\r
-        }\r
-\r
-        LPOLEINPLACESITE p_inPlaceSite;\r
-\r
-        if( SUCCEEDED(pActiveSite->QueryInterface(IID_IOleInPlaceSite, (void**)&p_inPlaceSite)) )\r
-        {\r
-            if( S_OK != p_inPlaceSite->CanInPlaceActivate() )\r
-                return E_FAIL;\r
-\r
-            LPOLEINPLACEFRAME p_inPlaceFrame;\r
-            LPOLEINPLACEUIWINDOW p_inPlaceUIWindow;\r
-            OLEINPLACEFRAMEINFO oleFrameInfo;\r
-\r
-            if( SUCCEEDED(p_inPlaceSite->GetWindowContext(&p_inPlaceFrame, &p_inPlaceUIWindow, &posRect, &clipRect, &oleFrameInfo)) )\r
-            {\r
-                lprcPosRect = &posRect;\r
-                lprcClipRect = &clipRect;\r
-\r
-                if( NULL != p_inPlaceFrame )\r
-                    p_inPlaceFrame->Release();\r
-                if( NULL != p_inPlaceUIWindow )\r
-                    p_inPlaceUIWindow->Release();\r
-            }\r
-        }\r
-\r
-        if( FAILED(_p_instance->onActivateInPlace(lpMsg, hwndParent, lprcPosRect, lprcClipRect)) )\r
-            return E_FAIL;\r
-\r
-        if( NULL != p_inPlaceSite )\r
-            p_inPlaceSite->OnPosRectChange(lprcPosRect);\r
-\r
-        pActiveSite->ShowObject();\r
-        _p_instance->setVisible(TRUE);\r
-\r
-        if( NULL != p_inPlaceSite )\r
-        {\r
-            p_inPlaceSite->OnInPlaceActivate();\r
-            p_inPlaceSite->Release();\r
-        }\r
-\r
-        if( NULL != lpMsg )\r
-        {\r
-            switch( lpMsg->message )\r
-            {\r
-                case WM_LBUTTONDOWN:\r
-                case WM_LBUTTONDBLCLK:\r
-                    doUIActivate(lpMsg, pActiveSite, hwndParent, lprcPosRect);\r
-                    break;\r
-                default:\r
-                    break;\r
-            }\r
-        }\r
-        return S_OK;\r
-    }\r
-    return E_FAIL;\r
-};\r
-\r
-HRESULT VLCOleObject::doUIActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite, HWND hwndParent, LPCRECT lprcPosRect)\r
-{\r
-    if( NULL != pActiveSite )\r
-    {\r
-        // check if already activated\r
-        if( ! _p_instance->isInPlaceActive() )\r
-            return OLE_E_NOT_INPLACEACTIVE;\r
-\r
-        LPOLEINPLACESITE p_inPlaceSite;\r
-\r
-        if( SUCCEEDED(pActiveSite->QueryInterface(IID_IOleInPlaceSite, (void**)&p_inPlaceSite)) )\r
-        {\r
-            p_inPlaceSite->OnUIActivate();\r
-\r
-            if( NULL != lprcPosRect )\r
-            {\r
-                p_inPlaceSite->OnPosRectChange(lprcPosRect);\r
-            }\r
-            p_inPlaceSite->Release();\r
-        }\r
-\r
-        pActiveSite->ShowObject();\r
-        _p_instance->setVisible(TRUE);\r
-        _p_instance->setFocus(TRUE);\r
-\r
-        return S_OK;\r
-    }\r
-    return E_FAIL;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::EnumAdvise(IEnumSTATDATA **ppEnumAdvise)\r
-{\r
-    return _p_advise_holder->EnumAdvise(ppEnumAdvise);\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::EnumVerbs(IEnumOleVerb **ppEnumOleVerb)\r
-{\r
-    return OLE_S_USEREG;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::GetClientSite(LPOLECLIENTSITE *ppClientSite)\r
-{\r
-    if( NULL == ppClientSite )\r
-        return E_POINTER;\r
\r
-    if( NULL != _p_clientsite )\r
-        _p_clientsite->AddRef(); \r
-\r
-    *ppClientSite= _p_clientsite;\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::GetClipboardData(DWORD dwReserved, LPDATAOBJECT *ppDataObject)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::GetExtent(DWORD dwDrawAspect, SIZEL *pSizel)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus)\r
-{\r
-    if( NULL != pdwStatus )\r
-        return E_POINTER;\r
-\r
-    switch( dwAspect )\r
-    {\r
-        case DVASPECT_CONTENT:\r
-            *pdwStatus = OLEMISC_RECOMPOSEONRESIZE\r
-                | OLEMISC_CANTLINKINSIDE\r
-                | OLEMISC_INSIDEOUT\r
-                | OLEMISC_ACTIVATEWHENVISIBLE\r
-                | OLEMISC_SETCLIENTSITEFIRST;\r
-            break;\r
-        default:\r
-            *pdwStatus = 0;\r
-    }\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER *ppMoniker)\r
-{\r
-    if( NULL != _p_clientsite )\r
-        return _p_clientsite->GetMoniker(dwAssign,dwWhichMoniker, ppMoniker);\r
\r
-    return E_UNEXPECTED;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::GetUserClassID(LPCLSID pClsid)\r
-{\r
-    if( NULL == pClsid )\r
-        return E_POINTER;\r
\r
-    pClsid = const_cast<LPCLSID>(&_p_instance->getClassID()); \r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::GetUserType(DWORD dwFormOfType, LPOLESTR *pszUserType)\r
-{\r
-    return OLE_S_USEREG;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::InitFromData(LPDATAOBJECT pDataObject, BOOL fCreation, DWORD dwReserved)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::IsUpToDate(void)\r
-{\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::SetClientSite(LPOLECLIENTSITE pClientSite)\r
-{\r
-    if( NULL != _p_clientsite )\r
-        _p_clientsite->Release(); \r
\r
-    if( NULL != pClientSite )\r
-    {\r
-        pClientSite->AddRef();\r
-\r
-        /*\r
-        ** retrieve container ambient properties\r
-        */\r
-        VARIANT v;\r
-        VariantInit(&v);\r
-        V_VT(&v) = VT_I4;\r
-        if( SUCCEEDED(GetObjectProperty(pClientSite, DISPID_AMBIENT_CODEPAGE, v)) )\r
-        {\r
-            _p_instance->setCodePage(V_I4(&v));\r
-            VariantClear(&v);\r
-        }\r
-    }\r
-\r
-    _p_clientsite = pClientSite;\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::SetColorScheme(LOGPALETTE *pLogpal)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::SetExtent(DWORD dwDrawAspect, SIZEL *pSizel)\r
-{\r
-    return E_NOTIMPL;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::SetHostNames(LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)\r
-{\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::SetMoniker(DWORD dwWhichMoniker, LPMONIKER pMoniker)\r
-{\r
-    return _p_advise_holder->SendOnRename(pMoniker);\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::Unadvise(DWORD dwConnection)\r
-{\r
-    return _p_advise_holder->Unadvise(dwConnection);\r
-};\r
-\r
-STDMETHODIMP VLCOleObject::Update(void)\r
-{\r
-    return S_OK;\r
-};\r
-\r
+/*****************************************************************************
+ * oleobject.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "oleobject.h"
+
+#include "utils.h"
+
+#include <docobj.h>
+
+using namespace std;
+
+VLCOleObject::VLCOleObject(VLCPlugin *p_instance) :
+_p_clientsite(NULL), _p_instance(p_instance) 
+{
+    CreateOleAdviseHolder(&_p_advise_holder);
+};
+
+VLCOleObject::~VLCOleObject()
+{
+    _p_advise_holder->Release();
+    SetClientSite(NULL); 
+};
+
+STDMETHODIMP VLCOleObject::Advise(IAdviseSink *pAdvSink, DWORD *dwConnection)
+{
+    return _p_advise_holder->Advise(pAdvSink, dwConnection);
+};
+
+STDMETHODIMP VLCOleObject::Close(DWORD dwSaveOption)
+{
+    _p_advise_holder->SendOnClose();
+    OleFlushClipboard();
+    return _p_instance->onClose(dwSaveOption);
+};
+
+STDMETHODIMP VLCOleObject::DoVerb(LONG iVerb, LPMSG lpMsg, LPOLECLIENTSITE pActiveSite,
+                                    LONG lIndex, HWND hwndParent, LPCRECT lprcPosRect)
+{
+    if( 0 != lIndex )
+        return DV_E_LINDEX;
+
+    switch( iVerb )
+    {
+        case OLEIVERB_PRIMARY:
+        case OLEIVERB_SHOW:
+        case OLEIVERB_OPEN:
+        case OLEIVERB_INPLACEACTIVATE:
+            if( NULL == hwndParent )
+                return OLEOBJ_S_INVALIDHWND;
+
+            if( SUCCEEDED(doInPlaceActivate(lpMsg, pActiveSite, hwndParent, lprcPosRect)) )
+                return S_OK;
+
+            return OLEOBJ_S_CANNOT_DOVERB_NOW;
+
+        case OLEIVERB_HIDE:
+            _p_instance->setVisible(FALSE);
+            return S_OK;
+
+        case OLEIVERB_UIACTIVATE:
+            return doUIActivate(lpMsg, pActiveSite, hwndParent, lprcPosRect);
+
+        case OLEIVERB_DISCARDUNDOSTATE:
+            return S_OK;
+
+        default:
+            if( NULL == hwndParent )
+                return OLEOBJ_S_INVALIDHWND;
+
+            if( SUCCEEDED(doInPlaceActivate(lpMsg, pActiveSite, hwndParent, lprcPosRect)) )
+                return OLEOBJ_S_INVALIDVERB;
+
+            return OLEOBJ_S_CANNOT_DOVERB_NOW;
+    }
+};
+
+HRESULT VLCOleObject::doInPlaceActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite, HWND hwndParent, LPCRECT lprcPosRect)
+{
+    RECT posRect;
+    RECT clipRect;
+    LPCRECT lprcClipRect = lprcPosRect;
+
+    if( NULL != pActiveSite )
+    {
+        // check if already activated
+        if( _p_instance->isInPlaceActive() )
+        {
+            // just attempt to show object then
+            pActiveSite->ShowObject();
+            _p_instance->setVisible(TRUE);
+            return S_OK;
+        }
+
+        LPOLEINPLACESITE p_inPlaceSite;
+
+        if( SUCCEEDED(pActiveSite->QueryInterface(IID_IOleInPlaceSite, (void**)&p_inPlaceSite)) )
+        {
+            if( S_OK != p_inPlaceSite->CanInPlaceActivate() )
+                return E_FAIL;
+
+            LPOLEINPLACEFRAME p_inPlaceFrame;
+            LPOLEINPLACEUIWINDOW p_inPlaceUIWindow;
+            OLEINPLACEFRAMEINFO oleFrameInfo;
+
+            if( SUCCEEDED(p_inPlaceSite->GetWindowContext(&p_inPlaceFrame, &p_inPlaceUIWindow, &posRect, &clipRect, &oleFrameInfo)) )
+            {
+                lprcPosRect = &posRect;
+                lprcClipRect = &clipRect;
+
+                if( NULL != p_inPlaceFrame )
+                    p_inPlaceFrame->Release();
+                if( NULL != p_inPlaceUIWindow )
+                    p_inPlaceUIWindow->Release();
+            }
+        }
+
+        if( FAILED(_p_instance->onActivateInPlace(lpMsg, hwndParent, lprcPosRect, lprcClipRect)) )
+            return E_FAIL;
+
+        if( NULL != p_inPlaceSite )
+            p_inPlaceSite->OnPosRectChange(lprcPosRect);
+
+        pActiveSite->ShowObject();
+        _p_instance->setVisible(TRUE);
+
+        if( NULL != p_inPlaceSite )
+        {
+            p_inPlaceSite->OnInPlaceActivate();
+            p_inPlaceSite->Release();
+        }
+
+        if( NULL != lpMsg )
+        {
+            switch( lpMsg->message )
+            {
+                case WM_LBUTTONDOWN:
+                case WM_LBUTTONDBLCLK:
+                    doUIActivate(lpMsg, pActiveSite, hwndParent, lprcPosRect);
+                    break;
+                default:
+                    break;
+            }
+        }
+        return S_OK;
+    }
+    return E_FAIL;
+};
+
+HRESULT VLCOleObject::doUIActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite, HWND hwndParent, LPCRECT lprcPosRect)
+{
+    if( NULL != pActiveSite )
+    {
+        // check if already activated
+        if( ! _p_instance->isInPlaceActive() )
+            return OLE_E_NOT_INPLACEACTIVE;
+
+        LPOLEINPLACESITE p_inPlaceSite;
+
+        if( SUCCEEDED(pActiveSite->QueryInterface(IID_IOleInPlaceSite, (void**)&p_inPlaceSite)) )
+        {
+            p_inPlaceSite->OnUIActivate();
+
+            if( NULL != lprcPosRect )
+            {
+                p_inPlaceSite->OnPosRectChange(lprcPosRect);
+            }
+            p_inPlaceSite->Release();
+        }
+
+        pActiveSite->ShowObject();
+        _p_instance->setVisible(TRUE);
+        _p_instance->setFocus(TRUE);
+
+        return S_OK;
+    }
+    return E_FAIL;
+};
+
+STDMETHODIMP VLCOleObject::EnumAdvise(IEnumSTATDATA **ppEnumAdvise)
+{
+    return _p_advise_holder->EnumAdvise(ppEnumAdvise);
+};
+
+STDMETHODIMP VLCOleObject::EnumVerbs(IEnumOleVerb **ppEnumOleVerb)
+{
+    return OLE_S_USEREG;
+};
+
+STDMETHODIMP VLCOleObject::GetClientSite(LPOLECLIENTSITE *ppClientSite)
+{
+    if( NULL == ppClientSite )
+        return E_POINTER;
+    if( NULL != _p_clientsite )
+        _p_clientsite->AddRef(); 
+
+    *ppClientSite= _p_clientsite;
+    return S_OK;
+};
+
+STDMETHODIMP VLCOleObject::GetClipboardData(DWORD dwReserved, LPDATAOBJECT *ppDataObject)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleObject::GetExtent(DWORD dwDrawAspect, SIZEL *pSizel)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleObject::GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus)
+{
+    if( NULL != pdwStatus )
+        return E_POINTER;
+
+    switch( dwAspect )
+    {
+        case DVASPECT_CONTENT:
+            *pdwStatus = OLEMISC_RECOMPOSEONRESIZE
+                | OLEMISC_CANTLINKINSIDE
+                | OLEMISC_INSIDEOUT
+                | OLEMISC_ACTIVATEWHENVISIBLE
+                | OLEMISC_SETCLIENTSITEFIRST;
+            break;
+        default:
+            *pdwStatus = 0;
+    }
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCOleObject::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER *ppMoniker)
+{
+    if( NULL != _p_clientsite )
+        return _p_clientsite->GetMoniker(dwAssign,dwWhichMoniker, ppMoniker);
+    return E_UNEXPECTED;
+};
+
+STDMETHODIMP VLCOleObject::GetUserClassID(LPCLSID pClsid)
+{
+    if( NULL == pClsid )
+        return E_POINTER;
+    pClsid = const_cast<LPCLSID>(&_p_instance->getClassID()); 
+    return S_OK;
+};
+
+STDMETHODIMP VLCOleObject::GetUserType(DWORD dwFormOfType, LPOLESTR *pszUserType)
+{
+    return OLE_S_USEREG;
+};
+
+STDMETHODIMP VLCOleObject::InitFromData(LPDATAOBJECT pDataObject, BOOL fCreation, DWORD dwReserved)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleObject::IsUpToDate(void)
+{
+    return S_OK;
+};
+
+STDMETHODIMP VLCOleObject::SetClientSite(LPOLECLIENTSITE pClientSite)
+{
+    if( NULL != _p_clientsite )
+        _p_clientsite->Release(); 
+    if( NULL != pClientSite )
+    {
+        pClientSite->AddRef();
+
+        /*
+        ** retrieve container ambient properties
+        */
+        VARIANT v;
+        VariantInit(&v);
+        V_VT(&v) = VT_I4;
+        if( SUCCEEDED(GetObjectProperty(pClientSite, DISPID_AMBIENT_CODEPAGE, v)) )
+        {
+            _p_instance->setCodePage(V_I4(&v));
+            VariantClear(&v);
+        }
+    }
+
+    _p_clientsite = pClientSite;
+    return S_OK;
+};
+
+STDMETHODIMP VLCOleObject::SetColorScheme(LOGPALETTE *pLogpal)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleObject::SetExtent(DWORD dwDrawAspect, SIZEL *pSizel)
+{
+    return E_NOTIMPL;
+};
+
+STDMETHODIMP VLCOleObject::SetHostNames(LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
+{
+    return S_OK;
+};
+
+STDMETHODIMP VLCOleObject::SetMoniker(DWORD dwWhichMoniker, LPMONIKER pMoniker)
+{
+    return _p_advise_holder->SendOnRename(pMoniker);
+};
+
+STDMETHODIMP VLCOleObject::Unadvise(DWORD dwConnection)
+{
+    return _p_advise_holder->Unadvise(dwConnection);
+};
+
+STDMETHODIMP VLCOleObject::Update(void)
+{
+    return S_OK;
+};
+
index 428e7f1..e122542 100644 (file)
@@ -1,86 +1,86 @@
-/*****************************************************************************\r
- * oleobject.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __OLEOBJECT_H__\r
-#define __OLEOBJECT_H__\r
-\r
-class VLCOleObject : public IOleObject\r
-{\r
-\r
-public:\r
-\r
-    VLCOleObject(VLCPlugin *p_instance);\r
-    virtual ~VLCOleObject();\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid)\r
-         && (IID_IOleObject == riid) ) \r
-        {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IOleObject methods\r
-    STDMETHODIMP Advise(IAdviseSink *, LPDWORD);\r
-    STDMETHODIMP Close(DWORD);\r
-    STDMETHODIMP DoVerb(LONG, LPMSG, LPOLECLIENTSITE, LONG, HWND, LPCRECT);\r
-    STDMETHODIMP EnumAdvise(IEnumSTATDATA **);\r
-    STDMETHODIMP EnumVerbs(IEnumOleVerb **);\r
-    STDMETHODIMP GetClientSite(LPOLECLIENTSITE *);\r
-    STDMETHODIMP GetClipboardData(DWORD, LPDATAOBJECT *);\r
-    STDMETHODIMP GetExtent(DWORD, SIZEL *);\r
-    STDMETHODIMP GetMiscStatus(DWORD, DWORD *);\r
-    STDMETHODIMP GetMoniker(DWORD, DWORD, LPMONIKER *);\r
-    STDMETHODIMP GetUserClassID(CLSID *);\r
-    STDMETHODIMP GetUserType(DWORD, LPOLESTR *);\r
-    STDMETHODIMP InitFromData(IDataObject *, BOOL, DWORD);\r
-    STDMETHODIMP IsUpToDate(void);\r
-    STDMETHODIMP SetClientSite(LPOLECLIENTSITE);\r
-    STDMETHODIMP SetColorScheme(LOGPALETTE *);\r
-    STDMETHODIMP SetExtent(DWORD, SIZEL *);\r
-    STDMETHODIMP SetHostNames(LPCOLESTR, LPCOLESTR) ;\r
-    STDMETHODIMP SetMoniker(DWORD, LPMONIKER);\r
-    STDMETHODIMP Unadvise(DWORD);\r
-    STDMETHODIMP Update(void);\r
-\r
-private:\r
-\r
-    HRESULT doInPlaceActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite, HWND hwndParent, LPCRECT lprcPosRect);\r
-    HRESULT doUIActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite, HWND hwndParent, LPCRECT lprcPosRect);\r
-\r
-    IOleAdviseHolder *_p_advise_holder;\r
-    IOleClientSite *_p_clientsite;\r
-\r
-    VLCPlugin *_p_instance;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * oleobject.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __OLEOBJECT_H__
+#define __OLEOBJECT_H__
+
+class VLCOleObject : public IOleObject
+{
+
+public:
+
+    VLCOleObject(VLCPlugin *p_instance);
+    virtual ~VLCOleObject();
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid)
+         && (IID_IOleObject == riid) ) 
+        {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IOleObject methods
+    STDMETHODIMP Advise(IAdviseSink *, LPDWORD);
+    STDMETHODIMP Close(DWORD);
+    STDMETHODIMP DoVerb(LONG, LPMSG, LPOLECLIENTSITE, LONG, HWND, LPCRECT);
+    STDMETHODIMP EnumAdvise(IEnumSTATDATA **);
+    STDMETHODIMP EnumVerbs(IEnumOleVerb **);
+    STDMETHODIMP GetClientSite(LPOLECLIENTSITE *);
+    STDMETHODIMP GetClipboardData(DWORD, LPDATAOBJECT *);
+    STDMETHODIMP GetExtent(DWORD, SIZEL *);
+    STDMETHODIMP GetMiscStatus(DWORD, DWORD *);
+    STDMETHODIMP GetMoniker(DWORD, DWORD, LPMONIKER *);
+    STDMETHODIMP GetUserClassID(CLSID *);
+    STDMETHODIMP GetUserType(DWORD, LPOLESTR *);
+    STDMETHODIMP InitFromData(IDataObject *, BOOL, DWORD);
+    STDMETHODIMP IsUpToDate(void);
+    STDMETHODIMP SetClientSite(LPOLECLIENTSITE);
+    STDMETHODIMP SetColorScheme(LOGPALETTE *);
+    STDMETHODIMP SetExtent(DWORD, SIZEL *);
+    STDMETHODIMP SetHostNames(LPCOLESTR, LPCOLESTR) ;
+    STDMETHODIMP SetMoniker(DWORD, LPMONIKER);
+    STDMETHODIMP Unadvise(DWORD);
+    STDMETHODIMP Update(void);
+
+private:
+
+    HRESULT doInPlaceActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite, HWND hwndParent, LPCRECT lprcPosRect);
+    HRESULT doUIActivate(LPMSG lpMsg, LPOLECLIENTSITE pActiveSite, HWND hwndParent, LPCRECT lprcPosRect);
+
+    IOleAdviseHolder *_p_advise_holder;
+    IOleClientSite *_p_clientsite;
+
+    VLCPlugin *_p_instance;
+};
+
+#endif
+
index 2f13ada..e1fb0ab 100644 (file)
-/*****************************************************************************\r
- * persistpropbag.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "persistpropbag.h"\r
-\r
-#include "utils.h"\r
-\r
-using namespace std;\r
-\r
-STDMETHODIMP VLCPersistPropertyBag::GetClassID(LPCLSID pClsID)\r
-{\r
-    if( NULL == pClsID )\r
-        return E_POINTER;\r
-\r
-    *pClsID = _p_instance->getClassID();\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCPersistPropertyBag::InitNew(void)\r
-{\r
-    return _p_instance->onInitNew();\r
-};\r
-\r
-STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog)\r
-{\r
-    if( NULL == pPropBag )\r
-        return E_POINTER;\r
-\r
-    HRESULT hr = _p_instance->onInitNew();\r
-    if( FAILED(hr) )\r
-        return hr;\r
-\r
-    VARIANT value;\r
-\r
-    V_VT(&value) = VT_BSTR;\r
-    if( S_OK == pPropBag->Read(OLESTR("filename"), &value, pErrorLog) )\r
-    {\r
-        char *src = CStrFromBSTR(_p_instance->getCodePage(), V_BSTR(&value));\r
-        if( NULL != src )\r
-        {\r
-            _p_instance->setSourceURL(src);\r
-            free(src);\r
-        }\r
-        VariantClear(&value);\r
-    }\r
-\r
-    V_VT(&value) = VT_BSTR;\r
-    if( S_OK == pPropBag->Read(OLESTR("src"), &value, pErrorLog) )\r
-    {\r
-        char *src = CStrFromBSTR(_p_instance->getCodePage(), V_BSTR(&value));\r
-        if( NULL != src )\r
-        {\r
-            _p_instance->setSourceURL(src);\r
-            free(src);\r
-        }\r
-        VariantClear(&value);\r
-    }\r
-\r
-    V_VT(&value) = VT_BOOL;\r
-    if( S_OK == pPropBag->Read(OLESTR("autoplay"), &value, pErrorLog) )\r
-    {\r
-        _p_instance->setAutoStart(V_BOOL(&value) != VARIANT_FALSE);\r
-        VariantClear(&value);\r
-    }\r
-\r
-    V_VT(&value) = VT_BOOL;\r
-    if( S_OK == pPropBag->Read(OLESTR("autostart"), &value, pErrorLog) )\r
-    {\r
-        _p_instance->setAutoStart(V_BOOL(&value) != VARIANT_FALSE);\r
-        VariantClear(&value);\r
-    }\r
-\r
-    V_VT(&value) = VT_BOOL;\r
-    if( S_OK == pPropBag->Read(OLESTR("loop"), &value, pErrorLog) )\r
-    {\r
-        _p_instance->setLoopMode(V_BOOL(&value) != VARIANT_FALSE);\r
-        VariantClear(&value);\r
-    }\r
-\r
-    V_VT(&value) = VT_BOOL;\r
-    if( S_OK == pPropBag->Read(OLESTR("mute"), &value, pErrorLog) )\r
-    {\r
-        _p_instance->setMute(V_BOOL(&value) != VARIANT_FALSE);\r
-        VariantClear(&value);\r
-    }\r
-\r
-    V_VT(&value) = VT_BOOL;\r
-    if( S_OK == pPropBag->Read(OLESTR("showdisplay"), &value, pErrorLog) )\r
-    {\r
-        _p_instance->setVisible(V_BOOL(&value) != VARIANT_FALSE);\r
-        VariantClear(&value);\r
-    }\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCPersistPropertyBag::Save(LPPROPERTYBAG pPropBag, BOOL fClearDiry, BOOL fSaveAllProperties)\r
-{\r
-    if( NULL == pPropBag )\r
-        return E_POINTER;\r
-\r
-    return S_OK;\r
-};\r
-\r
+/*****************************************************************************
+ * persistpropbag.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "persistpropbag.h"
+
+#include "utils.h"
+
+using namespace std;
+
+STDMETHODIMP VLCPersistPropertyBag::GetClassID(LPCLSID pClsID)
+{
+    if( NULL == pClsID )
+        return E_POINTER;
+
+    *pClsID = _p_instance->getClassID();
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCPersistPropertyBag::InitNew(void)
+{
+    return _p_instance->onInitNew();
+};
+
+STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog)
+{
+    if( NULL == pPropBag )
+        return E_POINTER;
+
+    HRESULT hr = _p_instance->onInitNew();
+    if( FAILED(hr) )
+        return hr;
+
+    VARIANT value;
+
+    V_VT(&value) = VT_BSTR;
+    if( S_OK == pPropBag->Read(OLESTR("filename"), &value, pErrorLog) )
+    {
+        char *src = CStrFromBSTR(_p_instance->getCodePage(), V_BSTR(&value));
+        if( NULL != src )
+        {
+            _p_instance->setSourceURL(src);
+            free(src);
+        }
+        VariantClear(&value);
+    }
+
+    V_VT(&value) = VT_BSTR;
+    if( S_OK == pPropBag->Read(OLESTR("src"), &value, pErrorLog) )
+    {
+        char *src = CStrFromBSTR(_p_instance->getCodePage(), V_BSTR(&value));
+        if( NULL != src )
+        {
+            _p_instance->setSourceURL(src);
+            free(src);
+        }
+        VariantClear(&value);
+    }
+
+    V_VT(&value) = VT_BOOL;
+    if( S_OK == pPropBag->Read(OLESTR("autoplay"), &value, pErrorLog) )
+    {
+        _p_instance->setAutoStart(V_BOOL(&value) != VARIANT_FALSE);
+        VariantClear(&value);
+    }
+
+    V_VT(&value) = VT_BOOL;
+    if( S_OK == pPropBag->Read(OLESTR("autostart"), &value, pErrorLog) )
+    {
+        _p_instance->setAutoStart(V_BOOL(&value) != VARIANT_FALSE);
+        VariantClear(&value);
+    }
+
+    V_VT(&value) = VT_BOOL;
+    if( S_OK == pPropBag->Read(OLESTR("loop"), &value, pErrorLog) )
+    {
+        _p_instance->setLoopMode(V_BOOL(&value) != VARIANT_FALSE);
+        VariantClear(&value);
+    }
+
+    V_VT(&value) = VT_BOOL;
+    if( S_OK == pPropBag->Read(OLESTR("mute"), &value, pErrorLog) )
+    {
+        _p_instance->setMute(V_BOOL(&value) != VARIANT_FALSE);
+        VariantClear(&value);
+    }
+
+    V_VT(&value) = VT_BOOL;
+    if( S_OK == pPropBag->Read(OLESTR("showdisplay"), &value, pErrorLog) )
+    {
+        _p_instance->setVisible(V_BOOL(&value) != VARIANT_FALSE);
+        VariantClear(&value);
+    }
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCPersistPropertyBag::Save(LPPROPERTYBAG pPropBag, BOOL fClearDiry, BOOL fSaveAllProperties)
+{
+    if( NULL == pPropBag )
+        return E_POINTER;
+
+    return S_OK;
+};
+
index c042547..1e1b440 100644 (file)
@@ -1,67 +1,67 @@
-/*****************************************************************************\r
- * persistpropbag.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __PERSISTPROPBAG_H__\r
-#define __PERSISTPROPBAG_H__\r
-\r
-#include <ocidl.h>\r
-\r
-class VLCPersistPropertyBag : public IPersistPropertyBag\r
-{\r
-\r
-public:\r
-\r
-    VLCPersistPropertyBag(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
-    virtual ~VLCPersistPropertyBag() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid) \r
-         && (IID_IPersist == riid) \r
-         && (IID_IPersistPropertyBag == riid) ) {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IPersist methods\r
-    STDMETHODIMP GetClassID(LPCLSID);\r
-\r
-    // IPersistPropertyBag methods\r
-    STDMETHODIMP InitNew(void);\r
-    STDMETHODIMP Load(LPPROPERTYBAG, LPERRORLOG);\r
-    STDMETHODIMP Save(LPPROPERTYBAG, BOOL, BOOL);\r
-\r
-private:\r
-\r
-    VLCPlugin *_p_instance;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * persistpropbag.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __PERSISTPROPBAG_H__
+#define __PERSISTPROPBAG_H__
+
+#include <ocidl.h>
+
+class VLCPersistPropertyBag : public IPersistPropertyBag
+{
+
+public:
+
+    VLCPersistPropertyBag(VLCPlugin *p_instance) : _p_instance(p_instance) {};
+    virtual ~VLCPersistPropertyBag() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid) 
+         && (IID_IPersist == riid) 
+         && (IID_IPersistPropertyBag == riid) ) {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IPersist methods
+    STDMETHODIMP GetClassID(LPCLSID);
+
+    // IPersistPropertyBag methods
+    STDMETHODIMP InitNew(void);
+    STDMETHODIMP Load(LPPROPERTYBAG, LPERRORLOG);
+    STDMETHODIMP Save(LPPROPERTYBAG, BOOL, BOOL);
+
+private:
+
+    VLCPlugin *_p_instance;
+};
+
+#endif
+
index b1bf657..54b17ae 100644 (file)
@@ -1,79 +1,79 @@
-/*****************************************************************************\r
- * persiststorage.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "persiststorage.h"\r
-\r
-using namespace std;\r
-\r
-STDMETHODIMP VLCPersistStorage::GetClassID(LPCLSID pClsID)\r
-{\r
-    if( NULL == pClsID )\r
-        return E_POINTER;\r
-\r
-    *pClsID = _p_instance->getClassID();\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCPersistStorage::IsDirty(void)\r
-{\r
-    return S_FALSE;\r
-};\r
-\r
-STDMETHODIMP VLCPersistStorage::InitNew(IStorage *pStg)\r
-{\r
-    if( NULL == pStg )\r
-        return E_POINTER;\r
-\r
-    return _p_instance->onInitNew();\r
-};\r
-\r
-STDMETHODIMP VLCPersistStorage::Load(IStorage *pStg)\r
-{\r
-    if( NULL == pStg )\r
-        return E_POINTER;\r
-\r
-    return _p_instance->onInitNew();\r
-};\r
-\r
-STDMETHODIMP VLCPersistStorage::Save(IStorage *pStg, BOOL fSameAsLoad)\r
-{\r
-    if( NULL == pStg )\r
-        return E_POINTER;\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCPersistStorage::SaveCompleted(IStorage *pStg)\r
-{\r
-    if( NULL == pStg )\r
-        return E_POINTER;\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCPersistStorage::HandsOffStorage(void)\r
-{\r
-    return S_OK;\r
-};\r
-\r
+/*****************************************************************************
+ * persiststorage.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "persiststorage.h"
+
+using namespace std;
+
+STDMETHODIMP VLCPersistStorage::GetClassID(LPCLSID pClsID)
+{
+    if( NULL == pClsID )
+        return E_POINTER;
+
+    *pClsID = _p_instance->getClassID();
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCPersistStorage::IsDirty(void)
+{
+    return S_FALSE;
+};
+
+STDMETHODIMP VLCPersistStorage::InitNew(IStorage *pStg)
+{
+    if( NULL == pStg )
+        return E_POINTER;
+
+    return _p_instance->onInitNew();
+};
+
+STDMETHODIMP VLCPersistStorage::Load(IStorage *pStg)
+{
+    if( NULL == pStg )
+        return E_POINTER;
+
+    return _p_instance->onInitNew();
+};
+
+STDMETHODIMP VLCPersistStorage::Save(IStorage *pStg, BOOL fSameAsLoad)
+{
+    if( NULL == pStg )
+        return E_POINTER;
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCPersistStorage::SaveCompleted(IStorage *pStg)
+{
+    if( NULL == pStg )
+        return E_POINTER;
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCPersistStorage::HandsOffStorage(void)
+{
+    return S_OK;
+};
+
index c20599a..792a00f 100644 (file)
@@ -1,70 +1,70 @@
-/*****************************************************************************\r
- * persiststorage.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __PERSISTSTORAGE_H__\r
-#define __PERSISTSTORAGE_H__\r
-\r
-#include <ocidl.h>\r
-\r
-class VLCPersistStorage : public IPersistStorage\r
-{\r
-\r
-public:\r
-\r
-    VLCPersistStorage(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
-    virtual ~VLCPersistStorage() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid) \r
-         && (IID_IPersist == riid) \r
-         && (IID_IPersistStorage == riid) ) {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IPersist methods\r
-    STDMETHODIMP GetClassID(LPCLSID);\r
-\r
-    // IPersistStorage methods\r
-    STDMETHODIMP IsDirty(void);\r
-    STDMETHODIMP InitNew(IStorage *);\r
-    STDMETHODIMP Load(IStorage *);\r
-    STDMETHODIMP Save(IStorage *, BOOL);\r
-    STDMETHODIMP SaveCompleted(IStorage *);\r
-    STDMETHODIMP HandsOffStorage(void);\r
-\r
-private:\r
-\r
-    VLCPlugin *_p_instance;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * persiststorage.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __PERSISTSTORAGE_H__
+#define __PERSISTSTORAGE_H__
+
+#include <ocidl.h>
+
+class VLCPersistStorage : public IPersistStorage
+{
+
+public:
+
+    VLCPersistStorage(VLCPlugin *p_instance) : _p_instance(p_instance) {};
+    virtual ~VLCPersistStorage() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid) 
+         && (IID_IPersist == riid) 
+         && (IID_IPersistStorage == riid) ) {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IPersist methods
+    STDMETHODIMP GetClassID(LPCLSID);
+
+    // IPersistStorage methods
+    STDMETHODIMP IsDirty(void);
+    STDMETHODIMP InitNew(IStorage *);
+    STDMETHODIMP Load(IStorage *);
+    STDMETHODIMP Save(IStorage *, BOOL);
+    STDMETHODIMP SaveCompleted(IStorage *);
+    STDMETHODIMP HandsOffStorage(void);
+
+private:
+
+    VLCPlugin *_p_instance;
+};
+
+#endif
+
index 421036f..4d2fd55 100644 (file)
@@ -1,70 +1,70 @@
-/*****************************************************************************\r
- * persiststreaminit.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-#include "persiststreaminit.h"\r
-\r
-using namespace std;\r
-\r
-STDMETHODIMP VLCPersistStreamInit::GetClassID(LPCLSID pClsID)\r
-{\r
-    if( NULL == pClsID )\r
-        return E_POINTER;\r
-\r
-    *pClsID = _p_instance->getClassID();\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCPersistStreamInit::InitNew(void)\r
-{\r
-    return _p_instance->onInitNew();\r
-};\r
-\r
-STDMETHODIMP VLCPersistStreamInit::Load(LPSTREAM pStm)\r
-{\r
-    if( NULL == pStm )\r
-        return E_POINTER;\r
-\r
-    return _p_instance->onInitNew();\r
-};\r
-\r
-STDMETHODIMP VLCPersistStreamInit::Save(LPSTREAM pStm, BOOL fClearDirty)\r
-{\r
-    if( NULL == pStm )\r
-        return E_POINTER;\r
-\r
-    return S_OK;\r
-};\r
-\r
-STDMETHODIMP VLCPersistStreamInit::IsDirty(void)\r
-{\r
-    return S_FALSE;\r
-};\r
-\r
-STDMETHODIMP VLCPersistStreamInit::GetSizeMax(ULARGE_INTEGER *pcbSize)\r
-{\r
-    pcbSize->QuadPart = 0ULL;\r
-\r
-    return S_OK;\r
-};\r
-\r
+/*****************************************************************************
+ * persiststreaminit.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+#include "persiststreaminit.h"
+
+using namespace std;
+
+STDMETHODIMP VLCPersistStreamInit::GetClassID(LPCLSID pClsID)
+{
+    if( NULL == pClsID )
+        return E_POINTER;
+
+    *pClsID = _p_instance->getClassID();
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCPersistStreamInit::InitNew(void)
+{
+    return _p_instance->onInitNew();
+};
+
+STDMETHODIMP VLCPersistStreamInit::Load(LPSTREAM pStm)
+{
+    if( NULL == pStm )
+        return E_POINTER;
+
+    return _p_instance->onInitNew();
+};
+
+STDMETHODIMP VLCPersistStreamInit::Save(LPSTREAM pStm, BOOL fClearDirty)
+{
+    if( NULL == pStm )
+        return E_POINTER;
+
+    return S_OK;
+};
+
+STDMETHODIMP VLCPersistStreamInit::IsDirty(void)
+{
+    return S_FALSE;
+};
+
+STDMETHODIMP VLCPersistStreamInit::GetSizeMax(ULARGE_INTEGER *pcbSize)
+{
+    pcbSize->QuadPart = 0ULL;
+
+    return S_OK;
+};
+
index bfead1b..8d8cc93 100644 (file)
@@ -1,69 +1,69 @@
-/*****************************************************************************\r
- * persiststreaminit.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#ifndef __PERSISTSTREAMINIT_H__\r
-#define __PERSISTSTREAMINIT_H__\r
-\r
-#include <ocidl.h>\r
-\r
-class VLCPersistStreamInit : public IPersistStreamInit\r
-{\r
-\r
-public:\r
-\r
-    VLCPersistStreamInit(VLCPlugin *p_instance) : _p_instance(p_instance) {};\r
-    virtual ~VLCPersistStreamInit() {};\r
-\r
-    // IUnknown methods\r
-    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)\r
-    {\r
-        if( (NULL != ppv)\r
-         && (IID_IUnknown == riid) \r
-         && (IID_IPersist == riid) \r
-         && (IID_IPersistStreamInit == riid) ) {\r
-            AddRef();\r
-            *ppv = reinterpret_cast<LPVOID>(this);\r
-            return NOERROR;\r
-        }\r
-        return _p_instance->QueryInterface(riid, ppv);\r
-    };\r
-\r
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };\r
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };\r
-\r
-    // IPersist methods\r
-    STDMETHODIMP GetClassID(LPCLSID);\r
-\r
-    // IPersistStreamInit methods\r
-    STDMETHODIMP IsDirty(void);\r
-    STDMETHODIMP InitNew(void);\r
-    STDMETHODIMP Load(LPSTREAM);\r
-    STDMETHODIMP Save(LPSTREAM, BOOL);\r
-    STDMETHODIMP GetSizeMax(ULARGE_INTEGER *);\r
-\r
-private:\r
-\r
-    VLCPlugin *_p_instance;\r
-};\r
-\r
-#endif\r
-\r
+/*****************************************************************************
+ * persiststreaminit.h: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifndef __PERSISTSTREAMINIT_H__
+#define __PERSISTSTREAMINIT_H__
+
+#include <ocidl.h>
+
+class VLCPersistStreamInit : public IPersistStreamInit
+{
+
+public:
+
+    VLCPersistStreamInit(VLCPlugin *p_instance) : _p_instance(p_instance) {};
+    virtual ~VLCPersistStreamInit() {};
+
+    // IUnknown methods
+    STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
+    {
+        if( (NULL != ppv)
+         && (IID_IUnknown == riid) 
+         && (IID_IPersist == riid) 
+         && (IID_IPersistStreamInit == riid) ) {
+            AddRef();
+            *ppv = reinterpret_cast<LPVOID>(this);
+            return NOERROR;
+        }
+        return _p_instance->QueryInterface(riid, ppv);
+    };
+
+    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); };
+    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); };
+
+    // IPersist methods
+    STDMETHODIMP GetClassID(LPCLSID);
+
+    // IPersistStreamInit methods
+    STDMETHODIMP IsDirty(void);
+    STDMETHODIMP InitNew(void);
+    STDMETHODIMP Load(LPSTREAM);
+    STDMETHODIMP Save(LPSTREAM, BOOL);
+    STDMETHODIMP GetSizeMax(ULARGE_INTEGER *);
+
+private:
+
+    VLCPlugin *_p_instance;
+};
+
+#endif
+
index e178b3a..a419037 100644 (file)
-/*****************************************************************************\r
- * plugin.cpp: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
-\r
-#include "plugin.h"\r
-\r
-#include "oleobject.h"\r
-#include "olecontrol.h"\r
-#include "oleinplaceobject.h"\r
-#include "oleinplaceactiveobject.h"\r
-#include "persistpropbag.h"\r
-#include "persiststreaminit.h"\r
-#include "persiststorage.h"\r
-#include "provideclassinfo.h"\r
-#include "connectioncontainer.h"\r
-#include "objectsafety.h"\r
-#include "vlccontrol.h"\r
-\r
-#include "utils.h"\r
-\r
-#include <string.h>\r
-#include <winreg.h>\r
-\r
-using namespace std;\r
-\r
-////////////////////////////////////////////////////////////////////////\r
-//class factory\r
-\r
-// {E23FE9C6-778E-49d4-B537-38FCDE4887D8}\r
-//const GUID CLSID_VLCPlugin = \r
-//    { 0xe23fe9c6, 0x778e, 0x49d4, { 0xb5, 0x37, 0x38, 0xfc, 0xde, 0x48, 0x87, 0xd8 } };\r
-\r
-static LRESULT CALLBACK VLCInPlaceClassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {\r
-    switch( uMsg )\r
-    {\r
-        case WM_ERASEBKGND:\r
-            return 1L;\r
-\r
-        case WM_PAINT:\r
-            PAINTSTRUCT ps;\r
-            if( GetUpdateRect(hWnd, NULL, FALSE) )\r
-            {\r
-                BeginPaint(hWnd, &ps);\r
-                EndPaint(hWnd, &ps);\r
-            }\r
-            return 0L;\r
-\r
-        default:\r
-            return DefWindowProc(hWnd, uMsg, wParam, lParam);\r
-    }\r
-};\r
-\r
-static LRESULT CALLBACK VLCVideoClassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {\r
-    VLCPlugin *p_instance = reinterpret_cast<VLCPlugin *>(GetWindowLongPtr(hWnd, GWLP_USERDATA));\r
-\r
-    switch( uMsg )\r
-    {\r
-        case WM_ERASEBKGND:\r
-            return 1L;\r
-\r
-        case WM_PAINT:\r
-            PAINTSTRUCT ps;\r
-            RECT pr;\r
-            if( GetUpdateRect(hWnd, &pr, FALSE) )\r
-            {\r
-                BeginPaint(hWnd, &ps);\r
-                p_instance->onPaint(ps, pr);\r
-                EndPaint(hWnd, &ps);\r
-            }\r
-            return 0L;\r
-\r
-        default:\r
-            return DefWindowProc(hWnd, uMsg, wParam, lParam);\r
-    }\r
-};\r
-\r
-VLCPluginClass::VLCPluginClass(LONG *p_class_ref, HINSTANCE hInstance) :\r
-    _p_class_ref(p_class_ref),\r
-    _hinstance(hInstance)\r
-{\r
-    WNDCLASS wClass;\r
-\r
-    if( ! GetClassInfo(hInstance, getInPlaceWndClassName(), &wClass) )\r
-    {\r
-        wClass.style          = CS_NOCLOSE|CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS;\r
-        wClass.lpfnWndProc    = VLCInPlaceClassWndProc;\r
-        wClass.cbClsExtra     = 0;\r
-        wClass.cbWndExtra     = 0;\r
-        wClass.hInstance      = hInstance;\r
-        wClass.hIcon          = NULL;\r
-        wClass.hCursor        = LoadCursor(NULL, IDC_ARROW);\r
-        wClass.hbrBackground  = NULL;\r
-        wClass.lpszMenuName   = NULL;\r
-        wClass.lpszClassName  = getInPlaceWndClassName();\r
-       \r
-        _inplace_wndclass_atom = RegisterClass(&wClass);\r
-    }\r
-    else\r
-    {\r
-        _inplace_wndclass_atom = 0;\r
-    }\r
-\r
-    if( ! GetClassInfo(hInstance, getVideoWndClassName(), &wClass) )\r
-    {\r
-        wClass.style          = CS_NOCLOSE|CS_HREDRAW|CS_VREDRAW;\r
-        wClass.lpfnWndProc    = VLCVideoClassWndProc;\r
-        wClass.cbClsExtra     = 0;\r
-        wClass.cbWndExtra     = 0;\r
-        wClass.hInstance      = hInstance;\r
-        wClass.hIcon          = NULL;\r
-        wClass.hCursor        = LoadCursor(NULL, IDC_ARROW);\r
-        wClass.hbrBackground  = NULL;\r
-        wClass.lpszMenuName   = NULL;\r
-        wClass.lpszClassName  = getVideoWndClassName();\r
-       \r
-        _video_wndclass_atom = RegisterClass(&wClass);\r
-    }\r
-    else\r
-    {\r
-        _video_wndclass_atom = 0;\r
-    }\r
-\r
-    _inplace_hbitmap = (HBITMAP)LoadImage(getHInstance(), TEXT("INPLACE-PICT"), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);\r
-\r
-    AddRef();\r
-};\r
-\r
-VLCPluginClass::~VLCPluginClass()\r
-{\r
-    if( 0 != _inplace_wndclass_atom )\r
-        UnregisterClass(MAKEINTATOM(_inplace_wndclass_atom), _hinstance);\r
-\r
-    if( 0 != _video_wndclass_atom )\r
-        UnregisterClass(MAKEINTATOM(_video_wndclass_atom), _hinstance);\r
-\r
-    if( NULL != _inplace_hbitmap )\r
-        DeleteObject(_inplace_hbitmap);\r
-};\r
-\r
-STDMETHODIMP VLCPluginClass::QueryInterface(REFIID riid, void **ppv)\r
-{\r
-    if( NULL == ppv )\r
-        return E_INVALIDARG;\r
-\r
-    if( (IID_IUnknown == riid) || (IID_IClassFactory == riid) )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(this);\r
-\r
-        return NOERROR;\r
-    }\r
-\r
-    *ppv = NULL;\r
-\r
-    return E_NOINTERFACE;\r
-};\r
-\r
-STDMETHODIMP_(ULONG) VLCPluginClass::AddRef(void)\r
-{\r
-    return InterlockedIncrement(_p_class_ref);\r
-};\r
-\r
-STDMETHODIMP_(ULONG) VLCPluginClass::Release(void)\r
-{\r
-    ULONG refcount = InterlockedDecrement(_p_class_ref);\r
-    if( 0 == refcount )\r
-    {\r
-        delete this;\r
-        return 0;\r
-    }\r
-    return refcount;\r
-};\r
-\r
-STDMETHODIMP VLCPluginClass::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppv)\r
-{\r
-    if( NULL == ppv )\r
-        return E_POINTER;\r
-\r
-    *ppv = NULL;\r
-\r
-    if( NULL != pUnkOuter )\r
-        return CLASS_E_NOAGGREGATION;\r
-\r
-    VLCPlugin *plugin = new VLCPlugin(this);\r
-    if( NULL != plugin )\r
-    {\r
-        HRESULT hr = plugin->QueryInterface(riid, ppv);\r
-        plugin->Release();\r
-        return hr;\r
-    }\r
-    return E_OUTOFMEMORY;\r
-};\r
-\r
-STDMETHODIMP VLCPluginClass::LockServer(BOOL fLock)\r
-{\r
-    if( fLock )\r
-        AddRef();\r
-    else \r
-        Release();\r
-\r
-    return S_OK;\r
-};\r
-\r
-////////////////////////////////////////////////////////////////////////\r
-\r
-VLCPlugin::VLCPlugin(VLCPluginClass *p_class) :\r
-    _inplacewnd(NULL),\r
-    _p_class(p_class),\r
-    _i_ref(1UL),\r
-    _codepage(CP_ACP),\r
-    _psz_src(NULL),\r
-    _b_autostart(TRUE),\r
-    _b_loopmode(FALSE),\r
-    _b_visible(TRUE),\r
-    _b_sendevents(TRUE),\r
-    _i_vlc(0)\r
-{\r
-    p_class->AddRef();\r
-\r
-    vlcOleObject = new VLCOleObject(this);\r
-    vlcOleControl = new VLCOleControl(this);\r
-    vlcOleInPlaceObject = new VLCOleInPlaceObject(this);\r
-    vlcOleInPlaceActiveObject = new VLCOleInPlaceActiveObject(this);\r
-    vlcPersistStorage = new VLCPersistStorage(this);\r
-    vlcPersistStreamInit = new VLCPersistStreamInit(this);\r
-    vlcPersistPropertyBag = new VLCPersistPropertyBag(this);\r
-    vlcProvideClassInfo = new VLCProvideClassInfo(this);\r
-    vlcConnectionPointContainer = new VLCConnectionPointContainer(this);\r
-    vlcObjectSafety = new VLCObjectSafety(this);\r
-    vlcControl = new VLCControl(this);\r
-};\r
-\r
-VLCPlugin::~VLCPlugin()\r
-{\r
-    vlcOleInPlaceObject->UIDeactivate();\r
-    vlcOleInPlaceObject->InPlaceDeactivate();\r
-\r
-    delete vlcControl;\r
-    delete vlcObjectSafety;\r
-    delete vlcConnectionPointContainer;\r
-    delete vlcProvideClassInfo;\r
-    delete vlcPersistPropertyBag;\r
-    delete vlcPersistStreamInit;\r
-    delete vlcPersistStorage;\r
-    delete vlcOleInPlaceActiveObject;\r
-    delete vlcOleInPlaceObject;\r
-    delete vlcOleControl;\r
-    delete vlcOleObject;\r
-\r
-    if( _psz_src )\r
-        free(_psz_src);\r
-\r
-    _p_class->Release();\r
-};\r
-\r
-STDMETHODIMP VLCPlugin::QueryInterface(REFIID riid, void **ppv)\r
-{\r
-    if( NULL == ppv )\r
-        return E_INVALIDARG;\r
-\r
-    if( IID_IUnknown == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(this);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IOleObject == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcOleObject);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IOleControl == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcOleControl);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IOleWindow == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcOleInPlaceObject);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IOleInPlaceObject == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcOleInPlaceObject);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IOleInPlaceActiveObject == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcOleInPlaceActiveObject);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IPersist == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcPersistPropertyBag);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IPersistStreamInit == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcPersistStreamInit);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IPersistStorage == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcPersistStorage);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IPersistPropertyBag == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcPersistPropertyBag);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IProvideClassInfo == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcProvideClassInfo);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IProvideClassInfo2 == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcProvideClassInfo);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IConnectionPointContainer == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcConnectionPointContainer);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IObjectSafety == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcObjectSafety);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IDispatch == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcControl);\r
-        return NOERROR;\r
-    }\r
-    else if( IID_IVLCControl == riid )\r
-    {\r
-        AddRef();\r
-        *ppv = reinterpret_cast<LPVOID>(vlcControl);\r
-        return NOERROR;\r
-    }\r
-\r
-    *ppv = NULL;\r
-\r
-    return E_NOINTERFACE;\r
-};\r
-\r
-STDMETHODIMP_(ULONG) VLCPlugin::AddRef(void)\r
-{\r
-    return InterlockedIncrement((LONG *)&_i_ref);\r
-};\r
-\r
-STDMETHODIMP_(ULONG) VLCPlugin::Release(void)\r
-{\r
-    if( ! InterlockedDecrement((LONG *)&_i_ref) )\r
-    {\r
-        delete this;\r
-        return 0;\r
-    }\r
-    return _i_ref;\r
-};\r
-\r
-//////////////////////////////////////\r
-\r
-/*\r
-** we use an in-place child window to represent plugin viewport,\r
-** whose size is limited by the clipping rectangle\r
-** all drawing within this window must follow \r
-** cartesian coordinate system represented by _bounds.\r
-*/\r
-\r
-void VLCPlugin::calcPositionChange(LPRECT lprPosRect, LPCRECT lprcClipRect)\r
-{\r
-    _bounds.right  = lprPosRect->right-lprPosRect->left;\r
-\r
-    if( lprcClipRect->left <= lprPosRect->left )\r
-    {\r
-        // left side is not clipped out\r
-        _bounds.left = 0;\r
-\r
-        if( lprcClipRect->right >= lprPosRect->right )\r
-        {\r
-            // right side is not clipped out, no change\r
-        }\r
-        else if( lprcClipRect->right >= lprPosRect->left )\r
-        {\r
-            // right side is clipped out\r
-            lprPosRect->right = lprcClipRect->right;\r
-        }\r
-        else\r
-        {\r
-            // outside of clipping rectange, not visible\r
-            lprPosRect->right = lprPosRect->left;\r
-        }\r
-    }\r
-    else\r
-    {\r
-        // left side is clipped out\r
-        _bounds.left = lprPosRect->left-lprcClipRect->left;\r
-        _bounds.right += _bounds.left;\r
-\r
-        lprPosRect->left = lprcClipRect->left;\r
-        if( lprcClipRect->right >= lprPosRect->right )\r
-        {\r
-            // right side is not clipped out\r
-        }\r
-        else\r
-        {\r
-            // right side is clipped out\r
-            lprPosRect->right = lprcClipRect->right;\r
-        }\r
-    }\r
-\r
-    _bounds.bottom = lprPosRect->bottom-lprPosRect->top;\r
-\r
-    if( lprcClipRect->top <= lprPosRect->top )\r
-    {\r
-        // top side is not clipped out\r
-        _bounds.top = 0;\r
-\r
-        if( lprcClipRect->bottom >= lprPosRect->bottom )\r
-        {\r
-            // bottom side is not clipped out, no change\r
-        }\r
-        else if( lprcClipRect->bottom >= lprPosRect->top )\r
-        {\r
-            // bottom side is clipped out\r
-            lprPosRect->bottom = lprcClipRect->bottom;\r
-        }\r
-        else\r
-        {\r
-            // outside of clipping rectange, not visible\r
-            lprPosRect->right = lprPosRect->left;\r
-        }\r
-    }\r
-    else\r
-    {\r
-        _bounds.top = lprPosRect->top-lprcClipRect->top;\r
-        _bounds.bottom += _bounds.top;\r
-\r
-        lprPosRect->top = lprcClipRect->top;\r
-        if( lprcClipRect->bottom >= lprPosRect->bottom )\r
-        {\r
-            // bottom side is not clipped out\r
-        }\r
-        else\r
-        {\r
-            // bottom side is clipped out\r
-            lprPosRect->bottom = lprcClipRect->bottom;\r
-        }\r
-    }\r
-};\r
-\r
-HRESULT VLCPlugin::onInitNew(void)\r
-{\r
-    if( 0 == _i_vlc )\r
-    {\r
-        char *ppsz_argv[] = { "vlc", "-vv" };\r
-        HKEY h_key;\r
-        DWORD i_type, i_data = MAX_PATH + 1;\r
-        char p_data[MAX_PATH + 1];\r
-        if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\VideoLAN\\VLC",\r
-                          0, KEY_READ, &h_key ) == ERROR_SUCCESS )\r
-        {\r
-             if( RegQueryValueEx( h_key, "InstallDir", 0, &i_type,\r
-                                  (LPBYTE)p_data, &i_data ) == ERROR_SUCCESS )\r
-             {\r
-                 if( i_type == REG_SZ )\r
-                 {\r
-                     strcat( p_data, "\\vlc" );\r
-                     ppsz_argv[0] = p_data;\r
-                 }\r
-             }\r
-             RegCloseKey( h_key );\r
-        }\r
-\r
-#if 0\r
-        ppsz_argv[0] = "C:\\cygwin\\home\\Damien_Fouilleul\\dev\\videolan\\vlc-trunk\\vlc";\r
-#endif\r
-\r
-        _i_vlc = VLC_Create();\r
-        \r
-        if( VLC_Init(_i_vlc, sizeof(ppsz_argv)/sizeof(char*), ppsz_argv) )\r
-        {\r
-            VLC_Destroy(_i_vlc);\r
-            _i_vlc = 0;\r
-            return E_FAIL;\r
-        }\r
-        return S_OK;\r
-    }\r
-    return E_UNEXPECTED;\r
-};\r
-    \r
-HRESULT VLCPlugin::onClose(DWORD dwSaveOption)\r
-{\r
-    if( _i_vlc )\r
-    {\r
-        if( isInPlaceActive() )\r
-        {\r
-            onInPlaceDeactivate();\r
-        }\r
-\r
-        VLC_CleanUp(_i_vlc);\r
-        VLC_Destroy(_i_vlc);\r
-        _i_vlc = 0;\r
-    }\r
-    return S_OK;\r
-};\r
-\r
-BOOL VLCPlugin::isInPlaceActive(void)\r
-{\r
-    return (NULL != _inplacewnd);\r
-};\r
-\r
-HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprcPosRect, LPCRECT lprcClipRect)\r
-{\r
-    RECT posRect = *lprcPosRect;\r
-\r
-    calcPositionChange(&posRect, lprcClipRect);\r
-\r
-    _inplacewnd = CreateWindow(_p_class->getInPlaceWndClassName(),\r
-            "VLC Plugin In-Place Window",\r
-            WS_CHILD|WS_CLIPCHILDREN|WS_TABSTOP,\r
-            posRect.left,\r
-            posRect.top,\r
-            posRect.right-posRect.left,\r
-            posRect.bottom-posRect.top,\r
-            hwndParent,\r
-            0,\r
-            _p_class->getHInstance(),\r
-            NULL\r
-           );\r
-\r
-    if( NULL == _inplacewnd )\r
-        return E_FAIL;\r
-\r
-    SetWindowLongPtr(_inplacewnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));\r
-\r
-    _videownd = CreateWindow(_p_class->getVideoWndClassName(),\r
-            "VLC Plugin Video Window",\r
-            WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,\r
-            _bounds.left,\r
-            _bounds.top,\r
-            _bounds.right-_bounds.left,\r
-            _bounds.bottom-_bounds.top,\r
-            _inplacewnd,\r
-            0,\r
-            _p_class->getHInstance(),\r
-            NULL\r
-           );\r
-\r
-    if( NULL == _videownd )\r
-    {\r
-        DestroyWindow(_inplacewnd);\r
-        return E_FAIL;\r
-    }\r
-\r
-    SetWindowLongPtr(_videownd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));\r
-\r
-    if( getVisible() )\r
-        ShowWindow(_inplacewnd, SW_SHOWNORMAL);\r
-\r
-    /* horrible cast there */\r
-    vlc_value_t val;\r
-    val.i_int = reinterpret_cast<int>(_videownd);\r
-    VLC_VariableSet(_i_vlc, "drawable", val);\r
-\r
-    if( NULL != _psz_src )\r
-    {\r
-        // add target to playlist\r
-        char *cOptions[1];\r
-        int  cOptionsCount = 0;\r
-\r
-        if( _b_loopmode )\r
-        {\r
-            cOptions[cOptionsCount++] = "loop";\r
-        }\r
-        VLC_AddTarget(_i_vlc, _psz_src, (const char **)&cOptions, cOptionsCount, PLAYLIST_APPEND, PLAYLIST_END);\r
-\r
-        if( _b_autostart )\r
-        {\r
-            VLC_Play(_i_vlc);\r
-            fireOnPlayEvent();\r
-        }\r
-    }\r
-    return S_OK;\r
-};\r
-\r
-HRESULT VLCPlugin::onInPlaceDeactivate(void)\r
-{\r
-    VLC_Stop(_i_vlc);\r
-    fireOnStopEvent();\r
-\r
-    DestroyWindow(_videownd);\r
-    _videownd = NULL;\r
-    DestroyWindow(_inplacewnd);\r
-    _inplacewnd = NULL;\r
\r
-    return S_OK;\r
-};\r
-\r
-void VLCPlugin::setVisible(BOOL fVisible)\r
-{\r
-    _b_visible = fVisible;\r
-    if( isInPlaceActive() )\r
-        ShowWindow(_inplacewnd, fVisible ? SW_SHOWNORMAL : SW_HIDE);\r
-    firePropChangedEvent(DISPID_Visible);\r
-};\r
-\r
-void VLCPlugin::setFocus(BOOL fFocus)\r
-{\r
-    if( fFocus )\r
-        SetActiveWindow(_inplacewnd);\r
-};\r
-\r
-BOOL VLCPlugin::hasFocus(void)\r
-{\r
-    return GetActiveWindow() == _inplacewnd;\r
-};\r
-\r
-void VLCPlugin::onPaint(PAINTSTRUCT &ps, RECT &pr)\r
-{\r
-    /*\r
-    ** if VLC is playing, it may not display any VIDEO content \r
-    ** hence, draw control logo\r
-    */ \r
-    int width = _bounds.right-_bounds.left;\r
-    int height = _bounds.bottom-_bounds.top;\r
-\r
-    HBITMAP pict = _p_class->getInPlacePict();\r
-    if( NULL != pict )\r
-    {\r
-        HDC hdcPict = CreateCompatibleDC(ps.hdc);\r
-        if( NULL != hdcPict )\r
-        {\r
-            BITMAP bm;\r
-            if( GetObject(pict, sizeof(BITMAPINFO), &bm) )\r
-            {\r
-                int dstWidth = bm.bmWidth;\r
-                if( dstWidth > width-4 )\r
-                    dstWidth = width-4;\r
-\r
-                int dstHeight = bm.bmHeight;\r
-                if( dstHeight > height-4 )\r
-                    dstHeight = height-4;\r
-\r
-                int dstX = (width-dstWidth)/2;\r
-                int dstY = (height-dstHeight)/2;\r
-\r
-                SelectObject(hdcPict, pict);\r
-                StretchBlt(ps.hdc, dstX, dstY, dstWidth, dstHeight,\r
-                        hdcPict, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);\r
-                DeleteDC(hdcPict);\r
-                ExcludeClipRect(ps.hdc, dstX, dstY, dstWidth+dstX, dstHeight+dstY);\r
-            }\r
-        }\r
-    }\r
-\r
-    FillRect(ps.hdc, &pr, (HBRUSH)GetStockObject(WHITE_BRUSH));\r
-    SelectObject(ps.hdc, GetStockObject(BLACK_BRUSH));\r
-\r
-    MoveToEx(ps.hdc, 0, 0, NULL);\r
-    LineTo(ps.hdc, width-1, 0);\r
-    LineTo(ps.hdc, width-1, height-1);\r
-    LineTo(ps.hdc, 0, height-1);\r
-    LineTo(ps.hdc, 0, 0);\r
-};\r
-\r
-void VLCPlugin::onPositionChange(LPCRECT lprcPosRect, LPCRECT lprcClipRect)\r
-{\r
-    RECT posRect = *lprcPosRect;\r
-\r
-    calcPositionChange(&posRect, lprcClipRect);\r
-\r
-    /*\r
-    ** change in-place window geometry to match clipping region\r
-    */\r
-    MoveWindow(_inplacewnd,\r
-            posRect.left,\r
-            posRect.top,\r
-            posRect.right-posRect.left,\r
-            posRect.bottom-posRect.top,\r
-            FALSE);\r
-\r
-    /*\r
-    ** change video window geometry to match object bounds within clipping region\r
-    */\r
-    MoveWindow(_videownd,\r
-            _bounds.left,\r
-            _bounds.top,\r
-            _bounds.right-_bounds.left,\r
-            _bounds.bottom-_bounds.top,\r
-            FALSE);\r
-\r
-    RECT updateRect;\r
-\r
-    updateRect.left = -_bounds.left;\r
-    updateRect.top = -_bounds.top;\r
-    updateRect.right = _bounds.right-_bounds.left;\r
-    updateRect.bottom = _bounds.bottom-_bounds.top;\r
-\r
-    ValidateRect(_videownd, NULL);\r
-    InvalidateRect(_videownd, &updateRect, FALSE);\r
-    UpdateWindow(_videownd);\r
-};\r
-\r
-void VLCPlugin::firePropChangedEvent(DISPID dispid)\r
-{\r
-    if( _b_sendevents )\r
-    {\r
-        vlcConnectionPointContainer->firePropChangedEvent(dispid); \r
-    }\r
-};\r
-\r
-void VLCPlugin::fireOnPlayEvent(void)\r
-{\r
-    if( _b_sendevents )\r
-    {\r
-        DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};\r
-        vlcConnectionPointContainer->fireEvent(DISPID_PlayEvent, &dispparamsNoArgs); \r
-    }\r
-};\r
-\r
-void VLCPlugin::fireOnPauseEvent(void)\r
-{\r
-    if( _b_sendevents )\r
-    {\r
-        DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};\r
-        vlcConnectionPointContainer->fireEvent(DISPID_PauseEvent, &dispparamsNoArgs); \r
-    }\r
-};\r
-\r
-void VLCPlugin::fireOnStopEvent(void)\r
-{\r
-    if( _b_sendevents )\r
-    {\r
-        DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};\r
-        vlcConnectionPointContainer->fireEvent(DISPID_StopEvent, &dispparamsNoArgs); \r
-    }\r
-};\r
-\r
+/*****************************************************************************
+ * plugin.cpp: ActiveX control for VLC
+ *****************************************************************************
+ * Copyright (C) 2005 VideoLAN
+ *
+ * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#include "plugin.h"
+
+#include "oleobject.h"
+#include "olecontrol.h"
+#include "oleinplaceobject.h"
+#include "oleinplaceactiveobject.h"
+#include "persistpropbag.h"
+#include "persiststreaminit.h"
+#include "persiststorage.h"
+#include "provideclassinfo.h"
+#include "connectioncontainer.h"
+#include "objectsafety.h"
+#include "vlccontrol.h"
+
+#include "utils.h"
+
+#include <string.h>
+#include <winreg.h>
+
+using namespace std;
+
+////////////////////////////////////////////////////////////////////////
+//class factory
+
+// {E23FE9C6-778E-49d4-B537-38FCDE4887D8}
+//const GUID CLSID_VLCPlugin = 
+//    { 0xe23fe9c6, 0x778e, 0x49d4, { 0xb5, 0x37, 0x38, 0xfc, 0xde, 0x48, 0x87, 0xd8 } };
+
+static LRESULT CALLBACK VLCInPlaceClassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+    switch( uMsg )
+    {
+        case WM_ERASEBKGND:
+            return 1L;
+
+        case WM_PAINT:
+            PAINTSTRUCT ps;
+            if( GetUpdateRect(hWnd, NULL, FALSE) )
+            {
+                BeginPaint(hWnd, &ps);
+                EndPaint(hWnd, &ps);
+            }
+            return 0L;
+
+        default:
+            return DefWindowProc(hWnd, uMsg, wParam, lParam);
+    }
+};
+
+static LRESULT CALLBACK VLCVideoClassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+    VLCPlugin *p_instance = reinterpret_cast<VLCPlugin *>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
+
+    switch( uMsg )
+    {
+        case WM_ERASEBKGND:
+            return 1L;
+
+        case WM_PAINT:
+            PAINTSTRUCT ps;
+            RECT pr;
+            if( GetUpdateRect(hWnd, &pr, FALSE) )
+            {
+                BeginPaint(hWnd, &ps);
+                p_instance->onPaint(ps, pr);
+                EndPaint(hWnd, &ps);
+            }
+            return 0L;
+
+        default:
+            return DefWindowProc(hWnd, uMsg, wParam, lParam);
+    }
+};
+
+VLCPluginClass::VLCPluginClass(LONG *p_class_ref, HINSTANCE hInstance) :
+    _p_class_ref(p_class_ref),
+    _hinstance(hInstance)
+{
+    WNDCLASS wClass;
+
+    if( ! GetClassInfo(hInstance, getInPlaceWndClassName(), &wClass) )
+    {
+        wClass.style          = CS_NOCLOSE|CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS;
+        wClass.lpfnWndProc    = VLCInPlaceClassWndProc;
+        wClass.cbClsExtra     = 0;
+        wClass.cbWndExtra     = 0;
+        wClass.hInstance      = hInstance;
+        wClass.hIcon          = NULL;
+        wClass.hCursor        = LoadCursor(NULL, IDC_ARROW);
+        wClass.hbrBackground  = NULL;
+        wClass.lpszMenuName   = NULL;
+        wClass.lpszClassName  = getInPlaceWndClassName();
+       
+        _inplace_wndclass_atom = RegisterClass(&wClass);
+    }
+    else
+    {
+        _inplace_wndclass_atom = 0;
+    }
+
+    if( ! GetClassInfo(hInstance, getVideoWndClassName(), &wClass) )
+    {
+        wClass.style          = CS_NOCLOSE|CS_HREDRAW|CS_VREDRAW;
+        wClass.lpfnWndProc    = VLCVideoClassWndProc;
+        wClass.cbClsExtra     = 0;
+        wClass.cbWndExtra     = 0;
+        wClass.hInstance      = hInstance;
+        wClass.hIcon          = NULL;
+        wClass.hCursor        = LoadCursor(NULL, IDC_ARROW);
+        wClass.hbrBackground  = NULL;
+        wClass.lpszMenuName   = NULL;
+        wClass.lpszClassName  = getVideoWndClassName();
+       
+        _video_wndclass_atom = RegisterClass(&wClass);
+    }
+    else
+    {
+        _video_wndclass_atom = 0;
+    }
+
+    _inplace_hbitmap = (HBITMAP)LoadImage(getHInstance(), TEXT("INPLACE-PICT"), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
+
+    AddRef();
+};
+
+VLCPluginClass::~VLCPluginClass()
+{
+    if( 0 != _inplace_wndclass_atom )
+        UnregisterClass(MAKEINTATOM(_inplace_wndclass_atom), _hinstance);
+
+    if( 0 != _video_wndclass_atom )
+        UnregisterClass(MAKEINTATOM(_video_wndclass_atom), _hinstance);
+
+    if( NULL != _inplace_hbitmap )
+        DeleteObject(_inplace_hbitmap);
+};
+
+STDMETHODIMP VLCPluginClass::QueryInterface(REFIID riid, void **ppv)
+{
+    if( NULL == ppv )
+        return E_INVALIDARG;
+
+    if( (IID_IUnknown == riid) || (IID_IClassFactory == riid) )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(this);
+
+        return NOERROR;
+    }
+
+    *ppv = NULL;
+
+    return E_NOINTERFACE;
+};
+
+STDMETHODIMP_(ULONG) VLCPluginClass::AddRef(void)
+{
+    return InterlockedIncrement(_p_class_ref);
+};
+
+STDMETHODIMP_(ULONG) VLCPluginClass::Release(void)
+{
+    ULONG refcount = InterlockedDecrement(_p_class_ref);
+    if( 0 == refcount )
+    {
+        delete this;
+        return 0;
+    }
+    return refcount;
+};
+
+STDMETHODIMP VLCPluginClass::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppv)
+{
+    if( NULL == ppv )
+        return E_POINTER;
+
+    *ppv = NULL;
+
+    if( NULL != pUnkOuter )
+        return CLASS_E_NOAGGREGATION;
+
+    VLCPlugin *plugin = new VLCPlugin(this);
+    if( NULL != plugin )
+    {
+        HRESULT hr = plugin->QueryInterface(riid, ppv);
+        plugin->Release();
+        return hr;
+    }
+    return E_OUTOFMEMORY;
+};
+
+STDMETHODIMP VLCPluginClass::LockServer(BOOL fLock)
+{
+    if( fLock )
+        AddRef();
+    else 
+        Release();
+
+    return S_OK;
+};
+
+////////////////////////////////////////////////////////////////////////
+
+VLCPlugin::VLCPlugin(VLCPluginClass *p_class) :
+    _inplacewnd(NULL),
+    _p_class(p_class),
+    _i_ref(1UL),
+    _codepage(CP_ACP),
+    _psz_src(NULL),
+    _b_autostart(TRUE),
+    _b_loopmode(FALSE),
+    _b_visible(TRUE),
+    _b_sendevents(TRUE),
+    _i_vlc(0)
+{
+    p_class->AddRef();
+
+    vlcOleObject = new VLCOleObject(this);
+    vlcOleControl = new VLCOleControl(this);
+    vlcOleInPlaceObject = new VLCOleInPlaceObject(this);
+    vlcOleInPlaceActiveObject = new VLCOleInPlaceActiveObject(this);
+    vlcPersistStorage = new VLCPersistStorage(this);
+    vlcPersistStreamInit = new VLCPersistStreamInit(this);
+    vlcPersistPropertyBag = new VLCPersistPropertyBag(this);
+    vlcProvideClassInfo = new VLCProvideClassInfo(this);
+    vlcConnectionPointContainer = new VLCConnectionPointContainer(this);
+    vlcObjectSafety = new VLCObjectSafety(this);
+    vlcControl = new VLCControl(this);
+};
+
+VLCPlugin::~VLCPlugin()
+{
+    vlcOleInPlaceObject->UIDeactivate();
+    vlcOleInPlaceObject->InPlaceDeactivate();
+
+    delete vlcControl;
+    delete vlcObjectSafety;
+    delete vlcConnectionPointContainer;
+    delete vlcProvideClassInfo;
+    delete vlcPersistPropertyBag;
+    delete vlcPersistStreamInit;
+    delete vlcPersistStorage;
+    delete vlcOleInPlaceActiveObject;
+    delete vlcOleInPlaceObject;
+    delete vlcOleControl;
+    delete vlcOleObject;
+
+    if( _psz_src )
+        free(_psz_src);
+
+    _p_class->Release();
+};
+
+STDMETHODIMP VLCPlugin::QueryInterface(REFIID riid, void **ppv)
+{
+    if( NULL == ppv )
+        return E_INVALIDARG;
+
+    if( IID_IUnknown == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(this);
+        return NOERROR;
+    }
+    else if( IID_IOleObject == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcOleObject);
+        return NOERROR;
+    }
+    else if( IID_IOleControl == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcOleControl);
+        return NOERROR;
+    }
+    else if( IID_IOleWindow == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcOleInPlaceObject);
+        return NOERROR;
+    }
+    else if( IID_IOleInPlaceObject == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcOleInPlaceObject);
+        return NOERROR;
+    }
+    else if( IID_IOleInPlaceActiveObject == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcOleInPlaceActiveObject);
+        return NOERROR;
+    }
+    else if( IID_IPersist == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcPersistPropertyBag);
+        return NOERROR;
+    }
+    else if( IID_IPersistStreamInit == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcPersistStreamInit);
+        return NOERROR;
+    }
+    else if( IID_IPersistStorage == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcPersistStorage);
+        return NOERROR;
+    }
+    else if( IID_IPersistPropertyBag == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcPersistPropertyBag);
+        return NOERROR;
+    }
+    else if( IID_IProvideClassInfo == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcProvideClassInfo);
+        return NOERROR;
+    }
+    else if( IID_IProvideClassInfo2 == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcProvideClassInfo);
+        return NOERROR;
+    }
+    else if( IID_IConnectionPointContainer == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcConnectionPointContainer);
+        return NOERROR;
+    }
+    else if( IID_IObjectSafety == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcObjectSafety);
+        return NOERROR;
+    }
+    else if( IID_IDispatch == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcControl);
+        return NOERROR;
+    }
+    else if( IID_IVLCControl == riid )
+    {
+        AddRef();
+        *ppv = reinterpret_cast<LPVOID>(vlcControl);
+        return NOERROR;
+    }
+
+    *ppv = NULL;
+
+    return E_NOINTERFACE;
+};
+
+STDMETHODIMP_(ULONG) VLCPlugin::AddRef(void)
+{
+    return InterlockedIncrement((LONG *)&_i_ref);
+};
+
+STDMETHODIMP_(ULONG) VLCPlugin::Release(void)
+{
+    if( ! InterlockedDecrement((LONG *)&_i_ref) )
+    {
+        delete this;
+        return 0;
+    }
+    return _i_ref;
+};
+
+//////////////////////////////////////
+
+/*
+** we use an in-place child window to represent plugin viewport,
+** whose size is limited by the clipping rectangle
+** all drawing within this window must follow 
+** cartesian coordinate system represented by _bounds.
+*/
+
+void VLCPlugin::calcPositionChange(LPRECT lprPosRect, LPCRECT lprcClipRect)
+{
+    _bounds.right  = lprPosRect->right-lprPosRect->left;
+
+    if( lprcClipRect->left <= lprPosRect->left )
+    {
+        // left side is not clipped out
+        _bounds.left = 0;
+
+        if( lprcClipRect->right >= lprPosRect->right )
+        {
+            // right side is not clipped out, no change
+        }
+        else if( lprcClipRect->right >= lprPosRect->left )
+        {
+            // right side is clipped out
+            lprPosRect->right = lprcClipRect->right;
+        }
+        else
+        {
+            // outside of clipping rectange, not visible
+            lprPosRect->right = lprPosRect->left;
+        }
+    }
+    else
+    {
+        // left side is clipped out
+        _bounds.left = lprPosRect->left-lprcClipRect->left;
+        _bounds.right += _bounds.left;
+
+        lprPosRect->left = lprcClipRect->left;
+        if( lprcClipRect->right >= lprPosRect->right )
+        {
+            // right side is not clipped out
+        }
+        else
+        {
+            // right side is clipped out
+            lprPosRect->right = lprcClipRect->right;
+        }
+    }
+
+    _bounds.bottom = lprPosRect->bottom-lprPosRect->top;
+
+    if( lprcClipRect->top <= lprPosRect->top )
+    {
+        // top side is not clipped out
+        _bounds.top = 0;
+
+        if( lprcClipRect->bottom >= lprPosRect->bottom )
+        {
+            // bottom side is not clipped out, no change
+        }
+        else if( lprcClipRect->bottom >= lprPosRect->top )
+        {
+            // bottom side is clipped out
+            lprPosRect->bottom = lprcClipRect->bottom;
+        }
+        else
+        {
+            // outside of clipping rectange, not visible
+            lprPosRect->right = lprPosRect->left;
+        }
+    }
+    else
+    {
+        _bounds.top = lprPosRect->top-lprcClipRect->top;
+        _bounds.bottom += _bounds.top;
+
+        lprPosRect->top = lprcClipRect->top;
+        if( lprcClipRect->bottom >= lprPosRect->bottom )
+        {
+            // bottom side is not clipped out
+        }
+        else
+        {
+            // bottom side is clipped out
+            lprPosRect->bottom = lprcClipRect->bottom;
+        }
+    }
+};
+
+HRESULT VLCPlugin::onInitNew(void)
+{
+    if( 0 == _i_vlc )
+    {
+        char *ppsz_argv[] = { "vlc", "-vv" };
+        HKEY h_key;
+        DWORD i_type, i_data = MAX_PATH + 1;
+        char p_data[MAX_PATH + 1];
+        if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\VideoLAN\\VLC",
+                          0, KEY_READ, &h_key ) == ERROR_SUCCESS )
+        {
+             if( RegQueryValueEx( h_key, "InstallDir", 0, &i_type,
+                                  (LPBYTE)p_data, &i_data ) == ERROR_SUCCESS )
+             {
+                 if( i_type == REG_SZ )
+                 {
+                     strcat( p_data, "\\vlc" );
+                     ppsz_argv[0] = p_data;
+                 }
+             }
+             RegCloseKey( h_key );
+        }
+
+#if 0
+        ppsz_argv[0] = "C:\\cygwin\\home\\Damien_Fouilleul\\dev\\videolan\\vlc-trunk\\vlc";
+#endif
+
+        _i_vlc = VLC_Create();
+        
+        if( VLC_Init(_i_vlc, sizeof(ppsz_argv)/sizeof(char*), ppsz_argv) )
+        {
+            VLC_Destroy(_i_vlc);
+            _i_vlc = 0;
+            return E_FAIL;
+        }
+        return&