}
}
+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;
{
travellog_entry_t *new_entry;
- 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;
+ static const WCHAR about_schemeW[] = {'a','b','o','u','t',':'};
- This->travellog.size = 4;
- }else if(This->travellog.size < This->travellog.position+1) {
- travellog_entry_t *new_travellog;
+ if(This->url && !strncmpiW(This->url, about_schemeW, sizeof(about_schemeW)/sizeof(*about_schemeW))) {
+ TRACE("Skipping about URL\n");
+ return;
+ }
- new_travellog = heap_realloc(This->travellog.log, This->travellog.size*2*sizeof(*This->travellog.log));
- if(!new_travellog)
- return;
+ if(!This->travellog.log) {
+ This->travellog.log = heap_alloc(4 * sizeof(*This->travellog.log));
+ if(!This->travellog.log)
+ return;
- This->travellog.log = new_travellog;
- This->travellog.size *= 2;
- }
+ 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. */
while(This->travellog.length > This->travellog.position)
free_travellog_entry(This->travellog.log + --This->travellog.length);
}
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,
IOleInPlaceFrame_Release(This->frame);
This->frame = NULL;
}
+
+ if(This->olecmd) {
+ IOleCommandTarget_Release(This->olecmd);
+ This->olecmd = NULL;
+ }
}
static inline DocHost *impl_from_IOleCommandTarget(IOleCommandTarget *iface)
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;
switch(nCmdID) {
case CMDID_EXPLORER_UPDATEHISTORY:
update_travellog(This);
+ update_navigation_commands(This);
return S_OK;
default:
}
}
- 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;
{
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)
{
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 {
IDispatch *client_disp;
IDocHostUIHandler *hostui;
IOleInPlaceFrame *frame;
+ IOleCommandTarget *olecmd;
IUnknown *document;
IOleDocumentView *view;
IOleContainer *container;
IOleInPlaceSiteEx *inplace;
+ IAdviseSink *sink;
+ DWORD sink_aspects;
+ DWORD sink_flags;
+
/* window context */
HWND frame_hwnd;
HWND frame_hwnd;
HWND status_hwnd;
+ HWND toolbar_hwnd;
HMENU menu;
BOOL nohome;
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;
}
#endif
-static void add_tb_separator(HWND hwnd)
+static void add_tb_separator(InternetExplorer *ie)
{
TBBUTTON btn;
btn.iBitmap = 3;
btn.fsStyle = BTNS_SEP;
- SendMessageW(hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn);
+ SendMessageW(ie->toolbar_hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn);
}
-static void add_tb_button(HWND hwnd, int bmp, int cmd, int strId)
+static void add_tb_button(InternetExplorer *ie, int bmp, int cmd, int strId)
{
TBBUTTON btn;
WCHAR buf[30];
btn.dwData = 0;
btn.iString = (INT_PTR)buf;
- SendMessageW(hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn);
+ SendMessageW(ie->toolbar_hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn);
}
-static void create_rebar(HWND hwnd)
+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];
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;
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);
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;
}
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);
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
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);
}
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);
- This->nohome = FALSE;
- SendMessageW(This->frame_hwnd, WM_UPDATEADDRBAR, 0, (LPARAM)url);
+ 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 HRESULT DocHostContainer_exec(DocHost* This, const GUID *cmd_group, DWORD cmdid, DWORD execopt, VARIANT *in,
- VARIANT *out)
+static void DocHostContainer_set_url(DocHost* iface, const WCHAR *url)
{
- return E_NOTIMPL;
+ InternetExplorer *This = impl_from_DocHost(iface);
+
+ This->nohome = FALSE;
+ SendMessageW(This->frame_hwnd, WM_UPDATEADDRBAR, 0, (LPARAM)url);
}
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)
}
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);
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)
{
return CONTAINING_RECORD(iface, BindStatusCallback, IBindStatusCallback_iface);
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);
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;
return S_OK;
}
+ notify_download_state(This, TRUE);
on_commandstate_change(This, CSC_NAVIGATEBACK, VARIANT_FALSE);
on_commandstate_change(This, CSC_NAVIGATEFORWARD, VARIANT_FALSE);
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);
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;
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);
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;
}
{
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;
This->uiwindow = NULL;
}
- if(This->client) {
- IOleClientSite_Release(This->client);
- This->client = NULL;
+ if(This->sink) {
+ IAdviseSink_Release(This->sink);
+ This->sink = NULL;
}
}
{
WebBrowser *This = impl_from_IOleObject(iface);
IDocHostUIHandler *hostui;
+ IOleCommandTarget *olecmd;
IOleContainer *container;
IDispatch *disp;
HRESULT hres;
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);
on_offlineconnected_change(This);
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);
}
{
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;
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;
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,
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,
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)
+static HRESULT DocHostContainer_set_status_text(DocHost *This, const WCHAR *text)
{
return E_NOTIMPL;
}
-static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url)
+static void DocHostContainer_on_command_state_change(DocHost *This, LONG command, BOOL enable)
{
-
}
-static HRESULT DocHostContainer_exec(DocHost *doc_host, const GUID *cmd_group, DWORD cmdid, DWORD execopt, VARIANT *in,
- VARIANT *out)
+static void DocHostContainer_set_url(DocHost *This, const WCHAR *url)
{
- 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 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)
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