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
932cf287
Commit
932cf287
authored
Dec 02, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added implementation of IConnectionPoint::Advise and Unadvise.
parent
548d0888
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
17 deletions
+90
-17
events.c
dlls/shdocvw/events.c
+83
-14
shdocvw.h
dlls/shdocvw/shdocvw.h
+7
-3
No files found.
dlls/shdocvw/events.c
View file @
932cf287
...
@@ -27,13 +27,16 @@
...
@@ -27,13 +27,16 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
shdocvw
);
WINE_DEFAULT_DEBUG_CHANNEL
(
shdocvw
);
typedef
struc
t
{
struct
ConnectionPoin
t
{
const
IConnectionPointVtbl
*
lpConnectionPointVtbl
;
const
IConnectionPointVtbl
*
lpConnectionPointVtbl
;
WebBrowser
*
webbrowser
;
WebBrowser
*
webbrowser
;
IDispatch
**
sinks
;
DWORD
sinks_size
;
IID
iid
;
IID
iid
;
}
ConnectionPoint
;
};
#define CONPOINT(x) ((IConnectionPoint*) &(x)->lpConnectionPointVtbl)
#define CONPOINT(x) ((IConnectionPoint*) &(x)->lpConnectionPointVtbl)
...
@@ -84,13 +87,13 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
...
@@ -84,13 +87,13 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
if
(
IsEqualGUID
(
&
DIID_DWebBrowserEvents2
,
riid
))
{
if
(
IsEqualGUID
(
&
DIID_DWebBrowserEvents2
,
riid
))
{
TRACE
(
"(%p)->(DIID_DWebBrowserEvents2 %p)
\n
"
,
This
,
ppCP
);
TRACE
(
"(%p)->(DIID_DWebBrowserEvents2 %p)
\n
"
,
This
,
ppCP
);
*
ppCP
=
This
->
cp_wbe2
;
*
ppCP
=
CONPOINT
(
This
->
cp_wbe2
)
;
}
else
if
(
IsEqualGUID
(
&
DIID_DWebBrowserEvents
,
riid
))
{
}
else
if
(
IsEqualGUID
(
&
DIID_DWebBrowserEvents
,
riid
))
{
TRACE
(
"(%p)->(DIID_DWebBrowserEvents %p)
\n
"
,
This
,
ppCP
);
TRACE
(
"(%p)->(DIID_DWebBrowserEvents %p)
\n
"
,
This
,
ppCP
);
*
ppCP
=
This
->
cp_wbe
;
*
ppCP
=
CONPOINT
(
This
->
cp_wbe
)
;
}
else
if
(
IsEqualGUID
(
&
IID_IPropertyNotifySink
,
riid
))
{
}
else
if
(
IsEqualGUID
(
&
IID_IPropertyNotifySink
,
riid
))
{
TRACE
(
"(%p)->(IID_IPropertyNotifySink %p)
\n
"
,
This
,
ppCP
);
TRACE
(
"(%p)->(IID_IPropertyNotifySink %p)
\n
"
,
This
,
ppCP
);
*
ppCP
=
This
->
cp_pns
;
*
ppCP
=
CONPOINT
(
This
->
cp_pns
)
;
}
}
if
(
*
ppCP
)
{
if
(
*
ppCP
)
{
...
@@ -181,15 +184,53 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
...
@@ -181,15 +184,53 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
DWORD
*
pdwCookie
)
DWORD
*
pdwCookie
)
{
{
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
pUnkSink
,
pdwCookie
);
IDispatch
*
disp
;
return
E_NOTIMPL
;
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
)
static
HRESULT
WINAPI
ConnectionPoint_Unadvise
(
IConnectionPoint
*
iface
,
DWORD
dwCookie
)
{
{
ConnectionPoint
*
This
=
CONPOINT_THIS
(
iface
);
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
,
static
HRESULT
WINAPI
ConnectionPoint_EnumConnections
(
IConnectionPoint
*
iface
,
...
@@ -214,15 +255,43 @@ static const IConnectionPointVtbl ConnectionPointVtbl =
...
@@ -214,15 +255,43 @@ static const IConnectionPointVtbl ConnectionPointVtbl =
ConnectionPoint_EnumConnections
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
));
ConnectionPoint
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ConnectionPoint
));
ret
->
lpConnectionPointVtbl
=
&
ConnectionPointVtbl
;
ret
->
lpConnectionPointVtbl
=
&
ConnectionPointVtbl
;
ret
->
webbrowser
=
wb
;
ret
->
webbrowser
=
wb
;
ret
->
sinks
=
NULL
;
ret
->
sinks_size
=
0
;
memcpy
(
&
ret
->
iid
,
riid
,
sizeof
(
IID
));
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
)
void
WebBrowser_Events_Init
(
WebBrowser
*
This
)
...
@@ -236,7 +305,7 @@ void WebBrowser_Events_Init(WebBrowser *This)
...
@@ -236,7 +305,7 @@ void WebBrowser_Events_Init(WebBrowser *This)
void
WebBrowser_Events_Destroy
(
WebBrowser
*
This
)
void
WebBrowser_Events_Destroy
(
WebBrowser
*
This
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
cp_wbe2
);
ConnectionPoint_Destroy
(
This
->
cp_wbe2
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
cp_wbe
);
ConnectionPoint_Destroy
(
This
->
cp_wbe
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
cp_pns
);
ConnectionPoint_Destroy
(
This
->
cp_pns
);
}
}
dlls/shdocvw/shdocvw.h
View file @
932cf287
...
@@ -58,6 +58,9 @@ extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
...
@@ -58,6 +58,9 @@ extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
/**********************************************************************
/**********************************************************************
* WebBrowser declaration for SHDOCVW.DLL
* WebBrowser declaration for SHDOCVW.DLL
*/
*/
typedef
struct
ConnectionPoint
ConnectionPoint
;
typedef
struct
{
typedef
struct
{
/* Interfaces available via WebBrowser object */
/* Interfaces available via WebBrowser object */
...
@@ -109,9 +112,9 @@ typedef struct {
...
@@ -109,9 +112,9 @@ typedef struct {
/* Connection points */
/* Connection points */
I
ConnectionPoint
*
cp_wbe2
;
ConnectionPoint
*
cp_wbe2
;
I
ConnectionPoint
*
cp_wbe
;
ConnectionPoint
*
cp_wbe
;
I
ConnectionPoint
*
cp_pns
;
ConnectionPoint
*
cp_pns
;
}
WebBrowser
;
}
WebBrowser
;
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
#define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
...
@@ -155,6 +158,7 @@ void WebBrowser_ClientSite_Destroy(WebBrowser*);
...
@@ -155,6 +158,7 @@ void WebBrowser_ClientSite_Destroy(WebBrowser*);
HRESULT
WebBrowser_Create
(
IUnknown
*
,
REFIID
,
void
**
);
HRESULT
WebBrowser_Create
(
IUnknown
*
,
REFIID
,
void
**
);
void
create_doc_view_hwnd
(
WebBrowser
*
This
);
void
create_doc_view_hwnd
(
WebBrowser
*
This
);
void
call_sink
(
ConnectionPoint
*
,
DISPID
,
DISPPARAMS
*
);
#define WB_WM_NAVIGATE2 (WM_USER+100)
#define WB_WM_NAVIGATE2 (WM_USER+100)
...
...
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