2002-05-05 19:40:57 +00:00
|
|
|
/*
|
2005-09-06 11:41:14 +00:00
|
|
|
* Implementation of IOleObject interfaces for WebBrowser control
|
2002-05-05 19:40:57 +00:00
|
|
|
*
|
|
|
|
* - IOleObject
|
|
|
|
* - IOleInPlaceObject
|
|
|
|
* - IOleControl
|
|
|
|
*
|
|
|
|
* Copyright 2001 John R. Sheets (for CodeWeavers)
|
2005-09-06 11:41:14 +00:00
|
|
|
* Copyright 2005 Jacek Caban
|
2002-05-05 19:40:57 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-05-05 19:40:57 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "shdocvw.h"
|
2006-07-07 13:15:24 +00:00
|
|
|
#include "htiframe.h"
|
2002-05-05 19:40:57 +00:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
|
|
|
|
2005-11-22 11:59:57 +00:00
|
|
|
static ATOM shell_embedding_atom = 0;
|
|
|
|
|
2005-12-02 10:25:30 +00:00
|
|
|
static LRESULT resize_window(WebBrowser *This, LONG width, LONG height)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
if(This->doc_host.hwnd)
|
|
|
|
SetWindowPos(This->doc_host.hwnd, NULL, 0, 0, width, height,
|
2005-12-02 10:25:30 +00:00
|
|
|
SWP_NOZORDER | SWP_NOACTIVATE);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-11-22 11:59:57 +00:00
|
|
|
static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
2005-12-02 10:25:30 +00:00
|
|
|
WebBrowser *This;
|
|
|
|
|
|
|
|
static const WCHAR wszTHIS[] = {'T','H','I','S',0};
|
|
|
|
|
|
|
|
if(msg == WM_CREATE) {
|
|
|
|
This = *(WebBrowser**)lParam;
|
|
|
|
SetPropW(hwnd, wszTHIS, This);
|
|
|
|
}else {
|
|
|
|
This = GetPropW(hwnd, wszTHIS);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(msg) {
|
|
|
|
case WM_SIZE:
|
|
|
|
return resize_window(This, LOWORD(lParam), HIWORD(lParam));
|
|
|
|
}
|
|
|
|
|
2006-04-14 12:40:33 +00:00
|
|
|
return DefWindowProcW(hwnd, msg, wParam, lParam);
|
2005-11-22 11:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void create_shell_embedding_hwnd(WebBrowser *This)
|
|
|
|
{
|
|
|
|
IOleInPlaceSite *inplace;
|
|
|
|
HWND parent = NULL;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static const WCHAR wszShellEmbedding[] =
|
|
|
|
{'S','h','e','l','l',' ','E','m','b','e','d','d','i','n','g',0};
|
|
|
|
|
|
|
|
if(!shell_embedding_atom) {
|
|
|
|
static WNDCLASSEXW wndclass = {
|
|
|
|
sizeof(wndclass),
|
|
|
|
CS_DBLCLKS,
|
|
|
|
shell_embedding_proc,
|
|
|
|
0, 0 /* native uses 8 */, NULL, NULL, NULL,
|
|
|
|
(HBRUSH)COLOR_WINDOWFRAME, NULL,
|
|
|
|
wszShellEmbedding,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
wndclass.hInstance = shdocvw_hinstance;
|
|
|
|
|
|
|
|
RegisterClassExW(&wndclass);
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleInPlaceSite, (void**)&inplace);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
IOleInPlaceSite_GetWindow(inplace, &parent);
|
|
|
|
IOleInPlaceSite_Release(inplace);
|
|
|
|
}
|
|
|
|
|
2006-04-17 22:26:47 +00:00
|
|
|
This->doc_host.frame_hwnd = This->shell_embedding_hwnd = CreateWindowExW(
|
2006-04-14 12:40:33 +00:00
|
|
|
WS_EX_WINDOWEDGE,
|
|
|
|
wszShellEmbedding, wszShellEmbedding,
|
|
|
|
WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP,
|
|
|
|
0, 0, 0, 0, parent,
|
|
|
|
NULL, shdocvw_hinstance, This);
|
2005-11-22 11:59:57 +00:00
|
|
|
}
|
|
|
|
|
2006-05-23 18:04:56 +00:00
|
|
|
static HRESULT activate_inplace(WebBrowser *This, IOleClientSite *active_site, HWND parent_hwnd)
|
|
|
|
{
|
|
|
|
HRESULT hres;
|
|
|
|
|
2006-05-23 18:06:55 +00:00
|
|
|
if(This->inplace)
|
|
|
|
return S_OK;
|
|
|
|
|
2006-05-23 18:04:56 +00:00
|
|
|
if(!active_site)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
hres = IOleClientSite_QueryInterface(active_site, &IID_IOleInPlaceSite,
|
|
|
|
(void**)&This->inplace);
|
|
|
|
if(FAILED(hres)) {
|
|
|
|
WARN("Could not get IOleInPlaceSite\n");
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = IOleInPlaceSite_CanInPlaceActivate(This->inplace);
|
|
|
|
if(hres != S_OK) {
|
2006-10-05 21:49:39 +00:00
|
|
|
WARN("CanInPlaceActivate returned: %08x\n", hres);
|
2006-05-23 18:04:56 +00:00
|
|
|
IOleInPlaceSite_Release(This->inplace);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
hres = IOleInPlaceSite_GetWindow(This->inplace, &This->iphwnd);
|
|
|
|
if(FAILED(hres))
|
|
|
|
This->iphwnd = parent_hwnd;
|
|
|
|
|
|
|
|
IOleInPlaceSite_OnInPlaceActivate(This->inplace);
|
|
|
|
|
|
|
|
IOleInPlaceSite_GetWindowContext(This->inplace, &This->frame, &This->uiwindow,
|
|
|
|
&This->pos_rect, &This->clip_rect,
|
|
|
|
&This->frameinfo);
|
|
|
|
|
|
|
|
SetWindowPos(This->shell_embedding_hwnd, NULL,
|
|
|
|
This->pos_rect.left, This->pos_rect.top,
|
|
|
|
This->pos_rect.right-This->pos_rect.left,
|
|
|
|
This->pos_rect.bottom-This->pos_rect.top,
|
|
|
|
SWP_NOZORDER | SWP_SHOWWINDOW);
|
|
|
|
|
|
|
|
if(This->client) {
|
|
|
|
IOleClientSite_ShowObject(This->client);
|
|
|
|
IOleClientSite_GetContainer(This->client, &This->container);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(This->frame)
|
|
|
|
IOleInPlaceFrame_GetWindow(This->frame, &This->frame_hwnd);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2006-05-23 18:05:58 +00:00
|
|
|
static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site, HWND parent_hwnd)
|
|
|
|
{
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
static const WCHAR wszitem[] = {'i','t','e','m',0};
|
|
|
|
|
2006-05-23 18:06:55 +00:00
|
|
|
if(This->inplace)
|
|
|
|
return S_OK;
|
|
|
|
|
2006-05-23 18:05:58 +00:00
|
|
|
hres = activate_inplace(This, active_site, parent_hwnd);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
|
|
|
IOleInPlaceSite_OnUIActivate(This->inplace);
|
|
|
|
|
|
|
|
if(This->frame)
|
|
|
|
IOleInPlaceFrame_SetActiveObject(This->frame, ACTIVEOBJ(This), wszitem);
|
|
|
|
if(This->uiwindow)
|
|
|
|
IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, ACTIVEOBJ(This), wszitem);
|
|
|
|
|
2006-07-08 14:09:24 +00:00
|
|
|
if(This->frame)
|
|
|
|
IOleInPlaceFrame_SetMenu(This->frame, NULL, NULL, This->shell_embedding_hwnd);
|
2006-05-23 18:05:58 +00:00
|
|
|
|
2006-06-02 22:58:53 +00:00
|
|
|
SetFocus(This->shell_embedding_hwnd);
|
|
|
|
|
2006-05-23 18:05:58 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-06-12 10:42:03 +00:00
|
|
|
/**********************************************************************
|
2005-09-06 11:41:14 +00:00
|
|
|
* Implement the IOleObject interface for the WebBrowser control
|
2005-06-12 10:42:03 +00:00
|
|
|
*/
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
#define OLEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleObject, iface)
|
2005-06-12 10:42:03 +00:00
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv)
|
2005-06-12 10:42:03 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppv);
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser_AddRef(WEBBROWSER(This));
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static ULONG WINAPI OleObject_Release(IOleObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser_Release(WEBBROWSER(This));
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE pClientSite)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-07-07 13:15:24 +00:00
|
|
|
IOleContainer *container;
|
2006-01-25 12:14:57 +00:00
|
|
|
HRESULT hres;
|
2005-09-16 18:44:37 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pClientSite);
|
|
|
|
|
|
|
|
if(This->client == pClientSite)
|
|
|
|
return S_OK;
|
|
|
|
|
2006-04-17 22:26:47 +00:00
|
|
|
if(This->doc_host.hwnd) {
|
|
|
|
DestroyWindow(This->doc_host.hwnd);
|
|
|
|
This->doc_host.hwnd = NULL;
|
2006-01-18 12:22:52 +00:00
|
|
|
}
|
|
|
|
if(This->shell_embedding_hwnd) {
|
2005-11-22 11:59:57 +00:00
|
|
|
DestroyWindow(This->shell_embedding_hwnd);
|
2006-01-18 12:22:52 +00:00
|
|
|
This->shell_embedding_hwnd = NULL;
|
|
|
|
}
|
2005-11-22 11:59:57 +00:00
|
|
|
|
2006-04-14 12:42:14 +00:00
|
|
|
if(This->inplace) {
|
|
|
|
IOleInPlaceSite_Release(This->inplace);
|
|
|
|
This->inplace = NULL;
|
|
|
|
}
|
|
|
|
|
2006-04-17 22:28:37 +00:00
|
|
|
if(This->doc_host.hostui)
|
|
|
|
IDocHostUIHandler_Release(This->doc_host.hostui);
|
2005-09-16 18:44:37 +00:00
|
|
|
if(This->client)
|
|
|
|
IOleClientSite_Release(This->client);
|
|
|
|
|
2006-01-18 12:22:52 +00:00
|
|
|
if(!pClientSite) {
|
2006-04-17 22:31:22 +00:00
|
|
|
if(This->doc_host.document)
|
2006-04-17 22:39:15 +00:00
|
|
|
deactivate_document(&This->doc_host);
|
2006-01-18 12:22:52 +00:00
|
|
|
This->client = NULL;
|
2005-11-22 11:59:57 +00:00
|
|
|
return S_OK;
|
2006-01-18 12:22:52 +00:00
|
|
|
}
|
2005-12-01 10:36:52 +00:00
|
|
|
|
2006-01-18 12:22:52 +00:00
|
|
|
This->client = pClientSite;
|
2005-11-22 11:59:57 +00:00
|
|
|
IOleClientSite_AddRef(pClientSite);
|
|
|
|
|
2006-01-25 12:14:57 +00:00
|
|
|
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
|
2006-04-17 22:28:37 +00:00
|
|
|
(void**)&This->doc_host.hostui);
|
2006-01-25 12:14:57 +00:00
|
|
|
if(FAILED(hres))
|
2006-04-17 22:28:37 +00:00
|
|
|
This->doc_host.hostui = NULL;
|
2006-01-25 12:14:57 +00:00
|
|
|
|
2006-07-07 13:15:24 +00:00
|
|
|
hres = IOleClientSite_GetContainer(This->client, &container);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
ITargetContainer *target_container;
|
|
|
|
|
|
|
|
hres = IOleContainer_QueryInterface(container, &IID_ITargetContainer,
|
|
|
|
(void**)&target_container);
|
|
|
|
if(SUCCEEDED(hres)) {
|
|
|
|
FIXME("Unsupported ITargetContainer\n");
|
|
|
|
ITargetContainer_Release(target_container);
|
|
|
|
}
|
|
|
|
|
|
|
|
IOleContainer_Release(container);
|
|
|
|
}
|
|
|
|
|
2005-11-22 11:59:57 +00:00
|
|
|
create_shell_embedding_hwnd(This);
|
|
|
|
|
2005-09-16 18:44:37 +00:00
|
|
|
return S_OK;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, LPOLECLIENTSITE *ppClientSite)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2005-09-16 18:44:37 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppClientSite);
|
|
|
|
|
|
|
|
if(!ppClientSite)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if(This->client)
|
|
|
|
IOleClientSite_AddRef(This->client);
|
|
|
|
*ppClientSite = This->client;
|
|
|
|
|
|
|
|
return S_OK;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp,
|
|
|
|
LPCOLESTR szContainerObj)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%s, %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj));
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%d)\n", This, dwSaveOption);
|
2005-09-06 11:41:14 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker* pmk)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%d, %p)\n", This, dwWhichMoniker, pmk);
|
2005-09-06 11:41:14 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign,
|
|
|
|
DWORD dwWhichMoniker, LPMONIKER *ppmk)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%d, %d, %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
|
2005-09-06 11:41:14 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, LPDATAOBJECT pDataObject,
|
|
|
|
BOOL fCreation, DWORD dwReserved)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%p, %d, %d)\n", This, pDataObject, fCreation, dwReserved);
|
2005-09-06 11:41:14 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved,
|
|
|
|
LPDATAOBJECT *ppDataObject)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%d, %p)\n", This, dwReserved, ppDataObject);
|
2005-09-06 11:41:14 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tagMSG* lpmsg,
|
|
|
|
LPOLECLIENTSITE pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2005-12-01 11:49:02 +00:00
|
|
|
|
2006-10-05 21:49:39 +00:00
|
|
|
TRACE("(%p)->(%d %p %p %d %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent,
|
2005-09-06 11:41:14 +00:00
|
|
|
lprcPosRect);
|
2005-11-16 11:46:56 +00:00
|
|
|
|
2002-05-05 19:40:57 +00:00
|
|
|
switch (iVerb)
|
|
|
|
{
|
2006-05-23 18:05:58 +00:00
|
|
|
case OLEIVERB_SHOW:
|
|
|
|
TRACE("OLEIVERB_SHOW\n");
|
|
|
|
return activate_ui(This, pActiveSite, hwndParent);
|
2006-05-23 18:07:45 +00:00
|
|
|
case OLEIVERB_UIACTIVATE:
|
|
|
|
TRACE("OLEIVERB_UIACTIVATE\n");
|
|
|
|
return activate_ui(This, pActiveSite, hwndParent);
|
2006-04-14 12:42:14 +00:00
|
|
|
case OLEIVERB_INPLACEACTIVATE:
|
2005-11-16 11:46:56 +00:00
|
|
|
TRACE("OLEIVERB_INPLACEACTIVATE\n");
|
2006-05-23 18:04:56 +00:00
|
|
|
return activate_inplace(This, pActiveSite, hwndParent);
|
2005-11-16 11:46:56 +00:00
|
|
|
default:
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("stub for %d\n", iVerb);
|
2002-05-05 19:40:57 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
TRACE("(%p)->(%p)\n", This, ppEnumOleVerb);
|
2002-05-05 19:40:57 +00:00
|
|
|
return OleRegEnumVerbs(&CLSID_WebBrowser, ppEnumOleVerb);
|
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_Update(IOleObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
2002-05-05 19:40:57 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID* pClsid)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pClsid);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType,
|
|
|
|
LPOLESTR* pszUserType)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
TRACE("(%p, %d, %p)\n", This, dwFormOfType, pszUserType);
|
2002-05-05 19:40:57 +00:00
|
|
|
return OleRegGetUserType(&CLSID_WebBrowser, dwFormOfType, pszUserType);
|
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-07-31 11:22:32 +00:00
|
|
|
|
2006-10-05 21:49:39 +00:00
|
|
|
TRACE("(%p)->(%x %p)\n", This, dwDrawAspect, psizel);
|
2006-07-31 11:22:32 +00:00
|
|
|
|
|
|
|
/* Tests show that dwDrawAspect is ignored */
|
|
|
|
memcpy(&This->extent, psizel, sizeof(SIZEL));
|
|
|
|
return S_OK;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-07-31 11:22:32 +00:00
|
|
|
|
2006-10-05 21:49:39 +00:00
|
|
|
TRACE("(%p)->(%x, %p)\n", This, dwDrawAspect, psizel);
|
2006-07-31 11:22:32 +00:00
|
|
|
|
|
|
|
/* Tests show that dwDrawAspect is ignored */
|
|
|
|
memcpy(psizel, &This->extent, sizeof(SIZEL));
|
|
|
|
return S_OK;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink,
|
|
|
|
DWORD* pdwConnection)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p, %p)\n", This, pAdvSink, pdwConnection);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%d)\n", This, dwConnection);
|
2005-09-06 11:41:14 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, ppenumAdvise);
|
2002-05-05 19:40:57 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
2002-05-05 19:40:57 +00:00
|
|
|
|
2006-10-05 21:49:39 +00:00
|
|
|
TRACE("(%p)->(%x, %p)\n", This, dwAspect, pdwStatus);
|
2002-05-05 19:40:57 +00:00
|
|
|
|
2006-04-28 18:08:02 +00:00
|
|
|
*pdwStatus = OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_INSIDEOUT
|
|
|
|
|OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE;
|
2002-05-05 19:40:57 +00:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE* pLogpal)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-06 11:41:14 +00:00
|
|
|
WebBrowser *This = OLEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pLogpal);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
#undef OLEOBJ_THIS
|
|
|
|
|
|
|
|
static const IOleObjectVtbl OleObjectVtbl =
|
|
|
|
{
|
|
|
|
OleObject_QueryInterface,
|
|
|
|
OleObject_AddRef,
|
|
|
|
OleObject_Release,
|
|
|
|
OleObject_SetClientSite,
|
|
|
|
OleObject_GetClientSite,
|
|
|
|
OleObject_SetHostNames,
|
|
|
|
OleObject_Close,
|
|
|
|
OleObject_SetMoniker,
|
|
|
|
OleObject_GetMoniker,
|
|
|
|
OleObject_InitFromData,
|
|
|
|
OleObject_GetClipboardData,
|
|
|
|
OleObject_DoVerb,
|
|
|
|
OleObject_EnumVerbs,
|
|
|
|
OleObject_Update,
|
|
|
|
OleObject_IsUpToDate,
|
|
|
|
OleObject_GetUserClassID,
|
|
|
|
OleObject_GetUserType,
|
|
|
|
OleObject_SetExtent,
|
|
|
|
OleObject_GetExtent,
|
|
|
|
OleObject_Advise,
|
|
|
|
OleObject_Unadvise,
|
|
|
|
OleObject_EnumAdvise,
|
|
|
|
OleObject_GetMiscStatus,
|
|
|
|
OleObject_SetColorScheme
|
2002-05-05 19:40:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* Implement the IOleInPlaceObject interface
|
|
|
|
*/
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
#define INPLACEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceObject, iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleInPlaceObject_QueryInterface(IOleInPlaceObject *iface,
|
|
|
|
REFIID riid, LPVOID *ppobj)
|
|
|
|
{
|
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static ULONG WINAPI OleInPlaceObject_AddRef(IOleInPlaceObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser_AddRef(WEBBROWSER(This));
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static ULONG WINAPI OleInPlaceObject_Release(IOleInPlaceObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser_Release(WEBBROWSER(This));
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleInPlaceObject_GetWindow(IOleInPlaceObject *iface, HWND* phwnd)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
|
|
|
|
2006-01-20 15:12:36 +00:00
|
|
|
TRACE("(%p)->(%p)\n", This, phwnd);
|
2002-05-05 19:40:57 +00:00
|
|
|
|
2006-01-20 15:12:36 +00:00
|
|
|
*phwnd = This->shell_embedding_hwnd;
|
2002-05-05 19:40:57 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleInPlaceObject_ContextSensitiveHelp(IOleInPlaceObject *iface,
|
|
|
|
BOOL fEnterMode)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, fEnterMode);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleInPlaceObject_InPlaceDeactivate(IOleInPlaceObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleInPlaceObject_UIDeactivate(IOleInPlaceObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleInPlaceObject_SetObjectRects(IOleInPlaceObject *iface,
|
|
|
|
LPCRECT lprcPosRect, LPCRECT lprcClipRect)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
2005-12-01 10:11:22 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
|
|
|
|
|
2006-04-14 12:42:47 +00:00
|
|
|
memcpy(&This->pos_rect, lprcPosRect, sizeof(RECT));
|
|
|
|
|
|
|
|
if(lprcClipRect)
|
|
|
|
memcpy(&This->clip_rect, lprcClipRect, sizeof(RECT));
|
|
|
|
|
2005-12-01 10:11:22 +00:00
|
|
|
if(This->shell_embedding_hwnd) {
|
|
|
|
SetWindowPos(This->shell_embedding_hwnd, NULL,
|
|
|
|
lprcPosRect->left, lprcPosRect->top,
|
|
|
|
lprcPosRect->right-lprcPosRect->left,
|
2005-12-02 10:25:30 +00:00
|
|
|
lprcPosRect->bottom-lprcPosRect->top,
|
2005-12-01 10:11:22 +00:00
|
|
|
SWP_NOZORDER | SWP_NOACTIVATE);
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleInPlaceObject_ReactivateAndUndo(IOleInPlaceObject *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
#undef INPLACEOBJ_THIS
|
2002-05-05 19:40:57 +00:00
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static const IOleInPlaceObjectVtbl OleInPlaceObjectVtbl =
|
|
|
|
{
|
|
|
|
OleInPlaceObject_QueryInterface,
|
|
|
|
OleInPlaceObject_AddRef,
|
|
|
|
OleInPlaceObject_Release,
|
|
|
|
OleInPlaceObject_GetWindow,
|
|
|
|
OleInPlaceObject_ContextSensitiveHelp,
|
|
|
|
OleInPlaceObject_InPlaceDeactivate,
|
|
|
|
OleInPlaceObject_UIDeactivate,
|
|
|
|
OleInPlaceObject_SetObjectRects,
|
|
|
|
OleInPlaceObject_ReactivateAndUndo
|
2002-05-05 19:40:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* Implement the IOleControl interface
|
|
|
|
*/
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
#define CONTROL_THIS(iface) DEFINE_THIS(WebBrowser, OleControl, iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface,
|
|
|
|
REFIID riid, LPVOID *ppobj)
|
|
|
|
{
|
|
|
|
WebBrowser *This = CONTROL_THIS(iface);
|
|
|
|
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = CONTROL_THIS(iface);
|
|
|
|
return IWebBrowser_AddRef(WEBBROWSER(This));
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static ULONG WINAPI OleControl_Release(IOleControl *iface)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = CONTROL_THIS(iface);
|
|
|
|
return IWebBrowser_Release(WEBBROWSER(This));
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, LPCONTROLINFO pCI)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = CONTROL_THIS(iface);
|
2006-07-27 21:30:36 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pCI);
|
|
|
|
|
|
|
|
/* Tests show that this function should be not implemented */
|
2005-09-07 09:23:47 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, struct tagMSG *pMsg)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = CONTROL_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, pMsg);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = CONTROL_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%d)\n", This, dispID);
|
2005-09-07 09:23:47 +00:00
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze)
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
WebBrowser *This = CONTROL_THIS(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, bFreeze);
|
|
|
|
return E_NOTIMPL;
|
2002-05-05 19:40:57 +00:00
|
|
|
}
|
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
#undef CONTROL_THIS
|
2002-05-05 19:40:57 +00:00
|
|
|
|
2005-09-07 09:23:47 +00:00
|
|
|
static const IOleControlVtbl OleControlVtbl =
|
2002-05-05 19:40:57 +00:00
|
|
|
{
|
2005-09-07 09:23:47 +00:00
|
|
|
OleControl_QueryInterface,
|
|
|
|
OleControl_AddRef,
|
|
|
|
OleControl_Release,
|
|
|
|
OleControl_GetControlInfo,
|
|
|
|
OleControl_OnMnemonic,
|
|
|
|
OleControl_OnAmbientPropertyChange,
|
|
|
|
OleControl_FreezeEvents
|
2002-05-05 19:40:57 +00:00
|
|
|
};
|
|
|
|
|
2005-12-01 10:36:52 +00:00
|
|
|
#define ACTIVEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceActiveObject, iface)
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser2_QueryInterface(WEBBROWSER2(This), riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI InPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser2_AddRef(WEBBROWSER2(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI InPlaceActiveObject_Release(IOleInPlaceActiveObject *iface)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
return IWebBrowser2_Release(WEBBROWSER2(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface,
|
|
|
|
HWND *phwnd)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
return IOleInPlaceObject_GetWindow(INPLACEOBJ(This), phwnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface,
|
|
|
|
BOOL fEnterMode)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
return IOleInPlaceObject_ContextSensitiveHelp(INPLACEOBJ(This), fEnterMode);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface,
|
|
|
|
LPMSG lpmsg)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, lpmsg);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface,
|
|
|
|
BOOL fActivate)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, fActivate);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface,
|
|
|
|
BOOL fActivate)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, fActivate);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface,
|
|
|
|
LPCRECT lprcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%p %p %x)\n", This, lprcBorder, pUIWindow, fFrameWindow);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface,
|
|
|
|
BOOL fEnable)
|
|
|
|
{
|
|
|
|
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
|
|
|
FIXME("(%p)->(%x)\n", This, fEnable);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef ACTIVEOBJ_THIS
|
|
|
|
|
|
|
|
static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
|
|
|
|
InPlaceActiveObject_QueryInterface,
|
|
|
|
InPlaceActiveObject_AddRef,
|
|
|
|
InPlaceActiveObject_Release,
|
|
|
|
InPlaceActiveObject_GetWindow,
|
|
|
|
InPlaceActiveObject_ContextSensitiveHelp,
|
|
|
|
InPlaceActiveObject_TranslateAccelerator,
|
|
|
|
InPlaceActiveObject_OnFrameWindowActivate,
|
|
|
|
InPlaceActiveObject_OnDocWindowActivate,
|
|
|
|
InPlaceActiveObject_ResizeBorder,
|
|
|
|
InPlaceActiveObject_EnableModeless
|
|
|
|
};
|
|
|
|
|
2006-05-17 16:28:13 +00:00
|
|
|
#define OLECMD_THIS(iface) DEFINE_THIS(WebBrowser, OleCommandTarget, iface)
|
2006-01-26 12:29:35 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI WBOleCommandTarget_QueryInterface(IOleCommandTarget *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
WebBrowser *This = OLECMD_THIS(iface);
|
|
|
|
return IWebBrowser2_QueryInterface(WEBBROWSER(This), riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI WBOleCommandTarget_AddRef(IOleCommandTarget *iface)
|
|
|
|
{
|
|
|
|
WebBrowser *This = OLECMD_THIS(iface);
|
|
|
|
return IWebBrowser2_AddRef(WEBBROWSER(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI WBOleCommandTarget_Release(IOleCommandTarget *iface)
|
|
|
|
{
|
|
|
|
WebBrowser *This = OLECMD_THIS(iface);
|
|
|
|
return IWebBrowser2_Release(WEBBROWSER(This));
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WBOleCommandTarget_QueryStatus(IOleCommandTarget *iface,
|
|
|
|
const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
|
|
|
|
{
|
|
|
|
WebBrowser *This = OLECMD_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%s %u %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds,
|
2006-01-26 12:29:35 +00:00
|
|
|
pCmdText);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WBOleCommandTarget_Exec(IOleCommandTarget *iface,
|
|
|
|
const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn,
|
|
|
|
VARIANT *pvaOut)
|
|
|
|
{
|
|
|
|
WebBrowser *This = OLECMD_THIS(iface);
|
2006-10-05 21:49:39 +00:00
|
|
|
FIXME("(%p)->(%s %d %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID,
|
2006-01-26 12:29:35 +00:00
|
|
|
nCmdexecopt, pvaIn, pvaOut);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef OLECMD_THIS
|
|
|
|
|
|
|
|
static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
|
|
|
|
WBOleCommandTarget_QueryInterface,
|
|
|
|
WBOleCommandTarget_AddRef,
|
|
|
|
WBOleCommandTarget_Release,
|
|
|
|
WBOleCommandTarget_QueryStatus,
|
|
|
|
WBOleCommandTarget_Exec
|
|
|
|
};
|
|
|
|
|
2005-09-06 11:41:14 +00:00
|
|
|
void WebBrowser_OleObject_Init(WebBrowser *This)
|
|
|
|
{
|
2005-12-01 10:36:52 +00:00
|
|
|
This->lpOleObjectVtbl = &OleObjectVtbl;
|
|
|
|
This->lpOleInPlaceObjectVtbl = &OleInPlaceObjectVtbl;
|
|
|
|
This->lpOleControlVtbl = &OleControlVtbl;
|
|
|
|
This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl;
|
2006-05-17 16:28:13 +00:00
|
|
|
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
|
2005-09-16 18:44:37 +00:00
|
|
|
|
|
|
|
This->client = NULL;
|
2006-04-14 12:42:14 +00:00
|
|
|
This->inplace = NULL;
|
2005-11-16 11:46:56 +00:00
|
|
|
This->container = NULL;
|
|
|
|
This->iphwnd = NULL;
|
|
|
|
This->frame_hwnd = NULL;
|
|
|
|
This->frame = NULL;
|
|
|
|
This->uiwindow = NULL;
|
2005-11-28 10:17:28 +00:00
|
|
|
This->shell_embedding_hwnd = NULL;
|
2005-11-16 11:46:56 +00:00
|
|
|
|
|
|
|
memset(&This->pos_rect, 0, sizeof(RECT));
|
|
|
|
memset(&This->clip_rect, 0, sizeof(RECT));
|
|
|
|
memset(&This->frameinfo, 0, sizeof(OLEINPLACEFRAMEINFO));
|
2006-07-31 11:22:32 +00:00
|
|
|
|
|
|
|
This->extent.cx = 1323;
|
|
|
|
This->extent.cy = 529;
|
2005-11-16 11:46:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WebBrowser_OleObject_Destroy(WebBrowser *This)
|
|
|
|
{
|
|
|
|
if(This->client)
|
2005-11-22 11:59:57 +00:00
|
|
|
IOleObject_SetClientSite(OLEOBJ(This), NULL);
|
2005-11-16 11:46:56 +00:00
|
|
|
if(This->container)
|
|
|
|
IOleContainer_Release(This->container);
|
|
|
|
if(This->frame)
|
|
|
|
IOleInPlaceFrame_Release(This->frame);
|
|
|
|
if(This->uiwindow)
|
|
|
|
IOleInPlaceUIWindow_Release(This->uiwindow);
|
2005-09-06 11:41:14 +00:00
|
|
|
}
|