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
f723e4ca
Commit
f723e4ca
authored
Mar 24, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Mar 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: ThreadMgr sink framework.
parent
8d2ce074
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
threadmgr.c
dlls/msctf/threadmgr.c
+77
-0
No files found.
dlls/msctf/threadmgr.c
View file @
f723e4ca
...
...
@@ -34,18 +34,41 @@
#include "objbase.h"
#include "wine/unicode.h"
#include "wine/list.h"
#include "msctf.h"
#include "msctf_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msctf
);
typedef
struct
tagThreadMgrSink
{
struct
list
entry
;
union
{
/* ThreadMgr Sinks */
IUnknown
*
pIUnknown
;
/* ITfActiveLanguageProfileNotifySink *pITfActiveLanguageProfileNotifySink; */
/* ITfDisplayAttributeNotifySink *pITfDisplayAttributeNotifySink; */
/* ITfKeyTraceEventSink *pITfKeyTraceEventSink; */
/* ITfPreservedKeyNotifySink *pITfPreservedKeyNotifySink; */
/* ITfThreadFocusSink *pITfThreadFocusSink; */
/* ITfThreadMgrEventSink *pITfThreadMgrEventSink; */
}
interfaces
;
}
ThreadMgrSink
;
typedef
struct
tagACLMulti
{
const
ITfThreadMgrVtbl
*
ThreadMgrVtbl
;
const
ITfSourceVtbl
*
SourceVtbl
;
LONG
refCount
;
ITfDocumentMgr
*
focus
;
/* kept as separate lists to reduce unnecessary iterations */
struct
list
ActiveLanguageProfileNotifySink
;
struct
list
DisplayAttributeNotifySink
;
struct
list
KeyTraceEventSink
;
struct
list
PreservedKeyNotifySink
;
struct
list
ThreadFocusSink
;
struct
list
ThreadMgrEventSink
;
}
ThreadMgr
;
static
inline
ThreadMgr
*
impl_from_ITfSourceVtbl
(
ITfSource
*
iface
)
...
...
@@ -53,12 +76,59 @@ static inline ThreadMgr *impl_from_ITfSourceVtbl(ITfSource *iface)
return
(
ThreadMgr
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
ThreadMgr
,
SourceVtbl
));
}
static
void
free_sink
(
ThreadMgrSink
*
sink
)
{
IUnknown_Release
(
sink
->
interfaces
.
pIUnknown
);
HeapFree
(
GetProcessHeap
(),
0
,
sink
);
}
static
void
ThreadMgr_Destructor
(
ThreadMgr
*
This
)
{
struct
list
*
cursor
,
*
cursor2
;
TlsSetValue
(
tlsIndex
,
NULL
);
TRACE
(
"destroying %p
\n
"
,
This
);
if
(
This
->
focus
)
ITfDocumentMgr_Release
(
This
->
focus
);
/* free sinks */
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
ActiveLanguageProfileNotifySink
)
{
ThreadMgrSink
*
sink
=
LIST_ENTRY
(
cursor
,
ThreadMgrSink
,
entry
);
list_remove
(
cursor
);
free_sink
(
sink
);
}
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
DisplayAttributeNotifySink
)
{
ThreadMgrSink
*
sink
=
LIST_ENTRY
(
cursor
,
ThreadMgrSink
,
entry
);
list_remove
(
cursor
);
free_sink
(
sink
);
}
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
KeyTraceEventSink
)
{
ThreadMgrSink
*
sink
=
LIST_ENTRY
(
cursor
,
ThreadMgrSink
,
entry
);
list_remove
(
cursor
);
free_sink
(
sink
);
}
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
PreservedKeyNotifySink
)
{
ThreadMgrSink
*
sink
=
LIST_ENTRY
(
cursor
,
ThreadMgrSink
,
entry
);
list_remove
(
cursor
);
free_sink
(
sink
);
}
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
ThreadFocusSink
)
{
ThreadMgrSink
*
sink
=
LIST_ENTRY
(
cursor
,
ThreadMgrSink
,
entry
);
list_remove
(
cursor
);
free_sink
(
sink
);
}
LIST_FOR_EACH_SAFE
(
cursor
,
cursor2
,
&
This
->
ThreadMgrEventSink
)
{
ThreadMgrSink
*
sink
=
LIST_ENTRY
(
cursor
,
ThreadMgrSink
,
entry
);
list_remove
(
cursor
);
free_sink
(
sink
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -303,6 +373,13 @@ HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
This
->
refCount
=
1
;
TlsSetValue
(
tlsIndex
,
This
);
list_init
(
&
This
->
ActiveLanguageProfileNotifySink
);
list_init
(
&
This
->
DisplayAttributeNotifySink
);
list_init
(
&
This
->
KeyTraceEventSink
);
list_init
(
&
This
->
PreservedKeyNotifySink
);
list_init
(
&
This
->
ThreadFocusSink
);
list_init
(
&
This
->
ThreadMgrEventSink
);
TRACE
(
"returning %p
\n
"
,
This
);
*
ppOut
=
(
IUnknown
*
)
This
;
return
S_OK
;
...
...
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