Commit b3c2b380 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Moved state flags to HTMLDocumentObj.

parent e1aa05b1
......@@ -1887,7 +1887,7 @@ static ULONG HTMLDocumentObj_Release(HTMLDocument *base)
if(This->client)
IOleObject_SetClientSite(OLEOBJ(&This->basedoc), NULL);
if(This->basedoc.in_place_active)
if(This->in_place_active)
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(&This->basedoc));
if(This->ipsite)
IOleDocumentView_SetInPlaceSite(DOCVIEW(&This->basedoc), NULL);
......
......@@ -291,12 +291,6 @@ struct HTMLDocument {
USERMODE usermode;
READYSTATE readystate;
BOOL in_place_active;
BOOL ui_active;
BOOL window_active;
BOOL has_key_path;
BOOL container_locked;
BOOL focus;
LPWSTR mime;
DWORD update;
......@@ -354,6 +348,13 @@ struct HTMLDocumentObj {
HWND hwnd;
HWND tooltips_hwnd;
BOOL in_place_active;
BOOL ui_active;
BOOL window_active;
BOOL has_key_path;
BOOL container_locked;
BOOL focus;
};
typedef struct {
......
......@@ -117,7 +117,7 @@ static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
SetFocus(This->reset_focus);
This->reset_focus = NULL;
if(This->doc)
This->doc->basedoc.focus = FALSE;
This->doc->focus = FALSE;
}
}
......
......@@ -91,9 +91,9 @@ static nsresult NSAPI handle_blur(nsIDOMEventListener *iface, nsIDOMEvent *event
TRACE("(%p)\n", 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;
notif_focus(This->doc->basedoc.doc_obj);
if(!This->reset_focus && This->doc && This->doc->basedoc.doc_obj->focus && !is_doc_child_focus(This)) {
This->doc->basedoc.doc_obj->focus = FALSE;
notif_focus(This->doc);
}
return NS_OK;
......@@ -105,9 +105,9 @@ static nsresult NSAPI handle_focus(nsIDOMEventListener *iface, nsIDOMEvent *even
TRACE("(%p)\n", This);
if(!This->reset_focus && This->doc && !This->doc->basedoc.focus) {
This->doc->basedoc.focus = TRUE;
notif_focus(This->doc->basedoc.doc_obj);
if(!This->reset_focus && This->doc && !This->doc->focus) {
This->doc->focus = TRUE;
notif_focus(This->doc);
}
return NS_OK;
......
......@@ -609,7 +609,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if(FAILED(hres))
return hres;
if(This->ui_active) {
if(This->doc_obj->ui_active) {
if(This->doc_obj->ip_window)
call_set_active_object(This->doc_obj->ip_window, NULL);
if(This->doc_obj->hostui)
......@@ -619,7 +619,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if(This->doc_obj->nscontainer)
set_ns_editmode(This->doc_obj->nscontainer);
if(This->ui_active) {
if(This->doc_obj->ui_active) {
RECT rcBorderWidths;
if(This->doc_obj->hostui)
......
......@@ -133,7 +133,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
This->doc_obj->hostinfo = hostinfo;
}
if(!This->has_key_path) {
if(!This->doc_obj->has_key_path) {
hres = IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler, &key_path, 0);
if(hres == S_OK && key_path) {
if(key_path[0]) {
......@@ -157,7 +157,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
IDocHostUIHandler2_Release(pDocHostUIHandler2);
}
This->has_key_path = TRUE;
This->doc_obj->has_key_path = TRUE;
}
}
......@@ -246,7 +246,7 @@ static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
if(dwSaveOption == OLECLOSE_PROMPTSAVE)
FIXME("OLECLOSE_PROMPTSAVE not implemented\n");
if(This->in_place_active)
if(This->doc_obj->in_place_active)
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
HTMLDocument_LockContainer(This->doc_obj, FALSE);
......@@ -750,13 +750,13 @@ void HTMLDocument_LockContainer(HTMLDocumentObj *This, BOOL fLock)
IOleContainer *container;
HRESULT hres;
if(!This->client || This->basedoc.container_locked == fLock)
if(!This->client || This->container_locked == fLock)
return;
hres = IOleClientSite_GetContainer(This->client, &container);
if(SUCCEEDED(hres)) {
IOleContainer_LockContainer(container, fLock);
This->basedoc.container_locked = fLock;
This->container_locked = fLock;
IOleContainer_Release(container);
}
}
......
......@@ -68,7 +68,7 @@ static HRESULT WINAPI OleInPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *
if(!phwnd)
return E_INVALIDARG;
if(!This->in_place_active) {
if(!This->doc_obj->in_place_active) {
*phwnd = NULL;
return E_FAIL;
}
......@@ -186,11 +186,11 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceOb
TRACE("(%p)\n", This);
if(This->ui_active)
if(This->doc_obj->ui_active)
IOleDocumentView_UIActivate(DOCVIEW(This), FALSE);
This->window_active = FALSE;
This->doc_obj->window_active = FALSE;
if(!This->in_place_active)
if(!This->doc_obj->in_place_active)
return S_OK;
if(This->doc_obj->frame)
......@@ -201,10 +201,10 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceOb
SetWindowPos(This->doc_obj->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
}
This->focus = FALSE;
This->doc_obj->focus = FALSE;
notif_focus(This->doc_obj);
This->in_place_active = FALSE;
This->doc_obj->in_place_active = FALSE;
if(This->doc_obj->ipsite) {
IOleInPlaceSiteEx *ipsiteex;
HRESULT hres;
......
......@@ -175,7 +175,7 @@ void notif_focus(HTMLDocumentObj *This)
if(FAILED(hres))
return;
IOleControlSite_OnFocus(site, This->basedoc.focus);
IOleControlSite_OnFocus(site, This->focus);
IOleControlSite_Release(site);
}
......@@ -304,7 +304,7 @@ static HRESULT activate_window(HTMLDocumentObj *This)
if(This->nscontainer)
activate_gecko(This->nscontainer);
This->basedoc.in_place_active = TRUE;
This->in_place_active = TRUE;
hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
if(SUCCEEDED(hres)) {
BOOL redraw = FALSE;
......@@ -318,7 +318,7 @@ static HRESULT activate_window(HTMLDocumentObj *This)
}
if(FAILED(hres)) {
WARN("OnInPlaceActivate failed: %08x\n", hres);
This->basedoc.in_place_active = FALSE;
This->in_place_active = FALSE;
return hres;
}
......@@ -342,7 +342,7 @@ static HRESULT activate_window(HTMLDocumentObj *This)
IOleInPlaceFrame_Release(This->frame);
This->frame = pIPFrame;
This->basedoc.window_active = TRUE;
This->window_active = TRUE;
return S_OK;
}
......@@ -548,7 +548,7 @@ static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
TRACE("(%p)->(%x)\n", This, fShow);
if(fShow) {
if(!This->ui_active) {
if(!This->doc_obj->ui_active) {
hres = activate_window(This->doc_obj);
if(FAILED(hres))
return hres;
......@@ -581,16 +581,16 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
if(fUIActivate) {
RECT rcBorderWidths;
if(This->ui_active)
if(This->doc_obj->ui_active)
return S_OK;
if(!This->window_active) {
if(!This->doc_obj->window_active) {
hres = activate_window(This->doc_obj);
if(FAILED(hres))
return hres;
}
This->focus = TRUE;
This->doc_obj->focus = TRUE;
if(This->doc_obj->nscontainer)
nsIWebBrowserFocus_Activate(This->doc_obj->nscontainer->focus);
notif_focus(This->doc_obj);
......@@ -604,7 +604,7 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
FIXME("OnUIActivate failed: %08x\n", hres);
IOleInPlaceFrame_Release(This->doc_obj->frame);
This->doc_obj->frame = NULL;
This->ui_active = FALSE;
This->doc_obj->ui_active = FALSE;
return hres;
}
......@@ -622,10 +622,10 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
IOleInPlaceFrame_SetBorderSpace(This->doc_obj->frame, &rcBorderWidths);
This->ui_active = TRUE;
This->doc_obj->ui_active = TRUE;
}else {
if(This->ui_active) {
This->ui_active = FALSE;
if(This->doc_obj->ui_active) {
This->doc_obj->ui_active = FALSE;
if(This->doc_obj->ip_window)
call_set_active_object(This->doc_obj->ip_window, NULL);
if(This->doc_obj->frame)
......
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