Author: akhaldi
Date: Tue Nov 17 20:19:58 2015
New Revision: 69928
URL:
http://svn.reactos.org/svn/reactos?rev=69928&view=rev
Log:
[IEFRAME] Sync with Wine Staging 1.7.55. CORE-10536
Modified:
trunk/reactos/dll/win32/ieframe/dochost.c
trunk/reactos/dll/win32/ieframe/frame.c
trunk/reactos/dll/win32/ieframe/ieframe.h
trunk/reactos/dll/win32/ieframe/iexplore.c
trunk/reactos/dll/win32/ieframe/navigate.c
trunk/reactos/dll/win32/ieframe/oleobject.c
trunk/reactos/dll/win32/ieframe/shellbrowser.c
trunk/reactos/dll/win32/ieframe/view.c
trunk/reactos/dll/win32/ieframe/webbrowser.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/ieframe/dochost.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/dochost.…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/dochost.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/dochost.c [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -73,6 +73,37 @@
}
}
+void on_commandstate_change(DocHost *doc_host, LONG command, VARIANT_BOOL enable)
+{
+ DISPPARAMS dispparams;
+ VARIANTARG params[2];
+
+ TRACE("command=%d enable=%d\n", command, enable);
+
+ dispparams.cArgs = 2;
+ dispparams.cNamedArgs = 0;
+ dispparams.rgdispidNamedArgs = NULL;
+ dispparams.rgvarg = params;
+
+ V_VT(params) = VT_BOOL;
+ V_BOOL(params) = enable ? VARIANT_TRUE : VARIANT_FALSE;
+
+ V_VT(params+1) = VT_I4;
+ V_I4(params+1) = command;
+
+ call_sink(doc_host->cps.wbe2, DISPID_COMMANDSTATECHANGE, &dispparams);
+
+ doc_host->container_vtbl->on_command_state_change(doc_host, command, enable);
+}
+
+void update_navigation_commands(DocHost *dochost)
+{
+ unsigned pos = dochost->travellog.loading_pos == -1 ?
dochost->travellog.position : dochost->travellog.loading_pos;
+
+ on_commandstate_change(dochost, CSC_NAVIGATEBACK, pos > 0);
+ on_commandstate_change(dochost, CSC_NAVIGATEFORWARD, pos <
dochost->travellog.length);
+}
+
static void notif_complete(DocHost *This, DISPID dispid)
{
DISPPARAMS dispparams;
@@ -388,25 +419,32 @@
{
travellog_entry_t *new_entry;
+ static const WCHAR about_schemeW[] =
{'a','b','o','u','t',':'};
+
+ if(This->url && !strncmpiW(This->url, about_schemeW,
sizeof(about_schemeW)/sizeof(*about_schemeW))) {
+ TRACE("Skipping about URL\n");
+ return;
+ }
+
+ if(!This->travellog.log) {
+ This->travellog.log = heap_alloc(4 * sizeof(*This->travellog.log));
+ if(!This->travellog.log)
+ return;
+
+ This->travellog.size = 4;
+ }else if(This->travellog.size < This->travellog.position+1) {
+ travellog_entry_t *new_travellog;
+
+ new_travellog = heap_realloc(This->travellog.log,
This->travellog.size*2*sizeof(*This->travellog.log));
+ if(!new_travellog)
+ return;
+
+ This->travellog.log = new_travellog;
+ This->travellog.size *= 2;
+ }
+
if(This->travellog.loading_pos == -1) {
/* Clear forward history. */
- if(!This->travellog.log) {
- This->travellog.log = heap_alloc(4 * sizeof(*This->travellog.log));
- if(!This->travellog.log)
- return;
-
- This->travellog.size = 4;
- }else if(This->travellog.size < This->travellog.position+1) {
- travellog_entry_t *new_travellog;
-
- new_travellog = heap_realloc(This->travellog.log,
This->travellog.size*2*sizeof(*This->travellog.log));
- if(!new_travellog)
- return;
-
- This->travellog.log = new_travellog;
- This->travellog.size *= 2;
- }
-
while(This->travellog.length > This->travellog.position)
free_travellog_entry(This->travellog.log + --This->travellog.length);
}
@@ -455,7 +493,7 @@
doc_view_atom = RegisterClassExW(&wndclass);
}
- This->container_vtbl->GetDocObjRect(This, &rect);
+ This->container_vtbl->get_docobj_rect(This, &rect);
This->hwnd = CreateWindowExW(0, wszShell_DocObject_View,
wszShell_DocObject_View,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP,
@@ -574,6 +612,11 @@
if(This->frame) {
IOleInPlaceFrame_Release(This->frame);
This->frame = NULL;
+ }
+
+ if(This->olecmd) {
+ IOleCommandTarget_Release(This->olecmd);
+ This->olecmd = NULL;
}
}
@@ -627,8 +670,18 @@
if(!pguidCmdGroup) {
switch(nCmdID) {
case OLECMDID_UPDATECOMMANDS:
+ if(!This->olecmd)
+ return E_NOTIMPL;
+ return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID,
nCmdexecopt, pvaIn, pvaOut);
case OLECMDID_SETDOWNLOADSTATE:
- return This->container_vtbl->exec(This, pguidCmdGroup, nCmdID,
nCmdexecopt, pvaIn, pvaOut);
+ if(This->olecmd)
+ return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID,
nCmdexecopt, pvaIn, pvaOut);
+
+ if(!pvaIn || V_VT(pvaIn) != VT_I4)
+ return E_INVALIDARG;
+
+ notify_download_state(This, V_I4(pvaIn));
+ return S_OK;
default:
FIXME("Unimplemented cmdid %d\n", nCmdID);
return E_NOTIMPL;
@@ -691,6 +744,7 @@
switch(nCmdID) {
case CMDID_EXPLORER_UPDATEHISTORY:
update_travellog(This);
+ update_navigation_commands(This);
return S_OK;
default:
@@ -707,8 +761,11 @@
}
}
- if(IsEqualGUID(&CGID_DocHostCommandHandler, pguidCmdGroup))
- return This->container_vtbl->exec(This, pguidCmdGroup, nCmdID, nCmdexecopt,
pvaIn, pvaOut);
+ if(IsEqualGUID(&CGID_DocHostCommandHandler, pguidCmdGroup)) {
+ if(!This->olecmd)
+ return E_NOTIMPL;
+ return IOleCommandTarget_Exec(This->olecmd, pguidCmdGroup, nCmdID,
nCmdexecopt, pvaIn, pvaOut);
+ }
FIXME("Unimplemented cmdid %d of group %s\n", nCmdID,
debugstr_guid(pguidCmdGroup));
return E_NOTIMPL;
Modified: trunk/reactos/dll/win32/ieframe/frame.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/frame.c?…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/frame.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/frame.c [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -137,7 +137,7 @@
{
DocHost *This = impl_from_IOleInPlaceFrame(iface);
TRACE("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
- return This->container_vtbl->SetStatusText(This, pszStatusText);
+ return This->container_vtbl->set_status_text(This, pszStatusText);
}
static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
Modified: trunk/reactos/dll/win32/ieframe/ieframe.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/ieframe.…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/ieframe.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/ieframe.h [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -120,10 +120,10 @@
{
ULONG (*addref)(DocHost*);
ULONG (*release)(DocHost*);
- void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
- HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
- void (WINAPI* SetURL)(DocHost*,LPCWSTR);
- HRESULT (*exec)(DocHost*,const GUID*,DWORD,DWORD,VARIANT*,VARIANT*);
+ void (*get_docobj_rect)(DocHost*,RECT*);
+ HRESULT (*set_status_text)(DocHost*,const WCHAR*);
+ void (*on_command_state_change)(DocHost*,LONG,BOOL);
+ void (*set_url)(DocHost*,const WCHAR*);
} IDocHostContainerVtbl;
struct DocHost {
@@ -145,6 +145,7 @@
IDispatch *client_disp;
IDocHostUIHandler *hostui;
IOleInPlaceFrame *frame;
+ IOleCommandTarget *olecmd;
IUnknown *document;
IOleDocumentView *view;
@@ -208,6 +209,10 @@
IOleContainer *container;
IOleInPlaceSiteEx *inplace;
+ IAdviseSink *sink;
+ DWORD sink_aspects;
+ DWORD sink_flags;
+
/* window context */
HWND frame_hwnd;
@@ -243,6 +248,7 @@
HWND frame_hwnd;
HWND status_hwnd;
+ HWND toolbar_hwnd;
HMENU menu;
BOOL nohome;
@@ -290,6 +296,8 @@
void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
void on_commandstate_change(DocHost*,LONG,VARIANT_BOOL) DECLSPEC_HIDDEN;
+void notify_download_state(DocHost*,BOOL) DECLSPEC_HIDDEN;
+void update_navigation_commands(DocHost *dochost) DECLSPEC_HIDDEN;
#define WM_DOCHOSTTASK (WM_USER+0x300)
void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL)
DECLSPEC_HIDDEN;
Modified: trunk/reactos/dll/win32/ieframe/iexplore.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/iexplore…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/iexplore.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/iexplore.c [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -389,7 +389,7 @@
}
#endif
-static void add_tb_separator(HWND hwnd)
+static void add_tb_separator(InternetExplorer *ie)
{
TBBUTTON btn;
@@ -397,10 +397,10 @@
btn.iBitmap = 3;
btn.fsStyle = BTNS_SEP;
- SendMessageW(hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn);
-}
-
-static void add_tb_button(HWND hwnd, int bmp, int cmd, int strId)
+ SendMessageW(ie->toolbar_hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn);
+}
+
+static void add_tb_button(InternetExplorer *ie, int bmp, int cmd, int strId)
{
TBBUTTON btn;
WCHAR buf[30];
@@ -414,14 +414,18 @@
btn.dwData = 0;
btn.iString = (INT_PTR)buf;
- SendMessageW(hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn);
-}
-
-static void create_rebar(HWND hwnd)
+ SendMessageW(ie->toolbar_hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn);
+}
+
+static void enable_toolbar_button(InternetExplorer *ie, int command, BOOL enable)
+{
+ SendMessageW(ie->toolbar_hwnd, TB_ENABLEBUTTON, command, enable);
+}
+
+static void create_rebar(InternetExplorer *ie)
{
HWND hwndRebar;
HWND hwndAddress;
- HWND hwndToolbar;
REBARINFO rebarinf;
REBARBANDINFOW bandinf;
WCHAR addr[40];
@@ -432,7 +436,7 @@
hwndRebar = CreateWindowExW(WS_EX_TOOLWINDOW, REBARCLASSNAMEW, NULL,
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|RBS_VARHEIGHT|CCS_TOP|CCS_NODIVIDER,
0, 0, 0, 0,
- hwnd, (HMENU)IDC_BROWSE_REBAR, ieframe_instance, NULL);
+ ie->frame_hwnd, (HMENU)IDC_BROWSE_REBAR, ieframe_instance, NULL);
rebarinf.cbSize = sizeof(rebarinf);
rebarinf.fMask = 0;
@@ -440,29 +444,29 @@
SendMessageW(hwndRebar, RB_SETBARINFO, 0, (LPARAM)&rebarinf);
- hwndToolbar = CreateWindowExW(TBSTYLE_EX_MIXEDBUTTONS, TOOLBARCLASSNAMEW, NULL,
TBSTYLE_FLAT | WS_CHILD | WS_VISIBLE | CCS_NORESIZE,
+ ie->toolbar_hwnd = CreateWindowExW(TBSTYLE_EX_MIXEDBUTTONS, TOOLBARCLASSNAMEW,
NULL, TBSTYLE_FLAT | WS_CHILD | WS_VISIBLE | CCS_NORESIZE,
0, 0, 0, 0, hwndRebar, (HMENU)IDC_BROWSE_TOOLBAR, ieframe_instance, NULL);
imagelist = ImageList_LoadImageW(ieframe_instance, MAKEINTRESOURCEW(IDB_IETOOLBAR),
32, 0, CLR_NONE, IMAGE_BITMAP, LR_CREATEDIBSECTION);
- SendMessageW(hwndToolbar, TB_SETIMAGELIST, 0, (LPARAM)imagelist);
- SendMessageW(hwndToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
- add_tb_button(hwndToolbar, 0, ID_BROWSE_BACK, IDS_TB_BACK);
- add_tb_button(hwndToolbar, 1, ID_BROWSE_FORWARD, IDS_TB_FORWARD);
- add_tb_button(hwndToolbar, 2, ID_BROWSE_STOP, IDS_TB_STOP);
- add_tb_button(hwndToolbar, 3, ID_BROWSE_REFRESH, IDS_TB_REFRESH);
- add_tb_button(hwndToolbar, 4, ID_BROWSE_HOME, IDS_TB_HOME);
- add_tb_separator(hwndToolbar);
- add_tb_button(hwndToolbar, 5, ID_BROWSE_PRINT, IDS_TB_PRINT);
- SendMessageW(hwndToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(55,50));
- SendMessageW(hwndToolbar, TB_GETMAXSIZE, 0, (LPARAM)&toolbar_size);
+ SendMessageW(ie->toolbar_hwnd, TB_SETIMAGELIST, 0, (LPARAM)imagelist);
+ SendMessageW(ie->toolbar_hwnd, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
+ add_tb_button(ie, 0, ID_BROWSE_BACK, IDS_TB_BACK);
+ add_tb_button(ie, 1, ID_BROWSE_FORWARD, IDS_TB_FORWARD);
+ add_tb_button(ie, 2, ID_BROWSE_STOP, IDS_TB_STOP);
+ add_tb_button(ie, 3, ID_BROWSE_REFRESH, IDS_TB_REFRESH);
+ add_tb_button(ie, 4, ID_BROWSE_HOME, IDS_TB_HOME);
+ add_tb_separator(ie);
+ add_tb_button(ie, 5, ID_BROWSE_PRINT, IDS_TB_PRINT);
+ SendMessageW(ie->toolbar_hwnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(55,50));
+ SendMessageW(ie->toolbar_hwnd, TB_GETMAXSIZE, 0, (LPARAM)&toolbar_size);
bandinf.cbSize = sizeof(bandinf);
bandinf.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE;
bandinf.fStyle = RBBS_CHILDEDGE;
bandinf.cxMinChild = toolbar_size.cx;
bandinf.cyMinChild = toolbar_size.cy+2;
- bandinf.hwndChild = hwndToolbar;
+ bandinf.hwndChild = ie->toolbar_hwnd;
SendMessageW(hwndRebar, RB_INSERTBANDW, -1, (LPARAM)&bandinf);
@@ -484,13 +488,15 @@
InternetExplorer* This = (InternetExplorer*)lpcs->lpCreateParams;
SetWindowLongPtrW(hwnd, 0, (LONG_PTR) lpcs->lpCreateParams);
+ This->doc_host.frame_hwnd = This->frame_hwnd = hwnd;
+
This->menu = create_ie_menu();
This->status_hwnd =
CreateStatusWindowW(WS_VISIBLE|WS_CHILD|SBT_NOBORDERS|CCS_NODIVIDER,
NULL, hwnd, IDC_BROWSE_STATUSBAR);
SendMessageW(This->status_hwnd, SB_SIMPLE, TRUE, 0);
- create_rebar(hwnd);
+ create_rebar(This);
return 0;
}
@@ -554,9 +560,7 @@
static LRESULT iewnd_OnDestroy(InternetExplorer *This)
{
- HWND hwndRebar = GetDlgItem(This->frame_hwnd, IDC_BROWSE_REBAR);
- HWND hwndToolbar = GetDlgItem(hwndRebar, IDC_BROWSE_TOOLBAR);
- HIMAGELIST list = (HIMAGELIST)SendMessageW(hwndToolbar, TB_GETIMAGELIST, 0, 0);
+ HIMAGELIST list = (HIMAGELIST)SendMessageW(This->toolbar_hwnd, TB_GETIMAGELIST, 0,
0);
TRACE("%p\n", This);
@@ -715,7 +719,7 @@
static void create_frame_hwnd(InternetExplorer *This)
{
- This->frame_hwnd = CreateWindowExW(
+ CreateWindowExW(
WS_EX_WINDOWEDGE,
szIEWinFrame, wszWineInternetExplorer,
WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
@@ -723,7 +727,6 @@
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL /* FIXME */, ieframe_instance, This);
- This->doc_host.frame_hwnd = This->frame_hwnd;
create_doc_view_hwnd(&This->doc_host);
}
@@ -744,39 +747,47 @@
return IWebBrowser2_Release(&This->IWebBrowser2_iface);
}
-static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
+static void DocHostContainer_get_docobj_rect(DocHost *This, RECT *rc)
{
GetClientRect(This->frame_hwnd, rc);
adjust_ie_docobj_rect(This->frame_hwnd, rc);
}
-static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost *iface, LPCWSTR text)
+static HRESULT DocHostContainer_set_status_text(DocHost *iface, const WCHAR *text)
{
InternetExplorer *This = impl_from_DocHost(iface);
return update_ie_statustext(This, text);
}
-static void WINAPI DocHostContainer_SetURL(DocHost* iface, LPCWSTR url)
+static void DocHostContainer_on_command_state_change(DocHost *iface, LONG command, BOOL
enable)
+{
+ InternetExplorer *This = impl_from_DocHost(iface);
+
+ switch(command) {
+ case CSC_NAVIGATEBACK:
+ enable_toolbar_button(This, ID_BROWSE_BACK, enable);
+ break;
+ case CSC_NAVIGATEFORWARD:
+ enable_toolbar_button(This, ID_BROWSE_FORWARD, enable);
+ break;
+ }
+}
+
+static void DocHostContainer_set_url(DocHost* iface, const WCHAR *url)
{
InternetExplorer *This = impl_from_DocHost(iface);
This->nohome = FALSE;
SendMessageW(This->frame_hwnd, WM_UPDATEADDRBAR, 0, (LPARAM)url);
-}
-
-static HRESULT DocHostContainer_exec(DocHost* This, const GUID *cmd_group, DWORD cmdid,
DWORD execopt, VARIANT *in,
- VARIANT *out)
-{
- return E_NOTIMPL;
}
static const IDocHostContainerVtbl DocHostContainerVtbl = {
IEDocHost_addref,
IEDocHost_release,
- DocHostContainer_GetDocObjRect,
- DocHostContainer_SetStatusText,
- DocHostContainer_SetURL,
- DocHostContainer_exec
+ DocHostContainer_get_docobj_rect,
+ DocHostContainer_set_status_text,
+ DocHostContainer_on_command_state_change,
+ DocHostContainer_set_url
};
static HRESULT create_ie(InternetExplorer **ret_obj)
Modified: trunk/reactos/dll/win32/ieframe/navigate.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/navigate…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/navigate.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/navigate.c [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -102,7 +102,7 @@
}
V_VT(&arg) = VT_BSTR;
- V_BSTR(&arg) = str ? SysAllocString(buffer) : NULL;
+ V_BSTR(&arg) = str ? SysAllocString(buffer) : SysAllocString(emptyW);
TRACE("=> %s\n", debugstr_w(V_BSTR(&arg)));
call_sink(This->doc_host->cps.wbe2, DISPID_STATUSTEXTCHANGE, &dispparams);
@@ -129,8 +129,15 @@
heap_free(This->url);
This->url = new_url;
- This->container_vtbl->SetURL(This, This->url);
+ This->container_vtbl->set_url(This, This->url);
return S_OK;
+}
+
+void notify_download_state(DocHost *dochost, BOOL is_downloading)
+{
+ DISPPARAMS dwl_dp = {NULL};
+ TRACE("(%x)\n", is_downloading);
+ call_sink(dochost->cps.wbe2, is_downloading ? DISPID_DOWNLOADBEGIN :
DISPID_DOWNLOADCOMPLETE, &dwl_dp);
}
static inline BindStatusCallback *impl_from_IBindStatusCallback(IBindStatusCallback
*iface)
@@ -344,6 +351,8 @@
if(!This->doc_host)
return S_OK;
+ if(!This->doc_host->olecmd)
+ notify_download_state(This->doc_host, FALSE);
if(FAILED(hresult))
handle_navigation_error(This->doc_host, hresult, This->url, NULL);
@@ -759,27 +768,6 @@
heap_free(task);
}
-void on_commandstate_change(DocHost *doc_host, LONG command, VARIANT_BOOL enable)
-{
- DISPPARAMS dispparams;
- VARIANTARG params[2];
-
- TRACE("command=%d enable=%d\n", command, enable);
-
- dispparams.cArgs = 2;
- dispparams.cNamedArgs = 0;
- dispparams.rgdispidNamedArgs = NULL;
- dispparams.rgvarg = params;
-
- V_VT(params) = VT_BOOL;
- V_BOOL(params) = enable;
-
- V_VT(params+1) = VT_I4;
- V_I4(params+1) = command;
-
- call_sink(doc_host->cps.wbe2, DISPID_COMMANDSTATECHANGE, &dispparams);
-}
-
static void doc_navigate_proc(DocHost *This, task_header_t *t)
{
task_doc_navigate_t *task = (task_doc_navigate_t*)t;
@@ -883,6 +871,7 @@
return S_OK;
}
+ notify_download_state(This, TRUE);
on_commandstate_change(This, CSC_NAVIGATEBACK, VARIANT_FALSE);
on_commandstate_change(This, CSC_NAVIGATEFORWARD, VARIANT_FALSE);
@@ -1089,19 +1078,10 @@
return E_NOTIMPL;
}
- if (travellog_pos < This->travellog.position)
- {
- on_commandstate_change(This, CSC_NAVIGATEBACK, VARIANT_FALSE);
- on_commandstate_change(This, CSC_NAVIGATEFORWARD, VARIANT_TRUE);
- }
- else if (travellog_pos > This->travellog.position)
- {
- on_commandstate_change(This, CSC_NAVIGATEBACK, VARIANT_TRUE);
- on_commandstate_change(This, CSC_NAVIGATEFORWARD, VARIANT_FALSE);
- }
-
This->travellog.loading_pos = travellog_pos;
entry = This->travellog.log + This->travellog.loading_pos;
+
+ update_navigation_commands(This);
if(!entry->stream)
return async_doc_navigate(This, entry->url, NULL, NULL, 0, FALSE);
Modified: trunk/reactos/dll/win32/ieframe/oleobject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/oleobjec…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/oleobject.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/oleobject.c [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -39,6 +39,22 @@
return 0;
}
+static void notify_on_focus(WebBrowser *This, BOOL got_focus)
+{
+ IOleControlSite *control_site;
+ HRESULT hres;
+
+ if(!This->client)
+ return;
+
+ hres = IOleClientSite_QueryInterface(This->client, &IID_IOleControlSite,
(void**)&control_site);
+ if(FAILED(hres))
+ return;
+
+ IOleControlSite_OnFocus(control_site, got_focus);
+ IOleControlSite_Release(control_site);
+}
+
static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
lParam)
{
WebBrowser *This;
@@ -57,6 +73,12 @@
return resize_window(This, LOWORD(lParam), HIWORD(lParam));
case WM_DOCHOSTTASK:
return process_dochost_tasks(&This->doc_host);
+ case WM_SETFOCUS:
+ notify_on_focus(This, TRUE);
+ break;
+ case WM_KILLFOCUS:
+ notify_on_focus(This, FALSE);
+ break;
}
return DefWindowProcW(hwnd, msg, wParam, lParam);
@@ -193,6 +215,7 @@
IOleInPlaceFrame_SetMenu(This->doc_host.frame, NULL, NULL,
This->shell_embedding_hwnd);
SetFocus(This->shell_embedding_hwnd);
+ notify_on_focus(This, TRUE);
return S_OK;
}
@@ -254,6 +277,11 @@
{
release_dochost_client(&This->doc_host);
+ if(This->client) {
+ IOleClientSite_Release(This->client);
+ This->client = NULL;
+ }
+
if(This->shell_embedding_hwnd) {
DestroyWindow(This->shell_embedding_hwnd);
This->shell_embedding_hwnd = NULL;
@@ -274,9 +302,9 @@
This->uiwindow = NULL;
}
- if(This->client) {
- IOleClientSite_Release(This->client);
- This->client = NULL;
+ if(This->sink) {
+ IAdviseSink_Release(This->sink);
+ This->sink = NULL;
}
}
@@ -420,6 +448,7 @@
{
WebBrowser *This = impl_from_IOleObject(iface);
IDocHostUIHandler *hostui;
+ IOleCommandTarget *olecmd;
IOleContainer *container;
IDispatch *disp;
HRESULT hres;
@@ -464,8 +493,18 @@
ITargetContainer_Release(target_container);
}
+ hres = IOleContainer_QueryInterface(container, &IID_IOleCommandTarget,
(void**)&olecmd);
+ if(FAILED(hres))
+ olecmd = NULL;
+
IOleContainer_Release(container);
- }
+ }else {
+ hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
(void**)&olecmd);
+ if(FAILED(hres))
+ olecmd = NULL;
+ }
+
+ This->doc_host.olecmd = olecmd;
create_shell_embedding_hwnd(This);
@@ -519,10 +558,11 @@
if(This->uiwindow)
IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, NULL, NULL);
- if(This->inplace) {
+ if(This->inplace)
IOleInPlaceSiteEx_OnUIDeactivate(This->inplace, FALSE);
+ notify_on_focus(This, FALSE);
+ if(This->inplace)
IOleInPlaceSiteEx_OnInPlaceDeactivate(This->inplace);
- }
return IOleObject_SetClientSite(iface, NULL);
}
@@ -802,7 +842,7 @@
{
WebBrowser *This = impl_from_IOleInPlaceObject(iface);
- TRACE("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
+ TRACE("(%p)->(%s %s)\n", This, wine_dbgstr_rect(lprcPosRect),
wine_dbgstr_rect(lprcClipRect));
This->pos_rect = *lprcPosRect;
Modified: trunk/reactos/dll/win32/ieframe/shellbrowser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/shellbro…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/shellbrowser.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/shellbrowser.c [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -742,6 +742,8 @@
TRACE("%p %p %x\n", This, pHTMLWindow2, dwFlags);
+ update_navigation_commands(This->doc_host);
+
if(doc_host->travellog.loading_pos != -1) {
WARN("histupdate not notified\n");
doc_host->travellog.position = doc_host->travellog.loading_pos;
Modified: trunk/reactos/dll/win32/ieframe/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/view.c?r…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/view.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/view.c [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -56,7 +56,7 @@
FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %08lx)\n", This, dwDrawAspect,
lindex,
pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue,
dwContinue);
- return E_NOTIMPL;
+ return S_OK;
}
static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect,
@@ -88,16 +88,36 @@
IAdviseSink *pAdvSink)
{
WebBrowser *This = impl_from_IViewObject2(iface);
- FIXME("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
+
+ if (aspects || advf) FIXME("aspects and/or flags not supported yet\n");
+
+ This->sink_aspects = aspects;
+ This->sink_flags = advf;
+ if (This->sink) IAdviseSink_Release(This->sink);
+ This->sink = pAdvSink;
+ if (This->sink) IAdviseSink_AddRef(This->sink);
+
+ return S_OK;
}
static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects,
DWORD *pAdvf, IAdviseSink **ppAdvSink)
{
WebBrowser *This = impl_from_IViewObject2(iface);
- FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
+
+ if (pAspects) *pAspects = This->sink_aspects;
+ if (pAdvf) *pAdvf = This->sink_flags;
+ if (ppAdvSink)
+ {
+ *ppAdvSink = This->sink;
+ if (*ppAdvSink) IAdviseSink_AddRef(*ppAdvSink);
+ }
+
+ return S_OK;
}
static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG
lindex,
Modified: trunk/reactos/dll/win32/ieframe/webbrowser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ieframe/webbrows…
==============================================================================
--- trunk/reactos/dll/win32/ieframe/webbrowser.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ieframe/webbrowser.c [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -1187,60 +1187,31 @@
return IWebBrowser2_Release(&This->IWebBrowser2_iface);
}
-static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
+static void DocHostContainer_get_docobj_rect(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 HRESULT DocHostContainer_exec(DocHost *doc_host, const GUID *cmd_group, DWORD
cmdid, DWORD execopt, VARIANT *in,
- VARIANT *out)
-{
- WebBrowser *This = impl_from_DocHost(doc_host);
- IOleCommandTarget *cmdtrg = NULL;
- HRESULT hres;
-
- if(This->client) {
- hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
(void**)&cmdtrg);
- if(FAILED(hres))
- cmdtrg = NULL;
- }
-
- if(!cmdtrg && This->container) {
- hres = IOleContainer_QueryInterface(This->container,
&IID_IOleCommandTarget, (void**)&cmdtrg);
- if(FAILED(hres))
- cmdtrg = NULL;
- }
-
- if(!cmdtrg)
- return E_NOTIMPL;
-
- hres = IOleCommandTarget_Exec(cmdtrg, cmd_group, cmdid, execopt, in, out);
- IOleCommandTarget_Release(cmdtrg);
- if(SUCCEEDED(hres))
- TRACE("Exec returned %08x %s\n", hres, debugstr_variant(out));
- else
- FIXME("Exec failed\n");
-
- return hres;
+static HRESULT DocHostContainer_set_status_text(DocHost *This, const WCHAR *text)
+{
+ return E_NOTIMPL;
+}
+
+static void DocHostContainer_on_command_state_change(DocHost *This, LONG command, BOOL
enable)
+{
+}
+
+static void DocHostContainer_set_url(DocHost *This, const WCHAR *url)
+{
}
static const IDocHostContainerVtbl DocHostContainerVtbl = {
WebBrowser_addref,
WebBrowser_release,
- DocHostContainer_GetDocObjRect,
- DocHostContainer_SetStatusText,
- DocHostContainer_SetURL,
- DocHostContainer_exec
+ DocHostContainer_get_docobj_rect,
+ DocHostContainer_set_status_text,
+ DocHostContainer_on_command_state_change,
+ DocHostContainer_set_url
};
static HRESULT create_webbrowser(int version, IUnknown *outer, REFIID riid, void **ppv)
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 17 20:19:58 2015
@@ -76,7 +76,7 @@
reactos/dll/win32/httpapi # Synced to WineStaging-1.7.47
reactos/dll/win32/iccvid # Synced to WineStaging-1.7.47
reactos/dll/win32/icmp # Out of sync
-reactos/dll/win32/ieframe # Synced to WineStaging-1.7.47
+reactos/dll/win32/ieframe # Synced to WineStaging-1.7.55
reactos/dll/win32/imaadp32.acm # Synced to WineStaging-1.7.47
reactos/dll/win32/imagehlp # Synced to WineStaging-1.7.47
reactos/dll/win32/imm32 # Synced to Wine-1.7.27