msctf: Use generic sink type for thread manager sinks.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8f91f7403e
commit
0b912fecf6
|
@ -36,7 +36,6 @@
|
||||||
#include "olectl.h"
|
#include "olectl.h"
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
#include "wine/list.h"
|
|
||||||
|
|
||||||
#include "msctf.h"
|
#include "msctf.h"
|
||||||
#include "msctf_internal.h"
|
#include "msctf_internal.h"
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include "olectl.h"
|
#include "olectl.h"
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
#include "wine/list.h"
|
|
||||||
|
|
||||||
#include "msctf.h"
|
#include "msctf.h"
|
||||||
#include "msctf_internal.h"
|
#include "msctf_internal.h"
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include "olectl.h"
|
#include "olectl.h"
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
#include "wine/list.h"
|
|
||||||
|
|
||||||
#include "msctf.h"
|
#include "msctf.h"
|
||||||
#include "msctf_internal.h"
|
#include "msctf_internal.h"
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "wine/list.h"
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
#ifndef __WINE_MSCTF_I_H
|
#ifndef __WINE_MSCTF_I_H
|
||||||
#define __WINE_MSCTF_I_H
|
#define __WINE_MSCTF_I_H
|
||||||
|
|
||||||
|
#include "wine/list.h"
|
||||||
|
|
||||||
#define COOKIE_MAGIC_TMSINK 0x0010
|
#define COOKIE_MAGIC_TMSINK 0x0010
|
||||||
#define COOKIE_MAGIC_CONTEXTSINK 0x0020
|
#define COOKIE_MAGIC_CONTEXTSINK 0x0020
|
||||||
#define COOKIE_MAGIC_GUIDATOM 0x0030
|
#define COOKIE_MAGIC_GUIDATOM 0x0030
|
||||||
|
@ -65,6 +67,14 @@ extern CLSID get_textservice_clsid(TfClientId tid) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT get_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown** sink) DECLSPEC_HIDDEN;
|
extern HRESULT get_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown** sink) DECLSPEC_HIDDEN;
|
||||||
extern HRESULT set_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown* sink) DECLSPEC_HIDDEN;
|
extern HRESULT set_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown* sink) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
struct list entry;
|
||||||
|
union {
|
||||||
|
IUnknown *pIUnknown;
|
||||||
|
ITfThreadMgrEventSink *pITfThreadMgrEventSink;
|
||||||
|
} interfaces;
|
||||||
|
} Sink;
|
||||||
|
|
||||||
extern const WCHAR szwSystemTIPKey[] DECLSPEC_HIDDEN;
|
extern const WCHAR szwSystemTIPKey[] DECLSPEC_HIDDEN;
|
||||||
extern const WCHAR szwSystemCTFKey[] DECLSPEC_HIDDEN;
|
extern const WCHAR szwSystemCTFKey[] DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
|
|
@ -35,27 +35,12 @@
|
||||||
#include "olectl.h"
|
#include "olectl.h"
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
#include "wine/list.h"
|
|
||||||
|
|
||||||
#include "msctf.h"
|
#include "msctf.h"
|
||||||
#include "msctf_internal.h"
|
#include "msctf_internal.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
|
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 tagPreservedKey
|
typedef struct tagPreservedKey
|
||||||
{
|
{
|
||||||
struct list entry;
|
struct list entry;
|
||||||
|
@ -172,7 +157,7 @@ static inline EnumTfDocumentMgr *impl_from_IEnumTfDocumentMgrs(IEnumTfDocumentMg
|
||||||
return CONTAINING_RECORD(iface, EnumTfDocumentMgr, IEnumTfDocumentMgrs_iface);
|
return CONTAINING_RECORD(iface, EnumTfDocumentMgr, IEnumTfDocumentMgrs_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_sink(ThreadMgrSink *sink)
|
static void free_sink(Sink *sink)
|
||||||
{
|
{
|
||||||
IUnknown_Release(sink->interfaces.pIUnknown);
|
IUnknown_Release(sink->interfaces.pIUnknown);
|
||||||
HeapFree(GetProcessHeap(),0,sink);
|
HeapFree(GetProcessHeap(),0,sink);
|
||||||
|
@ -194,37 +179,37 @@ static void ThreadMgr_Destructor(ThreadMgr *This)
|
||||||
/* free sinks */
|
/* free sinks */
|
||||||
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ActiveLanguageProfileNotifySink)
|
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ActiveLanguageProfileNotifySink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
list_remove(cursor);
|
list_remove(cursor);
|
||||||
free_sink(sink);
|
free_sink(sink);
|
||||||
}
|
}
|
||||||
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->DisplayAttributeNotifySink)
|
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->DisplayAttributeNotifySink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
list_remove(cursor);
|
list_remove(cursor);
|
||||||
free_sink(sink);
|
free_sink(sink);
|
||||||
}
|
}
|
||||||
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->KeyTraceEventSink)
|
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->KeyTraceEventSink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
list_remove(cursor);
|
list_remove(cursor);
|
||||||
free_sink(sink);
|
free_sink(sink);
|
||||||
}
|
}
|
||||||
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->PreservedKeyNotifySink)
|
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->PreservedKeyNotifySink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
list_remove(cursor);
|
list_remove(cursor);
|
||||||
free_sink(sink);
|
free_sink(sink);
|
||||||
}
|
}
|
||||||
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ThreadFocusSink)
|
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ThreadFocusSink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
list_remove(cursor);
|
list_remove(cursor);
|
||||||
free_sink(sink);
|
free_sink(sink);
|
||||||
}
|
}
|
||||||
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ThreadMgrEventSink)
|
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ThreadMgrEventSink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
list_remove(cursor);
|
list_remove(cursor);
|
||||||
free_sink(sink);
|
free_sink(sink);
|
||||||
}
|
}
|
||||||
|
@ -658,7 +643,7 @@ static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface,
|
||||||
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
|
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
|
||||||
{
|
{
|
||||||
ThreadMgr *This = impl_from_ITfSource(iface);
|
ThreadMgr *This = impl_from_ITfSource(iface);
|
||||||
ThreadMgrSink *tms;
|
Sink *tms;
|
||||||
|
|
||||||
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
|
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
|
||||||
|
|
||||||
|
@ -667,7 +652,7 @@ static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface,
|
||||||
|
|
||||||
if (IsEqualIID(riid, &IID_ITfThreadMgrEventSink))
|
if (IsEqualIID(riid, &IID_ITfThreadMgrEventSink))
|
||||||
{
|
{
|
||||||
tms = HeapAlloc(GetProcessHeap(),0,sizeof(ThreadMgrSink));
|
tms = HeapAlloc(GetProcessHeap(),0,sizeof(*tms));
|
||||||
if (!tms)
|
if (!tms)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
if (FAILED(IUnknown_QueryInterface(punk, riid, (LPVOID *)&tms->interfaces.pITfThreadMgrEventSink)))
|
if (FAILED(IUnknown_QueryInterface(punk, riid, (LPVOID *)&tms->interfaces.pITfThreadMgrEventSink)))
|
||||||
|
@ -692,7 +677,7 @@ static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface,
|
||||||
static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
|
static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
|
||||||
{
|
{
|
||||||
ThreadMgr *This = impl_from_ITfSource(iface);
|
ThreadMgr *This = impl_from_ITfSource(iface);
|
||||||
ThreadMgrSink *sink;
|
Sink *sink;
|
||||||
|
|
||||||
TRACE("(%p) %x\n",This,pdwCookie);
|
TRACE("(%p) %x\n",This,pdwCookie);
|
||||||
|
|
||||||
|
@ -1164,7 +1149,7 @@ static HRESULT WINAPI ThreadMgrEventSink_OnInitDocumentMgr(
|
||||||
|
|
||||||
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
ITfThreadMgrEventSink_OnInitDocumentMgr(sink->interfaces.pITfThreadMgrEventSink,pdim);
|
ITfThreadMgrEventSink_OnInitDocumentMgr(sink->interfaces.pITfThreadMgrEventSink,pdim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1181,7 +1166,7 @@ static HRESULT WINAPI ThreadMgrEventSink_OnUninitDocumentMgr(
|
||||||
|
|
||||||
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
ITfThreadMgrEventSink_OnUninitDocumentMgr(sink->interfaces.pITfThreadMgrEventSink,pdim);
|
ITfThreadMgrEventSink_OnUninitDocumentMgr(sink->interfaces.pITfThreadMgrEventSink,pdim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1199,7 +1184,7 @@ static HRESULT WINAPI ThreadMgrEventSink_OnSetFocus(
|
||||||
|
|
||||||
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
ITfThreadMgrEventSink_OnSetFocus(sink->interfaces.pITfThreadMgrEventSink, pdimFocus, pdimPrevFocus);
|
ITfThreadMgrEventSink_OnSetFocus(sink->interfaces.pITfThreadMgrEventSink, pdimFocus, pdimPrevFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1216,7 +1201,7 @@ static HRESULT WINAPI ThreadMgrEventSink_OnPushContext(
|
||||||
|
|
||||||
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
ITfThreadMgrEventSink_OnPushContext(sink->interfaces.pITfThreadMgrEventSink,pic);
|
ITfThreadMgrEventSink_OnPushContext(sink->interfaces.pITfThreadMgrEventSink,pic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1233,7 +1218,7 @@ static HRESULT WINAPI ThreadMgrEventSink_OnPopContext(
|
||||||
|
|
||||||
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink)
|
||||||
{
|
{
|
||||||
ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry);
|
Sink* sink = LIST_ENTRY(cursor,Sink,entry);
|
||||||
ITfThreadMgrEventSink_OnPopContext(sink->interfaces.pITfThreadMgrEventSink,pic);
|
ITfThreadMgrEventSink_OnPopContext(sink->interfaces.pITfThreadMgrEventSink,pic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue