Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
72c53293
Commit
72c53293
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 IOleDocumentSite to DocHost object.
parent
ff7a8abb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
47 deletions
+46
-47
client.c
dlls/shdocvw/client.c
+15
-15
dochost.c
dlls/shdocvw/dochost.c
+19
-18
navigate.c
dlls/shdocvw/navigate.c
+4
-4
oleobject.c
dlls/shdocvw/oleobject.c
+1
-1
shdocvw.h
dlls/shdocvw/shdocvw.h
+3
-4
webbrowser.c
dlls/shdocvw/webbrowser.c
+4
-5
No files found.
dlls/shdocvw/client.c
View file @
72c53293
...
...
@@ -49,7 +49,7 @@ static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID ri
*
ppv
=
DOCHOSTUI2
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleDocumentSite
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleDocumentSite %p)
\n
"
,
This
,
ppv
);
*
ppv
=
DOCSITE
(
This
->
wb
);
*
ppv
=
DOCSITE
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IOleCommandTarget
,
riid
))
{
TRACE
(
"(%p)->(IID_IOleCommandTarget %p)
\n
"
,
This
,
ppv
);
*
ppv
=
CLOLECMD
(
This
->
wb
);
...
...
@@ -292,31 +292,31 @@ static const IOleInPlaceSiteVtbl OleInPlaceSiteVtbl = {
InPlaceSite_OnPosRectChange
};
#define DOCSITE_THIS(iface) DEFINE_THIS(
WebBrowser
, OleDocumentSite, iface)
#define DOCSITE_THIS(iface) DEFINE_THIS(
DocHost
, OleDocumentSite, iface)
static
HRESULT
WINAPI
OleDocumentSite_QueryInterface
(
IOleDocumentSite
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
WebBrowser
*
This
=
DOCSITE_THIS
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
&
This
->
doc_host
),
riid
,
ppv
);
DocHost
*
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
->
doc_host
));
DocHost
*
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
->
doc_host
));
DocHost
*
This
=
DOCSITE_THIS
(
iface
);
return
IOleClientSite_Release
(
CLIENTSITE
(
This
));
}
static
HRESULT
WINAPI
OleDocumentSite_ActivateMe
(
IOleDocumentSite
*
iface
,
IOleDocumentView
*
pViewToActivate
)
{
WebBrowser
*
This
=
DOCSITE_THIS
(
iface
);
DocHost
*
This
=
DOCSITE_THIS
(
iface
);
IOleDocument
*
oledoc
;
RECT
rect
;
HRESULT
hres
;
...
...
@@ -327,10 +327,10 @@ static HRESULT WINAPI OleDocumentSite_ActivateMe(IOleDocumentSite *iface,
if
(
FAILED
(
hres
))
return
hres
;
IOleDocument_CreateView
(
oledoc
,
INPLACESITE
(
&
This
->
doc_host
),
NULL
,
0
,
&
This
->
view
);
IOleDocument_CreateView
(
oledoc
,
INPLACESITE
(
This
),
NULL
,
0
,
&
This
->
view
);
IOleDocument_Release
(
oledoc
);
GetClientRect
(
This
->
doc_host
.
hwnd
,
&
rect
);
GetClientRect
(
This
->
hwnd
,
&
rect
);
IOleDocumentView_SetRect
(
This
->
view
,
&
rect
);
hres
=
IOleDocumentView_Show
(
This
->
view
,
TRUE
);
...
...
@@ -468,17 +468,17 @@ void WebBrowser_ClientSite_Init(WebBrowser *This)
{
This
->
doc_host
.
lpOleClientSiteVtbl
=
&
OleClientSiteVtbl
;
This
->
doc_host
.
lpOleInPlaceSiteVtbl
=
&
OleInPlaceSiteVtbl
;
This
->
lpOleDocumentSiteVtbl
=
&
OleDocumentSiteVtbl
;
This
->
doc_host
.
lpOleDocumentSiteVtbl
=
&
OleDocumentSiteVtbl
;
This
->
lpDispatchVtbl
=
&
DispatchVtbl
;
This
->
lpClServiceProviderVtbl
=
&
ServiceProviderVtbl
;
This
->
view
=
NULL
;
This
->
doc_host
.
view
=
NULL
;
This
->
doc_host
.
wb
=
This
;
}
void
WebBrowser_ClientSite_Destroy
(
WebBrowser
*
This
)
{
if
(
This
->
view
)
IOleDocumentView_Release
(
This
->
view
);
if
(
This
->
doc_host
.
view
)
IOleDocumentView_Release
(
This
->
doc_host
.
view
);
}
dlls/shdocvw/dochost.c
View file @
72c53293
...
...
@@ -33,7 +33,7 @@ static void navigate_complete(WebBrowser *This)
VARIANT
url
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
hres
=
IUnknown_QueryInterface
(
This
->
doc
_host
.
doc
ument
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
if
(
FAILED
(
hres
))
FIXME
(
"Could not get IDispatch interface
\n
"
);
...
...
@@ -65,12 +65,12 @@ static LRESULT navigate2(WebBrowser *This)
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
This
->
document
)
{
if
(
!
This
->
doc
_host
.
doc
ument
)
{
WARN
(
"document == NULL
\n
"
);
return
0
;
}
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IHlinkTarget
,
(
void
**
)
&
hlink
);
hres
=
IUnknown_QueryInterface
(
This
->
doc
_host
.
doc
ument
,
&
IID_IHlinkTarget
,
(
void
**
)
&
hlink
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Could not get IHlinkTarget interface
\n
"
);
return
0
;
...
...
@@ -94,8 +94,8 @@ static LRESULT resize_document(WebBrowser *This, LONG width, LONG height)
TRACE
(
"(%p)->(%ld %ld)
\n
"
,
This
,
width
,
height
);
if
(
This
->
view
)
IOleDocumentView_SetRect
(
This
->
view
,
&
rect
);
if
(
This
->
doc_host
.
view
)
IOleDocumentView_SetRect
(
This
->
doc_host
.
view
,
&
rect
);
return
0
;
}
...
...
@@ -161,29 +161,29 @@ void deactivate_document(WebBrowser *This)
IHlinkTarget
*
hlink
=
NULL
;
HRESULT
hres
;
if
(
This
->
view
)
IOleDocumentView_UIActivate
(
This
->
view
,
FALSE
);
if
(
This
->
doc_host
.
view
)
IOleDocumentView_UIActivate
(
This
->
doc_host
.
view
,
FALSE
);
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IOleInPlaceObjectWindowless
,
hres
=
IUnknown_QueryInterface
(
This
->
doc
_host
.
doc
ument
,
&
IID_IOleInPlaceObjectWindowless
,
(
void
**
)
&
winobj
);
if
(
SUCCEEDED
(
hres
))
{
IOleInPlaceObjectWindowless_InPlaceDeactivate
(
winobj
);
IOleInPlaceObjectWindowless_Release
(
winobj
);
}
if
(
This
->
view
)
{
IOleDocumentView_Show
(
This
->
view
,
FALSE
);
IOleDocumentView_CloseView
(
This
->
view
,
0
);
IOleDocumentView_SetInPlaceSite
(
This
->
view
,
NULL
);
IOleDocumentView_Release
(
This
->
view
);
This
->
view
=
NULL
;
if
(
This
->
doc_host
.
view
)
{
IOleDocumentView_Show
(
This
->
doc_host
.
view
,
FALSE
);
IOleDocumentView_CloseView
(
This
->
doc_host
.
view
,
0
);
IOleDocumentView_SetInPlaceSite
(
This
->
doc_host
.
view
,
NULL
);
IOleDocumentView_Release
(
This
->
doc_host
.
view
);
This
->
doc_host
.
view
=
NULL
;
}
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
hres
=
IUnknown_QueryInterface
(
This
->
doc
_host
.
doc
ument
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
if
(
SUCCEEDED
(
hres
))
IOleObject_Close
(
oleobj
,
OLECLOSE_NOSAVE
);
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IHlinkTarget
,
(
void
**
)
&
hlink
);
hres
=
IUnknown_QueryInterface
(
This
->
doc
_host
.
doc
ument
,
&
IID_IHlinkTarget
,
(
void
**
)
&
hlink
);
if
(
SUCCEEDED
(
hres
))
{
IHlinkTarget_SetBrowseContext
(
hlink
,
NULL
);
IHlinkTarget_Release
(
hlink
);
...
...
@@ -202,8 +202,8 @@ void deactivate_document(WebBrowser *This)
IOleObject_Release
(
oleobj
);
}
IUnknown_Release
(
This
->
document
);
This
->
document
=
NULL
;
IUnknown_Release
(
This
->
doc
_host
.
doc
ument
);
This
->
doc
_host
.
doc
ument
=
NULL
;
}
#define OLECMD_THIS(iface) DEFINE_THIS(WebBrowser, ClOleCommandTarget, iface)
...
...
@@ -483,6 +483,7 @@ void WebBrowser_DocHost_Init(WebBrowser *This)
This
->
doc_host
.
lpDocHostUIHandlerVtbl
=
&
DocHostUIHandler2Vtbl
;
This
->
lpClOleCommandTargetVtbl
=
&
OleCommandTargetVtbl
;
This
->
doc_host
.
document
=
NULL
;
This
->
doc_host
.
hostui
=
NULL
;
This
->
doc_host
.
hwnd
=
NULL
;
...
...
dlls/shdocvw/navigate.c
View file @
72c53293
...
...
@@ -400,19 +400,19 @@ static HRESULT navigate(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx,
* This should be fixed when mshtml.dll and urlmon.dll will be good enough.
*/
if
(
This
->
document
)
if
(
This
->
doc
_host
.
doc
ument
)
deactivate_document
(
This
);
hres
=
CoCreateInstance
(
&
CLSID_HTMLDocument
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IUnknown
,
(
void
**
)
&
This
->
document
);
&
IID_IUnknown
,
(
void
**
)
&
This
->
doc
_host
.
doc
ument
);
if
(
FAILED
(
hres
))
{
ERR
(
"Could not create HTMLDocument: %08lx
\n
"
,
hres
);
return
hres
;
}
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IPersistMoniker
,
(
void
**
)
&
persist
);
hres
=
IUnknown_QueryInterface
(
This
->
doc
_host
.
doc
ument
,
&
IID_IPersistMoniker
,
(
void
**
)
&
persist
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -428,7 +428,7 @@ static HRESULT navigate(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx,
return
hres
;
}
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
hres
=
IUnknown_QueryInterface
(
This
->
doc
_host
.
doc
ument
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/shdocvw/oleobject.c
View file @
72c53293
...
...
@@ -153,7 +153,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
IOleClientSite_Release
(
This
->
client
);
if
(
!
pClientSite
)
{
if
(
This
->
document
)
if
(
This
->
doc
_host
.
doc
ument
)
deactivate_document
(
This
);
This
->
client
=
NULL
;
return
S_OK
;
...
...
dlls/shdocvw/shdocvw.h
View file @
72c53293
...
...
@@ -57,9 +57,12 @@ typedef struct {
const
IOleClientSiteVtbl
*
lpOleClientSiteVtbl
;
const
IOleInPlaceSiteVtbl
*
lpOleInPlaceSiteVtbl
;
const
IDocHostUIHandler2Vtbl
*
lpDocHostUIHandlerVtbl
;
const
IOleDocumentSiteVtbl
*
lpOleDocumentSiteVtbl
;
IDispatch
*
disp
;
IUnknown
*
document
;
IOleDocumentView
*
view
;
IDocHostUIHandler
*
hostui
;
HWND
hwnd
;
...
...
@@ -86,7 +89,6 @@ typedef struct WebBrowser {
/* Interfaces available for embeded document */
const
IOleDocumentSiteVtbl
*
lpOleDocumentSiteVtbl
;
const
IOleCommandTargetVtbl
*
lpClOleCommandTargetVtbl
;
const
IDispatchVtbl
*
lpDispatchVtbl
;
const
IServiceProviderVtbl
*
lpClServiceProviderVtbl
;
...
...
@@ -97,11 +99,8 @@ typedef struct WebBrowser {
LONG
ref
;
IUnknown
*
document
;
IOleClientSite
*
client
;
IOleContainer
*
container
;
IOleDocumentView
*
view
;
IOleInPlaceSite
*
inplace
;
LPOLESTR
url
;
...
...
dlls/shdocvw/webbrowser.c
View file @
72c53293
...
...
@@ -125,8 +125,8 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
if
(
This
->
document
)
IUnknown_Release
(
This
->
document
);
if
(
This
->
doc
_host
.
doc
ument
)
IUnknown_Release
(
This
->
doc
_host
.
doc
ument
);
WebBrowser_OleObject_Destroy
(
This
);
WebBrowser_Events_Destroy
(
This
);
...
...
@@ -274,8 +274,8 @@ static HRESULT WINAPI WebBrowser_get_Document(IWebBrowser2 *iface, IDispatch **p
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ppDisp
);
*
ppDisp
=
NULL
;
if
(
This
->
document
)
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IDispatch
,
(
void
**
)
ppDisp
);
if
(
This
->
doc
_host
.
doc
ument
)
IUnknown_QueryInterface
(
This
->
doc
_host
.
doc
ument
,
&
IID_IDispatch
,
(
void
**
)
ppDisp
);
return
S_OK
;
}
...
...
@@ -844,7 +844,6 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret
->
lpWebBrowser2Vtbl
=
&
WebBrowser2Vtbl
;
ret
->
ref
=
0
;
ret
->
document
=
NULL
;
ret
->
url
=
NULL
;
ret
->
doc_host
.
disp
=
(
IDispatch
*
)
WEBBROWSER2
(
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