Commit fbf91383 authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

shdocvw: Add DocHostContainer interface to interact with WB2/IE.

parent d83a08c4
......@@ -311,8 +311,7 @@ void create_doc_view_hwnd(DocHost *This)
doc_view_atom = RegisterClassExW(&wndclass);
}
GetClientRect(This->frame_hwnd, &rect);
adjust_ie_docobj_rect(This->frame_hwnd, &rect);
This->container_vtbl->GetDocObjRect(This, &rect);
This->hwnd = CreateWindowExW(0, wszShell_DocObject_View,
wszShell_DocObject_View,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP,
......@@ -784,7 +783,7 @@ static const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl = {
PropertyNotifySink_OnRequestEdit
};
void DocHost_Init(DocHost *This, IDispatch *disp)
void DocHost_Init(DocHost *This, IDispatch *disp, const IDocHostContainerVtbl* container)
{
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
......@@ -792,6 +791,8 @@ void DocHost_Init(DocHost *This, IDispatch *disp)
This->disp = disp;
This->container_vtbl = container;
This->client_disp = NULL;
This->document = NULL;
......
......@@ -135,8 +135,8 @@ static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface,
LPCOLESTR pszStatusText)
{
DocHost *This = INPLACEFRAME_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
return This->container_vtbl->SetStatusText(This, pszStatusText);
}
static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
......
......@@ -344,6 +344,30 @@ static IWebBrowser2 *create_ie_window(LPCSTR cmdline)
return wb;
}
static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
{
GetClientRect(This->frame_hwnd, rc);
adjust_ie_docobj_rect(This->frame_hwnd, rc);
}
static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost* This, LPCWSTR text)
{
FIXME("(%p)->(%s)\n", This, debugstr_w(text));
return E_NOTIMPL;
}
static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url)
{
}
static const IDocHostContainerVtbl DocHostContainerVtbl = {
DocHostContainer_GetDocObjRect,
DocHostContainer_SetStatusText,
DocHostContainer_SetURL
};
HRESULT InternetExplorer_Create(IUnknown *pOuter, REFIID riid, void **ppv)
{
InternetExplorer *ret;
......@@ -355,7 +379,7 @@ HRESULT InternetExplorer_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret->ref = 0;
ret->doc_host.disp = (IDispatch*)WEBBROWSER2(ret);
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret), &DocHostContainerVtbl);
InternetExplorer_WebBrowser_Init(ret);
......
......@@ -125,6 +125,8 @@ static HRESULT set_dochost_url(DocHost *This, const WCHAR *url)
heap_free(This->url);
This->url = new_url;
This->container_vtbl->SetURL(This, This->url);
return S_OK;
}
......
......@@ -82,6 +82,13 @@ typedef struct _task_header_t {
task_proc_t proc;
} task_header_t;
typedef struct _IDocHostContainerVtbl
{
void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
void (WINAPI* SetURL)(DocHost*,LPCWSTR);
} IDocHostContainerVtbl;
struct DocHost {
const IOleClientSiteVtbl *lpOleClientSiteVtbl;
const IOleInPlaceSiteVtbl *lpOleInPlaceSiteVtbl;
......@@ -105,6 +112,8 @@ struct DocHost {
IOleDocumentView *view;
IUnknown *doc_navigate;
const IDocHostContainerVtbl *container_vtbl;
HWND hwnd;
HWND frame_hwnd;
......@@ -220,7 +229,7 @@ void WebBrowser_ClassInfo_Init(WebBrowser*);
void WebBrowser_OleObject_Destroy(WebBrowser*);
void DocHost_Init(DocHost*,IDispatch*);
void DocHost_Init(DocHost*,IDispatch*,const IDocHostContainerVtbl*);
void DocHost_ClientSite_Init(DocHost*);
void DocHost_Frame_Init(DocHost*);
void release_dochost_client(DocHost*);
......
......@@ -1126,6 +1126,27 @@ static const IServiceProviderVtbl ServiceProviderVtbl =
WebBrowser_IServiceProvider_QueryService
};
static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
{
GetClientRect(This->frame_hwnd, rc);
}
static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost* This, LPCWSTR text)
{
return E_NOTIMPL;
}
static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url)
{
}
static const IDocHostContainerVtbl DocHostContainerVtbl = {
DocHostContainer_GetDocObjRect,
DocHostContainer_SetStatusText,
DocHostContainer_SetURL
};
static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, void **ppv)
{
WebBrowser *ret;
......@@ -1140,7 +1161,7 @@ static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, voi
ret->ref = 1;
ret->version = version;
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret), &DocHostContainerVtbl);
ret->visible = VARIANT_TRUE;
ret->menu_bar = VARIANT_TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment