2005-04-06 13:23:52 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* viewobject.cpp: ActiveX control for VLC
|
|
|
|
*****************************************************************************
|
2005-07-09 08:17:09 +02:00
|
|
|
* Copyright (C) 2005 the VideoLAN team
|
2005-04-06 13:23:52 +02:00
|
|
|
*
|
|
|
|
* 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 "viewobject.h"
|
|
|
|
|
2005-04-18 13:35:18 +02:00
|
|
|
#include "utils.h"
|
2005-04-06 13:23:52 +02:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
STDMETHODIMP VLCViewObject::Draw(DWORD dwAspect, LONG lindex, PVOID pvAspect,
|
|
|
|
DVTARGETDEVICE *ptd, HDC hicTargetDev, HDC hdcDraw, LPCRECTL lprcBounds,
|
|
|
|
LPCRECTL lprcWBounds, BOOL(CALLBACK *pfnContinue)(DWORD), DWORD dwContinue)
|
|
|
|
{
|
2005-04-18 13:35:18 +02:00
|
|
|
if( dwAspect & DVASPECT_CONTENT )
|
2005-04-06 13:23:52 +02:00
|
|
|
{
|
2005-07-19 19:41:16 +02:00
|
|
|
_p_instance->onDraw(ptd, hicTargetDev, hdcDraw, lprcBounds, lprcWBounds);
|
2005-04-18 13:35:18 +02:00
|
|
|
return S_OK;
|
2005-04-06 13:23:52 +02:00
|
|
|
}
|
|
|
|
return E_NOTIMPL;
|
|
|
|
};
|
|
|
|
|
|
|
|
STDMETHODIMP VLCViewObject::Freeze(DWORD dwAspect, LONG lindex,
|
|
|
|
PVOID pvAspect, LPDWORD pdwFreeze)
|
|
|
|
{
|
2005-04-18 13:35:18 +02:00
|
|
|
return E_NOTIMPL;
|
2005-04-06 13:23:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
STDMETHODIMP VLCViewObject::GetAdvise(LPDWORD pdwAspect, LPDWORD padvf,
|
|
|
|
LPADVISESINK *ppAdviseSink)
|
|
|
|
{
|
2005-04-18 13:35:18 +02:00
|
|
|
if( NULL != pdwAspect )
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
*pdwAspect = _dwAspect;
|
2005-04-18 13:35:18 +02:00
|
|
|
|
|
|
|
if( NULL != padvf )
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
*padvf = _advf;
|
2005-04-18 13:35:18 +02:00
|
|
|
|
|
|
|
if( NULL != ppAdviseSink )
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
{
|
|
|
|
*ppAdviseSink = _pAdvSink;
|
|
|
|
if( NULL != _pAdvSink )
|
|
|
|
_pAdvSink->AddRef();
|
|
|
|
}
|
2005-04-18 13:35:18 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2005-04-06 13:23:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
STDMETHODIMP VLCViewObject::GetColorSet(DWORD dwAspect, LONG lindex,
|
|
|
|
PVOID pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LPLOGPALETTE *ppColorSet)
|
|
|
|
{
|
2005-04-18 13:35:18 +02:00
|
|
|
return S_FALSE;
|
2005-04-06 13:23:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
STDMETHODIMP VLCViewObject::SetAdvise(DWORD dwAspect, DWORD advf,
|
|
|
|
LPADVISESINK pAdvSink)
|
|
|
|
{
|
2005-06-27 13:41:16 +02:00
|
|
|
if( NULL != pAdvSink )
|
|
|
|
pAdvSink->AddRef();
|
|
|
|
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
if( NULL != _pAdvSink )
|
|
|
|
_pAdvSink->Release();
|
|
|
|
|
2005-06-27 13:41:16 +02:00
|
|
|
_dwAspect = dwAspect;
|
|
|
|
_advf = advf;
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
_pAdvSink = pAdvSink;
|
|
|
|
|
2005-06-27 13:41:16 +02:00
|
|
|
if( (dwAspect & DVASPECT_CONTENT) && (advf & ADVF_PRIMEFIRST) && (NULL != _pAdvSink) )
|
|
|
|
{
|
|
|
|
_pAdvSink->OnViewChange(DVASPECT_CONTENT, -1);
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
}
|
2005-06-27 13:41:16 +02:00
|
|
|
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
return S_OK;
|
2005-04-06 13:23:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
STDMETHODIMP VLCViewObject::Unfreeze(DWORD dwFreeze)
|
|
|
|
{
|
|
|
|
return E_NOTIMPL;
|
|
|
|
};
|
|
|
|
|
2005-04-18 13:35:18 +02:00
|
|
|
STDMETHODIMP VLCViewObject::GetExtent(DWORD dwAspect, LONG lindex,
|
|
|
|
DVTARGETDEVICE *ptd, LPSIZEL lpSizel)
|
|
|
|
{
|
|
|
|
if( dwAspect & DVASPECT_CONTENT )
|
|
|
|
{
|
|
|
|
*lpSizel = _p_instance->getExtent();
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
lpSizel->cx= 0L;
|
|
|
|
lpSizel->cy= 0L;
|
|
|
|
return E_NOTIMPL;
|
|
|
|
};
|
|
|
|
|