Commit 67d00e3e authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

msctf: When a Context is created connect to the ITextStoreACP if provided and…

msctf: When a Context is created connect to the ITextStoreACP if provided and create and advise our ITextStoreACPSink.
parent 5e7493d5
...@@ -61,7 +61,11 @@ typedef struct tagContext { ...@@ -61,7 +61,11 @@ typedef struct tagContext {
LONG refCount; LONG refCount;
TfClientId tidOwner; TfClientId tidOwner;
IUnknown *punk; /* possible ITextStoreACP or ITfContextOwnerCompositionSink */
ITextStoreACP *pITextStoreACP;
/* ITfContextOwnerCompositionSink */
ITextStoreACPSink *pITextStoreACPSink;
/* kept as seperate lists to reduce unnesseccary iterations */ /* kept as seperate lists to reduce unnesseccary iterations */
struct list pContextKeyEventSink; struct list pContextKeyEventSink;
...@@ -99,6 +103,15 @@ static void Context_Destructor(Context *This) ...@@ -99,6 +103,15 @@ static void Context_Destructor(Context *This)
struct list *cursor, *cursor2; struct list *cursor, *cursor2;
TRACE("destroying %p\n", This); TRACE("destroying %p\n", This);
if (This->pITextStoreACPSink)
{
ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)This->pITextStoreACPSink);
ITextStoreACPSink_Release(This->pITextStoreACPSink);
}
if (This->pITextStoreACP)
ITextStoreACPSink_Release(This->pITextStoreACP);
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pContextKeyEventSink) LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pContextKeyEventSink)
{ {
ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry);
...@@ -408,11 +421,22 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp ...@@ -408,11 +421,22 @@ HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfContext **pp
if (This == NULL) if (This == NULL)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore);
This->ContextVtbl= &Context_ContextVtbl; This->ContextVtbl= &Context_ContextVtbl;
This->SourceVtbl = &Context_SourceVtbl; This->SourceVtbl = &Context_SourceVtbl;
This->refCount = 1; This->refCount = 1;
This->tidOwner = tidOwner; This->tidOwner = tidOwner;
This->punk = punk;
if (punk && SUCCEEDED(IUnknown_QueryInterface(punk, &IID_ITextStoreACP,
(LPVOID*)&This->pITextStoreACP)))
{
if (SUCCEEDED(TextStoreACPSink_Constructor(&This->pITextStoreACPSink, This)))
ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink,
(IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS);
}
else if (punk)
FIXME("Unhandled pUnk\n");
TRACE("returning %p\n", This); TRACE("returning %p\n", This);
*ppOut = (ITfContext*)This; *ppOut = (ITfContext*)This;
......
...@@ -30,6 +30,15 @@ const DWORD TS_SS_REGIONS = 0x002; ...@@ -30,6 +30,15 @@ const DWORD TS_SS_REGIONS = 0x002;
const DWORD TS_SS_TRANSITORY = 0x004; const DWORD TS_SS_TRANSITORY = 0x004;
const DWORD TS_SS_NOHIDDENTEXT = 0x008; const DWORD TS_SS_NOHIDDENTEXT = 0x008;
const DWORD TS_AS_TEXT_CHANGE = 0x01;
const DWORD TS_AS_SEL_CHANGE = 0x02;
const DWORD TS_AS_LAYOUT_CHANGE = 0x04;
const DWORD TS_AS_ATTR_CHANGE = 0x08;
const DWORD TS_AS_STATUS_CHANGE = 0x10;
const DWORD TS_AS_ALL_SINKS = (TS_AS_TEXT_CHANGE | TS_AS_SEL_CHANGE | TS_AS_LAYOUT_CHANGE | TS_AS_ATTR_CHANGE | TS_AS_STATUS_CHANGE);
typedef [uuid(05fcf85b-5e9c-4c3e-ab71-29471d4f38e7)] enum { TS_AE_NONE, TS_AE_START, TS_AE_END } TsActiveSelEnd; typedef [uuid(05fcf85b-5e9c-4c3e-ab71-29471d4f38e7)] enum { TS_AE_NONE, TS_AE_START, TS_AE_END } TsActiveSelEnd;
typedef [uuid(033b0df0-f193-4170-b47b-141afc247878)] enum { TS_RT_PLAIN, TS_RT_HIDDEN, TS_RT_OPAQUE } TsRunType; typedef [uuid(033b0df0-f193-4170-b47b-141afc247878)] enum { TS_RT_PLAIN, TS_RT_HIDDEN, TS_RT_OPAQUE } TsRunType;
typedef [uuid(ef3457d9-8446-49a7-a9e6-b50d9d5f3fd9)] GUID TS_ATTRID; typedef [uuid(ef3457d9-8446-49a7-a9e6-b50d9d5f3fd9)] GUID TS_ATTRID;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment