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
40cdfd2a
Commit
40cdfd2a
authored
May 04, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
May 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Use generic sinks in Compartment object.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7c1c94c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
55 deletions
+10
-55
compartmentmgr.c
dlls/msctf/compartmentmgr.c
+9
-55
msctf_internal.h
dlls/msctf/msctf_internal.h
+1
-0
No files found.
dlls/msctf/compartmentmgr.c
View file @
40cdfd2a
...
...
@@ -66,15 +66,6 @@ typedef struct tagCompartmentEnumGuid {
struct
list
*
cursor
;
}
CompartmentEnumGuid
;
typedef
struct
tagCompartmentSink
{
struct
list
entry
;
union
{
IUnknown
*
pIUnknown
;
ITfCompartmentEventSink
*
pITfCompartmentEventSink
;
}
interfaces
;
}
CompartmentSink
;
typedef
struct
tagCompartment
{
ITfCompartment
ITfCompartment_iface
;
ITfSource
ITfSource_iface
;
...
...
@@ -443,23 +434,11 @@ static HRESULT CompartmentEnumGuid_Constructor(struct list *values, IEnumGUID **
/**************************************************
* ITfCompartment
**************************************************/
static
void
free_sink
(
CompartmentSink
*
sink
)
{
IUnknown_Release
(
sink
->
interfaces
.
pIUnknown
);
HeapFree
(
GetProcessHeap
(),
0
,
sink
);
}
static
void
Compartment_Destructor
(
Compartment
*
This
)
{
struct
list
*
cursor
,
*
cursor2
;
TRACE
(
"destroying %p
\n
"
,
This
);
VariantClear
(
&
This
->
variant
);
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
CompartmentEventSink
)
{
CompartmentSink
*
sink
=
LIST_ENTRY
(
cursor
,
CompartmentSink
,
entry
);
list_remove
(
cursor
);
free_sink
(
sink
);
}
free_sinks
(
&
This
->
CompartmentEventSink
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -509,6 +488,7 @@ static HRESULT WINAPI Compartment_SetValue(ITfCompartment *iface,
TfClientId
tid
,
const
VARIANT
*
pvarValue
)
{
Compartment
*
This
=
impl_from_ITfCompartment
(
iface
);
ITfCompartmentEventSink
*
sink
;
struct
list
*
cursor
;
TRACE
(
"(%p) %i %p
\n
"
,
This
,
tid
,
pvarValue
);
...
...
@@ -534,10 +514,9 @@ static HRESULT WINAPI Compartment_SetValue(ITfCompartment *iface,
else
if
(
V_VT
(
pvarValue
)
==
VT_UNKNOWN
)
IUnknown_AddRef
(
V_UNKNOWN
(
&
This
->
variant
));
LIST_FOR_EACH
(
cursor
,
&
This
->
CompartmentEventS
ink
)
SINK_FOR_EACH
(
cursor
,
&
This
->
CompartmentEventSink
,
ITfCompartmentEventSink
,
s
ink
)
{
CompartmentSink
*
sink
=
LIST_ENTRY
(
cursor
,
CompartmentSink
,
entry
);
ITfCompartmentEventSink_OnChange
(
sink
->
interfaces
.
pITfCompartmentEventSink
,
&
This
->
valueData
->
guid
);
ITfCompartmentEventSink_OnChange
(
sink
,
&
This
->
valueData
->
guid
);
}
return
S_OK
;
...
...
@@ -592,7 +571,6 @@ static HRESULT WINAPI CompartmentSource_AdviseSink(ITfSource *iface,
REFIID
riid
,
IUnknown
*
punk
,
DWORD
*
pdwCookie
)
{
Compartment
*
This
=
impl_from_ITfSource
(
iface
);
CompartmentSink
*
cs
;
TRACE
(
"(%p) %s %p %p
\n
"
,
This
,
debugstr_guid
(
riid
),
punk
,
pdwCookie
);
...
...
@@ -600,47 +578,23 @@ static HRESULT WINAPI CompartmentSource_AdviseSink(ITfSource *iface,
return
E_INVALIDARG
;
if
(
IsEqualIID
(
riid
,
&
IID_ITfCompartmentEventSink
))
{
cs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
CompartmentSink
));
if
(
!
cs
)
return
E_OUTOFMEMORY
;
if
(
FAILED
(
IUnknown_QueryInterface
(
punk
,
riid
,
(
LPVOID
*
)
&
cs
->
interfaces
.
pITfCompartmentEventSink
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
cs
);
return
CONNECT_E_CANNOTCONNECT
;
}
list_add_head
(
&
This
->
CompartmentEventSink
,
&
cs
->
entry
);
*
pdwCookie
=
generate_Cookie
(
COOKIE_MAGIC_COMPARTMENTSINK
,
cs
);
}
else
{
FIXME
(
"(%p) Unhandled Sink: %s
\n
"
,
This
,
debugstr_guid
(
riid
));
return
E_NOTIMPL
;
}
return
advise_sink
(
&
This
->
CompartmentEventSink
,
&
IID_ITfCompartmentEventSink
,
COOKIE_MAGIC_COMPARTMENTSINK
,
punk
,
pdwCookie
);
TRACE
(
"cookie %x
\n
"
,
*
pdwCookie
);
return
S_OK
;
FIXME
(
"(%p) Unhandled Sink: %s
\n
"
,
This
,
debugstr_guid
(
riid
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
CompartmentSource_UnadviseSink
(
ITfSource
*
iface
,
DWORD
pdwCookie
)
{
Compartment
*
This
=
impl_from_ITfSource
(
iface
);
CompartmentSink
*
sink
;
TRACE
(
"(%p) %x
\n
"
,
This
,
pdwCookie
);
if
(
get_Cookie_magic
(
pdwCookie
)
!=
COOKIE_MAGIC_COMPARTMENTSINK
)
return
E_INVALIDARG
;
sink
=
remove_Cookie
(
pdwCookie
);
if
(
!
sink
)
return
CONNECT_E_NOCONNECTION
;
list_remove
(
&
sink
->
entry
);
free_sink
(
sink
);
return
S_OK
;
return
unadvise_sink
(
pdwCookie
);
}
static
const
ITfSourceVtbl
CompartmentSourceVtbl
=
...
...
dlls/msctf/msctf_internal.h
View file @
40cdfd2a
...
...
@@ -72,6 +72,7 @@ typedef struct {
union
{
IUnknown
*
pIUnknown
;
ITfThreadMgrEventSink
*
pITfThreadMgrEventSink
;
ITfCompartmentEventSink
*
pITfCompartmentEventSink
;
}
interfaces
;
}
Sink
;
...
...
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