1 /*****************************************************************************
2 * viewobject.cpp: ActiveX control for VLC
3 *****************************************************************************
4 * Copyright (C) 2005 the VideoLAN team
6 * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
21 *****************************************************************************/
24 #include "viewobject.h"
30 STDMETHODIMP VLCViewObject::Draw(DWORD dwAspect, LONG lindex, PVOID pvAspect,
31 DVTARGETDEVICE *ptd, HDC hicTargetDev, HDC hdcDraw, LPCRECTL lprcBounds,
32 LPCRECTL lprcWBounds, BOOL(CALLBACK *pfnContinue)(DWORD), DWORD dwContinue)
34 if( dwAspect & DVASPECT_CONTENT )
36 _p_instance->onDraw(ptd, hicTargetDev, hdcDraw, lprcBounds, lprcWBounds);
42 STDMETHODIMP VLCViewObject::Freeze(DWORD dwAspect, LONG lindex,
43 PVOID pvAspect, LPDWORD pdwFreeze)
48 STDMETHODIMP VLCViewObject::GetAdvise(LPDWORD pdwAspect, LPDWORD padvf,
49 LPADVISESINK *ppAdviseSink)
51 if( NULL != pdwAspect )
52 *pdwAspect = _dwAspect;
57 if( NULL != ppAdviseSink )
59 *ppAdviseSink = _pAdvSink;
60 if( NULL != _pAdvSink )
67 STDMETHODIMP VLCViewObject::GetColorSet(DWORD dwAspect, LONG lindex,
68 PVOID pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LPLOGPALETTE *ppColorSet)
73 STDMETHODIMP VLCViewObject::SetAdvise(DWORD dwAspect, DWORD advf,
74 LPADVISESINK pAdvSink)
76 if( NULL != pAdvSink )
79 if( NULL != _pAdvSink )
86 if( (dwAspect & DVASPECT_CONTENT) && (advf & ADVF_PRIMEFIRST) && (NULL != _pAdvSink) )
88 _pAdvSink->OnViewChange(DVASPECT_CONTENT, -1);
94 STDMETHODIMP VLCViewObject::Unfreeze(DWORD dwFreeze)
99 STDMETHODIMP VLCViewObject::GetExtent(DWORD dwAspect, LONG lindex,
100 DVTARGETDEVICE *ptd, LPSIZEL lpSizel)
102 if( dwAspect & DVASPECT_CONTENT )
104 *lpSizel = _p_instance->getExtent();