Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2dab3d4c
Commit
2dab3d4c
authored
Apr 18, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw: Move IOleClientSite to new DocHost object to allow sharing
code between WebBrowser and InternetExplorer.
parent
02a9bc00
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
44 deletions
+59
-44
client.c
dlls/shdocvw/client.c
+38
-36
dochost.c
dlls/shdocvw/dochost.c
+5
-5
navigate.c
dlls/shdocvw/navigate.c
+2
-2
shdocvw.h
dlls/shdocvw/shdocvw.h
+12
-1
webbrowser.c
dlls/shdocvw/webbrowser.c
+2
-0
No files found.
dlls/shdocvw/client.c
View file @
2dab3d4c
...
...
@@ -21,11 +21,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
shdocvw
);
#define CLIENTSITE_THIS(iface) DEFINE_THIS(
WebBrowser
, OleClientSite, iface)
#define CLIENTSITE_THIS(iface) DEFINE_THIS(
DocHost
, OleClientSite, iface)
static
HRESULT
WINAPI
ClientSite_QueryInterface
(
IOleClientSite
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
*
ppv
=
NULL
;
...
...
@@ -37,32 +37,32 @@ static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID ri
*
ppv
=
CLIENTSITE
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleWindow
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleWindow %p)
\n
"
,
This
,
ppv
);
*
ppv
=
INPLACESITE
(
This
);
*
ppv
=
INPLACESITE
(
This
->
wb
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleInPlaceSite
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleInPlaceSite %p)
\n
"
,
This
,
ppv
);
*
ppv
=
INPLACESITE
(
This
);
*
ppv
=
INPLACESITE
(
This
->
wb
);
}
else
if
(
IsEqualGUID
(
&
IID_IDocHostUIHandler
,
riid
))
{
TRACE
(
"(%p)->(IID_IDocHostUIHandler %p)
\n
"
,
This
,
ppv
);
*
ppv
=
DOCHOSTUI
(
This
);
*
ppv
=
DOCHOSTUI
(
This
->
wb
);
}
else
if
(
IsEqualGUID
(
&
IID_IDocHostUIHandler2
,
riid
))
{
TRACE
(
"(%p)->(IID_IDocHostUIHandler2 %p)
\n
"
,
This
,
ppv
);
*
ppv
=
DOCHOSTUI2
(
This
);
*
ppv
=
DOCHOSTUI2
(
This
->
wb
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleDocumentSite
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleDocumentSite %p)
\n
"
,
This
,
ppv
);
*
ppv
=
DOCSITE
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleC
lientSite
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleC
lientSite
%p)
\n
"
,
This
,
ppv
);
*
ppv
=
CLOLECMD
(
This
);
*
ppv
=
DOCSITE
(
This
->
wb
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleC
ommandTarget
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleC
ommandTarget
%p)
\n
"
,
This
,
ppv
);
*
ppv
=
CLOLECMD
(
This
->
wb
);
}
else
if
(
IsEqualGUID
(
&
IID_IDispatch
,
riid
))
{
TRACE
(
"(%p)->(IID_IDispatch %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CLDISP
(
This
);
*
ppv
=
CLDISP
(
This
->
wb
);
}
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
{
TRACE
(
"(%p)->(IID_IServiceProvider %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CLSERVPROV
(
This
);
*
ppv
=
CLSERVPROV
(
This
->
wb
);
}
if
(
*
ppv
)
{
I
WebBrowser2_AddRef
(
WEBBROWSER
(
This
));
I
OleClientSite_AddRef
(
CLIENTSITE
(
This
));
return
S_OK
;
}
...
...
@@ -73,19 +73,19 @@ static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID ri
static
ULONG
WINAPI
ClientSite_AddRef
(
IOleClientSite
*
iface
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
return
I
WebBrowser2_AddRef
(
WEBBROWSER
(
This
)
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
return
I
Dispatch_AddRef
(
This
->
disp
);
}
static
ULONG
WINAPI
ClientSite_Release
(
IOleClientSite
*
iface
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
return
I
WebBrowser2_Release
(
WEBBROWSER
(
This
)
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
return
I
Dispatch_Release
(
This
->
disp
);
}
static
HRESULT
WINAPI
ClientSite_SaveObject
(
IOleClientSite
*
iface
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
...
...
@@ -93,35 +93,35 @@ static HRESULT WINAPI ClientSite_SaveObject(IOleClientSite *iface)
static
HRESULT
WINAPI
ClientSite_GetMoniker
(
IOleClientSite
*
iface
,
DWORD
dwAssign
,
DWORD
dwWhichMoniker
,
IMoniker
**
ppmk
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
FIXME
(
"(%p)->(%ld %ld %p)
\n
"
,
This
,
dwAssign
,
dwWhichMoniker
,
ppmk
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ClientSite_GetContainer
(
IOleClientSite
*
iface
,
IOleContainer
**
ppContainer
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
ppContainer
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ClientSite_ShowObject
(
IOleClientSite
*
iface
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ClientSite_OnShowWindow
(
IOleClientSite
*
iface
,
BOOL
fShow
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
FIXME
(
"(%p)->(%x)
\n
"
,
This
,
fShow
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ClientSite_RequestNewObjectLayout
(
IOleClientSite
*
iface
)
{
WebBrowser
*
This
=
CLIENTSITE_THIS
(
iface
);
DocHost
*
This
=
CLIENTSITE_THIS
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
...
...
@@ -145,19 +145,19 @@ static const IOleClientSiteVtbl OleClientSiteVtbl = {
static
HRESULT
WINAPI
InPlaceSite_QueryInterface
(
IOleInPlaceSite
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
WebBrowser
*
This
=
INPLACESITE_THIS
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
),
riid
,
ppv
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
&
This
->
doc_host
),
riid
,
ppv
);
}
static
ULONG
WINAPI
InPlaceSite_AddRef
(
IOleInPlaceSite
*
iface
)
{
WebBrowser
*
This
=
INPLACESITE_THIS
(
iface
);
return
IOleClientSite_AddRef
(
CLIENTSITE
(
This
));
return
IOleClientSite_AddRef
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
ULONG
WINAPI
InPlaceSite_Release
(
IOleInPlaceSite
*
iface
)
{
WebBrowser
*
This
=
INPLACESITE_THIS
(
iface
);
return
IOleClientSite_Release
(
CLIENTSITE
(
This
));
return
IOleClientSite_Release
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
HRESULT
WINAPI
InPlaceSite_GetWindow
(
IOleInPlaceSite
*
iface
,
HWND
*
phwnd
)
...
...
@@ -298,19 +298,19 @@ static HRESULT WINAPI OleDocumentSite_QueryInterface(IOleDocumentSite *iface,
REFIID
riid
,
void
**
ppv
)
{
WebBrowser
*
This
=
DOCSITE_THIS
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
),
riid
,
ppv
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
&
This
->
doc_host
),
riid
,
ppv
);
}
static
ULONG
WINAPI
OleDocumentSite_AddRef
(
IOleDocumentSite
*
iface
)
{
WebBrowser
*
This
=
DOCSITE_THIS
(
iface
);
return
IOleClientSite_AddRef
(
CLIENTSITE
(
This
));
return
IOleClientSite_AddRef
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
ULONG
WINAPI
OleDocumentSite_Release
(
IOleDocumentSite
*
iface
)
{
WebBrowser
*
This
=
DOCSITE_THIS
(
iface
);
return
IOleClientSite_Release
(
CLIENTSITE
(
This
));
return
IOleClientSite_Release
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
HRESULT
WINAPI
OleDocumentSite_ActivateMe
(
IOleDocumentSite
*
iface
,
...
...
@@ -352,19 +352,19 @@ static const IOleDocumentSiteVtbl OleDocumentSiteVtbl = {
static
HRESULT
WINAPI
ClDispatch_QueryInterface
(
IDispatch
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
WebBrowser
*
This
=
DISP_THIS
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
),
riid
,
ppv
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
&
This
->
doc_host
),
riid
,
ppv
);
}
static
ULONG
WINAPI
ClDispatch_AddRef
(
IDispatch
*
iface
)
{
WebBrowser
*
This
=
DISP_THIS
(
iface
);
return
I
WebBrowser2_AddRef
(
WEBBROWSER
(
This
));
return
I
OleClientSite_AddRef
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
ULONG
WINAPI
ClDispatch_Release
(
IDispatch
*
iface
)
{
WebBrowser
*
This
=
DISP_THIS
(
iface
);
return
I
WebBrowser2_Release
(
WEBBROWSER
(
This
));
return
I
OleClientSite_Release
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
HRESULT
WINAPI
ClDispatch_GetTypeInfoCount
(
IDispatch
*
iface
,
UINT
*
pctinfo
)
...
...
@@ -425,19 +425,19 @@ static HRESULT WINAPI ClServiceProvider_QueryInterface(IServiceProvider *iface,
void
**
ppv
)
{
WebBrowser
*
This
=
SERVPROV_THIS
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
),
riid
,
ppv
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
&
This
->
doc_host
),
riid
,
ppv
);
}
static
ULONG
WINAPI
ClServiceProvider_AddRef
(
IServiceProvider
*
iface
)
{
WebBrowser
*
This
=
SERVPROV_THIS
(
iface
);
return
I
WebBrowser2_AddRef
(
WEBBROWSER2
(
This
));
return
I
OleClientSite_AddRef
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
ULONG
WINAPI
ClServiceProvider_Release
(
IServiceProvider
*
iface
)
{
WebBrowser
*
This
=
SERVPROV_THIS
(
iface
);
return
I
WebBrowser2_Release
(
WEBBROWSER2
(
This
));
return
I
OleClientSite_Release
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
HRESULT
WINAPI
ClServiceProvider_QueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
...
...
@@ -466,13 +466,15 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
void
WebBrowser_ClientSite_Init
(
WebBrowser
*
This
)
{
This
->
lpOleClientSiteVtbl
=
&
OleClientSiteVtbl
;
This
->
doc_host
.
lpOleClientSiteVtbl
=
&
OleClientSiteVtbl
;
This
->
lpOleInPlaceSiteVtbl
=
&
OleInPlaceSiteVtbl
;
This
->
lpOleDocumentSiteVtbl
=
&
OleDocumentSiteVtbl
;
This
->
lpDispatchVtbl
=
&
DispatchVtbl
;
This
->
lpClServiceProviderVtbl
=
&
ServiceProviderVtbl
;
This
->
view
=
NULL
;
This
->
doc_host
.
wb
=
This
;
}
void
WebBrowser_ClientSite_Destroy
(
WebBrowser
*
This
)
...
...
dlls/shdocvw/dochost.c
View file @
2dab3d4c
...
...
@@ -194,7 +194,7 @@ void deactivate_document(WebBrowser *This)
IOleObject_GetClientSite
(
oleobj
,
&
client_site
);
if
(
client_site
)
{
if
(
client_site
==
CLIENTSITE
(
This
))
if
(
client_site
==
CLIENTSITE
(
&
This
->
doc_host
))
IOleObject_SetClientSite
(
oleobj
,
NULL
);
IOleClientSite_Release
(
client_site
);
}
...
...
@@ -212,7 +212,7 @@ static HRESULT WINAPI ClOleCommandTarget_QueryInterface(IOleCommandTarget *iface
REFIID
riid
,
void
**
ppv
)
{
WebBrowser
*
This
=
OLECMD_THIS
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
),
riid
,
ppv
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
&
This
->
doc_host
),
riid
,
ppv
);
}
static
ULONG
WINAPI
ClOleCommandTarget_AddRef
(
IOleCommandTarget
*
iface
)
...
...
@@ -262,19 +262,19 @@ static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface,
REFIID
riid
,
void
**
ppv
)
{
WebBrowser
*
This
=
DOCHOSTUI_THIS
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
),
riid
,
ppv
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
&
This
->
doc_host
),
riid
,
ppv
);
}
static
ULONG
WINAPI
DocHostUIHandler_AddRef
(
IDocHostUIHandler2
*
iface
)
{
WebBrowser
*
This
=
DOCHOSTUI_THIS
(
iface
);
return
IOleClientSite_AddRef
(
CLIENTSITE
(
This
));
return
IOleClientSite_AddRef
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
ULONG
WINAPI
DocHostUIHandler_Release
(
IDocHostUIHandler2
*
iface
)
{
WebBrowser
*
This
=
DOCHOSTUI_THIS
(
iface
);
return
IOleClientSite_Release
(
CLIENTSITE
(
This
));
return
IOleClientSite_Release
(
CLIENTSITE
(
&
This
->
doc_host
));
}
static
HRESULT
WINAPI
DocHostUIHandler_ShowContextMenu
(
IDocHostUIHandler2
*
iface
,
...
...
dlls/shdocvw/navigate.c
View file @
2dab3d4c
...
...
@@ -392,7 +392,7 @@ static HRESULT navigate(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx,
}
IBindCtx_RegisterObjectParam
(
bindctx
,
(
LPOLESTR
)
SZ_HTML_CLIENTSITE_OBJECTPARAM
,
(
IUnknown
*
)
CLIENTSITE
(
This
));
(
IUnknown
*
)
CLIENTSITE
(
&
This
->
doc_host
));
/*
* FIXME:
...
...
@@ -432,7 +432,7 @@ static HRESULT navigate(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx,
if
(
FAILED
(
hres
))
return
hres
;
hres
=
IOleObject_SetClientSite
(
oleobj
,
CLIENTSITE
(
This
));
hres
=
IOleObject_SetClientSite
(
oleobj
,
CLIENTSITE
(
&
This
->
doc_host
));
IOleObject_Release
(
oleobj
);
PostMessageW
(
This
->
doc_view_hwnd
,
WB_WM_NAVIGATE2
,
0
,
0
);
...
...
dlls/shdocvw/shdocvw.h
View file @
2dab3d4c
...
...
@@ -51,7 +51,17 @@ extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
typedef
struct
ConnectionPoint
ConnectionPoint
;
struct
WebBrowser
;
typedef
struct
{
const
IOleClientSiteVtbl
*
lpOleClientSiteVtbl
;
IDispatch
*
disp
;
struct
WebBrowser
*
wb
;
/* FIXME */
}
DocHost
;
typedef
struct
WebBrowser
{
/* Interfaces available via WebBrowser object */
const
IWebBrowser2Vtbl
*
lpWebBrowser2Vtbl
;
...
...
@@ -69,7 +79,6 @@ typedef struct {
/* Interfaces available for embeded document */
const
IOleClientSiteVtbl
*
lpOleClientSiteVtbl
;
const
IOleInPlaceSiteVtbl
*
lpOleInPlaceSiteVtbl
;
const
IDocHostUIHandler2Vtbl
*
lpDocHostUIHandlerVtbl
;
const
IOleDocumentSiteVtbl
*
lpOleDocumentSiteVtbl
;
...
...
@@ -111,6 +120,8 @@ typedef struct {
ConnectionPoint
*
cp_wbe2
;
ConnectionPoint
*
cp_wbe
;
ConnectionPoint
*
cp_pns
;
DocHost
doc_host
;
}
WebBrowser
;
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
...
...
dlls/shdocvw/webbrowser.c
View file @
2dab3d4c
...
...
@@ -847,6 +847,8 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret
->
document
=
NULL
;
ret
->
url
=
NULL
;
ret
->
doc_host
.
disp
=
(
IDispatch
*
)
WEBBROWSER2
(
ret
);
WebBrowser_OleObject_Init
(
ret
);
WebBrowser_ViewObject_Init
(
ret
);
WebBrowser_Persist_Init
(
ret
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment