mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
Sync to Wine-0_9_3:
Jacek Caban <jacek@codeweavers.com> - Return S_OK in [On|Can]InPlaceActivate. Handle IOleDocumentSite in QueryInterface. - Added IOleDocumentSite implementation. - Sync the WebBrowser's window size with document's window. - Sync window sizes. - Use sink in navigate_complete instead of ClientSite's IDispatch. - Added implementation of OLEIVERB_SHOW in DoVerb. - Activate document object. - Added IOleInPlaceActiveObject stub implementation. - Added GetOverrideKeyPath and GetOptionKeyPath implementation. - Added SetObjectRects implementation. - Better windows handling. - shdocvw: Added get_Document implementation. - Added implementation of IConnectionPoint::Advise and Unadvise. - Don't crash when parameters of Navigate2 are NULL. - Added implementation of GetWindowContext. Added stub implementation of IOleInPlaceFrame interface. svn path=/trunk/; revision=20170
This commit is contained in:
parent
3fb8c2a35b
commit
748241e0bc
14 changed files with 2082 additions and 79 deletions
|
@ -94,10 +94,6 @@ typedef struct tagRemSTGMEDIUM {
|
|||
unsigned long cbData;
|
||||
BYTE data[1];
|
||||
} RemSTGMEDIUM;
|
||||
typedef struct tagHLITEM {
|
||||
ULONG uHLID;
|
||||
LPWSTR pwzFriendlyName;
|
||||
} HLITEM;
|
||||
typedef struct tagSTATDATA {
|
||||
FORMATETC formatetc;
|
||||
DWORD grfAdvf;
|
||||
|
@ -430,7 +426,6 @@ EXTERN_C const FMTID FMTID_DocSummaryInformation;
|
|||
EXTERN_C const FMTID FMTID_UserDefinedProperties;
|
||||
|
||||
DECLARE_ENUMERATOR(FORMATETC);
|
||||
DECLARE_ENUMERATOR(HLITEM);
|
||||
DECLARE_ENUMERATOR(STATDATA);
|
||||
DECLARE_ENUMERATOR(STATPROPSETSTG);
|
||||
DECLARE_ENUMERATOR(STATPROPSTG);
|
||||
|
|
|
@ -47,6 +47,9 @@ static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID ri
|
|||
}else if(IsEqualGUID(&IID_IDocHostUIHandler2, riid)) {
|
||||
TRACE("(%p)->(IID_IDocHostUIHandler2 %p)\n", This, ppv);
|
||||
*ppv = DOCHOSTUI2(This);
|
||||
}else if(IsEqualGUID(&IID_IOleDocumentSite, riid)) {
|
||||
TRACE("(%p)->(IID_IOleDocumentSite %p)\n", This, ppv);
|
||||
*ppv = DOCSITE(This);
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
|
@ -168,15 +171,21 @@ static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp(IOleInPlaceSite *iface, B
|
|||
static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
/* Nothing to do here */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
/* Nothing to do here */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_OnUIActivate(IOleInPlaceSite *iface)
|
||||
|
@ -191,9 +200,23 @@ static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface,
|
|||
LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect,
|
||||
|
||||
TRACE("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect,
|
||||
lprcClipRect, lpFrameInfo);
|
||||
return E_NOTIMPL;
|
||||
|
||||
*ppFrame = INPLACEFRAME(This);
|
||||
*ppDoc = NULL;
|
||||
|
||||
GetClientRect(This->doc_view_hwnd, lprcPosRect);
|
||||
memcpy(lprcClipRect, lprcPosRect, sizeof(RECT));
|
||||
|
||||
lpFrameInfo->cb = sizeof(*lpFrameInfo);
|
||||
lpFrameInfo->fMDIApp = FALSE;
|
||||
lpFrameInfo->hwndFrame = This->shell_embedding_hwnd;
|
||||
lpFrameInfo->haccel = NULL;
|
||||
lpFrameInfo->cAccelEntries = 0; /* FIXME: should be 5 */
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_Scroll(IOleInPlaceSite *iface, SIZE scrollExtent)
|
||||
|
@ -259,8 +282,72 @@ static const IOleInPlaceSiteVtbl OleInPlaceSiteVtbl = {
|
|||
InPlaceSite_OnPosRectChange
|
||||
};
|
||||
|
||||
#define DOCSITE_THIS(iface) DEFINE_THIS(WebBrowser, OleDocumentSite, iface)
|
||||
|
||||
static HRESULT WINAPI OleDocumentSite_QueryInterface(IOleDocumentSite *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
WebBrowser *This = DOCSITE_THIS(iface);
|
||||
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI OleDocumentSite_AddRef(IOleDocumentSite *iface)
|
||||
{
|
||||
WebBrowser *This = DOCSITE_THIS(iface);
|
||||
return IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI OleDocumentSite_Release(IOleDocumentSite *iface)
|
||||
{
|
||||
WebBrowser *This = DOCSITE_THIS(iface);
|
||||
return IOleClientSite_Release(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI OleDocumentSite_ActivateMe(IOleDocumentSite *iface,
|
||||
IOleDocumentView *pViewToActivate)
|
||||
{
|
||||
WebBrowser *This = DOCSITE_THIS(iface);
|
||||
IOleDocument *oledoc;
|
||||
RECT rect;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, pViewToActivate);
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IOleDocument, (void**)&oledoc);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
IOleDocument_CreateView(oledoc, INPLACESITE(This), NULL, 0, &This->view);
|
||||
IOleDocument_Release(oledoc);
|
||||
|
||||
GetClientRect(This->doc_view_hwnd, &rect);
|
||||
IOleDocumentView_SetRect(This->view, &rect);
|
||||
|
||||
hres = IOleDocumentView_Show(This->view, TRUE);
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
#undef DOCSITE_THIS
|
||||
|
||||
static const IOleDocumentSiteVtbl OleDocumentSiteVtbl = {
|
||||
OleDocumentSite_QueryInterface,
|
||||
OleDocumentSite_AddRef,
|
||||
OleDocumentSite_Release,
|
||||
OleDocumentSite_ActivateMe
|
||||
};
|
||||
|
||||
void WebBrowser_ClientSite_Init(WebBrowser *This)
|
||||
{
|
||||
This->lpOleClientSiteVtbl = &OleClientSiteVtbl;
|
||||
This->lpOleInPlaceSiteVtbl = &OleInPlaceSiteVtbl;
|
||||
This->lpOleDocumentSiteVtbl = &OleDocumentSiteVtbl;
|
||||
|
||||
This->view = NULL;
|
||||
}
|
||||
|
||||
void WebBrowser_ClientSite_Destroy(WebBrowser *This)
|
||||
{
|
||||
if(This->view)
|
||||
IOleDocumentView_Release(This->view);
|
||||
}
|
||||
|
|
|
@ -18,9 +18,142 @@
|
|||
|
||||
#include "wine/debug.h"
|
||||
#include "shdocvw.h"
|
||||
#include "hlink.h"
|
||||
#include "exdispid.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
static ATOM doc_view_atom = 0;
|
||||
|
||||
static void navigate_complete(WebBrowser *This)
|
||||
{
|
||||
IDispatch *disp = NULL;
|
||||
DISPPARAMS dispparams;
|
||||
VARIANTARG params[2];
|
||||
VARIANT url;
|
||||
HRESULT hres;
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IDispatch, (void**)&disp);
|
||||
if(FAILED(hres))
|
||||
FIXME("Could not get IDispatch interface\n");
|
||||
|
||||
dispparams.cArgs = 2;
|
||||
dispparams.cNamedArgs = 0;
|
||||
dispparams.rgdispidNamedArgs = NULL;
|
||||
dispparams.rgvarg = params;
|
||||
|
||||
V_VT(params) = (VT_BYREF|VT_VARIANT);
|
||||
V_BYREF(params) = &url;
|
||||
|
||||
V_VT(params+1) = VT_DISPATCH;
|
||||
V_DISPATCH(params+1) = disp;
|
||||
|
||||
V_VT(&url) = VT_BSTR;
|
||||
V_BSTR(&url) = This->url;
|
||||
|
||||
call_sink(This->cp_wbe2, DISPID_NAVIGATECOMPLETE2, &dispparams);
|
||||
call_sink(This->cp_wbe2, DISPID_DOCUMENTCOMPLETE, &dispparams);
|
||||
|
||||
if(disp)
|
||||
IDispatch_Release(disp);
|
||||
}
|
||||
|
||||
static LRESULT navigate2(WebBrowser *This)
|
||||
{
|
||||
IHlinkTarget *hlink;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
if(!This->document) {
|
||||
WARN("document == NULL\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
|
||||
if(FAILED(hres)) {
|
||||
FIXME("Could not get IHlinkTarget interface\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
hres = IHlinkTarget_Navigate(hlink, 0, NULL);
|
||||
IHlinkTarget_Release(hlink);
|
||||
if(FAILED(hres)) {
|
||||
FIXME("Navigate failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
navigate_complete(This);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT resize_document(WebBrowser *This, LONG width, LONG height)
|
||||
{
|
||||
RECT rect = {0, 0, width, height};
|
||||
|
||||
TRACE("(%p)->(%ld %ld)\n", This, width, height);
|
||||
|
||||
if(This->view)
|
||||
IOleDocumentView_SetRect(This->view, &rect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
WebBrowser *This;
|
||||
|
||||
static const WCHAR wszTHIS[] = {'T','H','I','S',0};
|
||||
|
||||
if(msg == WM_CREATE) {
|
||||
This = *(WebBrowser**)lParam;
|
||||
SetPropW(hwnd, wszTHIS, This);
|
||||
}else {
|
||||
This = GetPropW(hwnd, wszTHIS);
|
||||
}
|
||||
|
||||
switch(msg) {
|
||||
case WM_SIZE:
|
||||
return resize_document(This, LOWORD(lParam), HIWORD(lParam));
|
||||
case WB_WM_NAVIGATE2:
|
||||
return navigate2(This);
|
||||
}
|
||||
|
||||
return DefWindowProcA(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
void create_doc_view_hwnd(WebBrowser *This)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
static const WCHAR wszShell_DocObject_View[] =
|
||||
{'S','h','e','l','l',' ','D','o','c','O','b','j','e','c','t',' ','V','i','e','w',0};
|
||||
|
||||
if(!doc_view_atom) {
|
||||
static WNDCLASSEXW wndclass = {
|
||||
sizeof(wndclass),
|
||||
CS_PARENTDC,
|
||||
doc_view_proc,
|
||||
0, 0 /* native uses 4*/, NULL, NULL, NULL,
|
||||
(HBRUSH)COLOR_WINDOWFRAME, NULL,
|
||||
wszShell_DocObject_View,
|
||||
NULL
|
||||
};
|
||||
|
||||
wndclass.hInstance = shdocvw_hinstance;
|
||||
|
||||
doc_view_atom = RegisterClassExW(&wndclass);
|
||||
}
|
||||
|
||||
GetWindowRect(This->shell_embedding_hwnd, &rect);
|
||||
This->doc_view_hwnd = CreateWindowExW(0, wszShell_DocObject_View,
|
||||
wszShell_DocObject_View,
|
||||
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP | WS_MAXIMIZEBOX,
|
||||
rect.left, rect.top, rect.right, rect.bottom, This->shell_embedding_hwnd,
|
||||
NULL, shdocvw_hinstance, This);
|
||||
}
|
||||
|
||||
#define DOCHOSTUI_THIS(iface) DEFINE_THIS(WebBrowser, DocHostUIHandler, iface)
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface,
|
||||
|
@ -143,8 +276,23 @@ static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *ifac
|
|||
LPOLESTR *pchKey, DWORD dw)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%p %ld)\n", This, pchKey, dw);
|
||||
return E_NOTIMPL;
|
||||
IDocHostUIHandler *handler;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p %ld)\n", This, pchKey, dw);
|
||||
|
||||
if(!This->client)
|
||||
return S_OK;
|
||||
|
||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
|
||||
(void**)&handler);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IDocHostUIHandler_GetOptionKeyPath(handler, pchKey, dw);
|
||||
IDocHostUIHandler_Release(handler);
|
||||
return hres;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface,
|
||||
|
@ -183,8 +331,23 @@ static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *if
|
|||
LPOLESTR *pchKey, DWORD dw)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%p %ld)\n", This, pchKey, dw);
|
||||
return E_NOTIMPL;
|
||||
IDocHostUIHandler2 *handler;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p %ld)\n", This, pchKey, dw);
|
||||
|
||||
if(!This->client)
|
||||
return S_OK;
|
||||
|
||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler2,
|
||||
(void**)&handler);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IDocHostUIHandler2_GetOverrideKeyPath(handler, pchKey, dw);
|
||||
IDocHostUIHandler2_Release(handler);
|
||||
return hres;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#undef DOCHOSTUI_THIS
|
||||
|
@ -214,4 +377,6 @@ static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl = {
|
|||
void WebBrowser_DocHost_Init(WebBrowser *This)
|
||||
{
|
||||
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
|
||||
|
||||
This->doc_view_hwnd = NULL;
|
||||
}
|
||||
|
|
|
@ -27,13 +27,16 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
typedef struct {
|
||||
struct ConnectionPoint {
|
||||
const IConnectionPointVtbl *lpConnectionPointVtbl;
|
||||
|
||||
WebBrowser *webbrowser;
|
||||
|
||||
IDispatch **sinks;
|
||||
DWORD sinks_size;
|
||||
|
||||
IID iid;
|
||||
} ConnectionPoint;
|
||||
};
|
||||
|
||||
#define CONPOINT(x) ((IConnectionPoint*) &(x)->lpConnectionPointVtbl)
|
||||
|
||||
|
@ -84,13 +87,13 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
|
|||
|
||||
if(IsEqualGUID(&DIID_DWebBrowserEvents2, riid)) {
|
||||
TRACE("(%p)->(DIID_DWebBrowserEvents2 %p)\n", This, ppCP);
|
||||
*ppCP = This->cp_wbe2;
|
||||
*ppCP = CONPOINT(This->cp_wbe2);
|
||||
}else if(IsEqualGUID(&DIID_DWebBrowserEvents, riid)) {
|
||||
TRACE("(%p)->(DIID_DWebBrowserEvents %p)\n", This, ppCP);
|
||||
*ppCP = This->cp_wbe;
|
||||
*ppCP = CONPOINT(This->cp_wbe);
|
||||
}else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
|
||||
TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppCP);
|
||||
*ppCP = This->cp_pns;
|
||||
*ppCP = CONPOINT(This->cp_pns);
|
||||
}
|
||||
|
||||
if(*ppCP) {
|
||||
|
@ -181,15 +184,53 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
|
|||
DWORD *pdwCookie)
|
||||
{
|
||||
ConnectionPoint *This = CONPOINT_THIS(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, pUnkSink, pdwCookie);
|
||||
return E_NOTIMPL;
|
||||
IDispatch *disp;
|
||||
DWORD i;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p %p)\n", This, pUnkSink, pdwCookie);
|
||||
|
||||
hres = IUnknown_QueryInterface(pUnkSink, &This->iid, (void**)&disp);
|
||||
if(FAILED(hres)) {
|
||||
hres = IUnknown_QueryInterface(pUnkSink, &IID_IDispatch, (void**)&disp);
|
||||
if(FAILED(hres))
|
||||
return CONNECT_E_CANNOTCONNECT;
|
||||
}
|
||||
|
||||
if(This->sinks) {
|
||||
for(i=0; i<This->sinks_size; i++) {
|
||||
if(!This->sinks[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if(i == This->sinks_size)
|
||||
This->sinks = HeapReAlloc(GetProcessHeap(), 0, This->sinks,
|
||||
(++This->sinks_size)*sizeof(*This->sinks));
|
||||
}else {
|
||||
This->sinks = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->sinks));
|
||||
This->sinks_size = 1;
|
||||
i = 0;
|
||||
}
|
||||
|
||||
This->sinks[i] = disp;
|
||||
*pdwCookie = i+1;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie)
|
||||
{
|
||||
ConnectionPoint *This = CONPOINT_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, dwCookie);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%ld)\n", This, dwCookie);
|
||||
|
||||
if(!dwCookie || dwCookie > This->sinks_size || !This->sinks[dwCookie-1])
|
||||
return CONNECT_E_NOCONNECTION;
|
||||
|
||||
IDispatch_Release(This->sinks[dwCookie-1]);
|
||||
This->sinks[dwCookie-1] = NULL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface,
|
||||
|
@ -214,15 +255,43 @@ static const IConnectionPointVtbl ConnectionPointVtbl =
|
|||
ConnectionPoint_EnumConnections
|
||||
};
|
||||
|
||||
static void ConnectionPoint_Create(WebBrowser *wb, REFIID riid, IConnectionPoint **cp)
|
||||
void call_sink(ConnectionPoint *This, DISPID dispid, DISPPARAMS *dispparams)
|
||||
{
|
||||
DWORD i;
|
||||
|
||||
for(i=0; i<This->sinks_size; i++) {
|
||||
if(This->sinks[i])
|
||||
IDispatch_Invoke(This->sinks[i], dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
|
||||
DISPATCH_METHOD, dispparams, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void ConnectionPoint_Create(WebBrowser *wb, REFIID riid, ConnectionPoint **cp)
|
||||
{
|
||||
ConnectionPoint *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(ConnectionPoint));
|
||||
|
||||
ret->lpConnectionPointVtbl = &ConnectionPointVtbl;
|
||||
ret->webbrowser = wb;
|
||||
|
||||
ret->sinks = NULL;
|
||||
ret->sinks_size = 0;
|
||||
|
||||
memcpy(&ret->iid, riid, sizeof(IID));
|
||||
|
||||
*cp = CONPOINT(ret);
|
||||
*cp = ret;
|
||||
}
|
||||
|
||||
static void ConnectionPoint_Destroy(ConnectionPoint *This)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i=0; i<This->sinks_size; i++) {
|
||||
if(This->sinks[i])
|
||||
IDispatch_Release(This->sinks[i]);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->sinks);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
void WebBrowser_Events_Init(WebBrowser *This)
|
||||
|
@ -236,7 +305,7 @@ void WebBrowser_Events_Init(WebBrowser *This)
|
|||
|
||||
void WebBrowser_Events_Destroy(WebBrowser *This)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, This->cp_wbe2);
|
||||
HeapFree(GetProcessHeap(), 0, This->cp_wbe);
|
||||
HeapFree(GetProcessHeap(), 0, This->cp_pns);
|
||||
ConnectionPoint_Destroy(This->cp_wbe2);
|
||||
ConnectionPoint_Destroy(This->cp_wbe);
|
||||
ConnectionPoint_Destroy(This->cp_pns);
|
||||
}
|
||||
|
|
180
reactos/lib/shdocvw/frame.c
Normal file
180
reactos/lib/shdocvw/frame.c
Normal file
|
@ -0,0 +1,180 @@
|
|||
/*
|
||||
* Copyright 2005 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "shdocvw.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
#define INPLACEFRAME_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceFrame, iface)
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||
*ppv = INPLACEFRAME(This);
|
||||
}else if(IsEqualGUID(&IID_IOleInPlaceUIWindow, riid)) {
|
||||
TRACE("(%p)->(IID_IOleInPlaceUIWindow %p)\n", This, ppv);
|
||||
*ppv = INPLACEFRAME(This);
|
||||
}else if(IsEqualGUID(&IID_IOleInPlaceFrame, riid)) {
|
||||
TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This, ppv);
|
||||
*ppv = INPLACEFRAME(This);
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
IOleInPlaceFrame_AddRef(INPLACEFRAME(This));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("Unsopported interface %s\n", debugstr_guid(riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
return IWebBrowser2_AddRef(WEBBROWSER(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
return IWebBrowser2_Release(WEBBROWSER(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, phwnd);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface,
|
||||
BOOL fEnterMode)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fEnterMode);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, lprectBorder);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
|
||||
LPCBORDERWIDTHS pborderwidths)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pborderwidths);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
|
||||
LPCBORDERWIDTHS pborderwidths)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pborderwidths);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
|
||||
IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared,
|
||||
LPOLEMENUGROUPWIDTHS lpMenuWidths)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared,
|
||||
HOLEMENU holemenu, HWND hwndActiveObject)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, hmenuShared);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface,
|
||||
LPCOLESTR pszStatusText)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, debugstr_w(pszStatusText));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fEnable);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg,
|
||||
WORD wID)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p %d)\n", This, lpmsg, wID);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef INPLACEFRAME_THIS
|
||||
|
||||
static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
|
||||
InPlaceFrame_QueryInterface,
|
||||
InPlaceFrame_AddRef,
|
||||
InPlaceFrame_Release,
|
||||
InPlaceFrame_GetWindow,
|
||||
InPlaceFrame_ContextSensitiveHelp,
|
||||
InPlaceFrame_GetBorder,
|
||||
InPlaceFrame_RequestBorderSpace,
|
||||
InPlaceFrame_SetBorderSpace,
|
||||
InPlaceFrame_SetActiveObject,
|
||||
InPlaceFrame_InsertMenus,
|
||||
InPlaceFrame_SetMenu,
|
||||
InPlaceFrame_RemoveMenus,
|
||||
InPlaceFrame_SetStatusText,
|
||||
InPlaceFrame_EnableModeless,
|
||||
InPlaceFrame_TranslateAccelerator
|
||||
};
|
||||
|
||||
void WebBrowser_Frame_Init(WebBrowser *This)
|
||||
{
|
||||
This->lpOleInPlaceFrameVtbl = &OleInPlaceFrameVtbl;
|
||||
}
|
|
@ -29,44 +29,36 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
static ATOM doc_view_atom = 0;
|
||||
static ATOM shell_embedding_atom = 0;
|
||||
|
||||
static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
static LRESULT resize_window(WebBrowser *This, LONG width, LONG height)
|
||||
{
|
||||
return DefWindowProcA(hwnd, msg, wParam, lParam);
|
||||
if(This->doc_view_hwnd)
|
||||
SetWindowPos(This->doc_view_hwnd, NULL, 0, 0, width, height,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return DefWindowProcA(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
WebBrowser *This;
|
||||
|
||||
static void create_doc_view_hwnd(WebBrowser *This)
|
||||
{
|
||||
static const WCHAR wszShell_DocObject_View[] =
|
||||
{'S','h','e','l','l',' ','D','o','c','O','b','j','e','c','t',' ','V','i','e','w',0};
|
||||
static const WCHAR wszTHIS[] = {'T','H','I','S',0};
|
||||
|
||||
if(!doc_view_atom) {
|
||||
static WNDCLASSEXW wndclass = {
|
||||
sizeof(wndclass),
|
||||
CS_PARENTDC,
|
||||
doc_view_proc,
|
||||
0, 0 /* native uses 4*/, NULL, NULL, NULL,
|
||||
(HBRUSH)COLOR_WINDOWFRAME, NULL,
|
||||
wszShell_DocObject_View,
|
||||
NULL
|
||||
};
|
||||
|
||||
wndclass.hInstance = shdocvw_hinstance;
|
||||
|
||||
doc_view_atom = RegisterClassExW(&wndclass);
|
||||
if(msg == WM_CREATE) {
|
||||
This = *(WebBrowser**)lParam;
|
||||
SetPropW(hwnd, wszTHIS, This);
|
||||
}else {
|
||||
This = GetPropW(hwnd, wszTHIS);
|
||||
}
|
||||
|
||||
This->doc_view_hwnd = CreateWindowExW(0, wszShell_DocObject_View, NULL,
|
||||
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP | WS_MAXIMIZEBOX,
|
||||
0, 0, 0, 0, This->shell_embedding_hwnd,
|
||||
NULL, shdocvw_hinstance, This);
|
||||
switch(msg) {
|
||||
case WM_SIZE:
|
||||
return resize_window(This, LOWORD(lParam), HIWORD(lParam));
|
||||
}
|
||||
|
||||
return DefWindowProcA(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
static void create_shell_embedding_hwnd(WebBrowser *This)
|
||||
|
@ -99,12 +91,10 @@ static void create_shell_embedding_hwnd(WebBrowser *This)
|
|||
IOleInPlaceSite_Release(inplace);
|
||||
}
|
||||
|
||||
This->shell_embedding_hwnd = CreateWindowExW(0, wszShellEmbedding, NULL,
|
||||
This->shell_embedding_hwnd = CreateWindowExW(0, wszShellEmbedding, wszShellEmbedding,
|
||||
WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP | WS_MAXIMIZEBOX,
|
||||
0, 0, 0, 0, parent,
|
||||
NULL, shdocvw_hinstance, This);
|
||||
|
||||
create_doc_view_hwnd(This);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -151,7 +141,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
|
|||
This->client = pClientSite;
|
||||
if(!pClientSite)
|
||||
return S_OK;
|
||||
|
||||
|
||||
IOleClientSite_AddRef(pClientSite);
|
||||
|
||||
create_shell_embedding_hwnd(This);
|
||||
|
@ -227,11 +217,14 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tag
|
|||
WebBrowser *This = OLEOBJ_THIS(iface);
|
||||
HRESULT hres;
|
||||
|
||||
static const WCHAR wszitem[] = {'i','t','e','m',0};
|
||||
|
||||
TRACE("(%p)->(%ld %p %p %ld %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent,
|
||||
lprcPosRect);
|
||||
|
||||
switch (iVerb)
|
||||
{
|
||||
case OLEIVERB_SHOW:
|
||||
case OLEIVERB_INPLACEACTIVATE: {
|
||||
IOleInPlaceSite *inplace;
|
||||
|
||||
|
@ -264,7 +257,14 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tag
|
|||
&This->frameinfo);
|
||||
|
||||
|
||||
IOleInPlaceSite_Release(inplace);
|
||||
if(iVerb == OLEIVERB_INPLACEACTIVATE)
|
||||
IOleInPlaceSite_Release(inplace);
|
||||
|
||||
SetWindowPos(This->shell_embedding_hwnd, NULL,
|
||||
This->pos_rect.left, This->pos_rect.top,
|
||||
This->pos_rect.right-This->pos_rect.left,
|
||||
This->pos_rect.bottom-This->pos_rect.top,
|
||||
SWP_NOZORDER | SWP_SHOWWINDOW);
|
||||
|
||||
if(This->client) {
|
||||
IOleClientSite_ShowObject(This->client);
|
||||
|
@ -274,6 +274,20 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tag
|
|||
if(This->frame)
|
||||
IOleInPlaceFrame_GetWindow(This->frame, &This->frame_hwnd);
|
||||
|
||||
if(iVerb == OLEIVERB_INPLACEACTIVATE)
|
||||
return S_OK;
|
||||
|
||||
TRACE("OLEIVERB_SHOW\n");
|
||||
|
||||
IOleInPlaceSite_OnUIActivate(inplace);
|
||||
IOleInPlaceSite_Release(inplace);
|
||||
|
||||
IOleInPlaceFrame_SetActiveObject(This->frame, ACTIVEOBJ(This), wszitem);
|
||||
|
||||
/* TODO:
|
||||
* IOleInPlaceFrmae_SetMenu
|
||||
*/
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
default:
|
||||
|
@ -482,8 +496,18 @@ static HRESULT WINAPI OleInPlaceObject_SetObjectRects(IOleInPlaceObject *iface,
|
|||
LPCRECT lprcPosRect, LPCRECT lprcClipRect)
|
||||
{
|
||||
WebBrowser *This = INPLACEOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
|
||||
|
||||
if(This->shell_embedding_hwnd) {
|
||||
SetWindowPos(This->shell_embedding_hwnd, NULL,
|
||||
lprcPosRect->left, lprcPosRect->top,
|
||||
lprcPosRect->right-lprcPosRect->left,
|
||||
lprcPosRect->bottom-lprcPosRect->top,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI OleInPlaceObject_ReactivateAndUndo(IOleInPlaceObject *iface)
|
||||
|
@ -574,11 +598,102 @@ static const IOleControlVtbl OleControlVtbl =
|
|||
OleControl_FreezeEvents
|
||||
};
|
||||
|
||||
#define ACTIVEOBJ_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceActiveObject, iface)
|
||||
|
||||
static HRESULT WINAPI InPlaceActiveObject_QueryInterface(IOleInPlaceActiveObject *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
return IWebBrowser2_QueryInterface(WEBBROWSER2(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI InPlaceActiveObject_AddRef(IOleInPlaceActiveObject *iface)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
return IWebBrowser2_AddRef(WEBBROWSER2(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI InPlaceActiveObject_Release(IOleInPlaceActiveObject *iface)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
return IWebBrowser2_Release(WEBBROWSER2(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceActiveObject_GetWindow(IOleInPlaceActiveObject *iface,
|
||||
HWND *phwnd)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
return IOleInPlaceObject_GetWindow(INPLACEOBJ(This), phwnd);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceActiveObject_ContextSensitiveHelp(IOleInPlaceActiveObject *iface,
|
||||
BOOL fEnterMode)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
return IOleInPlaceObject_ContextSensitiveHelp(INPLACEOBJ(This), fEnterMode);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceActiveObject_TranslateAccelerator(IOleInPlaceActiveObject *iface,
|
||||
LPMSG lpmsg)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, lpmsg);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceActiveObject *iface,
|
||||
BOOL fActivate)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fActivate);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceActiveObject_OnDocWindowActivate(IOleInPlaceActiveObject *iface,
|
||||
BOOL fActivate)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fActivate);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceActiveObject_ResizeBorder(IOleInPlaceActiveObject *iface,
|
||||
LPCRECT lprcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%p %p %x)\n", This, lprcBorder, pUIWindow, fFrameWindow);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceActiveObject_EnableModeless(IOleInPlaceActiveObject *iface,
|
||||
BOOL fEnable)
|
||||
{
|
||||
WebBrowser *This = ACTIVEOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fEnable);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef ACTIVEOBJ_THIS
|
||||
|
||||
static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
|
||||
InPlaceActiveObject_QueryInterface,
|
||||
InPlaceActiveObject_AddRef,
|
||||
InPlaceActiveObject_Release,
|
||||
InPlaceActiveObject_GetWindow,
|
||||
InPlaceActiveObject_ContextSensitiveHelp,
|
||||
InPlaceActiveObject_TranslateAccelerator,
|
||||
InPlaceActiveObject_OnFrameWindowActivate,
|
||||
InPlaceActiveObject_OnDocWindowActivate,
|
||||
InPlaceActiveObject_ResizeBorder,
|
||||
InPlaceActiveObject_EnableModeless
|
||||
};
|
||||
|
||||
void WebBrowser_OleObject_Init(WebBrowser *This)
|
||||
{
|
||||
This->lpOleObjectVtbl = &OleObjectVtbl;
|
||||
This->lpOleInPlaceObjectVtbl = &OleInPlaceObjectVtbl;
|
||||
This->lpOleControlVtbl = &OleControlVtbl;
|
||||
This->lpOleObjectVtbl = &OleObjectVtbl;
|
||||
This->lpOleInPlaceObjectVtbl = &OleInPlaceObjectVtbl;
|
||||
This->lpOleControlVtbl = &OleControlVtbl;
|
||||
This->lpOleInPlaceActiveObjectVtbl = &OleInPlaceActiveObjectVtbl;
|
||||
|
||||
This->client = NULL;
|
||||
This->container = NULL;
|
||||
|
@ -586,6 +701,7 @@ void WebBrowser_OleObject_Init(WebBrowser *This)
|
|||
This->frame_hwnd = NULL;
|
||||
This->frame = NULL;
|
||||
This->uiwindow = NULL;
|
||||
This->shell_embedding_hwnd = NULL;
|
||||
|
||||
memset(&This->pos_rect, 0, sizeof(RECT));
|
||||
memset(&This->clip_rect, 0, sizeof(RECT));
|
||||
|
|
|
@ -58,6 +58,9 @@ extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
|
|||
/**********************************************************************
|
||||
* WebBrowser declaration for SHDOCVW.DLL
|
||||
*/
|
||||
|
||||
typedef struct ConnectionPoint ConnectionPoint;
|
||||
|
||||
typedef struct {
|
||||
/* Interfaces available via WebBrowser object */
|
||||
|
||||
|
@ -71,12 +74,18 @@ typedef struct {
|
|||
const IQuickActivateVtbl *lpQuickActivateVtbl;
|
||||
const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
|
||||
const IViewObject2Vtbl *lpViewObjectVtbl;
|
||||
const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl;
|
||||
|
||||
/* Interfaces available for embeded document */
|
||||
|
||||
const IOleClientSiteVtbl *lpOleClientSiteVtbl;
|
||||
const IOleInPlaceSiteVtbl *lpOleInPlaceSiteVtbl;
|
||||
const IDocHostUIHandler2Vtbl *lpDocHostUIHandlerVtbl;
|
||||
const IOleDocumentSiteVtbl *lpOleDocumentSiteVtbl;
|
||||
|
||||
/* Interfaces of InPlaceFrame object */
|
||||
|
||||
const IOleInPlaceFrameVtbl *lpOleInPlaceFrameVtbl;
|
||||
|
||||
LONG ref;
|
||||
|
||||
|
@ -84,6 +93,9 @@ typedef struct {
|
|||
|
||||
IOleClientSite *client;
|
||||
IOleContainer *container;
|
||||
IOleDocumentView *view;
|
||||
|
||||
LPOLESTR url;
|
||||
|
||||
/* window context */
|
||||
|
||||
|
@ -100,9 +112,9 @@ typedef struct {
|
|||
|
||||
/* Connection points */
|
||||
|
||||
IConnectionPoint *cp_wbe2;
|
||||
IConnectionPoint *cp_wbe;
|
||||
IConnectionPoint *cp_pns;
|
||||
ConnectionPoint *cp_wbe2;
|
||||
ConnectionPoint *cp_wbe;
|
||||
ConnectionPoint *cp_pns;
|
||||
} WebBrowser;
|
||||
|
||||
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
|
||||
|
@ -117,11 +129,15 @@ typedef struct {
|
|||
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
|
||||
#define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
|
||||
#define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
|
||||
#define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
|
||||
|
||||
#define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpOleClientSiteVtbl)
|
||||
#define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl)
|
||||
#define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpDocHostUIHandlerVtbl)
|
||||
#define DOCHOSTUI2(x) ((IDocHostUIHandler2*) &(x)->lpDocHostUIHandlerVtbl)
|
||||
#define DOCSITE(x) ((IOleDocumentSite*) &(x)->lpOleDocumentSiteVtbl)
|
||||
|
||||
#define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
|
||||
|
||||
void WebBrowser_OleObject_Init(WebBrowser*);
|
||||
void WebBrowser_ViewObject_Init(WebBrowser*);
|
||||
|
@ -133,11 +149,19 @@ void WebBrowser_Events_Init(WebBrowser*);
|
|||
void WebBrowser_ClientSite_Init(WebBrowser*);
|
||||
void WebBrowser_DocHost_Init(WebBrowser*);
|
||||
|
||||
void WebBrowser_Frame_Init(WebBrowser*);
|
||||
|
||||
void WebBrowser_OleObject_Destroy(WebBrowser*);
|
||||
void WebBrowser_Events_Destroy(WebBrowser*);
|
||||
void WebBrowser_ClientSite_Destroy(WebBrowser*);
|
||||
|
||||
HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
|
||||
|
||||
void create_doc_view_hwnd(WebBrowser *This);
|
||||
void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
|
||||
|
||||
#define WB_WM_NAVIGATE2 (WM_USER+100)
|
||||
|
||||
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
<file>dochost.c</file>
|
||||
<file>events.c</file>
|
||||
<file>factory.c</file>
|
||||
<file>frame.c</file>
|
||||
<file>misc.c</file>
|
||||
<file>oleobject.c</file>
|
||||
<file>persist.c</file>
|
||||
|
|
|
@ -94,6 +94,9 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid
|
|||
}else if(IsEqualGUID(&IID_IViewObject2, riid)) {
|
||||
TRACE("(%p)->(IID_IViewObject2 %p)\n", This, ppv);
|
||||
*ppv = VIEWOBJ2(This);
|
||||
}else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
|
||||
TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This, ppv);
|
||||
*ppv = ACTIVEOBJ(This);
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
|
@ -126,7 +129,9 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
|
|||
|
||||
WebBrowser_OleObject_Destroy(This);
|
||||
WebBrowser_Events_Destroy(This);
|
||||
WebBrowser_ClientSite_Destroy(This);
|
||||
|
||||
SysFreeString(This->url);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
SHDOCVW_UnlockModule();
|
||||
}
|
||||
|
@ -255,8 +260,14 @@ static HRESULT WINAPI WebBrowser_get_Container(IWebBrowser2 *iface, IDispatch **
|
|||
static HRESULT WINAPI WebBrowser_get_Document(IWebBrowser2 *iface, IDispatch **ppDisp)
|
||||
{
|
||||
WebBrowser *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, ppDisp);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, ppDisp);
|
||||
|
||||
*ppDisp = NULL;
|
||||
if(This->document)
|
||||
IUnknown_QueryInterface(This->document, &IID_IDispatch, (void**)ppDisp);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI WebBrowser_get_TopLevelContainer(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
||||
|
@ -504,12 +515,19 @@ static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VA
|
|||
if(!This->client)
|
||||
return E_FAIL;
|
||||
|
||||
if(V_VT(Flags) != VT_EMPTY || V_VT(TargetFrameName) != VT_EMPTY
|
||||
|| V_VT(PostData) != VT_EMPTY || V_VT(Headers) != VT_EMPTY)
|
||||
if((Flags && V_VT(Flags) != VT_EMPTY)
|
||||
|| (TargetFrameName && V_VT(TargetFrameName) != VT_EMPTY)
|
||||
|| (PostData && V_VT(PostData) != VT_EMPTY)
|
||||
|| (Headers && V_VT(Headers) != VT_EMPTY))
|
||||
FIXME("Unsupported arguments\n");
|
||||
|
||||
if(!URL)
|
||||
return S_OK;
|
||||
if(V_VT(URL) != VT_BSTR)
|
||||
FIXME("V_VT(URL) != VT_BSTR\n");
|
||||
return E_INVALIDARG;
|
||||
|
||||
if(!This->doc_view_hwnd)
|
||||
create_doc_view_hwnd(This);
|
||||
|
||||
/*
|
||||
* FIXME:
|
||||
|
@ -543,6 +561,8 @@ static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VA
|
|||
return hres;
|
||||
}
|
||||
|
||||
This->url = SysAllocString(V_BSTR(URL));
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
@ -550,6 +570,8 @@ static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VA
|
|||
hres = IOleObject_SetClientSite(oleobj, CLIENTSITE(This));
|
||||
IOleObject_Release(oleobj);
|
||||
|
||||
PostMessageW(This->doc_view_hwnd, WB_WM_NAVIGATE2, 0, 0);
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
|
@ -775,6 +797,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
|
|||
ret->ref = 0;
|
||||
|
||||
ret->document = NULL;
|
||||
ret->url = NULL;
|
||||
|
||||
WebBrowser_OleObject_Init(ret);
|
||||
WebBrowser_ViewObject_Init(ret);
|
||||
|
@ -784,6 +807,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
|
|||
WebBrowser_Events_Init(ret);
|
||||
WebBrowser_ClientSite_Init(ret);
|
||||
WebBrowser_DocHost_Init(ret);
|
||||
WebBrowser_Frame_Init(ret);
|
||||
|
||||
hres = IWebBrowser_QueryInterface(WEBBROWSER(ret), riid, ppv);
|
||||
if(SUCCEEDED(hres)) {
|
||||
|
|
|
@ -47,6 +47,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
|
|||
#include "docobj.h"
|
||||
#include "exdisp.h"
|
||||
|
||||
#include "hlink.h"
|
||||
#include "shlguid.h"
|
||||
#include "shlobj.h"
|
||||
#include "shldisp.h"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#define DISPID_BEFORENAVIGATE2 250
|
||||
#define DISPID_NEWWINDOW2 251
|
||||
#define DISPID_NAVIGATECOMPLETE2 252
|
||||
#define DISPID_PROGRESSCHANGE 108
|
||||
#define DISPID_DOCUMENTCOMPLETE 259
|
||||
#define DISPID_STATUSTEXTCHANGE 102
|
||||
|
|
1330
reactos/w32api/include/hlink.h
Normal file
1330
reactos/w32api/include/hlink.h
Normal file
File diff suppressed because it is too large
Load diff
|
@ -80,10 +80,6 @@ typedef struct tagRemSTGMEDIUM {
|
|||
unsigned long cbData;
|
||||
BYTE data[1];
|
||||
} RemSTGMEDIUM;
|
||||
typedef struct tagHLITEM {
|
||||
ULONG uHLID;
|
||||
LPWSTR pwzFriendlyName;
|
||||
} HLITEM;
|
||||
typedef struct tagSTATDATA {
|
||||
FORMATETC formatetc;
|
||||
DWORD grfAdvf;
|
||||
|
@ -416,7 +412,6 @@ EXTERN_C const FMTID FMTID_DocSummaryInformation;
|
|||
EXTERN_C const FMTID FMTID_UserDefinedProperties;
|
||||
|
||||
DECLARE_ENUMERATOR(FORMATETC);
|
||||
DECLARE_ENUMERATOR(HLITEM);
|
||||
DECLARE_ENUMERATOR(STATDATA);
|
||||
DECLARE_ENUMERATOR(STATPROPSETSTG);
|
||||
DECLARE_ENUMERATOR(STATPROPSTG);
|
||||
|
|
|
@ -318,6 +318,21 @@ DECLARE_INTERFACE_(IOleInPlaceObject,IOleWindow)
|
|||
};
|
||||
#undef INTERFACE
|
||||
|
||||
#ifdef COBJMACROS
|
||||
/*** IUnknown methods ***/
|
||||
#define IOleInPlaceObject_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IOleInPlaceObject_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IOleInPlaceObject_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IOleWindow methods ***/
|
||||
#define IOleInPlaceObject_GetWindow(p,a) (p)->lpVtbl->GetWindow(p,a)
|
||||
#define IOleInPlaceObject_ContextSensitiveHelp(p,a) (p)->lpVtbl->ContextSensitiveHelp(p,a)
|
||||
/*** IOleInPlaceObject methods ***/
|
||||
#define IOleInPlaceObject_InPlaceDeactivate(p) (p)->lpVtbl->InPlaceDeactivate(p)
|
||||
#define IOleInPlaceObject_UIDeactivate(p) (p)->lpVtbl->UIDeactivate(p)
|
||||
#define IOleInPlaceObject_SetObjectRects(p,a,b) (p)->lpVtbl->SetObjectRects(p,a,b)
|
||||
#define IOleInPlaceObject_ReactivateAndUndo(p) (p)->lpVtbl->ReactivateAndUndo(p)
|
||||
#endif
|
||||
|
||||
EXTERN_C const IID IID_IOleInPlaceActiveObject;
|
||||
#define INTERFACE IOleInPlaceActiveObject
|
||||
DECLARE_INTERFACE_(IOleInPlaceActiveObject,IOleWindow)
|
||||
|
|
Loading…
Reference in a new issue