]> git.sesse.net Git - vlc/blob - activex/viewobject.cpp
- all: intitial offscreen drawing support (mostly for printing). Unfortunately, video...
[vlc] / activex / viewobject.cpp
1 /*****************************************************************************
2  * viewobject.cpp: ActiveX control for VLC
3  *****************************************************************************
4  * Copyright (C) 2005 VideoLAN
5  *
6  * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
7  *
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.
12  *
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.
17  *
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  *****************************************************************************/
22
23 #include "plugin.h"
24 #include "viewobject.h"
25
26 #include <iostream>
27
28 using namespace std;
29
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)
33 {
34     switch( dwAspect )
35     {
36         case DVASPECT_CONTENT:
37             if( _p_instance->getVisible() )
38             {
39                 RECT bounds;
40                 bounds.left   = lprcBounds->left;
41                 bounds.top    = lprcBounds->top;
42                 bounds.right  = lprcBounds->right;
43                 bounds.bottom = lprcBounds->bottom;
44                 _p_instance->onPaint(hdcDraw, bounds, bounds);
45             }
46             return S_OK;
47         case DVASPECT_THUMBNAIL:
48             break;
49         case DVASPECT_ICON:
50             break;
51         case DVASPECT_DOCPRINT:
52             break;
53     }
54     return E_NOTIMPL;
55 };
56
57 STDMETHODIMP VLCViewObject::Freeze(DWORD dwAspect, LONG lindex,
58         PVOID pvAspect, LPDWORD pdwFreeze)
59 {
60     if( NULL != pvAspect )
61         return E_INVALIDARG;
62
63     return OLE_E_BLANK;
64 };
65
66 STDMETHODIMP VLCViewObject::GetAdvise(LPDWORD pdwAspect, LPDWORD padvf,
67         LPADVISESINK *ppAdviseSink)
68 {
69     return E_NOTIMPL;
70 };
71
72 STDMETHODIMP VLCViewObject::GetColorSet(DWORD dwAspect, LONG lindex, 
73         PVOID pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LPLOGPALETTE *ppColorSet)
74 {
75     return E_NOTIMPL;
76 };
77
78 STDMETHODIMP VLCViewObject::SetAdvise(DWORD dwAspect, DWORD advf,
79         LPADVISESINK pAdvSink)
80 {
81     return OLE_E_ADVISENOTSUPPORTED;
82 };
83
84 STDMETHODIMP VLCViewObject::Unfreeze(DWORD dwFreeze)
85 {
86     return E_NOTIMPL;
87 };
88