]> git.sesse.net Git - vlc/blob - projects/activex/oleinplaceactiveobject.cpp
macosx/framework: Build a fat framework (x86_64 and i386) in Release mode.
[vlc] / projects / activex / oleinplaceactiveobject.cpp
1 /*****************************************************************************
2  * oleinplaceactiveobject.cpp: ActiveX control for VLC
3  *****************************************************************************
4  * Copyright (C) 2005 the VideoLAN team
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22
23 #include "plugin.h"
24 #include "oleinplaceactiveobject.h"
25
26 using namespace std;
27
28 STDMETHODIMP VLCOleInPlaceActiveObject::GetWindow(HWND *pHwnd)
29 {
30     if( NULL == pHwnd )
31         return E_POINTER;
32
33     *pHwnd = NULL;
34     if( _p_instance->isInPlaceActive() )
35     {
36         if( NULL != (*pHwnd = _p_instance->getInPlaceWindow()) )
37             return S_OK;
38     }
39     return E_FAIL;
40 };
41
42 STDMETHODIMP VLCOleInPlaceActiveObject::EnableModeless(BOOL fEnable)
43 {
44     return S_OK;
45 };
46
47 STDMETHODIMP VLCOleInPlaceActiveObject::ContextSensitiveHelp(BOOL fEnterMode)
48 {
49     return E_NOTIMPL;
50 };
51
52 STDMETHODIMP VLCOleInPlaceActiveObject::TranslateAccelerator(LPMSG lpmsg)
53 {
54     HRESULT hr = S_FALSE;
55     LPOLEOBJECT oleObj;
56     if( SUCCEEDED(QueryInterface(IID_IOleObject, (LPVOID *)&oleObj)) )
57     {
58         LPOLECLIENTSITE clientSite;
59         if( SUCCEEDED(oleObj->GetClientSite(&clientSite)) && (NULL != clientSite) )
60         {
61             IOleControlSite *controlSite;
62             if( SUCCEEDED(clientSite->QueryInterface(IID_IOleControlSite, (LPVOID *)&controlSite)) )
63             {
64                 hr = controlSite->TranslateAccelerator(lpmsg,
65                     ((GetKeyState(VK_SHIFT) >> 15) & 1) |
66                     ((GetKeyState(VK_CONTROL) >> 14) & 2) |
67                     ((GetKeyState(VK_MENU) >> 13) & 4) );
68                 controlSite->Release();
69             }
70             clientSite->Release();
71         }
72         oleObj->Release();
73     }
74     return hr;
75 };
76
77 STDMETHODIMP VLCOleInPlaceActiveObject::OnFrameWindowActivate(BOOL fActivate)
78 {
79     return S_OK;
80 };
81
82 STDMETHODIMP VLCOleInPlaceActiveObject::OnDocWindowActivate(BOOL fActivate)
83 {
84     return S_OK;
85 };
86
87 STDMETHODIMP VLCOleInPlaceActiveObject::ResizeBorder(LPCRECT prcBorder, LPOLEINPLACEUIWINDOW pUIWindow, BOOL fFrameWindow)
88 {
89     return S_OK;
90 };
91