From 1b966122f85817195f3d32c1cf03d33e7f6abafb Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 26 Jan 2006 13:29:35 +0100 Subject: [PATCH] shdocvw: Added WebBrowser's IOleCommandTarget stub implementation. --- dlls/shdocvw/oleobject.c | 51 +++++++++++++++++++++++++++++++++++++++ dlls/shdocvw/shdocvw.h | 2 ++ dlls/shdocvw/webbrowser.c | 3 +++ 3 files changed, 56 insertions(+) diff --git a/dlls/shdocvw/oleobject.c b/dlls/shdocvw/oleobject.c index 4f41da3a37f..fa3e9dc7962 100644 --- a/dlls/shdocvw/oleobject.c +++ b/dlls/shdocvw/oleobject.c @@ -691,12 +691,63 @@ static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = { InPlaceActiveObject_EnableModeless }; +#define OLECMD_THIS(iface) DEFINE_THIS(WebBrowser, WBOleCommandTarget, iface) + +static HRESULT WINAPI WBOleCommandTarget_QueryInterface(IOleCommandTarget *iface, + REFIID riid, void **ppv) +{ + WebBrowser *This = OLECMD_THIS(iface); + return IWebBrowser2_QueryInterface(WEBBROWSER(This), riid, ppv); +} + +static ULONG WINAPI WBOleCommandTarget_AddRef(IOleCommandTarget *iface) +{ + WebBrowser *This = OLECMD_THIS(iface); + return IWebBrowser2_AddRef(WEBBROWSER(This)); +} + +static ULONG WINAPI WBOleCommandTarget_Release(IOleCommandTarget *iface) +{ + WebBrowser *This = OLECMD_THIS(iface); + return IWebBrowser2_Release(WEBBROWSER(This)); +} + +static HRESULT WINAPI WBOleCommandTarget_QueryStatus(IOleCommandTarget *iface, + const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) +{ + WebBrowser *This = OLECMD_THIS(iface); + FIXME("(%p)->(%s %lu %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds, + pCmdText); + return E_NOTIMPL; +} + +static HRESULT WINAPI WBOleCommandTarget_Exec(IOleCommandTarget *iface, + const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, + VARIANT *pvaOut) +{ + WebBrowser *This = OLECMD_THIS(iface); + FIXME("(%p)->(%s %ld %ld %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID, + nCmdexecopt, pvaIn, pvaOut); + return E_NOTIMPL; +} + +#undef OLECMD_THIS + +static const IOleCommandTargetVtbl OleCommandTargetVtbl = { + WBOleCommandTarget_QueryInterface, + WBOleCommandTarget_AddRef, + WBOleCommandTarget_Release, + WBOleCommandTarget_QueryStatus, + WBOleCommandTarget_Exec +}; + void WebBrowser_OleObject_Init(WebBrowser *This) { This->lpOleObjectVtbl = &OleObjectVtbl; This->lpOleInPlaceObjectVtbl = &OleInPlaceObjectVtbl; This->lpOleControlVtbl = &OleControlVtbl; This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl; + This->lpWBOleCommandTargetVtbl = &OleCommandTargetVtbl; This->client = NULL; This->container = NULL; diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h index 9b777fcf534..6679a023df0 100644 --- a/dlls/shdocvw/shdocvw.h +++ b/dlls/shdocvw/shdocvw.h @@ -76,6 +76,7 @@ typedef struct { const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl; const IViewObject2Vtbl *lpViewObjectVtbl; const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl; + const IOleCommandTargetVtbl *lpWBOleCommandTargetVtbl; /* Interfaces available for embeded document */ @@ -133,6 +134,7 @@ typedef struct { #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl); #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl); #define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl) +#define WBOLECMD(x) ((IOleCommandTarget*) &(x)->lpWBOleCommandTargetVtbl) #define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpOleClientSiteVtbl) #define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl) diff --git a/dlls/shdocvw/webbrowser.c b/dlls/shdocvw/webbrowser.c index 81109505899..1c435bdb64a 100644 --- a/dlls/shdocvw/webbrowser.c +++ b/dlls/shdocvw/webbrowser.c @@ -97,6 +97,9 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) { TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This, ppv); *ppv = ACTIVEOBJ(This); + }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) { + TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv); + *ppv = WBOLECMD(This); } if(*ppv) {