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
f0b20ad4
Commit
f0b20ad4
authored
Jan 17, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Use ifaces instead of vtbl pointers in IOleClientSiteImpl.
parent
725cb2f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
49 deletions
+62
-49
webbrowser.c
dlls/hhctrl.ocx/webbrowser.c
+62
-49
No files found.
dlls/hhctrl.ocx/webbrowser.c
View file @
f0b20ad4
...
...
@@ -24,14 +24,12 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
htmlhelp
);
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
typedef
struct
IOleClientSiteImpl
{
const
IOleClientSiteVtbl
*
lpVtbl
;
const
IOleInPlaceSiteVtbl
*
lpvtblOleInPlaceSit
e
;
const
IOleInPlaceFrameVtbl
*
lpvtblOleInPlaceFram
e
;
const
IDocHostUIHandlerVtbl
*
lpvtblDocHostUIHandler
;
IOleClientSite
IOleClientSite_iface
;
IOleInPlaceSite
IOleInPlaceSite_ifac
e
;
IOleInPlaceFrame
IOleInPlaceFrame_ifac
e
;
IDocHostUIHandler
IDocHostUIHandler_iface
;
/* IOleClientSiteImpl data */
IOleObject
*
pBrowserObject
;
...
...
@@ -41,32 +39,32 @@ typedef struct IOleClientSiteImpl
HWND
hwndWindow
;
}
IOleClientSiteImpl
;
#define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpVtbl
)
#define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpvtblDocHostUIHandler)
#define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpvtblOleInPlaceSite)
#define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpvtblOleInPlaceFrame)
static
inline
IOleClientSiteImpl
*
impl_from_IOleClientSite
(
IOleClientSite
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IOleClientSiteImpl
,
IOleClientSite_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
Site_QueryInterface
(
IOleClientSite
*
iface
,
REFIID
riid
,
void
**
ppvObj
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpVtbl
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleClientSite
(
iface
);
*
ppvObj
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppvObj
);
*
ppvObj
=
CLIENTSITE
(
This
)
;
*
ppvObj
=
&
This
->
IOleClientSite_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IOleClientSite
))
{
TRACE
(
"(%p)->(IID_IOleClientSite %p)
\n
"
,
This
,
ppvObj
);
*
ppvObj
=
CLIENTSITE
(
This
)
;
*
ppvObj
=
&
This
->
IOleClientSite_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IOleInPlaceSite
))
{
TRACE
(
"(%p)->(IID_IOleInPlaceSite %p)
\n
"
,
This
,
ppvObj
);
*
ppvObj
=
&
(
This
->
lpvtblOleInPlaceSite
)
;
*
ppvObj
=
&
This
->
IOleInPlaceSite_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IOleInPlaceFrame
))
{
TRACE
(
"(%p)->(IID_IOleInPlaceFrame %p)
\n
"
,
This
,
ppvObj
);
*
ppvObj
=
&
(
This
->
lpvtblOleInPlaceSite
)
;
*
ppvObj
=
&
This
->
IOleInPlaceSite_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IDocHostUIHandler
))
{
TRACE
(
"(%p)->(IID_IDocHostUIHandler %p)
\n
"
,
This
,
ppvObj
);
*
ppvObj
=
&
(
This
->
lpvtblDocHostUIHandler
)
;
*
ppvObj
=
&
This
->
IDocHostUIHandler_iface
;
}
else
{
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObj
);
return
E_NOINTERFACE
;
...
...
@@ -78,7 +76,7 @@ static HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite *iface, REFI
static
ULONG
STDMETHODCALLTYPE
Site_AddRef
(
IOleClientSite
*
iface
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpVtbl
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleClientSite
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -88,7 +86,7 @@ static ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite *iface)
static
ULONG
STDMETHODCALLTYPE
Site_Release
(
IOleClientSite
*
iface
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpVtbl
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleClientSite
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -144,25 +142,30 @@ static const IOleClientSiteVtbl MyIOleClientSiteTable =
Site_RequestNewObjectLayout
};
static
inline
IOleClientSiteImpl
*
impl_from_IDocHostUIHandler
(
IDocHostUIHandler
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IOleClientSiteImpl
,
IDocHostUIHandler_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
UI_QueryInterface
(
IDocHostUIHandler
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblDocHostUIHandler
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IDocHostUIHandler
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
)
,
riid
,
ppvObj
);
return
IOleClientSite_QueryInterface
(
&
This
->
IOleClientSite_iface
,
riid
,
ppvObj
);
}
static
ULONG
STDMETHODCALLTYPE
UI_AddRef
(
IDocHostUIHandler
*
iface
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblDocHostUIHandler
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IDocHostUIHandler
(
iface
);
return
IOleClientSite_AddRef
(
CLIENTSITE
(
This
)
);
return
IOleClientSite_AddRef
(
&
This
->
IOleClientSite_iface
);
}
static
ULONG
STDMETHODCALLTYPE
UI_Release
(
IDocHostUIHandler
*
iface
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblDocHostUIHandler
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IDocHostUIHandler
(
iface
);
return
IOleClientSite_Release
(
CLIENTSITE
(
This
)
);
return
IOleClientSite_Release
(
&
This
->
IOleClientSite_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
UI_ShowContextMenu
(
IDocHostUIHandler
*
iface
,
DWORD
dwID
,
POINT
*
ppt
,
IUnknown
*
pcmdtReserved
,
IDispatch
*
pdispReserved
)
...
...
@@ -269,30 +272,35 @@ static const IDocHostUIHandlerVtbl MyIDocHostUIHandlerTable =
UI_FilterDataObject
};
static
inline
IOleClientSiteImpl
*
impl_from_IOleInPlaceSite
(
IOleInPlaceSite
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IOleClientSiteImpl
,
IOleInPlaceSite_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
InPlace_QueryInterface
(
IOleInPlaceSite
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceSite
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceSite
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
)
,
riid
,
ppvObj
);
return
IOleClientSite_QueryInterface
(
&
This
->
IOleClientSite_iface
,
riid
,
ppvObj
);
}
static
ULONG
STDMETHODCALLTYPE
InPlace_AddRef
(
IOleInPlaceSite
*
iface
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceSite
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceSite
(
iface
);
return
IOleClientSite_AddRef
(
CLIENTSITE
(
This
)
);
return
IOleClientSite_AddRef
(
&
This
->
IOleClientSite_iface
);
}
static
ULONG
STDMETHODCALLTYPE
InPlace_Release
(
IOleInPlaceSite
*
iface
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceSite
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceSite
(
iface
);
return
IOleClientSite_Release
(
CLIENTSITE
(
This
)
);
return
IOleClientSite_Release
(
&
This
->
IOleClientSite_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
InPlace_GetWindow
(
IOleInPlaceSite
*
iface
,
HWND
*
lphwnd
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceSite
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceSite
(
iface
);
*
lphwnd
=
This
->
hwndWindow
;
return
S_OK
;
...
...
@@ -320,10 +328,10 @@ static HRESULT STDMETHODCALLTYPE InPlace_OnUIActivate(IOleInPlaceSite *iface)
static
HRESULT
STDMETHODCALLTYPE
InPlace_GetWindowContext
(
IOleInPlaceSite
*
iface
,
LPOLEINPLACEFRAME
*
lplpFrame
,
LPOLEINPLACEUIWINDOW
*
lplpDoc
,
LPRECT
lprcPosRect
,
LPRECT
lprcClipRect
,
LPOLEINPLACEFRAMEINFO
lpFrameInfo
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceSite
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceSite
(
iface
);
*
lplpFrame
=
INPLACEFRAME
(
This
)
;
IOleInPlaceFrame_AddRef
(
INPLACEFRAME
(
This
)
);
*
lplpFrame
=
&
This
->
IOleInPlaceFrame_iface
;
IOleInPlaceFrame_AddRef
(
&
This
->
IOleInPlaceFrame_iface
);
*
lplpDoc
=
NULL
;
...
...
@@ -362,7 +370,7 @@ static HRESULT STDMETHODCALLTYPE InPlace_DeactivateAndUndo(IOleInPlaceSite *ifac
static
HRESULT
STDMETHODCALLTYPE
InPlace_OnPosRectChange
(
IOleInPlaceSite
*
iface
,
LPCRECT
lprcPosRect
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceSite
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceSite
(
iface
);
IOleInPlaceObject
*
inplace
;
if
(
IOleObject_QueryInterface
(
This
->
pBrowserObject
,
&
IID_IOleInPlaceObject
,
...
...
@@ -394,30 +402,35 @@ static const IOleInPlaceSiteVtbl MyIOleInPlaceSiteTable =
InPlace_OnPosRectChange
};
static
inline
IOleClientSiteImpl
*
impl_from_IOleInPlaceFrame
(
IOleInPlaceFrame
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IOleClientSiteImpl
,
IOleInPlaceFrame_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
Frame_QueryInterface
(
IOleInPlaceFrame
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceFrame
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceFrame
(
iface
);
return
IOleClientSite_QueryInterface
(
CLIENTSITE
(
This
)
,
riid
,
ppvObj
);
return
IOleClientSite_QueryInterface
(
&
This
->
IOleClientSite_iface
,
riid
,
ppvObj
);
}
static
ULONG
STDMETHODCALLTYPE
Frame_AddRef
(
IOleInPlaceFrame
*
iface
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceFrame
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceFrame
(
iface
);
return
IOleClientSite_AddRef
(
CLIENTSITE
(
This
)
);
return
IOleClientSite_AddRef
(
&
This
->
IOleClientSite_iface
);
}
static
ULONG
STDMETHODCALLTYPE
Frame_Release
(
IOleInPlaceFrame
*
iface
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceFrame
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceFrame
(
iface
);
return
IOleClientSite_Release
(
CLIENTSITE
(
This
)
);
return
IOleClientSite_Release
(
&
This
->
IOleClientSite_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
Frame_GetWindow
(
IOleInPlaceFrame
*
iface
,
HWND
*
lphwnd
)
{
I
COM_THIS_MULTI
(
IOleClientSiteImpl
,
lpvtblOleInPlaceFrame
,
iface
);
I
OleClientSiteImpl
*
This
=
impl_from_IOleInPlaceFrame
(
iface
);
*
lphwnd
=
This
->
hwndWindow
;
return
S_OK
;
...
...
@@ -625,17 +638,17 @@ BOOL InitWebBrowser(HHInfo *info, HWND hwndParent)
return
FALSE
;
iOleClientSiteImpl
->
ref
=
1
;
iOleClientSiteImpl
->
lpVtbl
=
&
MyIOleClientSiteTable
;
iOleClientSiteImpl
->
lpvtblOleInPlaceSite
=
&
MyIOleInPlaceSiteTable
;
iOleClientSiteImpl
->
lpvtblOleInPlaceFrame
=
&
MyIOleInPlaceFrameTable
;
iOleClientSiteImpl
->
IOleClientSite_iface
.
lpVtbl
=
&
MyIOleClientSiteTable
;
iOleClientSiteImpl
->
IOleInPlaceSite_iface
.
lpVtbl
=
&
MyIOleInPlaceSiteTable
;
iOleClientSiteImpl
->
IOleInPlaceFrame_iface
.
lpVtbl
=
&
MyIOleInPlaceFrameTable
;
iOleClientSiteImpl
->
hwndWindow
=
hwndParent
;
iOleClientSiteImpl
->
lpvtblDocHostUIHandler
=
&
MyIDocHostUIHandlerTable
;
iOleClientSiteImpl
->
IDocHostUIHandler_iface
.
lpVtbl
=
&
MyIDocHostUIHandlerTable
;
hr
=
OleCreate
(
&
CLSID_WebBrowser
,
&
IID_IOleObject
,
OLERENDER_DRAW
,
0
,
(
IOleClientSite
*
)
iOleClientSiteImpl
,
&
MyIStorage
,
&
iOleClientSiteImpl
->
IOleClientSite_iface
,
&
MyIStorage
,
(
void
**
)
&
browserObject
);
info
->
client_site
=
(
IOleClientSite
*
)
iOleClientSiteImpl
;
info
->
client_site
=
&
iOleClientSiteImpl
->
IOleClientSite_iface
;
info
->
wb_object
=
browserObject
;
if
(
FAILED
(
hr
))
goto
error
;
...
...
@@ -649,7 +662,7 @@ BOOL InitWebBrowser(HHInfo *info, HWND hwndParent)
if
(
FAILED
(
hr
))
goto
error
;
hr
=
IOleObject_DoVerb
(
browserObject
,
OLEIVERB_SHOW
,
NULL
,
(
IOleClientSite
*
)
iOleClientSiteImpl
,
&
iOleClientSiteImpl
->
IOleClientSite_iface
,
-
1
,
hwndParent
,
&
rc
);
if
(
FAILED
(
hr
))
goto
error
;
...
...
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