mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
msctf: Beginning of TfEditCookie definition and usage.
This commit is contained in:
parent
d82df8f9b0
commit
a5006e7eb4
@ -69,6 +69,7 @@ typedef struct tagContext {
|
||||
BOOL connected;
|
||||
|
||||
TfClientId tidOwner;
|
||||
TfEditCookie defaultCookie;
|
||||
|
||||
ITextStoreACP *pITextStoreACP;
|
||||
ITfContextOwnerCompositionSink *pITfContextOwnerCompositionSink;
|
||||
@ -85,6 +86,10 @@ typedef struct tagContext {
|
||||
|
||||
} Context;
|
||||
|
||||
typedef struct tagEditCookie {
|
||||
DWORD lockType;
|
||||
Context *pOwningContext;
|
||||
} EditCookie;
|
||||
|
||||
typedef struct tagTextStoreACPSink {
|
||||
const ITextStoreACPSinkVtbl *TextStoreACPSinkVtbl;
|
||||
@ -111,6 +116,7 @@ static void free_sink(ContextSink *sink)
|
||||
static void Context_Destructor(Context *This)
|
||||
{
|
||||
struct list *cursor, *cursor2;
|
||||
EditCookie *cookie;
|
||||
TRACE("destroying %p\n", This);
|
||||
|
||||
if (This->pITextStoreACPSink)
|
||||
@ -125,6 +131,13 @@ static void Context_Destructor(Context *This)
|
||||
if (This->pITfContextOwnerCompositionSink)
|
||||
ITextStoreACPSink_Release(This->pITfContextOwnerCompositionSink);
|
||||
|
||||
if (This->defaultCookie)
|
||||
{
|
||||
cookie = remove_Cookie(This->defaultCookie);
|
||||
HeapFree(GetProcessHeap(),0,cookie);
|
||||
This->defaultCookie = 0;
|
||||
}
|
||||
|
||||
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pContextKeyEventSink)
|
||||
{
|
||||
ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry);
|
||||
@ -481,11 +494,19 @@ static const ITfSourceVtbl Context_SourceVtbl =
|
||||
HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **ppOut, TfEditCookie *pecTextStore)
|
||||
{
|
||||
Context *This;
|
||||
EditCookie *cookie;
|
||||
|
||||
This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Context));
|
||||
if (This == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
cookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie));
|
||||
if (cookie == NULL)
|
||||
{
|
||||
HeapFree(GetProcessHeap(),0,This);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore);
|
||||
|
||||
This->ContextVtbl= &Context_ContextVtbl;
|
||||
@ -494,6 +515,9 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp
|
||||
This->tidOwner = tidOwner;
|
||||
This->connected = FALSE;
|
||||
|
||||
cookie->lockType = TF_ES_READ;
|
||||
cookie->pOwningContext = This;
|
||||
|
||||
if (punk)
|
||||
{
|
||||
IUnknown_QueryInterface(punk, &IID_ITextStoreACP,
|
||||
@ -506,10 +530,8 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp
|
||||
FIXME("Unhandled pUnk\n");
|
||||
}
|
||||
|
||||
TRACE("returning %p\n", This);
|
||||
*ppOut = (ITfContext*)This;
|
||||
/* FIXME */
|
||||
*pecTextStore = 0xdeaddead;
|
||||
This->defaultCookie = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE,cookie);
|
||||
*pecTextStore = This->defaultCookie;
|
||||
|
||||
list_init(&This->pContextKeyEventSink);
|
||||
list_init(&This->pEditTransactionSink);
|
||||
@ -517,6 +539,9 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp
|
||||
list_init(&This->pTextEditSink);
|
||||
list_init(&This->pTextLayoutSink);
|
||||
|
||||
*ppOut = (ITfContext*)This;
|
||||
TRACE("returning %p\n", This);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#define COOKIE_MAGIC_CONTEXTSINK 0x0020
|
||||
#define COOKIE_MAGIC_GUIDATOM 0x0030
|
||||
#define COOKIE_MAGIC_IPPSINK 0x0040
|
||||
#define COOKIE_MAGIC_EDITCOOKIE 0x0050
|
||||
|
||||
extern DWORD tlsIndex;
|
||||
extern TfClientId processId;
|
||||
|
Loading…
Reference in New Issue
Block a user