mshtml: Move client site ifaces to HTMLDocumentObj.
This commit is contained in:
parent
068489fb94
commit
0d15ad8be4
|
@ -1764,12 +1764,6 @@ static void destroy_htmldoc(HTMLDocument *This)
|
||||||
{
|
{
|
||||||
remove_doc_tasks(This);
|
remove_doc_tasks(This);
|
||||||
|
|
||||||
if(This->client)
|
|
||||||
IOleObject_SetClientSite(OLEOBJ(This), NULL);
|
|
||||||
if(This->in_place_active)
|
|
||||||
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
|
|
||||||
if(This->ipsite)
|
|
||||||
IOleDocumentView_SetInPlaceSite(DOCVIEW(This), NULL);
|
|
||||||
if(This->undomgr)
|
if(This->undomgr)
|
||||||
IOleUndoManager_Release(This->undomgr);
|
IOleUndoManager_Release(This->undomgr);
|
||||||
|
|
||||||
|
@ -1899,6 +1893,12 @@ static ULONG HTMLDocumentObj_Release(HTMLDocument *base)
|
||||||
IHTMLWindow2_Release(HTMLWINDOW2(This->basedoc.window));
|
IHTMLWindow2_Release(HTMLWINDOW2(This->basedoc.window));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(This->client)
|
||||||
|
IOleObject_SetClientSite(OLEOBJ(&This->basedoc), NULL);
|
||||||
|
if(This->basedoc.in_place_active)
|
||||||
|
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(&This->basedoc));
|
||||||
|
if(This->ipsite)
|
||||||
|
IOleDocumentView_SetInPlaceSite(DOCVIEW(&This->basedoc), NULL);
|
||||||
destroy_htmldoc(&This->basedoc);
|
destroy_htmldoc(&This->basedoc);
|
||||||
if(This->basedoc.nsdoc)
|
if(This->basedoc.nsdoc)
|
||||||
remove_mutation_observer(This->nscontainer, This->basedoc.nsdoc);
|
remove_mutation_observer(This->nscontainer, This->basedoc.nsdoc);
|
||||||
|
|
|
@ -869,10 +869,10 @@ static HRESULT WINAPI HTMLWindow2_get_external(IHTMLWindow2 *iface, IDispatch **
|
||||||
|
|
||||||
*p = NULL;
|
*p = NULL;
|
||||||
|
|
||||||
if(!This->doc_obj->basedoc.hostui)
|
if(!This->doc_obj->hostui)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
return IDocHostUIHandler_GetExternal(This->doc_obj->basedoc.hostui, p);
|
return IDocHostUIHandler_GetExternal(This->doc_obj->hostui, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT HTMLWindow_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
|
static HRESULT HTMLWindow_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
|
||||||
|
|
|
@ -284,12 +284,6 @@ struct HTMLDocument {
|
||||||
HTMLWindow *window;
|
HTMLWindow *window;
|
||||||
nsIDOMHTMLDocument *nsdoc;
|
nsIDOMHTMLDocument *nsdoc;
|
||||||
|
|
||||||
IOleClientSite *client;
|
|
||||||
IDocHostUIHandler *hostui;
|
|
||||||
IOleInPlaceSite *ipsite;
|
|
||||||
IOleInPlaceFrame *frame;
|
|
||||||
IOleInPlaceUIWindow *ip_window;
|
|
||||||
|
|
||||||
IOleUndoManager *undomgr;
|
IOleUndoManager *undomgr;
|
||||||
|
|
||||||
nsChannelBSC *bscallback;
|
nsChannelBSC *bscallback;
|
||||||
|
@ -354,6 +348,12 @@ struct HTMLDocumentObj {
|
||||||
LONG ref;
|
LONG ref;
|
||||||
|
|
||||||
NSContainer *nscontainer;
|
NSContainer *nscontainer;
|
||||||
|
|
||||||
|
IOleClientSite *client;
|
||||||
|
IDocHostUIHandler *hostui;
|
||||||
|
IOleInPlaceSite *ipsite;
|
||||||
|
IOleInPlaceFrame *frame;
|
||||||
|
IOleInPlaceUIWindow *ip_window;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -580,9 +580,9 @@ void init_mutation(NSContainer*);
|
||||||
void set_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
|
void set_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
|
||||||
void remove_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
|
void remove_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
|
||||||
|
|
||||||
void HTMLDocument_LockContainer(HTMLDocument*,BOOL);
|
void HTMLDocument_LockContainer(HTMLDocumentObj*,BOOL);
|
||||||
void show_context_menu(HTMLDocument*,DWORD,POINT*,IDispatch*);
|
void show_context_menu(HTMLDocumentObj*,DWORD,POINT*,IDispatch*);
|
||||||
void notif_focus(HTMLDocument*);
|
void notif_focus(HTMLDocumentObj*);
|
||||||
|
|
||||||
void show_tooltip(HTMLDocument*,DWORD,DWORD,LPCWSTR);
|
void show_tooltip(HTMLDocument*,DWORD,DWORD,LPCWSTR);
|
||||||
void hide_tooltip(HTMLDocument*);
|
void hide_tooltip(HTMLDocument*);
|
||||||
|
@ -706,7 +706,7 @@ void do_ns_command(HTMLDocument*,const char*,nsICommandParams*);
|
||||||
#define UPDATE_TITLE 0x0002
|
#define UPDATE_TITLE 0x0002
|
||||||
|
|
||||||
void update_doc(HTMLDocument *This, DWORD flags);
|
void update_doc(HTMLDocument *This, DWORD flags);
|
||||||
void update_title(HTMLDocument*);
|
void update_title(HTMLDocumentObj*);
|
||||||
|
|
||||||
/* editor */
|
/* editor */
|
||||||
void init_editor(HTMLDocument*);
|
void init_editor(HTMLDocument*);
|
||||||
|
|
|
@ -615,7 +615,7 @@ static void init_bscallback(BSCallback *This, const BSCallbackVtbl *vtbl, IMonik
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calls undocumented 84 cmd of CGID_ShellDocView */
|
/* Calls undocumented 84 cmd of CGID_ShellDocView */
|
||||||
static void call_docview_84(HTMLDocument *doc)
|
static void call_docview_84(HTMLDocumentObj *doc)
|
||||||
{
|
{
|
||||||
IOleCommandTarget *olecmd;
|
IOleCommandTarget *olecmd;
|
||||||
VARIANT var;
|
VARIANT var;
|
||||||
|
@ -714,7 +714,7 @@ HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx)
|
||||||
|
|
||||||
/* NOTE: IE7 calls IsSystemMoniker here*/
|
/* NOTE: IE7 calls IsSystemMoniker here*/
|
||||||
|
|
||||||
call_docview_84(doc);
|
call_docview_84(doc->doc_obj);
|
||||||
|
|
||||||
if(bctx) {
|
if(bctx) {
|
||||||
RegisterBindStatusCallback(bctx, STATUSCLB(bscallback), NULL, 0);
|
RegisterBindStatusCallback(bctx, STATUSCLB(bscallback), NULL, 0);
|
||||||
|
|
|
@ -1139,7 +1139,7 @@ static nsresult NSAPI nsContextMenuListener_OnShowContextMenu(nsIContextMenuList
|
||||||
FIXME("aContextFlags=%08x\n", aContextFlags);
|
FIXME("aContextFlags=%08x\n", aContextFlags);
|
||||||
};
|
};
|
||||||
|
|
||||||
show_context_menu(&This->doc->basedoc, dwID, &pt, (IDispatch*)HTMLDOMNODE(get_node(&This->doc->basedoc, aNode, TRUE)));
|
show_context_menu(This->doc, dwID, &pt, (IDispatch*)HTMLDOMNODE(get_node(&This->doc->basedoc, aNode, TRUE)));
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -1178,7 +1178,7 @@ static nsrefcnt NSAPI nsURIContentListener_Release(nsIURIContentListener *iface)
|
||||||
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
|
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL translate_url(HTMLDocument *doc, nsIWineURI *nsuri)
|
static BOOL translate_url(HTMLDocumentObj *doc, nsIWineURI *nsuri)
|
||||||
{
|
{
|
||||||
OLECHAR *new_url = NULL, *url;
|
OLECHAR *new_url = NULL, *url;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
|
@ -1251,7 +1251,7 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener
|
||||||
|
|
||||||
*_retval = FALSE;
|
*_retval = FALSE;
|
||||||
}else if(This->doc) {
|
}else if(This->doc) {
|
||||||
*_retval = translate_url(&This->doc->basedoc.doc_obj->basedoc, wine_uri);
|
*_retval = translate_url(This->doc->basedoc.doc_obj, wine_uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIWineURI_Release(wine_uri);
|
nsIWineURI_Release(wine_uri);
|
||||||
|
|
|
@ -93,7 +93,7 @@ static nsresult NSAPI handle_blur(nsIDOMEventListener *iface, nsIDOMEvent *event
|
||||||
|
|
||||||
if(!This->reset_focus && This->doc && This->doc->basedoc.doc_obj->basedoc.focus && !is_doc_child_focus(This)) {
|
if(!This->reset_focus && This->doc && This->doc->basedoc.doc_obj->basedoc.focus && !is_doc_child_focus(This)) {
|
||||||
This->doc->basedoc.doc_obj->basedoc.focus = FALSE;
|
This->doc->basedoc.doc_obj->basedoc.focus = FALSE;
|
||||||
notif_focus(&This->doc->basedoc);
|
notif_focus(This->doc->basedoc.doc_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -107,7 +107,7 @@ static nsresult NSAPI handle_focus(nsIDOMEventListener *iface, nsIDOMEvent *even
|
||||||
|
|
||||||
if(!This->reset_focus && This->doc && !This->doc->basedoc.focus) {
|
if(!This->reset_focus && This->doc && !This->doc->basedoc.focus) {
|
||||||
This->doc->basedoc.focus = TRUE;
|
This->doc->basedoc.focus = TRUE;
|
||||||
notif_focus(&This->doc->basedoc);
|
notif_focus(This->doc->basedoc.doc_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -103,8 +103,7 @@ static BOOL exec_shldocvw_67(HTMLDocumentObj *doc, LPCWSTR url)
|
||||||
IOleCommandTarget *cmdtrg = NULL;
|
IOleCommandTarget *cmdtrg = NULL;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = IOleClientSite_QueryInterface(doc->basedoc.client, &IID_IOleCommandTarget,
|
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
|
||||||
(void**)&cmdtrg);
|
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
VARIANT varUrl, varRes;
|
VARIANT varUrl, varRes;
|
||||||
|
|
||||||
|
@ -149,13 +148,13 @@ static BOOL before_async_open(nsChannel *channel, NSContainer *container)
|
||||||
doc = container_iter->doc;
|
doc = container_iter->doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doc->basedoc.client)
|
if(!doc->client)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if(!hlnf && !exec_shldocvw_67(doc, uri))
|
if(!hlnf && !exec_shldocvw_67(doc, uri))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
hres = IOleClientSite_QueryInterface(doc->basedoc.client, &IID_IServiceProvider,
|
hres = IOleClientSite_QueryInterface(doc->client, &IID_IServiceProvider,
|
||||||
(void**)&service_provider);
|
(void**)&service_provider);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
IHlinkFrame *hlink_frame;
|
IHlinkFrame *hlink_frame;
|
||||||
|
|
|
@ -552,15 +552,15 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(This->frame)
|
if(This->doc_obj->frame)
|
||||||
IOleInPlaceFrame_SetStatusText(This->frame, NULL);
|
IOleInPlaceFrame_SetStatusText(This->doc_obj->frame, NULL);
|
||||||
|
|
||||||
This->readystate = READYSTATE_UNINITIALIZED;
|
This->readystate = READYSTATE_UNINITIALIZED;
|
||||||
|
|
||||||
if(This->client) {
|
if(This->doc_obj->client) {
|
||||||
IOleCommandTarget *cmdtrg;
|
IOleCommandTarget *cmdtrg;
|
||||||
|
|
||||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
|
hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
|
||||||
(void**)&cmdtrg);
|
(void**)&cmdtrg);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
VARIANT var;
|
VARIANT var;
|
||||||
|
@ -573,12 +573,12 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(This->hostui) {
|
if(This->doc_obj->hostui) {
|
||||||
DOCHOSTUIINFO hostinfo;
|
DOCHOSTUIINFO hostinfo;
|
||||||
|
|
||||||
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
|
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
|
||||||
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
|
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
|
||||||
hres = IDocHostUIHandler_GetHostInfo(This->hostui, &hostinfo);
|
hres = IDocHostUIHandler_GetHostInfo(This->doc_obj->hostui, &hostinfo);
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
/* FIXME: use hostinfo */
|
/* FIXME: use hostinfo */
|
||||||
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
|
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
|
||||||
|
@ -610,10 +610,10 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
|
||||||
return hres;
|
return hres;
|
||||||
|
|
||||||
if(This->ui_active) {
|
if(This->ui_active) {
|
||||||
if(This->ip_window)
|
if(This->doc_obj->ip_window)
|
||||||
call_set_active_object(This->ip_window, NULL);
|
call_set_active_object(This->doc_obj->ip_window, NULL);
|
||||||
if(This->hostui)
|
if(This->doc_obj->hostui)
|
||||||
IDocHostUIHandler_HideUI(This->hostui);
|
IDocHostUIHandler_HideUI(This->doc_obj->hostui);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(This->doc_obj->nscontainer)
|
if(This->doc_obj->nscontainer)
|
||||||
|
@ -622,16 +622,16 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
|
||||||
if(This->ui_active) {
|
if(This->ui_active) {
|
||||||
RECT rcBorderWidths;
|
RECT rcBorderWidths;
|
||||||
|
|
||||||
if(This->hostui)
|
if(This->doc_obj->hostui)
|
||||||
IDocHostUIHandler_ShowUI(This->hostui, DOCHOSTUITYPE_AUTHOR, ACTOBJ(This), CMDTARGET(This),
|
IDocHostUIHandler_ShowUI(This->doc_obj->hostui, DOCHOSTUITYPE_AUTHOR, ACTOBJ(This), CMDTARGET(This),
|
||||||
This->frame, This->ip_window);
|
This->doc_obj->frame, This->doc_obj->ip_window);
|
||||||
|
|
||||||
if(This->ip_window)
|
if(This->doc_obj->ip_window)
|
||||||
call_set_active_object(This->ip_window, ACTOBJ(This));
|
call_set_active_object(This->doc_obj->ip_window, ACTOBJ(This));
|
||||||
|
|
||||||
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
|
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
|
||||||
if (This->frame)
|
if(This->doc_obj->frame)
|
||||||
IOleInPlaceFrame_SetBorderSpace(This->frame, &rcBorderWidths);
|
IOleInPlaceFrame_SetBorderSpace(This->doc_obj->frame, &rcBorderWidths);
|
||||||
}
|
}
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -792,8 +792,8 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con
|
||||||
OLECMD olecmd;
|
OLECMD olecmd;
|
||||||
|
|
||||||
prgCmds[i].cmdf = OLECMDF_SUPPORTED;
|
prgCmds[i].cmdf = OLECMDF_SUPPORTED;
|
||||||
if(This->client) {
|
if(This->doc_obj->client) {
|
||||||
hr = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
|
hr = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
|
||||||
(void**)&cmdtrg);
|
(void**)&cmdtrg);
|
||||||
if(SUCCEEDED(hr)) {
|
if(SUCCEEDED(hr)) {
|
||||||
olecmd.cmdID = prgCmds[i].cmdID;
|
olecmd.cmdID = prgCmds[i].cmdID;
|
||||||
|
@ -897,14 +897,14 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
|
||||||
OleCommandTarget_Exec
|
OleCommandTarget_Exec
|
||||||
};
|
};
|
||||||
|
|
||||||
void show_context_menu(HTMLDocument *This, DWORD dwID, POINT *ppt, IDispatch *elem)
|
void show_context_menu(HTMLDocumentObj *This, DWORD dwID, POINT *ppt, IDispatch *elem)
|
||||||
{
|
{
|
||||||
HMENU menu_res, menu;
|
HMENU menu_res, menu;
|
||||||
DWORD cmdid;
|
DWORD cmdid;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = IDocHostUIHandler_ShowContextMenu(This->hostui, dwID, ppt,
|
hres = IDocHostUIHandler_ShowContextMenu(This->hostui, dwID, ppt,
|
||||||
(IUnknown*)CMDTARGET(This), elem);
|
(IUnknown*)CMDTARGET(&This->basedoc), elem);
|
||||||
if(hres == S_OK)
|
if(hres == S_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -912,11 +912,11 @@ void show_context_menu(HTMLDocument *This, DWORD dwID, POINT *ppt, IDispatch *el
|
||||||
menu = GetSubMenu(menu_res, dwID);
|
menu = GetSubMenu(menu_res, dwID);
|
||||||
|
|
||||||
cmdid = TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
|
cmdid = TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
|
||||||
ppt->x, ppt->y, 0, This->hwnd, NULL);
|
ppt->x, ppt->y, 0, This->basedoc.hwnd, NULL);
|
||||||
DestroyMenu(menu_res);
|
DestroyMenu(menu_res);
|
||||||
|
|
||||||
if(cmdid)
|
if(cmdid)
|
||||||
IOleCommandTarget_Exec(CMDTARGET(This), &CGID_MSHTML, cmdid, 0, NULL, NULL);
|
IOleCommandTarget_Exec(CMDTARGET(&This->basedoc), &CGID_MSHTML, cmdid, 0, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLDocument_OleCmd_Init(HTMLDocument *This)
|
void HTMLDocument_OleCmd_Init(HTMLDocument *This)
|
||||||
|
|
|
@ -97,18 +97,18 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, pClientSite);
|
TRACE("(%p)->(%p)\n", This, pClientSite);
|
||||||
|
|
||||||
if(pClientSite == This->client)
|
if(pClientSite == This->doc_obj->client)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
if(This->client) {
|
if(This->doc_obj->client) {
|
||||||
IOleClientSite_Release(This->client);
|
IOleClientSite_Release(This->doc_obj->client);
|
||||||
This->client = NULL;
|
This->doc_obj->client = NULL;
|
||||||
This->usermode = UNKNOWN_USERMODE;
|
This->usermode = UNKNOWN_USERMODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(This->hostui) {
|
if(This->doc_obj->hostui) {
|
||||||
IDocHostUIHandler_Release(This->hostui);
|
IDocHostUIHandler_Release(This->doc_obj->hostui);
|
||||||
This->hostui = NULL;
|
This->doc_obj->hostui = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
|
memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
|
||||||
|
@ -192,15 +192,15 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
|
||||||
}
|
}
|
||||||
|
|
||||||
IOleClientSite_AddRef(pClientSite);
|
IOleClientSite_AddRef(pClientSite);
|
||||||
This->client = pClientSite;
|
This->doc_obj->client = pClientSite;
|
||||||
This->hostui = pDocHostUIHandler;
|
This->doc_obj->hostui = pDocHostUIHandler;
|
||||||
|
|
||||||
if(This->usermode == UNKNOWN_USERMODE)
|
if(This->usermode == UNKNOWN_USERMODE)
|
||||||
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
|
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
|
||||||
|
|
||||||
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
|
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
|
||||||
|
|
||||||
hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent);
|
hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
if(V_VT(&silent) != VT_BOOL)
|
if(V_VT(&silent) != VT_BOOL)
|
||||||
WARN("V_VT(silent) = %d\n", V_VT(&silent));
|
WARN("V_VT(silent) = %d\n", V_VT(&silent));
|
||||||
|
@ -223,9 +223,9 @@ static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite
|
||||||
if(!ppClientSite)
|
if(!ppClientSite)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if(This->client)
|
if(This->doc_obj->client)
|
||||||
IOleClientSite_AddRef(This->client);
|
IOleClientSite_AddRef(This->doc_obj->client);
|
||||||
*ppClientSite = This->client;
|
*ppClientSite = This->doc_obj->client;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
|
||||||
if(This->in_place_active)
|
if(This->in_place_active)
|
||||||
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
|
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
|
||||||
|
|
||||||
HTMLDocument_LockContainer(This, FALSE);
|
HTMLDocument_LockContainer(This->doc_obj, FALSE);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -298,11 +298,11 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpms
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!pActiveSite)
|
if(!pActiveSite)
|
||||||
pActiveSite = This->client;
|
pActiveSite = This->doc_obj->client;
|
||||||
|
|
||||||
hres = IOleClientSite_QueryInterface(pActiveSite, &IID_IOleDocumentSite, (void**)&pDocSite);
|
hres = IOleClientSite_QueryInterface(pActiveSite, &IID_IOleDocumentSite, (void**)&pDocSite);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
HTMLDocument_LockContainer(This, TRUE);
|
HTMLDocument_LockContainer(This->doc_obj, TRUE);
|
||||||
|
|
||||||
/* FIXME: Create new IOleDocumentView. See CreateView for more info. */
|
/* FIXME: Create new IOleDocumentView. See CreateView for more info. */
|
||||||
hres = IOleDocumentSite_ActivateMe(pDocSite, DOCVIEW(This));
|
hres = IOleDocumentSite_ActivateMe(pDocSite, DOCVIEW(This));
|
||||||
|
@ -589,7 +589,7 @@ static HRESULT on_change_dlcontrol(HTMLDocument *This)
|
||||||
VARIANT res;
|
VARIANT res;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = get_client_disp_property(This->client, DISPID_AMBIENT_DLCONTROL, &res);
|
hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_DLCONTROL, &res);
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
FIXME("unsupported dlcontrol %08x\n", V_I4(&res));
|
FIXME("unsupported dlcontrol %08x\n", V_I4(&res));
|
||||||
|
|
||||||
|
@ -599,18 +599,20 @@ static HRESULT on_change_dlcontrol(HTMLDocument *This)
|
||||||
static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
|
static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
|
||||||
{
|
{
|
||||||
HTMLDocument *This = CONTROL_THIS(iface);
|
HTMLDocument *This = CONTROL_THIS(iface);
|
||||||
|
IOleClientSite *client;
|
||||||
VARIANT res;
|
VARIANT res;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
if(!This->client) {
|
client = This->doc_obj->client;
|
||||||
TRACE("This->client = NULL\n");
|
if(!client) {
|
||||||
|
TRACE("client = NULL\n");
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(dispID) {
|
switch(dispID) {
|
||||||
case DISPID_AMBIENT_USERMODE:
|
case DISPID_AMBIENT_USERMODE:
|
||||||
TRACE("(%p)->(DISPID_AMBIENT_USERMODE)\n", This);
|
TRACE("(%p)->(DISPID_AMBIENT_USERMODE)\n", This);
|
||||||
hres = get_client_disp_property(This->client, DISPID_AMBIENT_USERMODE, &res);
|
hres = get_client_disp_property(client, DISPID_AMBIENT_USERMODE, &res);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
|
@ -631,7 +633,7 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
|
||||||
case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED:
|
case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED:
|
||||||
TRACE("(%p)->(DISPID_AMBIENT_OFFLINEIFNOTCONNECTED)\n", This);
|
TRACE("(%p)->(DISPID_AMBIENT_OFFLINEIFNOTCONNECTED)\n", This);
|
||||||
on_change_dlcontrol(This);
|
on_change_dlcontrol(This);
|
||||||
hres = get_client_disp_property(This->client, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &res);
|
hres = get_client_disp_property(client, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &res);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
|
@ -647,7 +649,7 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
|
||||||
case DISPID_AMBIENT_SILENT:
|
case DISPID_AMBIENT_SILENT:
|
||||||
TRACE("(%p)->(DISPID_AMBIENT_SILENT)\n", This);
|
TRACE("(%p)->(DISPID_AMBIENT_SILENT)\n", This);
|
||||||
on_change_dlcontrol(This);
|
on_change_dlcontrol(This);
|
||||||
hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &res);
|
hres = get_client_disp_property(client, DISPID_AMBIENT_SILENT, &res);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
|
@ -662,7 +664,7 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
|
||||||
return S_OK;
|
return S_OK;
|
||||||
case DISPID_AMBIENT_USERAGENT:
|
case DISPID_AMBIENT_USERAGENT:
|
||||||
TRACE("(%p)->(DISPID_AMBIENT_USERAGENT)\n", This);
|
TRACE("(%p)->(DISPID_AMBIENT_USERAGENT)\n", This);
|
||||||
hres = get_client_disp_property(This->client, DISPID_AMBIENT_USERAGENT, &res);
|
hres = get_client_disp_property(client, DISPID_AMBIENT_USERAGENT, &res);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
|
@ -671,7 +673,7 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
|
||||||
return S_OK;
|
return S_OK;
|
||||||
case DISPID_AMBIENT_PALETTE:
|
case DISPID_AMBIENT_PALETTE:
|
||||||
TRACE("(%p)->(DISPID_AMBIENT_PALETTE)\n", This);
|
TRACE("(%p)->(DISPID_AMBIENT_PALETTE)\n", This);
|
||||||
hres = get_client_disp_property(This->client, DISPID_AMBIENT_PALETTE, &res);
|
hres = get_client_disp_property(client, DISPID_AMBIENT_PALETTE, &res);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
|
@ -743,18 +745,18 @@ static const ICustomDocVtbl CustomDocVtbl = {
|
||||||
CustomDoc_SetUIHandler
|
CustomDoc_SetUIHandler
|
||||||
};
|
};
|
||||||
|
|
||||||
void HTMLDocument_LockContainer(HTMLDocument *This, BOOL fLock)
|
void HTMLDocument_LockContainer(HTMLDocumentObj *This, BOOL fLock)
|
||||||
{
|
{
|
||||||
IOleContainer *container;
|
IOleContainer *container;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
if(!This->client || This->container_locked == fLock)
|
if(!This->client || This->basedoc.container_locked == fLock)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
hres = IOleClientSite_GetContainer(This->client, &container);
|
hres = IOleClientSite_GetContainer(This->client, &container);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
IOleContainer_LockContainer(container, fLock);
|
IOleContainer_LockContainer(container, fLock);
|
||||||
This->container_locked = fLock;
|
This->basedoc.container_locked = fLock;
|
||||||
IOleContainer_Release(container);
|
IOleContainer_Release(container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -767,12 +769,4 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This)
|
||||||
This->lpCustomDocVtbl = &CustomDocVtbl;
|
This->lpCustomDocVtbl = &CustomDocVtbl;
|
||||||
|
|
||||||
This->usermode = UNKNOWN_USERMODE;
|
This->usermode = UNKNOWN_USERMODE;
|
||||||
|
|
||||||
This->client = NULL;
|
|
||||||
This->hostui = NULL;
|
|
||||||
|
|
||||||
This->has_key_path = FALSE;
|
|
||||||
This->container_locked = FALSE;
|
|
||||||
|
|
||||||
memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,8 +98,8 @@ static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceAc
|
||||||
|
|
||||||
TRACE("(%p)->(%x)\n", This, fActivate);
|
TRACE("(%p)->(%x)\n", This, fActivate);
|
||||||
|
|
||||||
if(This->hostui)
|
if(This->doc_obj->hostui)
|
||||||
IDocHostUIHandler_OnFrameWindowActivate(This->hostui, fActivate);
|
IDocHostUIHandler_OnFrameWindowActivate(This->doc_obj->hostui, fActivate);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -193,8 +193,8 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceOb
|
||||||
if(!This->in_place_active)
|
if(!This->in_place_active)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
if(This->frame)
|
if(This->doc_obj->frame)
|
||||||
IOleInPlaceFrame_Release(This->frame);
|
IOleInPlaceFrame_Release(This->doc_obj->frame);
|
||||||
|
|
||||||
if(This->hwnd) {
|
if(This->hwnd) {
|
||||||
ShowWindow(This->hwnd, SW_HIDE);
|
ShowWindow(This->hwnd, SW_HIDE);
|
||||||
|
@ -202,19 +202,19 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceOb
|
||||||
}
|
}
|
||||||
|
|
||||||
This->focus = FALSE;
|
This->focus = FALSE;
|
||||||
notif_focus(This);
|
notif_focus(This->doc_obj);
|
||||||
|
|
||||||
This->in_place_active = FALSE;
|
This->in_place_active = FALSE;
|
||||||
if(This->ipsite) {
|
if(This->doc_obj->ipsite) {
|
||||||
IOleInPlaceSiteEx *ipsiteex;
|
IOleInPlaceSiteEx *ipsiteex;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
|
hres = IOleInPlaceSite_QueryInterface(This->doc_obj->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
IOleInPlaceSiteEx_OnInPlaceDeactivateEx(ipsiteex, TRUE);
|
IOleInPlaceSiteEx_OnInPlaceDeactivateEx(ipsiteex, TRUE);
|
||||||
IOleInPlaceSiteEx_Release(ipsiteex);
|
IOleInPlaceSiteEx_Release(ipsiteex);
|
||||||
}else {
|
}else {
|
||||||
IOleInPlaceSite_OnInPlaceDeactivate(This->ipsite);
|
IOleInPlaceSite_OnInPlaceDeactivate(This->doc_obj->ipsite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
|
||||||
call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE);
|
call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE);
|
||||||
update_doc(This, UPDATE_TITLE);
|
update_doc(This, UPDATE_TITLE);
|
||||||
|
|
||||||
HTMLDocument_LockContainer(This, TRUE);
|
HTMLDocument_LockContainer(This->doc_obj, TRUE);
|
||||||
|
|
||||||
hres = IMoniker_GetDisplayName(mon, pibc, NULL, &url);
|
hres = IMoniker_GetDisplayName(mon, pibc, NULL, &url);
|
||||||
if(FAILED(hres)) {
|
if(FAILED(hres)) {
|
||||||
|
@ -129,11 +129,11 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
|
||||||
|
|
||||||
set_current_mon(This, mon);
|
set_current_mon(This, mon);
|
||||||
|
|
||||||
if(This->client) {
|
if(This->doc_obj->client) {
|
||||||
VARIANT silent, offline;
|
VARIANT silent, offline;
|
||||||
IOleCommandTarget *cmdtrg = NULL;
|
IOleCommandTarget *cmdtrg = NULL;
|
||||||
|
|
||||||
hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent);
|
hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
if(V_VT(&silent) != VT_BOOL)
|
if(V_VT(&silent) != VT_BOOL)
|
||||||
WARN("V_VT(silent) = %d\n", V_VT(&silent));
|
WARN("V_VT(silent) = %d\n", V_VT(&silent));
|
||||||
|
@ -141,7 +141,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
|
||||||
FIXME("silent == true\n");
|
FIXME("silent == true\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = get_client_disp_property(This->client,
|
hres = get_client_disp_property(This->doc_obj->client,
|
||||||
DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline);
|
DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
if(V_VT(&silent) != VT_BOOL)
|
if(V_VT(&silent) != VT_BOOL)
|
||||||
|
@ -150,7 +150,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
|
||||||
FIXME("offline == true\n");
|
FIXME("offline == true\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
|
hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
|
||||||
(void**)&cmdtrg);
|
(void**)&cmdtrg);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
VARIANT var;
|
VARIANT var;
|
||||||
|
@ -165,7 +165,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
|
||||||
|
|
||||||
bscallback = create_channelbsc(mon);
|
bscallback = create_channelbsc(mon);
|
||||||
|
|
||||||
if(This->frame) {
|
if(This->doc_obj->frame) {
|
||||||
task = heap_alloc(sizeof(task_t));
|
task = heap_alloc(sizeof(task_t));
|
||||||
|
|
||||||
task->doc = This;
|
task->doc = This;
|
||||||
|
|
|
@ -191,7 +191,7 @@ HRESULT clear_task_timer(HTMLDocument *doc, BOOL interval, DWORD id)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_downloading(HTMLDocument *doc)
|
static void set_downloading(HTMLDocumentObj *doc)
|
||||||
{
|
{
|
||||||
IOleCommandTarget *olecmd;
|
IOleCommandTarget *olecmd;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
@ -228,7 +228,7 @@ static void set_downloading(HTMLDocument *doc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calls undocumented 69 cmd of CGID_Explorer */
|
/* Calls undocumented 69 cmd of CGID_Explorer */
|
||||||
static void call_explorer_69(HTMLDocument *doc)
|
static void call_explorer_69(HTMLDocumentObj *doc)
|
||||||
{
|
{
|
||||||
IOleCommandTarget *olecmd;
|
IOleCommandTarget *olecmd;
|
||||||
VARIANT var;
|
VARIANT var;
|
||||||
|
@ -257,17 +257,17 @@ static void set_parsecomplete(HTMLDocument *doc)
|
||||||
if(doc->usermode == EDITMODE)
|
if(doc->usermode == EDITMODE)
|
||||||
init_editor(doc);
|
init_editor(doc);
|
||||||
|
|
||||||
call_explorer_69(doc);
|
call_explorer_69(doc->doc_obj);
|
||||||
call_property_onchanged(&doc->cp_propnotif, 1005);
|
call_property_onchanged(&doc->cp_propnotif, 1005);
|
||||||
call_explorer_69(doc);
|
call_explorer_69(doc->doc_obj);
|
||||||
|
|
||||||
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
|
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
|
||||||
|
|
||||||
doc->readystate = READYSTATE_INTERACTIVE;
|
doc->readystate = READYSTATE_INTERACTIVE;
|
||||||
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
|
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
|
||||||
|
|
||||||
if(doc->client)
|
if(doc->doc_obj->client)
|
||||||
IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
|
IOleClientSite_QueryInterface(doc->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
|
||||||
|
|
||||||
if(olecmd) {
|
if(olecmd) {
|
||||||
VARIANT state, progress;
|
VARIANT state, progress;
|
||||||
|
@ -292,12 +292,12 @@ static void set_parsecomplete(HTMLDocument *doc)
|
||||||
doc->readystate = READYSTATE_COMPLETE;
|
doc->readystate = READYSTATE_COMPLETE;
|
||||||
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
|
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
|
||||||
|
|
||||||
if(doc->frame) {
|
if(doc->doc_obj->frame) {
|
||||||
static const WCHAR wszDone[] = {'D','o','n','e',0};
|
static const WCHAR wszDone[] = {'D','o','n','e',0};
|
||||||
IOleInPlaceFrame_SetStatusText(doc->frame, wszDone);
|
IOleInPlaceFrame_SetStatusText(doc->doc_obj->frame, wszDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
update_title(doc);
|
update_title(doc->doc_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_progress(HTMLDocument *doc)
|
static void set_progress(HTMLDocument *doc)
|
||||||
|
@ -307,8 +307,8 @@ static void set_progress(HTMLDocument *doc)
|
||||||
|
|
||||||
TRACE("(%p)\n", doc);
|
TRACE("(%p)\n", doc);
|
||||||
|
|
||||||
if(doc->client)
|
if(doc->doc_obj->client)
|
||||||
IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
|
IOleClientSite_QueryInterface(doc->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
|
||||||
|
|
||||||
if(olecmd) {
|
if(olecmd) {
|
||||||
VARIANT progress_max, progress;
|
VARIANT progress_max, progress;
|
||||||
|
@ -324,12 +324,12 @@ static void set_progress(HTMLDocument *doc)
|
||||||
&progress, NULL);
|
&progress, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doc->usermode == EDITMODE && doc->hostui) {
|
if(doc->usermode == EDITMODE && doc->doc_obj->hostui) {
|
||||||
DOCHOSTUIINFO hostinfo;
|
DOCHOSTUIINFO hostinfo;
|
||||||
|
|
||||||
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
|
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
|
||||||
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
|
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
|
||||||
hres = IDocHostUIHandler_GetHostInfo(doc->hostui, &hostinfo);
|
hres = IDocHostUIHandler_GetHostInfo(doc->doc_obj->hostui, &hostinfo);
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
/* FIXME: use hostinfo */
|
/* FIXME: use hostinfo */
|
||||||
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
|
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
|
||||||
|
@ -349,7 +349,7 @@ static void process_task(task_t *task)
|
||||||
{
|
{
|
||||||
switch(task->task_id) {
|
switch(task->task_id) {
|
||||||
case TASK_SETDOWNLOADSTATE:
|
case TASK_SETDOWNLOADSTATE:
|
||||||
set_downloading(task->doc);
|
set_downloading(task->doc->doc_obj);
|
||||||
break;
|
break;
|
||||||
case TASK_PARSECOMPLETE:
|
case TASK_PARSECOMPLETE:
|
||||||
set_parsecomplete(task->doc);
|
set_parsecomplete(task->doc);
|
||||||
|
|
|
@ -103,15 +103,15 @@ void update_doc(HTMLDocument *This, DWORD flags)
|
||||||
This->update |= flags;
|
This->update |= flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_title(HTMLDocument *This)
|
void update_title(HTMLDocumentObj *This)
|
||||||
{
|
{
|
||||||
IOleCommandTarget *olecmd;
|
IOleCommandTarget *olecmd;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
if(!(This->update & UPDATE_TITLE))
|
if(!(This->basedoc.update & UPDATE_TITLE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
This->update &= ~UPDATE_TITLE;
|
This->basedoc.update &= ~UPDATE_TITLE;
|
||||||
|
|
||||||
if(!This->client)
|
if(!This->client)
|
||||||
return;
|
return;
|
||||||
|
@ -131,16 +131,16 @@ void update_title(HTMLDocument *This)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static LRESULT on_timer(HTMLDocument *This)
|
static LRESULT on_timer(HTMLDocumentObj *This)
|
||||||
{
|
{
|
||||||
TRACE("(%p) %x\n", This, This->update);
|
TRACE("(%p) %x\n", This, This->basedoc.update);
|
||||||
|
|
||||||
KillTimer(This->hwnd, TIMER_ID);
|
KillTimer(This->basedoc.hwnd, TIMER_ID);
|
||||||
|
|
||||||
if(!This->update)
|
if(!This->basedoc.update)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(This->update & UPDATE_UI) {
|
if(This->basedoc.update & UPDATE_UI) {
|
||||||
if(This->hostui)
|
if(This->hostui)
|
||||||
IDocHostUIHandler_UpdateUI(This->hostui);
|
IDocHostUIHandler_UpdateUI(This->hostui);
|
||||||
|
|
||||||
|
@ -159,11 +159,11 @@ static LRESULT on_timer(HTMLDocument *This)
|
||||||
}
|
}
|
||||||
|
|
||||||
update_title(This);
|
update_title(This);
|
||||||
This->update = 0;
|
This->basedoc.update = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void notif_focus(HTMLDocument *This)
|
void notif_focus(HTMLDocumentObj *This)
|
||||||
{
|
{
|
||||||
IOleControlSite *site;
|
IOleControlSite *site;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
@ -175,7 +175,7 @@ void notif_focus(HTMLDocument *This)
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IOleControlSite_OnFocus(site, This->focus);
|
IOleControlSite_OnFocus(site, This->basedoc.focus);
|
||||||
IOleControlSite_Release(site);
|
IOleControlSite_Release(site);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_TIMER:
|
case WM_TIMER:
|
||||||
return on_timer(This);
|
return on_timer(This->doc_obj);
|
||||||
case WM_MOUSEACTIVATE:
|
case WM_MOUSEACTIVATE:
|
||||||
return MA_ACTIVATE;
|
return MA_ACTIVATE;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ static void register_serverwnd_class(void)
|
||||||
serverwnd_class = RegisterClassExW(&wndclass);
|
serverwnd_class = RegisterClassExW(&wndclass);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT activate_window(HTMLDocument *This)
|
static HRESULT activate_window(HTMLDocumentObj *This)
|
||||||
{
|
{
|
||||||
IOleInPlaceFrame *pIPFrame;
|
IOleInPlaceFrame *pIPFrame;
|
||||||
IOleCommandTarget *cmdtrg;
|
IOleCommandTarget *cmdtrg;
|
||||||
|
@ -276,10 +276,10 @@ static HRESULT activate_window(HTMLDocument *This)
|
||||||
|
|
||||||
TRACE("got parent window %p\n", parent_hwnd);
|
TRACE("got parent window %p\n", parent_hwnd);
|
||||||
|
|
||||||
if(This->hwnd) {
|
if(This->basedoc.hwnd) {
|
||||||
if(GetParent(This->hwnd) != parent_hwnd)
|
if(GetParent(This->basedoc.hwnd) != parent_hwnd)
|
||||||
SetParent(This->hwnd, parent_hwnd);
|
SetParent(This->basedoc.hwnd, parent_hwnd);
|
||||||
SetWindowPos(This->hwnd, HWND_TOP,
|
SetWindowPos(This->basedoc.hwnd, HWND_TOP,
|
||||||
posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
|
posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
|
||||||
SWP_NOACTIVATE | SWP_SHOWWINDOW);
|
SWP_NOACTIVATE | SWP_SHOWWINDOW);
|
||||||
}else {
|
}else {
|
||||||
|
@ -288,23 +288,23 @@ static HRESULT activate_window(HTMLDocument *This)
|
||||||
posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
|
posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
|
||||||
parent_hwnd, NULL, hInst, This);
|
parent_hwnd, NULL, hInst, This);
|
||||||
|
|
||||||
TRACE("Created window %p\n", This->hwnd);
|
TRACE("Created window %p\n", This->basedoc.hwnd);
|
||||||
|
|
||||||
SetWindowPos(This->hwnd, NULL, 0, 0, 0, 0,
|
SetWindowPos(This->basedoc.hwnd, NULL, 0, 0, 0, 0,
|
||||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_SHOWWINDOW);
|
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_SHOWWINDOW);
|
||||||
RedrawWindow(This->hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOERASE | RDW_ALLCHILDREN);
|
RedrawWindow(This->basedoc.hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOERASE | RDW_ALLCHILDREN);
|
||||||
|
|
||||||
/* NOTE:
|
/* NOTE:
|
||||||
* Windows implementation calls:
|
* Windows implementation calls:
|
||||||
* RegisterWindowMessage("MSWHEEL_ROLLMSG");
|
* RegisterWindowMessage("MSWHEEL_ROLLMSG");
|
||||||
*/
|
*/
|
||||||
SetTimer(This->hwnd, TIMER_ID, 100, NULL);
|
SetTimer(This->basedoc.hwnd, TIMER_ID, 100, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(This->doc_obj->nscontainer)
|
if(This->nscontainer)
|
||||||
activate_gecko(This->doc_obj->nscontainer);
|
activate_gecko(This->nscontainer);
|
||||||
|
|
||||||
This->in_place_active = TRUE;
|
This->basedoc.in_place_active = TRUE;
|
||||||
hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
|
hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
BOOL redraw = FALSE;
|
BOOL redraw = FALSE;
|
||||||
|
@ -318,7 +318,7 @@ static HRESULT activate_window(HTMLDocument *This)
|
||||||
}
|
}
|
||||||
if(FAILED(hres)) {
|
if(FAILED(hres)) {
|
||||||
WARN("OnInPlaceActivate failed: %08x\n", hres);
|
WARN("OnInPlaceActivate failed: %08x\n", hres);
|
||||||
This->in_place_active = FALSE;
|
This->basedoc.in_place_active = FALSE;
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ static HRESULT activate_window(HTMLDocument *This)
|
||||||
IOleInPlaceFrame_Release(This->frame);
|
IOleInPlaceFrame_Release(This->frame);
|
||||||
This->frame = pIPFrame;
|
This->frame = pIPFrame;
|
||||||
|
|
||||||
This->window_active = TRUE;
|
This->basedoc.window_active = TRUE;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -462,10 +462,10 @@ static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IO
|
||||||
if(pIPSite)
|
if(pIPSite)
|
||||||
IOleInPlaceSite_AddRef(pIPSite);
|
IOleInPlaceSite_AddRef(pIPSite);
|
||||||
|
|
||||||
if(This->ipsite)
|
if(This->doc_obj->ipsite)
|
||||||
IOleInPlaceSite_Release(This->ipsite);
|
IOleInPlaceSite_Release(This->doc_obj->ipsite);
|
||||||
|
|
||||||
This->ipsite = pIPSite;
|
This->doc_obj->ipsite = pIPSite;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,10 +477,10 @@ static HRESULT WINAPI OleDocumentView_GetInPlaceSite(IOleDocumentView *iface, IO
|
||||||
if(!ppIPSite)
|
if(!ppIPSite)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if(This->ipsite)
|
if(This->doc_obj->ipsite)
|
||||||
IOleInPlaceSite_AddRef(This->ipsite);
|
IOleInPlaceSite_AddRef(This->doc_obj->ipsite);
|
||||||
|
|
||||||
*ppIPSite = This->ipsite;
|
*ppIPSite = This->doc_obj->ipsite;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
|
||||||
|
|
||||||
if(fShow) {
|
if(fShow) {
|
||||||
if(!This->ui_active) {
|
if(!This->ui_active) {
|
||||||
hres = activate_window(This);
|
hres = activate_window(This->doc_obj);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
@ -557,9 +557,9 @@ static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
|
||||||
ShowWindow(This->hwnd, SW_SHOW);
|
ShowWindow(This->hwnd, SW_SHOW);
|
||||||
}else {
|
}else {
|
||||||
ShowWindow(This->hwnd, SW_HIDE);
|
ShowWindow(This->hwnd, SW_HIDE);
|
||||||
if(This->ip_window) {
|
if(This->doc_obj->ip_window) {
|
||||||
IOleInPlaceUIWindow_Release(This->ip_window);
|
IOleInPlaceUIWindow_Release(This->doc_obj->ip_window);
|
||||||
This->ip_window = NULL;
|
This->doc_obj->ip_window = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -573,7 +573,7 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
|
||||||
|
|
||||||
TRACE("(%p)->(%x)\n", This, fUIActivate);
|
TRACE("(%p)->(%x)\n", This, fUIActivate);
|
||||||
|
|
||||||
if(!This->ipsite) {
|
if(!This->doc_obj->ipsite) {
|
||||||
FIXME("This->ipsite = NULL\n");
|
FIXME("This->ipsite = NULL\n");
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
@ -585,7 +585,7 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
if(!This->window_active) {
|
if(!This->window_active) {
|
||||||
hres = activate_window(This);
|
hres = activate_window(This->doc_obj);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
@ -593,47 +593,47 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
|
||||||
This->focus = TRUE;
|
This->focus = TRUE;
|
||||||
if(This->doc_obj->nscontainer)
|
if(This->doc_obj->nscontainer)
|
||||||
nsIWebBrowserFocus_Activate(This->doc_obj->nscontainer->focus);
|
nsIWebBrowserFocus_Activate(This->doc_obj->nscontainer->focus);
|
||||||
notif_focus(This);
|
notif_focus(This->doc_obj);
|
||||||
|
|
||||||
update_doc(This, UPDATE_UI);
|
update_doc(This, UPDATE_UI);
|
||||||
|
|
||||||
hres = IOleInPlaceSite_OnUIActivate(This->ipsite);
|
hres = IOleInPlaceSite_OnUIActivate(This->doc_obj->ipsite);
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
call_set_active_object((IOleInPlaceUIWindow*)This->frame, ACTOBJ(This));
|
call_set_active_object((IOleInPlaceUIWindow*)This->doc_obj->frame, ACTOBJ(This));
|
||||||
}else {
|
}else {
|
||||||
FIXME("OnUIActivate failed: %08x\n", hres);
|
FIXME("OnUIActivate failed: %08x\n", hres);
|
||||||
IOleInPlaceFrame_Release(This->frame);
|
IOleInPlaceFrame_Release(This->doc_obj->frame);
|
||||||
This->frame = NULL;
|
This->doc_obj->frame = NULL;
|
||||||
This->ui_active = FALSE;
|
This->ui_active = FALSE;
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(This->hostui) {
|
if(This->doc_obj->hostui) {
|
||||||
hres = IDocHostUIHandler_ShowUI(This->hostui,
|
hres = IDocHostUIHandler_ShowUI(This->doc_obj->hostui,
|
||||||
This->usermode == EDITMODE ? DOCHOSTUITYPE_AUTHOR : DOCHOSTUITYPE_BROWSE,
|
This->usermode == EDITMODE ? DOCHOSTUITYPE_AUTHOR : DOCHOSTUITYPE_BROWSE,
|
||||||
ACTOBJ(This), CMDTARGET(This), This->frame, This->ip_window);
|
ACTOBJ(This), CMDTARGET(This), This->doc_obj->frame, This->doc_obj->ip_window);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
IDocHostUIHandler_HideUI(This->hostui);
|
IDocHostUIHandler_HideUI(This->doc_obj->hostui);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(This->ip_window)
|
if(This->doc_obj->ip_window)
|
||||||
call_set_active_object(This->ip_window, ACTOBJ(This));
|
call_set_active_object(This->doc_obj->ip_window, ACTOBJ(This));
|
||||||
|
|
||||||
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
|
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
|
||||||
IOleInPlaceFrame_SetBorderSpace(This->frame, &rcBorderWidths);
|
IOleInPlaceFrame_SetBorderSpace(This->doc_obj->frame, &rcBorderWidths);
|
||||||
|
|
||||||
This->ui_active = TRUE;
|
This->ui_active = TRUE;
|
||||||
}else {
|
}else {
|
||||||
if(This->ui_active) {
|
if(This->ui_active) {
|
||||||
This->ui_active = FALSE;
|
This->ui_active = FALSE;
|
||||||
if(This->ip_window)
|
if(This->doc_obj->ip_window)
|
||||||
call_set_active_object(This->ip_window, NULL);
|
call_set_active_object(This->doc_obj->ip_window, NULL);
|
||||||
if(This->frame)
|
if(This->doc_obj->frame)
|
||||||
call_set_active_object((IOleInPlaceUIWindow*)This->frame, NULL);
|
call_set_active_object((IOleInPlaceUIWindow*)This->doc_obj->frame, NULL);
|
||||||
if(This->hostui)
|
if(This->doc_obj->hostui)
|
||||||
IDocHostUIHandler_HideUI(This->hostui);
|
IDocHostUIHandler_HideUI(This->doc_obj->hostui);
|
||||||
if(This->ipsite)
|
if(This->doc_obj->ipsite)
|
||||||
IOleInPlaceSite_OnUIDeactivate(This->ipsite, FALSE);
|
IOleInPlaceSite_OnUIDeactivate(This->doc_obj->ipsite, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -805,17 +805,4 @@ void HTMLDocument_View_Init(HTMLDocument *This)
|
||||||
{
|
{
|
||||||
This->lpOleDocumentViewVtbl = &OleDocumentViewVtbl;
|
This->lpOleDocumentViewVtbl = &OleDocumentViewVtbl;
|
||||||
This->lpViewObject2Vtbl = &ViewObjectVtbl;
|
This->lpViewObject2Vtbl = &ViewObjectVtbl;
|
||||||
|
|
||||||
This->ipsite = NULL;
|
|
||||||
This->frame = NULL;
|
|
||||||
This->ip_window = NULL;
|
|
||||||
This->hwnd = NULL;
|
|
||||||
This->tooltips_hwnd = NULL;
|
|
||||||
|
|
||||||
This->in_place_active = FALSE;
|
|
||||||
This->ui_active = FALSE;
|
|
||||||
This->window_active = FALSE;
|
|
||||||
This->focus = FALSE;
|
|
||||||
|
|
||||||
This->update = 0;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue