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