X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=activex%2Fconnectioncontainer.h;h=71f1f5b1312e24f79e815a6609cb0d3ea7e741b9;hb=75b1aa19f528bb6f847c09963485d1e0356e1af5;hp=4bbd6968808f67190768a4983f24e70d95603190;hpb=3d831e04ece115bb9ca379b9552370755453e46e;p=vlc diff --git a/activex/connectioncontainer.h b/activex/connectioncontainer.h index 4bbd696880..71f1f5b131 100644 --- a/activex/connectioncontainer.h +++ b/activex/connectioncontainer.h @@ -1,7 +1,7 @@ /***************************************************************************** * connectioncontainer.h: ActiveX control for VLC ***************************************************************************** - * Copyright (C) 2005 VideoLAN + * Copyright (C) 2005 the VideoLAN team * * Authors: Damien Fouilleul * @@ -17,7 +17,7 @@ * * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef __CONNECTIONCONTAINER_H__ @@ -25,8 +25,7 @@ #include #include - -using namespace std; +#include class VLCConnectionPoint : public IConnectionPoint { @@ -40,9 +39,11 @@ public: // IUnknown methods STDMETHODIMP QueryInterface(REFIID riid, void **ppv) { - if( NULL == ppv ) return E_POINTER; + if( NULL == ppv ) + return E_POINTER; if( (IID_IUnknown == riid) - && (IID_IConnectionPoint == riid) ) { + || (IID_IConnectionPoint == riid) ) + { AddRef(); *ppv = reinterpret_cast(this); return NOERROR; @@ -68,11 +69,23 @@ private: REFIID _iid; IConnectionPointContainer *_p_cpc; - vector _connections; + std::vector _connections; }; ////////////////////////////////////////////////////////////////////////// +class VLCDispatchEvent { + +public: + VLCDispatchEvent(DISPID dispId, DISPPARAMS dispParams) : + _dispId(dispId), _dispParams(dispParams) {}; + VLCDispatchEvent(const VLCDispatchEvent&); + ~VLCDispatchEvent(); + + DISPID _dispId; + DISPPARAMS _dispParams; +}; + class VLCConnectionPointContainer : public IConnectionPointContainer { @@ -84,32 +97,37 @@ public: // IUnknown methods STDMETHODIMP QueryInterface(REFIID riid, void **ppv) { - if( (NULL != ppv) - && (IID_IUnknown == riid) - && (IID_IConnectionPointContainer == riid) ) { + if( NULL == ppv) + return E_POINTER; + if( (IID_IUnknown == riid) + || (IID_IConnectionPointContainer == riid) ) + { AddRef(); *ppv = reinterpret_cast(this); return NOERROR; } - return _p_instance->QueryInterface(riid, ppv); + return _p_instance->pUnkOuter->QueryInterface(riid, ppv); }; - STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->AddRef(); }; - STDMETHODIMP_(ULONG) Release(void) { return _p_instance->Release(); }; + STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); }; + STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); }; // IConnectionPointContainer methods STDMETHODIMP EnumConnectionPoints(LPENUMCONNECTIONPOINTS *); STDMETHODIMP FindConnectionPoint(REFIID, LPCONNECTIONPOINT *); + void freezeEvents(BOOL); void fireEvent(DISPID, DISPPARAMS*); void firePropChangedEvent(DISPID dispId); private: VLCPlugin *_p_instance; + BOOL _b_freeze; VLCConnectionPoint *_p_events; VLCConnectionPoint *_p_props; - vector _v_cps; + std::vector _v_cps; + std::queue _q_events; }; #endif