* Sync with Wine 1.7.17.
CORE-8080
svn path=/trunk/; revision=62915
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCategoryMgr))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfCategoryMgr_iface;
}
if (*ppvOut)
}
-static const ITfCategoryMgrVtbl CategoryMgr_CategoryMgrVtbl =
+static const ITfCategoryMgrVtbl CategoryMgrVtbl =
{
CategoryMgr_QueryInterface,
CategoryMgr_AddRef,
CategoryMgr_Release,
-
CategoryMgr_RegisterCategory,
CategoryMgr_UnregisterCategory,
CategoryMgr_EnumCategoriesInItem,
if (This == NULL)
return E_OUTOFMEMORY;
- This->ITfCategoryMgr_iface.lpVtbl = &CategoryMgr_CategoryMgrVtbl;
+ This->ITfCategoryMgr_iface.lpVtbl = &CategoryMgrVtbl;
This->refCount = 1;
- TRACE("returning %p\n", This);
- *ppOut = (IUnknown *)This;
+ *ppOut = (IUnknown *)&This->ITfCategoryMgr_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
} CompartmentValue;
typedef struct tagCompartmentMgr {
- const ITfCompartmentMgrVtbl *CompartmentMgrVtbl;
+ ITfCompartmentMgr ITfCompartmentMgr_iface;
LONG refCount;
IUnknown *pUnkOuter;
} CompartmentMgr;
typedef struct tagCompartmentEnumGuid {
- const IEnumGUIDVtbl *Vtbl;
+ IEnumGUID IEnumGUID_iface;
LONG refCount;
struct list *values;
} CompartmentSink;
typedef struct tagCompartment {
- const ITfCompartmentVtbl *Vtbl;
- const ITfSourceVtbl *SourceVtbl;
+ ITfCompartment ITfCompartment_iface;
+ ITfSource ITfSource_iface;
LONG refCount;
/* Only VT_I4, VT_UNKNOWN and VT_BSTR data types are allowed */
static HRESULT CompartmentEnumGuid_Constructor(struct list* values, IEnumGUID **ppOut);
static HRESULT Compartment_Constructor(CompartmentValue *value, ITfCompartment **ppOut);
-static inline Compartment *impl_from_ITfSourceVtbl(ITfSource *iface)
+static inline CompartmentMgr *impl_from_ITfCompartmentMgr(ITfCompartmentMgr *iface)
{
- return (Compartment *)((char *)iface - FIELD_OFFSET(Compartment,SourceVtbl));
+ return CONTAINING_RECORD(iface, CompartmentMgr, ITfCompartmentMgr_iface);
+}
+
+static inline Compartment *impl_from_ITfCompartment(ITfCompartment *iface)
+{
+ return CONTAINING_RECORD(iface, Compartment, ITfCompartment_iface);
+}
+
+static inline Compartment *impl_from_ITfSource(ITfSource *iface)
+{
+ return CONTAINING_RECORD(iface, Compartment, ITfSource_iface);
+}
+
+static inline CompartmentEnumGuid *impl_from_IEnumGUID(IEnumGUID *iface)
+{
+ return CONTAINING_RECORD(iface, CompartmentEnumGuid, IEnumGUID_iface);
}
HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *iface)
{
- CompartmentMgr *This = (CompartmentMgr *)iface;
+ CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
struct list *cursor, *cursor2;
LIST_FOR_EACH_SAFE(cursor, cursor2, &This->values)
*****************************************************/
static HRESULT WINAPI CompartmentMgr_QueryInterface(ITfCompartmentMgr *iface, REFIID iid, LPVOID *ppvOut)
{
- CompartmentMgr *This = (CompartmentMgr *)iface;
+ CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
if (This->pUnkOuter)
- return IUnknown_QueryInterface(This->pUnkOuter, iid, *ppvOut);
+ return IUnknown_QueryInterface(This->pUnkOuter, iid, ppvOut);
else
{
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCompartmentMgr))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfCompartmentMgr_iface;
}
if (*ppvOut)
static ULONG WINAPI CompartmentMgr_AddRef(ITfCompartmentMgr *iface)
{
- CompartmentMgr *This = (CompartmentMgr *)iface;
+ CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
if (This->pUnkOuter)
return IUnknown_AddRef(This->pUnkOuter);
else
static ULONG WINAPI CompartmentMgr_Release(ITfCompartmentMgr *iface)
{
- CompartmentMgr *This = (CompartmentMgr *)iface;
+ CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
if (This->pUnkOuter)
return IUnknown_Release(This->pUnkOuter);
else
static HRESULT WINAPI CompartmentMgr_GetCompartment(ITfCompartmentMgr *iface,
REFGUID rguid, ITfCompartment **ppcomp)
{
- CompartmentMgr *This = (CompartmentMgr *)iface;
+ CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
CompartmentValue* value;
struct list *cursor;
HRESULT hr;
static HRESULT WINAPI CompartmentMgr_ClearCompartment(ITfCompartmentMgr *iface,
TfClientId tid, REFGUID rguid)
{
+ CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
struct list *cursor;
- CompartmentMgr *This = (CompartmentMgr *)iface;
+
TRACE("(%p) %i %s\n",This,tid,debugstr_guid(rguid));
LIST_FOR_EACH(cursor, &This->values)
static HRESULT WINAPI CompartmentMgr_EnumCompartments(ITfCompartmentMgr *iface,
IEnumGUID **ppEnum)
{
- CompartmentMgr *This = (CompartmentMgr *)iface;
+ CompartmentMgr *This = impl_from_ITfCompartmentMgr(iface);
+
TRACE("(%p) %p\n",This,ppEnum);
if (!ppEnum)
return E_INVALIDARG;
return CompartmentEnumGuid_Constructor(&This->values, ppEnum);
}
-static const ITfCompartmentMgrVtbl CompartmentMgr_CompartmentMgrVtbl =
+static const ITfCompartmentMgrVtbl CompartmentMgrVtbl =
{
CompartmentMgr_QueryInterface,
CompartmentMgr_AddRef,
CompartmentMgr_Release,
-
CompartmentMgr_GetCompartment,
CompartmentMgr_ClearCompartment,
CompartmentMgr_EnumCompartments
if (This == NULL)
return E_OUTOFMEMORY;
- This->CompartmentMgrVtbl = &CompartmentMgr_CompartmentMgrVtbl;
+ This->ITfCompartmentMgr_iface.lpVtbl = &CompartmentMgrVtbl;
This->pUnkOuter = pUnkOuter;
list_init(&This->values);
if (pUnkOuter)
{
- TRACE("returning %p\n", This);
- *ppOut = (IUnknown*)This;
+ *ppOut = (IUnknown*)&This->ITfCompartmentMgr_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
else
{
HRESULT hr;
- hr = IUnknown_QueryInterface((IUnknown*)This, riid, (LPVOID*)ppOut);
+ hr = ITfCompartmentMgr_QueryInterface(&This->ITfCompartmentMgr_iface, riid, (void**)ppOut);
if (FAILED(hr))
HeapFree(GetProcessHeap(),0,This);
return hr;
static HRESULT WINAPI CompartmentEnumGuid_QueryInterface(IEnumGUID *iface, REFIID iid, LPVOID *ppvOut)
{
- CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface;
+ CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumGUID))
{
- *ppvOut = This;
+ *ppvOut = &This->IEnumGUID_iface;
}
if (*ppvOut)
static ULONG WINAPI CompartmentEnumGuid_AddRef(IEnumGUID *iface)
{
- CompartmentEnumGuid *This = (CompartmentEnumGuid*)iface;
+ CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI CompartmentEnumGuid_Release(IEnumGUID *iface)
{
- CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface;
+ CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
/*****************************************************
* IEnumGuid functions
*****************************************************/
-static HRESULT WINAPI CompartmentEnumGuid_Next( LPENUMGUID iface,
+static HRESULT WINAPI CompartmentEnumGuid_Next(IEnumGUID *iface,
ULONG celt, GUID *rgelt, ULONG *pceltFetched)
{
- CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface;
+ CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
ULONG fetched = 0;
TRACE("(%p)\n",This);
return fetched == celt ? S_OK : S_FALSE;
}
-static HRESULT WINAPI CompartmentEnumGuid_Skip( LPENUMGUID iface, ULONG celt)
+static HRESULT WINAPI CompartmentEnumGuid_Skip(IEnumGUID *iface, ULONG celt)
{
- CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface;
+ CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
TRACE("(%p)\n",This);
This->cursor = list_next(This->values,This->cursor);
return S_OK;
}
-static HRESULT WINAPI CompartmentEnumGuid_Reset( LPENUMGUID iface)
+static HRESULT WINAPI CompartmentEnumGuid_Reset(IEnumGUID *iface)
{
- CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface;
+ CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
TRACE("(%p)\n",This);
This->cursor = list_head(This->values);
return S_OK;
}
-static HRESULT WINAPI CompartmentEnumGuid_Clone( LPENUMGUID iface,
+static HRESULT WINAPI CompartmentEnumGuid_Clone(IEnumGUID *iface,
IEnumGUID **ppenum)
{
- CompartmentEnumGuid *This = (CompartmentEnumGuid *)iface;
+ CompartmentEnumGuid *This = impl_from_IEnumGUID(iface);
HRESULT res;
TRACE("(%p)\n",This);
res = CompartmentEnumGuid_Constructor(This->values, ppenum);
if (SUCCEEDED(res))
{
- CompartmentEnumGuid *new_This = (CompartmentEnumGuid *)*ppenum;
+ CompartmentEnumGuid *new_This = impl_from_IEnumGUID(*ppenum);
new_This->cursor = This->cursor;
}
return res;
}
-static const IEnumGUIDVtbl IEnumGUID_Vtbl ={
+static const IEnumGUIDVtbl EnumGUIDVtbl =
+{
CompartmentEnumGuid_QueryInterface,
CompartmentEnumGuid_AddRef,
CompartmentEnumGuid_Release,
-
CompartmentEnumGuid_Next,
CompartmentEnumGuid_Skip,
CompartmentEnumGuid_Reset,
if (This == NULL)
return E_OUTOFMEMORY;
- This->Vtbl= &IEnumGUID_Vtbl;
+ This->IEnumGUID_iface.lpVtbl= &EnumGUIDVtbl;
This->refCount = 1;
This->values = values;
This->cursor = list_head(values);
- TRACE("returning %p\n", This);
- *ppOut = (IEnumGUID*)This;
+ *ppOut = &This->IEnumGUID_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
static HRESULT WINAPI Compartment_QueryInterface(ITfCompartment *iface, REFIID iid, LPVOID *ppvOut)
{
- Compartment *This = (Compartment *)iface;
+ Compartment *This = impl_from_ITfCompartment(iface);
+
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCompartment))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfCompartment_iface;
}
else if (IsEqualIID(iid, &IID_ITfSource))
{
- *ppvOut = &This->SourceVtbl;
+ *ppvOut = &This->ITfSource_iface;
}
if (*ppvOut)
static ULONG WINAPI Compartment_AddRef(ITfCompartment *iface)
{
- Compartment *This = (Compartment*)iface;
+ Compartment *This = impl_from_ITfCompartment(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI Compartment_Release(ITfCompartment *iface)
{
- Compartment *This = (Compartment *)iface;
+ Compartment *This = impl_from_ITfCompartment(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
static HRESULT WINAPI Compartment_SetValue(ITfCompartment *iface,
TfClientId tid, const VARIANT *pvarValue)
{
- Compartment *This = (Compartment *)iface;
+ Compartment *This = impl_from_ITfCompartment(iface);
struct list *cursor;
TRACE("(%p) %i %p\n",This,tid,pvarValue);
static HRESULT WINAPI Compartment_GetValue(ITfCompartment *iface,
VARIANT *pvarValue)
{
- Compartment *This = (Compartment *)iface;
+ Compartment *This = impl_from_ITfCompartment(iface);
TRACE("(%p) %p\n",This, pvarValue);
if (!pvarValue)
return VariantCopy(pvarValue,&This->variant);
}
-static const ITfCompartmentVtbl ITfCompartment_Vtbl ={
+static const ITfCompartmentVtbl CompartmentVtbl =
+{
Compartment_QueryInterface,
Compartment_AddRef,
Compartment_Release,
-
Compartment_SetValue,
Compartment_GetValue
};
* ITfSource functions
*****************************************************/
-static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
+static HRESULT WINAPI CompartmentSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{
- Compartment *This = impl_from_ITfSourceVtbl(iface);
- return Compartment_QueryInterface((ITfCompartment *)This, iid, *ppvOut);
+ Compartment *This = impl_from_ITfSource(iface);
+ return ITfCompartment_QueryInterface(&This->ITfCompartment_iface, iid, ppvOut);
}
-static ULONG WINAPI Source_AddRef(ITfSource *iface)
+static ULONG WINAPI CompartmentSource_AddRef(ITfSource *iface)
{
- Compartment *This = impl_from_ITfSourceVtbl(iface);
- return Compartment_AddRef((ITfCompartment*)This);
+ Compartment *This = impl_from_ITfSource(iface);
+ return ITfCompartment_AddRef(&This->ITfCompartment_iface);
}
-static ULONG WINAPI Source_Release(ITfSource *iface)
+static ULONG WINAPI CompartmentSource_Release(ITfSource *iface)
{
- Compartment *This = impl_from_ITfSourceVtbl(iface);
- return Compartment_Release((ITfCompartment *)This);
+ Compartment *This = impl_from_ITfSource(iface);
+ return ITfCompartment_Release(&This->ITfCompartment_iface);
}
static HRESULT WINAPI CompartmentSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{
+ Compartment *This = impl_from_ITfSource(iface);
CompartmentSink *cs;
- Compartment *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
static HRESULT WINAPI CompartmentSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{
+ Compartment *This = impl_from_ITfSource(iface);
CompartmentSink *sink;
- Compartment *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %x\n",This,pdwCookie);
return S_OK;
}
-static const ITfSourceVtbl Compartment_SourceVtbl =
+static const ITfSourceVtbl CompartmentSourceVtbl =
{
- Source_QueryInterface,
- Source_AddRef,
- Source_Release,
-
+ CompartmentSource_QueryInterface,
+ CompartmentSource_AddRef,
+ CompartmentSource_Release,
CompartmentSource_AdviseSink,
CompartmentSource_UnadviseSink,
};
if (This == NULL)
return E_OUTOFMEMORY;
- This->Vtbl= &ITfCompartment_Vtbl;
- This->SourceVtbl = &Compartment_SourceVtbl;
+ This->ITfCompartment_iface.lpVtbl= &CompartmentVtbl;
+ This->ITfSource_iface.lpVtbl = &CompartmentSourceVtbl;
This->refCount = 1;
This->valueData = valueData;
list_init(&This->CompartmentEventSink);
- TRACE("returning %p\n", This);
- *ppOut = (ITfCompartment*)This;
+ *ppOut = &This->ITfCompartment_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
} ContextSink;
typedef struct tagContext {
- const ITfContextVtbl *ContextVtbl;
- const ITfSourceVtbl *SourceVtbl;
+ ITfContext ITfContext_iface;
+ ITfSource ITfSource_iface;
/* const ITfContextCompositionVtbl *ContextCompositionVtbl; */
/* const ITfContextOwnerCompositionServicesVtbl *ContextOwnerCompositionServicesVtbl; */
/* const ITfContextOwnerServicesVtbl *ContextOwnerServicesVtbl; */
- const ITfInsertAtSelectionVtbl *InsertAtSelectionVtbl;
+ ITfInsertAtSelection ITfInsertAtSelection_iface;
/* const ITfMouseTrackerVtbl *MouseTrackerVtbl; */
/* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */
- const ITfSourceSingleVtbl *SourceSingleVtbl;
+ ITfSourceSingle ITfSourceSingle_iface;
LONG refCount;
BOOL connected;
} EditCookie;
typedef struct tagTextStoreACPSink {
- const ITextStoreACPSinkVtbl *TextStoreACPSinkVtbl;
+ ITextStoreACPSink ITextStoreACPSink_iface;
/* const ITextStoreACPServicesVtbl *TextStoreACPServicesVtbl; */
LONG refCount;
static HRESULT TextStoreACPSink_Constructor(ITextStoreACPSink **ppOut, Context *pContext);
-static inline Context *impl_from_ITfSourceVtbl(ITfSource *iface)
+static inline Context *impl_from_ITfContext(ITfContext *iface)
{
- return (Context *)((char *)iface - FIELD_OFFSET(Context,SourceVtbl));
+ return CONTAINING_RECORD(iface, Context, ITfContext_iface);
}
-static inline Context *impl_from_ITfInsertAtSelectionVtbl(ITfInsertAtSelection*iface)
+static inline Context *impl_from_ITfSource(ITfSource *iface)
{
- return (Context *)((char *)iface - FIELD_OFFSET(Context,InsertAtSelectionVtbl));
+ return CONTAINING_RECORD(iface, Context, ITfSource_iface);
}
-static inline Context *impl_from_ITfSourceSingleVtbl(ITfSourceSingle* iface)
+static inline Context *impl_from_ITfInsertAtSelection(ITfInsertAtSelection *iface)
{
- return (Context *)((char *)iface - FIELD_OFFSET(Context,SourceSingleVtbl));
+ return CONTAINING_RECORD(iface, Context, ITfInsertAtSelection_iface);
+}
+
+static inline Context *impl_from_ITfSourceSingle(ITfSourceSingle* iface)
+{
+ return CONTAINING_RECORD(iface, Context, ITfSourceSingle_iface);
+}
+
+static inline TextStoreACPSink *impl_from_ITextStoreACPSink(ITextStoreACPSink *iface)
+{
+ return CONTAINING_RECORD(iface, TextStoreACPSink, ITextStoreACPSink_iface);
}
static void free_sink(ContextSink *sink)
static HRESULT WINAPI Context_QueryInterface(ITfContext *iface, REFIID iid, LPVOID *ppvOut)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfContext))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfContext_iface;
}
else if (IsEqualIID(iid, &IID_ITfSource))
{
- *ppvOut = &This->SourceVtbl;
+ *ppvOut = &This->ITfSource_iface;
}
else if (IsEqualIID(iid, &IID_ITfInsertAtSelection))
{
- *ppvOut = &This->InsertAtSelectionVtbl;
+ *ppvOut = &This->ITfInsertAtSelection_iface;
}
else if (IsEqualIID(iid, &IID_ITfCompartmentMgr))
{
}
else if (IsEqualIID(iid, &IID_ITfSourceSingle))
{
- *ppvOut = &This->SourceSingleVtbl;
+ *ppvOut = &This->ITfSourceSingle_iface;
}
if (*ppvOut)
static ULONG WINAPI Context_AddRef(ITfContext *iface)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI Context_Release(ITfContext *iface)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
TfClientId tid, ITfEditSession *pes, DWORD dwFlags,
HRESULT *phrSession)
{
+ Context *This = impl_from_ITfContext(iface);
HRESULT hr;
- Context *This = (Context *)iface;
DWORD dwLockFlags = 0x0;
TRACE("(%p) %i %p %x %p\n",This, tid, pes, dwFlags, phrSession);
TfClientId tid,
BOOL *pfWriteSession)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
TfEditCookie ec, ULONG ulIndex, ULONG ulCount,
TF_SELECTION *pSelection, ULONG *pcFetched)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
EditCookie *cookie;
ULONG count, i;
ULONG totalFetched = 0;
static HRESULT WINAPI Context_SetSelection (ITfContext *iface,
TfEditCookie ec, ULONG ulCount, const TF_SELECTION *pSelection)
{
+ Context *This = impl_from_ITfContext(iface);
TS_SELECTION_ACP *acp;
- Context *This = (Context *)iface;
ULONG i;
HRESULT hr;
static HRESULT WINAPI Context_GetStart (ITfContext *iface,
TfEditCookie ec, ITfRange **ppStart)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
EditCookie *cookie;
TRACE("(%p) %i %p\n",This,ec,ppStart);
static HRESULT WINAPI Context_GetEnd (ITfContext *iface,
TfEditCookie ec, ITfRange **ppEnd)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
EditCookie *cookie;
LONG end;
TRACE("(%p) %i %p\n",This,ec,ppEnd);
static HRESULT WINAPI Context_GetActiveView (ITfContext *iface,
ITfContextView **ppView)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Context_EnumViews (ITfContext *iface,
IEnumTfContextViews **ppEnum)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Context_GetStatus (ITfContext *iface,
TF_STATUS *pdcs)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
TRACE("(%p) %p\n",This,pdcs);
if (!This->connected)
static HRESULT WINAPI Context_GetProperty (ITfContext *iface,
REFGUID guidProp, ITfProperty **ppProp)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Context_GetAppProperty (ITfContext *iface,
REFGUID guidProp, ITfReadOnlyProperty **ppProp)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
const GUID **prgProp, ULONG cProp, const GUID **prgAppProp,
ULONG cAppProp, ITfReadOnlyProperty **ppProperty)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Context_EnumProperties (ITfContext *iface,
IEnumTfProperties **ppEnum)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Context_GetDocumentMgr (ITfContext *iface,
ITfDocumentMgr **ppDm)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
TRACE("(%p) %p\n",This,ppDm);
if (!ppDm)
static HRESULT WINAPI Context_CreateRangeBackup (ITfContext *iface,
TfEditCookie ec, ITfRange *pRange, ITfRangeBackup **ppBackup)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
-static const ITfContextVtbl Context_ContextVtbl =
+static const ITfContextVtbl ContextVtbl =
{
Context_QueryInterface,
Context_AddRef,
Context_Release,
-
Context_RequestEditSession,
Context_InWriteSession,
Context_GetSelection,
Context_CreateRangeBackup
};
-static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
+static HRESULT WINAPI ContextSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{
- Context *This = impl_from_ITfSourceVtbl(iface);
- return Context_QueryInterface((ITfContext *)This, iid, *ppvOut);
+ Context *This = impl_from_ITfSource(iface);
+ return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
}
-static ULONG WINAPI Source_AddRef(ITfSource *iface)
+static ULONG WINAPI ContextSource_AddRef(ITfSource *iface)
{
- Context *This = impl_from_ITfSourceVtbl(iface);
- return Context_AddRef((ITfContext *)This);
+ Context *This = impl_from_ITfSource(iface);
+ return ITfContext_AddRef(&This->ITfContext_iface);
}
-static ULONG WINAPI Source_Release(ITfSource *iface)
+static ULONG WINAPI ContextSource_Release(ITfSource *iface)
{
- Context *This = impl_from_ITfSourceVtbl(iface);
- return Context_Release((ITfContext *)This);
+ Context *This = impl_from_ITfSource(iface);
+ return ITfContext_Release(&This->ITfContext_iface);
}
/*****************************************************
static HRESULT WINAPI ContextSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{
+ Context *This = impl_from_ITfSource(iface);
ContextSink *es;
- Context *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
if (!riid || !punk || !pdwCookie)
static HRESULT WINAPI ContextSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{
+ Context *This = impl_from_ITfSource(iface);
ContextSink *sink;
- Context *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %x\n",This,pdwCookie);
return S_OK;
}
-static const ITfSourceVtbl Context_SourceVtbl =
+static const ITfSourceVtbl ContextSourceVtbl =
{
- Source_QueryInterface,
- Source_AddRef,
- Source_Release,
-
+ ContextSource_QueryInterface,
+ ContextSource_AddRef,
+ ContextSource_Release,
ContextSource_AdviseSink,
- ContextSource_UnadviseSink,
+ ContextSource_UnadviseSink
};
/*****************************************************
*****************************************************/
static HRESULT WINAPI InsertAtSelection_QueryInterface(ITfInsertAtSelection *iface, REFIID iid, LPVOID *ppvOut)
{
- Context *This = impl_from_ITfInsertAtSelectionVtbl(iface);
- return Context_QueryInterface((ITfContext *)This, iid, *ppvOut);
+ Context *This = impl_from_ITfInsertAtSelection(iface);
+ return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
}
static ULONG WINAPI InsertAtSelection_AddRef(ITfInsertAtSelection *iface)
{
- Context *This = impl_from_ITfInsertAtSelectionVtbl(iface);
- return Context_AddRef((ITfContext *)This);
+ Context *This = impl_from_ITfInsertAtSelection(iface);
+ return ITfContext_AddRef(&This->ITfContext_iface);
}
static ULONG WINAPI InsertAtSelection_Release(ITfInsertAtSelection *iface)
{
- Context *This = impl_from_ITfInsertAtSelectionVtbl(iface);
- return Context_Release((ITfContext *)This);
+ Context *This = impl_from_ITfInsertAtSelection(iface);
+ return ITfContext_Release(&This->ITfContext_iface);
}
static HRESULT WINAPI InsertAtSelection_InsertTextAtSelection(
ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags,
const WCHAR *pchText, LONG cch, ITfRange **ppRange)
{
- Context *This = impl_from_ITfInsertAtSelectionVtbl(iface);
+ Context *This = impl_from_ITfInsertAtSelection(iface);
EditCookie *cookie;
LONG acpStart, acpEnd;
TS_TEXTCHANGE change;
hr = ITextStoreACP_InsertTextAtSelection(This->pITextStoreACP, dwFlags, pchText, cch, &acpStart, &acpEnd, &change);
if (SUCCEEDED(hr))
- Range_Constructor((ITfContext*)This, This->pITextStoreACP, cookie->lockType, change.acpStart, change.acpNewEnd, ppRange);
+ Range_Constructor(&This->ITfContext_iface, This->pITextStoreACP, cookie->lockType, change.acpStart, change.acpNewEnd, ppRange);
return hr;
}
ITfInsertAtSelection *iface, TfEditCookie ec, DWORD dwFlags,
IDataObject *pDataObject, ITfRange **ppRange)
{
- Context *This = impl_from_ITfInsertAtSelectionVtbl(iface);
+ Context *This = impl_from_ITfInsertAtSelection(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
-static const ITfInsertAtSelectionVtbl Context_InsertAtSelectionVtbl =
+static const ITfInsertAtSelectionVtbl InsertAtSelectionVtbl =
{
InsertAtSelection_QueryInterface,
InsertAtSelection_AddRef,
InsertAtSelection_Release,
-
InsertAtSelection_InsertTextAtSelection,
InsertAtSelection_InsertEmbeddedAtSelection,
};
*****************************************************/
static HRESULT WINAPI SourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
{
- Context *This = impl_from_ITfSourceSingleVtbl(iface);
- return Context_QueryInterface((ITfContext *)This, iid, *ppvOut);
+ Context *This = impl_from_ITfSourceSingle(iface);
+ return ITfContext_QueryInterface(&This->ITfContext_iface, iid, ppvOut);
}
static ULONG WINAPI SourceSingle_AddRef(ITfSourceSingle *iface)
{
- Context *This = impl_from_ITfSourceSingleVtbl(iface);
- return Context_AddRef((ITfContext *)This);
+ Context *This = impl_from_ITfSourceSingle(iface);
+ return ITfContext_AddRef(&This->ITfContext_iface);
}
static ULONG WINAPI SourceSingle_Release(ITfSourceSingle *iface)
{
- Context *This = impl_from_ITfSourceSingleVtbl(iface);
- return Context_Release((ITfContext *)This);
+ Context *This = impl_from_ITfSourceSingle(iface);
+ return ITfContext_Release(&This->ITfContext_iface);
}
static HRESULT WINAPI SourceSingle_AdviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid, IUnknown *punk)
{
- Context *This = impl_from_ITfSourceSingleVtbl(iface);
+ Context *This = impl_from_ITfSourceSingle(iface);
FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk);
return E_NOTIMPL;
}
static HRESULT WINAPI SourceSingle_UnadviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid)
{
- Context *This = impl_from_ITfSourceSingleVtbl(iface);
+ Context *This = impl_from_ITfSourceSingle(iface);
FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid));
return E_NOTIMPL;
}
-static const ITfSourceSingleVtbl Context_SourceSingleVtbl =
+static const ITfSourceSingleVtbl ContextSourceSingleVtbl =
{
SourceSingle_QueryInterface,
SourceSingle_AddRef,
SourceSingle_Release,
-
SourceSingle_AdviseSingleSink,
SourceSingle_UnadviseSingleSink,
};
TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore);
- This->ContextVtbl= &Context_ContextVtbl;
- This->SourceVtbl = &Context_SourceVtbl;
- This->InsertAtSelectionVtbl = &Context_InsertAtSelectionVtbl;
- This->SourceSingleVtbl = &Context_SourceSingleVtbl;
+ This->ITfContext_iface.lpVtbl= &ContextVtbl;
+ This->ITfSource_iface.lpVtbl = &ContextSourceVtbl;
+ This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl;
+ This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl;
This->refCount = 1;
This->tidOwner = tidOwner;
This->connected = FALSE;
This->manager = mgr;
- CompartmentMgr_Constructor((IUnknown*)This, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
+ CompartmentMgr_Constructor((IUnknown*)&This->ITfContext_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
cookie->lockType = TF_ES_READ;
cookie->pOwningContext = This;
list_init(&This->pTextEditSink);
list_init(&This->pTextLayoutSink);
- *ppOut = (ITfContext*)This;
- TRACE("returning %p\n", This);
+ *ppOut = &This->ITfContext_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
if (This->pITextStoreACP)
{
HRESULT Context_Uninitialize(ITfContext *iface)
{
- Context *This = (Context *)iface;
+ Context *This = impl_from_ITfContext(iface);
if (This->pITextStoreACPSink)
{
static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface, REFIID iid, LPVOID *ppvOut)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITextStoreACPSink))
{
- *ppvOut = This;
+ *ppvOut = &This->ITextStoreACPSink_iface;
}
if (*ppvOut)
static ULONG WINAPI TextStoreACPSink_AddRef(ITextStoreACPSink *iface)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI TextStoreACPSink_Release(ITextStoreACPSink *iface)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
static HRESULT WINAPI TextStoreACPSink_OnTextChange(ITextStoreACPSink *iface,
DWORD dwFlags, const TS_TEXTCHANGE *pChange)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI TextStoreACPSink_OnSelectionChange(ITextStoreACPSink *iface)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface,
TsLayoutCode lcode, TsViewCookie vcView)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface,
DWORD dwFlags)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
HRESULT hr, hrSession;
TRACE("(%p) %x\n",This, dwFlags);
static HRESULT WINAPI TextStoreACPSink_OnAttrsChange(ITextStoreACPSink *iface,
LONG acpStart, LONG acpEnd, ULONG cAttrs, const TS_ATTRID *paAttrs)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
DWORD dwLockFlags)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
HRESULT hr;
EditCookie *cookie,*sinkcookie;
TfEditCookie ec;
static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction(ITextStoreACPSink *iface)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction(ITextStoreACPSink *iface)
{
- TextStoreACPSink *This = (TextStoreACPSink *)iface;
+ TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
-static const ITextStoreACPSinkVtbl TextStoreACPSink_TextStoreACPSinkVtbl =
+static const ITextStoreACPSinkVtbl TextStoreACPSinkVtbl =
{
TextStoreACPSink_QueryInterface,
TextStoreACPSink_AddRef,
TextStoreACPSink_Release,
-
TextStoreACPSink_OnTextChange,
TextStoreACPSink_OnSelectionChange,
TextStoreACPSink_OnLayoutChange,
if (This == NULL)
return E_OUTOFMEMORY;
- This->TextStoreACPSinkVtbl= &TextStoreACPSink_TextStoreACPSinkVtbl;
+ This->ITextStoreACPSink_iface.lpVtbl= &TextStoreACPSinkVtbl;
This->refCount = 1;
This->pContext = pContext;
- TRACE("returning %p\n", This);
- *ppOut = (ITextStoreACPSink*)This;
+ *ppOut = &This->ITextStoreACPSink_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfDisplayAttributeMgr_iface;
}
if (*ppvOut)
return E_NOTIMPL;
}
-static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgr_DisplayAttributeMgrVtbl =
+static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgrVtbl =
{
DisplayAttributeMgr_QueryInterface,
DisplayAttributeMgr_AddRef,
DisplayAttributeMgr_Release,
-
DisplayAttributeMgr_OnUpdateInfo,
DisplayAttributeMgr_EnumDisplayAttributeInfo,
DisplayAttributeMgr_GetDisplayAttributeInfo
if (This == NULL)
return E_OUTOFMEMORY;
- This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgr_DisplayAttributeMgrVtbl;
+ This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgrVtbl;
This->refCount = 1;
- TRACE("returning %p\n", This);
- *ppOut = (IUnknown *)This;
+ *ppOut = (IUnknown *)&This->ITfDisplayAttributeMgr_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDocumentMgr))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfDocumentMgr_iface;
}
else if (IsEqualIID(iid, &IID_ITfSource))
{
if (dwFlags == TF_POPF_ALL)
{
- if (This->contextStack[0])
- {
- ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[0]);
- Context_Uninitialize(This->contextStack[0]);
- ITfContext_Release(This->contextStack[0]);
- }
- if (This->contextStack[1])
- {
- ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[1]);
- Context_Uninitialize(This->contextStack[1]);
- ITfContext_Release(This->contextStack[1]);
- }
- This->contextStack[0] = This->contextStack[1] = NULL;
+ int i;
+
+ for (i = 0; i < sizeof(This->contextStack)/sizeof(This->contextStack[0]); i++)
+ if (This->contextStack[i])
+ {
+ ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink, This->contextStack[i]);
+ Context_Uninitialize(This->contextStack[i]);
+ ITfContext_Release(This->contextStack[i]);
+ This->contextStack[i] = NULL;
+ }
+
ITfThreadMgrEventSink_OnUninitDocumentMgr(This->ThreadMgrSink, iface);
return S_OK;
}
return EnumTfContext_Constructor(This, ppEnum);
}
-static const ITfDocumentMgrVtbl DocumentMgr_DocumentMgrVtbl =
+static const ITfDocumentMgrVtbl DocumentMgrVtbl =
{
DocumentMgr_QueryInterface,
DocumentMgr_AddRef,
DocumentMgr_Release,
-
DocumentMgr_CreateContext,
DocumentMgr_Push,
DocumentMgr_Pop,
DocumentMgr_EnumContexts
};
-
-static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
+static HRESULT WINAPI DocumentMgrSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{
DocumentMgr *This = impl_from_ITfSource(iface);
- return DocumentMgr_QueryInterface(&This->ITfDocumentMgr_iface, iid, *ppvOut);
+ return ITfDocumentMgr_QueryInterface(&This->ITfDocumentMgr_iface, iid, ppvOut);
}
-static ULONG WINAPI Source_AddRef(ITfSource *iface)
+static ULONG WINAPI DocumentMgrSource_AddRef(ITfSource *iface)
{
DocumentMgr *This = impl_from_ITfSource(iface);
- return DocumentMgr_AddRef(&This->ITfDocumentMgr_iface);
+ return ITfDocumentMgr_AddRef(&This->ITfDocumentMgr_iface);
}
-static ULONG WINAPI Source_Release(ITfSource *iface)
+static ULONG WINAPI DocumentMgrSource_Release(ITfSource *iface)
{
DocumentMgr *This = impl_from_ITfSource(iface);
- return DocumentMgr_Release(&This->ITfDocumentMgr_iface);
+ return ITfDocumentMgr_Release(&This->ITfDocumentMgr_iface);
}
/*****************************************************
return E_NOTIMPL;
}
-static const ITfSourceVtbl DocumentMgr_SourceVtbl =
+static const ITfSourceVtbl DocumentMgrSourceVtbl =
{
- Source_QueryInterface,
- Source_AddRef,
- Source_Release,
-
+ DocumentMgrSource_QueryInterface,
+ DocumentMgrSource_AddRef,
+ DocumentMgrSource_Release,
DocumentMgrSource_AdviseSink,
DocumentMgrSource_UnadviseSink,
};
if (This == NULL)
return E_OUTOFMEMORY;
- This->ITfDocumentMgr_iface.lpVtbl = &DocumentMgr_DocumentMgrVtbl;
- This->ITfSource_iface.lpVtbl = &DocumentMgr_SourceVtbl;
+ This->ITfDocumentMgr_iface.lpVtbl = &DocumentMgrVtbl;
+ This->ITfSource_iface.lpVtbl = &DocumentMgrSourceVtbl;
This->refCount = 1;
This->ThreadMgrSink = ThreadMgrSink;
- CompartmentMgr_Constructor((IUnknown*)This, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
+ CompartmentMgr_Constructor((IUnknown*)&This->ITfDocumentMgr_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
- TRACE("returning %p\n", This);
*ppOut = &This->ITfDocumentMgr_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfContexts))
{
- *ppvOut = This;
+ *ppvOut = &This->IEnumTfContexts_iface;
}
if (*ppvOut)
This->refCount = 1;
This->docmgr = mgr;
- TRACE("returning %p\n", This);
*ppOut = &This->IEnumTfContexts_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
} InputProcessorProfilesSink;
typedef struct tagInputProcessorProfiles {
- const ITfInputProcessorProfilesVtbl *InputProcessorProfilesVtbl;
- const ITfSourceVtbl *SourceVtbl;
+ ITfInputProcessorProfiles ITfInputProcessorProfiles_iface;
+ ITfSource ITfSource_iface;
/* const ITfInputProcessorProfileMgrVtbl *InputProcessorProfileMgrVtbl; */
/* const ITfInputProcessorProfilesExVtbl *InputProcessorProfilesExVtbl; */
/* const ITfInputProcessorProfileSubstituteLayoutVtbl *InputProcessorProfileSubstituteLayoutVtbl; */
} InputProcessorProfiles;
typedef struct tagProfilesEnumGuid {
- const IEnumGUIDVtbl *Vtbl;
+ IEnumGUID IEnumGUID_iface;
LONG refCount;
HKEY key;
} ProfilesEnumGuid;
typedef struct tagEnumTfLanguageProfiles {
- const IEnumTfLanguageProfilesVtbl *Vtbl;
+ IEnumTfLanguageProfiles IEnumTfLanguageProfiles_iface;
LONG refCount;
HKEY tipkey;
static HRESULT ProfilesEnumGuid_Constructor(IEnumGUID **ppOut);
static HRESULT EnumTfLanguageProfiles_Constructor(LANGID langid, IEnumTfLanguageProfiles **ppOut);
-static inline InputProcessorProfiles *impl_from_ITfSourceVtbl(ITfSource *iface)
+static inline InputProcessorProfiles *impl_from_ITfInputProcessorProfiles(ITfInputProcessorProfiles *iface)
{
- return (InputProcessorProfiles *)((char *)iface - FIELD_OFFSET(InputProcessorProfiles,SourceVtbl));
+ return CONTAINING_RECORD(iface, InputProcessorProfiles, ITfInputProcessorProfiles_iface);
+}
+
+static inline InputProcessorProfiles *impl_from_ITfSource(ITfSource *iface)
+{
+ return CONTAINING_RECORD(iface, InputProcessorProfiles, ITfSource_iface);
+}
+
+static inline ProfilesEnumGuid *impl_from_IEnumGUID(IEnumGUID *iface)
+{
+ return CONTAINING_RECORD(iface, ProfilesEnumGuid, IEnumGUID_iface);
+}
+
+static inline EnumTfLanguageProfiles *impl_from_IEnumTfLanguageProfiles(IEnumTfLanguageProfiles *iface)
+{
+ return CONTAINING_RECORD(iface, EnumTfLanguageProfiles, IEnumTfLanguageProfiles_iface);
}
static void free_sink(InputProcessorProfilesSink *sink)
static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorProfiles *iface, REFIID iid, LPVOID *ppvOut)
{
- InputProcessorProfiles *This = (InputProcessorProfiles *)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfInputProcessorProfiles))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfInputProcessorProfiles_iface;
}
else if (IsEqualIID(iid, &IID_ITfSource))
{
- *ppvOut = &This->SourceVtbl;
+ *ppvOut = &This->ITfSource_iface;
}
if (*ppvOut)
static ULONG WINAPI InputProcessorProfiles_AddRef(ITfInputProcessorProfiles *iface)
{
- InputProcessorProfiles *This = (InputProcessorProfiles *)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI InputProcessorProfiles_Release(ITfInputProcessorProfiles *iface)
{
- InputProcessorProfiles *This = (InputProcessorProfiles *)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
static HRESULT WINAPI InputProcessorProfiles_Register(
ITfInputProcessorProfiles *iface, REFCLSID rclsid)
{
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY tipkey;
WCHAR buf[39];
WCHAR fullkey[68];
static HRESULT WINAPI InputProcessorProfiles_Unregister(
ITfInputProcessorProfiles *iface, REFCLSID rclsid)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
WCHAR buf[39];
WCHAR fullkey[68];
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s\n",This,debugstr_guid(rclsid));
ULONG cchDesc, const WCHAR *pchIconFile, ULONG cchFile,
ULONG uIconIndex)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY tipkey,fmtkey;
WCHAR buf[39];
WCHAR fullkey[100];
static const WCHAR icnf[] = {'I','c','o','n','F','i','l','e',0};
static const WCHAR icni[] = {'I','c','o','n','I','n','d','e','x',0};
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
-
TRACE("(%p) %s %x %s %s %s %i\n",This,debugstr_guid(rclsid), langid,
debugstr_guid(guidProfile), debugstr_wn(pchDesc,cchDesc),
debugstr_wn(pchIconFile,cchFile),uIconIndex);
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile)
{
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfiles_EnumInputProcessorInfo(
ITfInputProcessorProfiles *iface, IEnumGUID **ppEnum)
{
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
TRACE("(%p) %p\n",This,ppEnum);
return ProfilesEnumGuid_Constructor(ppEnum);
}
ITfInputProcessorProfiles *iface, LANGID langid, REFGUID catid,
CLSID *pclsid, GUID *pguidProfile)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
WCHAR fullkey[168];
WCHAR buf[39];
HKEY hkey;
DWORD count;
ULONG res;
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("%p) %x %s %p %p\n",This, langid, debugstr_guid(catid),pclsid,pguidProfile);
ITfInputProcessorProfiles *iface, LANGID langid, REFCLSID rclsid,
REFGUID guidProfiles)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
WCHAR fullkey[168];
WCHAR buf[39];
HKEY hkey;
GUID catid;
HRESULT hr;
ITfCategoryMgr *catmgr;
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
static const GUID * tipcats[3] = { &GUID_TFCAT_TIP_KEYBOARD,
&GUID_TFCAT_TIP_SPEECH,
&GUID_TFCAT_TIP_HANDWRITING };
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfiles)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HRESULT hr;
BOOL enabled;
TF_LANGUAGEPROFILE LanguageProfile;
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %x %s\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfiles));
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID *plangid,
GUID *pguidProfile)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
TF_LANGUAGEPROFILE profile;
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %p %p\n",This,debugstr_guid(rclsid),plangid,pguidProfile);
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, BSTR *pbstrProfile)
{
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI InputProcessorProfiles_GetCurrentLanguage(
ITfInputProcessorProfiles *iface, LANGID *plangid)
{
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
TRACE("(%p) 0x%x\n",This,This->currentLanguage);
if (!plangid)
static HRESULT WINAPI InputProcessorProfiles_ChangeCurrentLanguage(
ITfInputProcessorProfiles *iface, LANGID langid)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
struct list *cursor;
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
BOOL accept;
FIXME("STUB:(%p)\n",This);
static HRESULT WINAPI InputProcessorProfiles_GetLanguageList(
ITfInputProcessorProfiles *iface, LANGID **ppLangId, ULONG *pulCount)
{
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
FIXME("Semi-STUB:(%p)\n",This);
*ppLangId = CoTaskMemAlloc(sizeof(LANGID));
**ppLangId = This->currentLanguage;
ITfInputProcessorProfiles *iface, LANGID langid,
IEnumTfLanguageProfiles **ppEnum)
{
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
TRACE("(%p) %x %p\n",This,langid,ppEnum);
return EnumTfLanguageProfiles_Constructor(langid, ppEnum);
}
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, BOOL fEnable)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY key;
WCHAR buf[39];
WCHAR buf2[39];
WCHAR fullkey[168];
ULONG res;
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %x %s %i\n",This, debugstr_guid(rclsid), langid, debugstr_guid(guidProfile), fEnable);
StringFromGUID2(rclsid, buf, 39);
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, BOOL *pfEnable)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY key;
WCHAR buf[39];
WCHAR buf2[39];
WCHAR fullkey[168];
ULONG res;
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s, %i, %s, %p\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfile),pfEnable);
if (!pfEnable)
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, BOOL fEnable)
{
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
HKEY key;
WCHAR buf[39];
WCHAR buf2[39];
WCHAR fullkey[168];
ULONG res;
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
TRACE("(%p) %s %x %s %i\n",This,debugstr_guid(rclsid),langid,debugstr_guid(guidProfile),fEnable);
StringFromGUID2(rclsid, buf, 39);
ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
REFGUID guidProfile, HKL hKL)
{
- InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
+ InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
-
-static const ITfInputProcessorProfilesVtbl InputProcessorProfiles_InputProcessorProfilesVtbl =
+static const ITfInputProcessorProfilesVtbl InputProcessorProfilesVtbl =
{
InputProcessorProfiles_QueryInterface,
InputProcessorProfiles_AddRef,
InputProcessorProfiles_Release,
-
InputProcessorProfiles_Register,
InputProcessorProfiles_Unregister,
InputProcessorProfiles_AddLanguageProfile,
*****************************************************/
static HRESULT WINAPI IPPSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{
- InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
- return InputProcessorProfiles_QueryInterface((ITfInputProcessorProfiles *)This, iid, *ppvOut);
+ InputProcessorProfiles *This = impl_from_ITfSource(iface);
+ return ITfInputProcessorProfiles_QueryInterface(&This->ITfInputProcessorProfiles_iface, iid, ppvOut);
}
static ULONG WINAPI IPPSource_AddRef(ITfSource *iface)
{
- InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
- return InputProcessorProfiles_AddRef((ITfInputProcessorProfiles*)This);
+ InputProcessorProfiles *This = impl_from_ITfSource(iface);
+ return ITfInputProcessorProfiles_AddRef(&This->ITfInputProcessorProfiles_iface);
}
static ULONG WINAPI IPPSource_Release(ITfSource *iface)
{
- InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
- return InputProcessorProfiles_Release((ITfInputProcessorProfiles *)This);
+ InputProcessorProfiles *This = impl_from_ITfSource(iface);
+ return ITfInputProcessorProfiles_Release(&This->ITfInputProcessorProfiles_iface);
}
static HRESULT WINAPI IPPSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{
+ InputProcessorProfiles *This = impl_from_ITfSource(iface);
InputProcessorProfilesSink *ipps;
- InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
static HRESULT WINAPI IPPSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{
+ InputProcessorProfiles *This = impl_from_ITfSource(iface);
InputProcessorProfilesSink *sink;
- InputProcessorProfiles *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %x\n",This,pdwCookie);
return S_OK;
}
-static const ITfSourceVtbl InputProcessorProfiles_SourceVtbl =
+static const ITfSourceVtbl InputProcessorProfilesSourceVtbl =
{
IPPSource_QueryInterface,
IPPSource_AddRef,
IPPSource_Release,
-
IPPSource_AdviseSink,
IPPSource_UnadviseSink,
};
if (This == NULL)
return E_OUTOFMEMORY;
- This->InputProcessorProfilesVtbl= &InputProcessorProfiles_InputProcessorProfilesVtbl;
- This->SourceVtbl = &InputProcessorProfiles_SourceVtbl;
+ This->ITfInputProcessorProfiles_iface.lpVtbl= &InputProcessorProfilesVtbl;
+ This->ITfSource_iface.lpVtbl = &InputProcessorProfilesSourceVtbl;
This->refCount = 1;
This->currentLanguage = GetUserDefaultLCID();
list_init(&This->LanguageProfileNotifySink);
- TRACE("returning %p\n", This);
- *ppOut = (IUnknown *)This;
+ *ppOut = (IUnknown *)&This->ITfInputProcessorProfiles_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
static HRESULT WINAPI ProfilesEnumGuid_QueryInterface(IEnumGUID *iface, REFIID iid, LPVOID *ppvOut)
{
- ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface;
+ ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumGUID))
{
- *ppvOut = This;
+ *ppvOut = &This->IEnumGUID_iface;
}
if (*ppvOut)
static ULONG WINAPI ProfilesEnumGuid_AddRef(IEnumGUID *iface)
{
- ProfilesEnumGuid *This = (ProfilesEnumGuid*)iface;
+ ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI ProfilesEnumGuid_Release(IEnumGUID *iface)
{
- ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface;
+ ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
static HRESULT WINAPI ProfilesEnumGuid_Next( LPENUMGUID iface,
ULONG celt, GUID *rgelt, ULONG *pceltFetched)
{
- ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface;
+ ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
ULONG fetched = 0;
TRACE("(%p)\n",This);
static HRESULT WINAPI ProfilesEnumGuid_Skip( LPENUMGUID iface, ULONG celt)
{
- ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface;
+ ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
TRACE("(%p)\n",This);
This->next_index += celt;
static HRESULT WINAPI ProfilesEnumGuid_Reset( LPENUMGUID iface)
{
- ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface;
+ ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
TRACE("(%p)\n",This);
This->next_index = 0;
return S_OK;
static HRESULT WINAPI ProfilesEnumGuid_Clone( LPENUMGUID iface,
IEnumGUID **ppenum)
{
- ProfilesEnumGuid *This = (ProfilesEnumGuid *)iface;
+ ProfilesEnumGuid *This = impl_from_IEnumGUID(iface);
HRESULT res;
TRACE("(%p)\n",This);
res = ProfilesEnumGuid_Constructor(ppenum);
if (SUCCEEDED(res))
{
- ProfilesEnumGuid *new_This = (ProfilesEnumGuid *)*ppenum;
+ ProfilesEnumGuid *new_This = impl_from_IEnumGUID(*ppenum);
new_This->next_index = This->next_index;
}
return res;
}
-static const IEnumGUIDVtbl IEnumGUID_Vtbl ={
+static const IEnumGUIDVtbl EnumGUIDVtbl =
+{
ProfilesEnumGuid_QueryInterface,
ProfilesEnumGuid_AddRef,
ProfilesEnumGuid_Release,
-
ProfilesEnumGuid_Next,
ProfilesEnumGuid_Skip,
ProfilesEnumGuid_Reset,
if (This == NULL)
return E_OUTOFMEMORY;
- This->Vtbl= &IEnumGUID_Vtbl;
+ This->IEnumGUID_iface.lpVtbl= &EnumGUIDVtbl;
This->refCount = 1;
if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, szwSystemTIPKey, 0, NULL, 0,
return E_FAIL;
}
- TRACE("returning %p\n", This);
- *ppOut = (IEnumGUID*)This;
+ *ppOut = &This->IEnumGUID_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
static HRESULT WINAPI EnumTfLanguageProfiles_QueryInterface(IEnumTfLanguageProfiles *iface, REFIID iid, LPVOID *ppvOut)
{
- EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface;
+ EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
+
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfLanguageProfiles))
{
- *ppvOut = This;
+ *ppvOut = &This->IEnumTfLanguageProfiles_iface;
}
if (*ppvOut)
static ULONG WINAPI EnumTfLanguageProfiles_AddRef(IEnumTfLanguageProfiles *iface)
{
- EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles*)iface;
+ EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI EnumTfLanguageProfiles_Release(IEnumTfLanguageProfiles *iface)
{
- EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface;
+ EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
static HRESULT WINAPI EnumTfLanguageProfiles_Next(IEnumTfLanguageProfiles *iface,
ULONG ulCount, TF_LANGUAGEPROFILE *pProfile, ULONG *pcFetch)
{
- EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface;
+ EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
ULONG fetched = 0;
TRACE("(%p)\n",This);
static HRESULT WINAPI EnumTfLanguageProfiles_Skip( IEnumTfLanguageProfiles* iface, ULONG celt)
{
- EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface;
+ EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
FIXME("STUB (%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI EnumTfLanguageProfiles_Reset( IEnumTfLanguageProfiles* iface)
{
- EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface;
+ EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
TRACE("(%p)\n",This);
This->tip_index = 0;
if (This->langkey)
static HRESULT WINAPI EnumTfLanguageProfiles_Clone( IEnumTfLanguageProfiles *iface,
IEnumTfLanguageProfiles **ppenum)
{
- EnumTfLanguageProfiles *This = (EnumTfLanguageProfiles *)iface;
+ EnumTfLanguageProfiles *This = impl_from_IEnumTfLanguageProfiles(iface);
HRESULT res;
TRACE("(%p)\n",This);
return res;
}
-static const IEnumTfLanguageProfilesVtbl IEnumTfLanguageProfiles_Vtbl ={
+static const IEnumTfLanguageProfilesVtbl EnumTfLanguageProfilesVtbl =
+{
EnumTfLanguageProfiles_QueryInterface,
EnumTfLanguageProfiles_AddRef,
EnumTfLanguageProfiles_Release,
-
EnumTfLanguageProfiles_Clone,
EnumTfLanguageProfiles_Next,
EnumTfLanguageProfiles_Reset,
if (This == NULL)
return E_OUTOFMEMORY;
- This->Vtbl= &IEnumTfLanguageProfiles_Vtbl;
+ This->IEnumTfLanguageProfiles_iface.lpVtbl= &EnumTfLanguageProfilesVtbl;
This->refCount = 1;
This->langid = langid;
return E_FAIL;
}
- TRACE("returning %p\n", This);
- *ppOut = (IEnumTfLanguageProfiles*)This;
+ *ppOut = &This->IEnumTfLanguageProfiles_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfLangBarMgr_iface;
}
if (*ppvOut)
This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl;
This->refCount = 1;
- TRACE("returning %p\n", This);
- *ppOut = (IUnknown *)This;
+ *ppOut = (IUnknown *)&This->ITfLangBarMgr_iface;
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#pragma makedep register
+
[
threading(apartment),
uuid(529a9e6b-6587-4f23-ab9e-9c7d683e3c50)
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfRange))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfRange_iface;
}
if (*ppvOut)
This->anchorEnd = anchorEnd;
*ppOut = &This->ITfRange_iface;
- TRACE("returning %p\n", This);
+ TRACE("returning %p\n", *ppOut);
return S_OK;
}
if (!tf || !tsAcp || !tf->range)
return E_INVALIDARG;
- This = (Range *)tf->range;
+ This = impl_from_ITfRange(tf->range);
tsAcp->acpStart = This->anchorStart;
tsAcp->acpEnd = This->anchorEnd;
} AssociatedWindow;
typedef struct tagACLMulti {
- const ITfThreadMgrVtbl *ThreadMgrVtbl;
- const ITfSourceVtbl *SourceVtbl;
- const ITfKeystrokeMgrVtbl *KeystrokeMgrVtbl;
- const ITfMessagePumpVtbl *MessagePumpVtbl;
- const ITfClientIdVtbl *ClientIdVtbl;
+ ITfThreadMgr ITfThreadMgr_iface;
+ ITfSource ITfSource_iface;
+ ITfKeystrokeMgr ITfKeystrokeMgr_iface;
+ ITfMessagePump ITfMessagePump_iface;
+ ITfClientId ITfClientId_iface;
/* const ITfThreadMgrExVtbl *ThreadMgrExVtbl; */
/* const ITfConfigureSystemKeystrokeFeedVtbl *ConfigureSystemKeystrokeFeedVtbl; */
/* const ITfLangBarItemMgrVtbl *LangBarItemMgrVtbl; */
/* const ITfUIElementMgrVtbl *UIElementMgrVtbl; */
- const ITfSourceSingleVtbl *SourceSingleVtbl;
+ ITfSourceSingle ITfSourceSingle_iface;
LONG refCount;
/* Aggregation */
ITfCompartmentMgr *CompartmentMgr;
- const ITfThreadMgrEventSinkVtbl *ThreadMgrEventSinkVtbl; /* internal */
+ ITfThreadMgrEventSink ITfThreadMgrEventSink_iface; /* internal */
ITfDocumentMgr *focus;
LONG activationCount;
} ThreadMgr;
typedef struct tagEnumTfDocumentMgr {
- const IEnumTfDocumentMgrsVtbl *Vtbl;
+ IEnumTfDocumentMgrs IEnumTfDocumentMgrs_iface;
LONG refCount;
struct list *index;
static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentMgrs **ppOut);
-static inline ThreadMgr *impl_from_ITfSourceVtbl(ITfSource *iface)
+static inline ThreadMgr *impl_from_ITfThreadMgr(ITfThreadMgr *iface)
{
- return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,SourceVtbl));
+ return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgr_iface);
}
-static inline ThreadMgr *impl_from_ITfKeystrokeMgrVtbl(ITfKeystrokeMgr *iface)
+static inline ThreadMgr *impl_from_ITfSource(ITfSource *iface)
{
- return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,KeystrokeMgrVtbl));
+ return CONTAINING_RECORD(iface, ThreadMgr, ITfSource_iface);
}
-static inline ThreadMgr *impl_from_ITfMessagePumpVtbl(ITfMessagePump *iface)
+static inline ThreadMgr *impl_from_ITfKeystrokeMgr(ITfKeystrokeMgr *iface)
{
- return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,MessagePumpVtbl));
+ return CONTAINING_RECORD(iface, ThreadMgr, ITfKeystrokeMgr_iface);
}
-static inline ThreadMgr *impl_from_ITfClientIdVtbl(ITfClientId *iface)
+static inline ThreadMgr *impl_from_ITfMessagePump(ITfMessagePump *iface)
{
- return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ClientIdVtbl));
+ return CONTAINING_RECORD(iface, ThreadMgr, ITfMessagePump_iface);
+}
+
+static inline ThreadMgr *impl_from_ITfClientId(ITfClientId *iface)
+{
+ return CONTAINING_RECORD(iface, ThreadMgr, ITfClientId_iface);
}
static inline ThreadMgr *impl_from_ITfThreadMgrEventSink(ITfThreadMgrEventSink *iface)
{
- return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,ThreadMgrEventSinkVtbl));
+ return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEventSink_iface);
}
-static inline ThreadMgr *impl_from_ITfSourceSingleVtbl(ITfSourceSingle* iface)
+static inline ThreadMgr *impl_from_ITfSourceSingle(ITfSourceSingle *iface)
+{
+ return CONTAINING_RECORD(iface, ThreadMgr, ITfSourceSingle_iface);
+}
+static inline EnumTfDocumentMgr *impl_from_IEnumTfDocumentMgrs(IEnumTfDocumentMgrs *iface)
{
- return (ThreadMgr *)((char *)iface - FIELD_OFFSET(ThreadMgr,SourceSingleVtbl));
+ return CONTAINING_RECORD(iface, EnumTfDocumentMgr, IEnumTfDocumentMgrs_iface);
}
static void free_sink(ThreadMgrSink *sink)
static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid, LPVOID *ppvOut)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgr))
{
- *ppvOut = This;
+ *ppvOut = &This->ITfThreadMgr_iface;
}
else if (IsEqualIID(iid, &IID_ITfSource))
{
- *ppvOut = &This->SourceVtbl;
+ *ppvOut = &This->ITfSource_iface;
}
else if (IsEqualIID(iid, &IID_ITfKeystrokeMgr))
{
- *ppvOut = &This->KeystrokeMgrVtbl;
+ *ppvOut = &This->ITfKeystrokeMgr_iface;
}
else if (IsEqualIID(iid, &IID_ITfMessagePump))
{
- *ppvOut = &This->MessagePumpVtbl;
+ *ppvOut = &This->ITfMessagePump_iface;
}
else if (IsEqualIID(iid, &IID_ITfClientId))
{
- *ppvOut = &This->ClientIdVtbl;
+ *ppvOut = &This->ITfClientId_iface;
}
else if (IsEqualIID(iid, &IID_ITfCompartmentMgr))
{
}
else if (IsEqualIID(iid, &IID_ITfSourceSingle))
{
- *ppvOut = &This->SourceSingleVtbl;
+ *ppvOut = &This->ITfSourceSingle_iface;
}
if (*ppvOut)
static ULONG WINAPI ThreadMgr_AddRef(ITfThreadMgr *iface)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI ThreadMgr_Release(ITfThreadMgr *iface)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
static HRESULT WINAPI ThreadMgr_fnActivate( ITfThreadMgr* iface, TfClientId *ptid)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
TRACE("(%p) %p\n",This, ptid);
{
GUID guid;
CoCreateGuid(&guid);
- ITfClientId_GetClientId((ITfClientId*)&This->ClientIdVtbl,&guid,&processId);
+ ITfClientId_GetClientId(&This->ITfClientId_iface, &guid, &processId);
}
activate_textservices(iface);
static HRESULT WINAPI ThreadMgr_fnDeactivate( ITfThreadMgr* iface)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
TRACE("(%p)\n",This);
if (This->activationCount == 0)
{
if (This->focus)
{
- ITfThreadMgrEventSink_OnSetFocus((ITfThreadMgrEventSink*)&This->ThreadMgrEventSinkVtbl, 0, This->focus);
+ ITfThreadMgrEventSink_OnSetFocus(&This->ITfThreadMgrEventSink_iface, 0, This->focus);
ITfDocumentMgr_Release(This->focus);
This->focus = 0;
}
return S_OK;
}
-static HRESULT WINAPI ThreadMgr_CreateDocumentMgr( ITfThreadMgr* iface, ITfDocumentMgr
-**ppdim)
+static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgr* iface, ITfDocumentMgr **ppdim)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
DocumentMgrEntry *mgrentry;
HRESULT hr;
if (mgrentry == NULL)
return E_OUTOFMEMORY;
- hr = DocumentMgr_Constructor((ITfThreadMgrEventSink*)&This->ThreadMgrEventSinkVtbl, ppdim);
+ hr = DocumentMgr_Constructor(&This->ITfThreadMgrEventSink_iface, ppdim);
if (SUCCEEDED(hr))
{
return hr;
}
-static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs( ITfThreadMgr* iface, IEnumTfDocumentMgrs
-**ppEnum)
+static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs( ITfThreadMgr* iface, IEnumTfDocumentMgrs **ppEnum)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
TRACE("(%p) %p\n",This,ppEnum);
if (!ppEnum)
static HRESULT WINAPI ThreadMgr_GetFocus( ITfThreadMgr* iface, ITfDocumentMgr
**ppdimFocus)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
TRACE("(%p)\n",This);
if (!ppdimFocus)
static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *pdimFocus)
{
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
ITfDocumentMgr *check;
- ThreadMgr *This = (ThreadMgr *)iface;
TRACE("(%p) %p\n",This,pdimFocus);
else if (FAILED(ITfDocumentMgr_QueryInterface(pdimFocus,&IID_ITfDocumentMgr,(LPVOID*) &check)))
return E_INVALIDARG;
- ITfThreadMgrEventSink_OnSetFocus((ITfThreadMgrEventSink*)&This->ThreadMgrEventSinkVtbl, check, This->focus);
+ ITfThreadMgrEventSink_OnSetFocus(&This->ITfThreadMgrEventSink_iface, check, This->focus);
if (This->focus)
ITfDocumentMgr_Release(This->focus);
static HRESULT WINAPI ThreadMgr_AssociateFocus( ITfThreadMgr* iface, HWND hwnd,
ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev)
{
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
struct list *cursor, *cursor2;
- ThreadMgr *This = (ThreadMgr *)iface;
AssociatedWindow *wnd;
TRACE("(%p) %p %p %p\n",This,hwnd,pdimNew,ppdimPrev);
static HRESULT WINAPI ThreadMgr_IsThreadFocus( ITfThreadMgr* iface, BOOL *pfThreadFocus)
{
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
HWND focus;
- ThreadMgr *This = (ThreadMgr *)iface;
+
TRACE("(%p) %p\n",This,pfThreadFocus);
focus = GetFocus();
*pfThreadFocus = (focus == NULL);
static HRESULT WINAPI ThreadMgr_GetFunctionProvider( ITfThreadMgr* iface, REFCLSID clsid,
ITfFunctionProvider **ppFuncProv)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI ThreadMgr_EnumFunctionProviders( ITfThreadMgr* iface,
IEnumTfFunctionProviders **ppEnum)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI ThreadMgr_GetGlobalCompartment( ITfThreadMgr* iface,
ITfCompartmentMgr **ppCompMgr)
{
- ThreadMgr *This = (ThreadMgr *)iface;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
HRESULT hr;
TRACE("(%p) %p\n",This, ppCompMgr);
return S_OK;
}
-static const ITfThreadMgrVtbl ThreadMgr_ThreadMgrVtbl =
+static const ITfThreadMgrVtbl ThreadMgrVtbl =
{
ThreadMgr_QueryInterface,
ThreadMgr_AddRef,
ThreadMgr_Release,
-
ThreadMgr_fnActivate,
ThreadMgr_fnDeactivate,
ThreadMgr_CreateDocumentMgr,
ThreadMgr_GetGlobalCompartment
};
-
static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{
- ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
- return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+ ThreadMgr *This = impl_from_ITfSource(iface);
+ return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
}
static ULONG WINAPI Source_AddRef(ITfSource *iface)
{
- ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
- return ThreadMgr_AddRef((ITfThreadMgr*)This);
+ ThreadMgr *This = impl_from_ITfSource(iface);
+ return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
}
static ULONG WINAPI Source_Release(ITfSource *iface)
{
- ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
- return ThreadMgr_Release((ITfThreadMgr *)This);
+ ThreadMgr *This = impl_from_ITfSource(iface);
+ return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
}
/*****************************************************
static HRESULT WINAPI ThreadMgrSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{
+ ThreadMgr *This = impl_from_ITfSource(iface);
ThreadMgrSink *tms;
- ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie);
static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{
+ ThreadMgr *This = impl_from_ITfSource(iface);
ThreadMgrSink *sink;
- ThreadMgr *This = impl_from_ITfSourceVtbl(iface);
TRACE("(%p) %x\n",This,pdwCookie);
return S_OK;
}
-static const ITfSourceVtbl ThreadMgr_SourceVtbl =
+static const ITfSourceVtbl ThreadMgrSourceVtbl =
{
Source_QueryInterface,
Source_AddRef,
Source_Release,
-
ThreadMgrSource_AdviseSink,
ThreadMgrSource_UnadviseSink,
};
static HRESULT WINAPI KeystrokeMgr_QueryInterface(ITfKeystrokeMgr *iface, REFIID iid, LPVOID *ppvOut)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
- return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
+ return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
}
static ULONG WINAPI KeystrokeMgr_AddRef(ITfKeystrokeMgr *iface)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
- return ThreadMgr_AddRef((ITfThreadMgr*)This);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
+ return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
}
static ULONG WINAPI KeystrokeMgr_Release(ITfKeystrokeMgr *iface)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
- return ThreadMgr_Release((ITfThreadMgr *)This);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
+ return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
}
static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface,
TfClientId tid, ITfKeyEventSink *pSink, BOOL fForeground)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
CLSID textservice;
ITfKeyEventSink *check = NULL;
static HRESULT WINAPI KeystrokeMgr_UnadviseKeyEventSink(ITfKeystrokeMgr *iface,
TfClientId tid)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
CLSID textservice;
ITfKeyEventSink *check = NULL;
TRACE("(%p) %x\n",This,tid);
static HRESULT WINAPI KeystrokeMgr_GetForeground(ITfKeystrokeMgr *iface,
CLSID *pclsid)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
TRACE("(%p) %p\n",This,pclsid);
if (!pclsid)
return E_INVALIDARG;
static HRESULT WINAPI KeystrokeMgr_TestKeyDown(ITfKeystrokeMgr *iface,
WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI KeystrokeMgr_TestKeyUp(ITfKeystrokeMgr *iface,
WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI KeystrokeMgr_KeyDown(ITfKeystrokeMgr *iface,
WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI KeystrokeMgr_KeyUp(ITfKeystrokeMgr *iface,
WPARAM wParam, LPARAM lParam, BOOL *pfEaten)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI KeystrokeMgr_GetPreservedKey(ITfKeystrokeMgr *iface,
ITfContext *pic, const TF_PRESERVEDKEY *pprekey, GUID *pguid)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI KeystrokeMgr_IsPreservedKey(ITfKeystrokeMgr *iface,
REFGUID rguid, const TF_PRESERVEDKEY *pprekey, BOOL *pfRegistered)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
struct list *cursor;
TRACE("(%p) %s (%x %x) %p\n",This,debugstr_guid(rguid), (pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0, pfRegistered);
TfClientId tid, REFGUID rguid, const TF_PRESERVEDKEY *prekey,
const WCHAR *pchDesc, ULONG cchDesc)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
struct list *cursor;
PreservedKey *newkey;
static HRESULT WINAPI KeystrokeMgr_UnpreserveKey(ITfKeystrokeMgr *iface,
REFGUID rguid, const TF_PRESERVEDKEY *pprekey)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
PreservedKey* key = NULL;
struct list *cursor;
TRACE("(%p) %s (%x %x)\n",This,debugstr_guid(rguid),(pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0);
static HRESULT WINAPI KeystrokeMgr_SetPreservedKeyDescription(ITfKeystrokeMgr *iface,
REFGUID rguid, const WCHAR *pchDesc, ULONG cchDesc)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI KeystrokeMgr_GetPreservedKeyDescription(ITfKeystrokeMgr *iface,
REFGUID rguid, BSTR *pbstrDesc)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI KeystrokeMgr_SimulatePreservedKey(ITfKeystrokeMgr *iface,
ITfContext *pic, REFGUID rguid, BOOL *pfEaten)
{
- ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
+ ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
-static const ITfKeystrokeMgrVtbl ThreadMgr_KeystrokeMgrVtbl =
+static const ITfKeystrokeMgrVtbl KeystrokeMgrVtbl =
{
KeystrokeMgr_QueryInterface,
KeystrokeMgr_AddRef,
KeystrokeMgr_Release,
-
KeystrokeMgr_AdviseKeyEventSink,
KeystrokeMgr_UnadviseKeyEventSink,
KeystrokeMgr_GetForeground,
static HRESULT WINAPI MessagePump_QueryInterface(ITfMessagePump *iface, REFIID iid, LPVOID *ppvOut)
{
- ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface);
- return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+ ThreadMgr *This = impl_from_ITfMessagePump(iface);
+ return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
}
static ULONG WINAPI MessagePump_AddRef(ITfMessagePump *iface)
{
- ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface);
- return ThreadMgr_AddRef((ITfThreadMgr*)This);
+ ThreadMgr *This = impl_from_ITfMessagePump(iface);
+ return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
}
static ULONG WINAPI MessagePump_Release(ITfMessagePump *iface)
{
- ThreadMgr *This = impl_from_ITfMessagePumpVtbl(iface);
- return ThreadMgr_Release((ITfThreadMgr *)This);
+ ThreadMgr *This = impl_from_ITfMessagePump(iface);
+ return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
}
static HRESULT WINAPI MessagePump_PeekMessageA(ITfMessagePump *iface,
return S_OK;
}
-static const ITfMessagePumpVtbl ThreadMgr_MessagePumpVtbl =
+static const ITfMessagePumpVtbl MessagePumpVtbl =
{
MessagePump_QueryInterface,
MessagePump_AddRef,
MessagePump_Release,
-
MessagePump_PeekMessageA,
MessagePump_GetMessageA,
MessagePump_PeekMessageW,
static HRESULT WINAPI ClientId_QueryInterface(ITfClientId *iface, REFIID iid, LPVOID *ppvOut)
{
- ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
- return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+ ThreadMgr *This = impl_from_ITfClientId(iface);
+ return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
}
static ULONG WINAPI ClientId_AddRef(ITfClientId *iface)
{
- ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
- return ThreadMgr_AddRef((ITfThreadMgr*)This);
+ ThreadMgr *This = impl_from_ITfClientId(iface);
+ return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
}
static ULONG WINAPI ClientId_Release(ITfClientId *iface)
{
- ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
- return ThreadMgr_Release((ITfThreadMgr *)This);
+ ThreadMgr *This = impl_from_ITfClientId(iface);
+ return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
}
static HRESULT WINAPI ClientId_GetClientId(ITfClientId *iface,
REFCLSID rclsid, TfClientId *ptid)
{
+ ThreadMgr *This = impl_from_ITfClientId(iface);
HRESULT hr;
ITfCategoryMgr *catmgr;
- ThreadMgr *This = impl_from_ITfClientIdVtbl(iface);
TRACE("(%p) %s\n",This,debugstr_guid(rclsid));
return hr;
}
-static const ITfClientIdVtbl ThreadMgr_ClientIdVtbl =
+static const ITfClientIdVtbl ClientIdVtbl =
{
ClientId_QueryInterface,
ClientId_AddRef,
ClientId_Release,
-
ClientId_GetClientId
};
static HRESULT WINAPI ThreadMgrEventSink_QueryInterface(ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut)
{
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
- return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+ return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
}
static ULONG WINAPI ThreadMgrEventSink_AddRef(ITfThreadMgrEventSink *iface)
{
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
- return ThreadMgr_AddRef((ITfThreadMgr*)This);
+ return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
}
static ULONG WINAPI ThreadMgrEventSink_Release(ITfThreadMgrEventSink *iface)
{
ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface);
- return ThreadMgr_Release((ITfThreadMgr *)This);
+ return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
}
return S_OK;
}
-static const ITfThreadMgrEventSinkVtbl ThreadMgr_ThreadMgrEventSinkVtbl =
+static const ITfThreadMgrEventSinkVtbl ThreadMgrEventSinkVtbl =
{
ThreadMgrEventSink_QueryInterface,
ThreadMgrEventSink_AddRef,
ThreadMgrEventSink_Release,
-
ThreadMgrEventSink_OnInitDocumentMgr,
ThreadMgrEventSink_OnUninitDocumentMgr,
ThreadMgrEventSink_OnSetFocus,
*****************************************************/
static HRESULT WINAPI ThreadMgrSourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut)
{
- ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
- return ThreadMgr_QueryInterface((ITfThreadMgr *)This, iid, *ppvOut);
+ ThreadMgr *This = impl_from_ITfSourceSingle(iface);
+ return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut);
}
static ULONG WINAPI ThreadMgrSourceSingle_AddRef(ITfSourceSingle *iface)
{
- ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
- return ThreadMgr_AddRef((ITfThreadMgr *)This);
+ ThreadMgr *This = impl_from_ITfSourceSingle(iface);
+ return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface);
}
static ULONG WINAPI ThreadMgrSourceSingle_Release(ITfSourceSingle *iface)
{
- ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
- return ThreadMgr_Release((ITfThreadMgr *)This);
+ ThreadMgr *This = impl_from_ITfSourceSingle(iface);
+ return ITfThreadMgr_Release(&This->ITfThreadMgr_iface);
}
static HRESULT WINAPI ThreadMgrSourceSingle_AdviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid, IUnknown *punk)
{
- ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
+ ThreadMgr *This = impl_from_ITfSourceSingle(iface);
FIXME("STUB:(%p) %i %s %p\n",This, tid, debugstr_guid(riid),punk);
return E_NOTIMPL;
}
static HRESULT WINAPI ThreadMgrSourceSingle_UnadviseSingleSink( ITfSourceSingle *iface,
TfClientId tid, REFIID riid)
{
- ThreadMgr *This = impl_from_ITfSourceSingleVtbl(iface);
+ ThreadMgr *This = impl_from_ITfSourceSingle(iface);
FIXME("STUB:(%p) %i %s\n",This, tid, debugstr_guid(riid));
return E_NOTIMPL;
}
-static const ITfSourceSingleVtbl ThreadMgr_SourceSingleVtbl =
+static const ITfSourceSingleVtbl SourceSingleVtbl =
{
ThreadMgrSourceSingle_QueryInterface,
ThreadMgrSourceSingle_AddRef,
ThreadMgrSourceSingle_Release,
-
ThreadMgrSourceSingle_AdviseSingleSink,
- ThreadMgrSourceSingle_UnadviseSingleSink,
+ ThreadMgrSourceSingle_UnadviseSingleSink
};
HRESULT ThreadMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
This = TlsGetValue(tlsIndex);
if (This)
{
- ThreadMgr_AddRef((ITfThreadMgr*)This);
- *ppOut = (IUnknown*)This;
+ ThreadMgr_AddRef(&This->ITfThreadMgr_iface);
+ *ppOut = (IUnknown*)&This->ITfThreadMgr_iface;
return S_OK;
}
if (This == NULL)
return E_OUTOFMEMORY;
- This->ThreadMgrVtbl= &ThreadMgr_ThreadMgrVtbl;
- This->SourceVtbl = &ThreadMgr_SourceVtbl;
- This->KeystrokeMgrVtbl= &ThreadMgr_KeystrokeMgrVtbl;
- This->MessagePumpVtbl= &ThreadMgr_MessagePumpVtbl;
- This->ClientIdVtbl = &ThreadMgr_ClientIdVtbl;
- This->ThreadMgrEventSinkVtbl = &ThreadMgr_ThreadMgrEventSinkVtbl;
- This->SourceSingleVtbl = &ThreadMgr_SourceSingleVtbl;
+ This->ITfThreadMgr_iface.lpVtbl= &ThreadMgrVtbl;
+ This->ITfSource_iface.lpVtbl = &ThreadMgrSourceVtbl;
+ This->ITfKeystrokeMgr_iface.lpVtbl= &KeystrokeMgrVtbl;
+ This->ITfMessagePump_iface.lpVtbl = &MessagePumpVtbl;
+ This->ITfClientId_iface.lpVtbl = &ClientIdVtbl;
+ This->ITfThreadMgrEventSink_iface.lpVtbl = &ThreadMgrEventSinkVtbl;
+ This->ITfSourceSingle_iface.lpVtbl = &SourceSingleVtbl;
This->refCount = 1;
TlsSetValue(tlsIndex,This);
list_init(&This->ThreadMgrEventSink);
TRACE("returning %p\n", This);
- *ppOut = (IUnknown *)This;
+ *ppOut = (IUnknown *)&This->ITfThreadMgr_iface;
return S_OK;
}
static HRESULT WINAPI EnumTfDocumentMgr_QueryInterface(IEnumTfDocumentMgrs *iface, REFIID iid, LPVOID *ppvOut)
{
- EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface;
+ EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfDocumentMgrs))
{
- *ppvOut = This;
+ *ppvOut = &This->IEnumTfDocumentMgrs_iface;
}
if (*ppvOut)
static ULONG WINAPI EnumTfDocumentMgr_AddRef(IEnumTfDocumentMgrs *iface)
{
- EnumTfDocumentMgr *This = (EnumTfDocumentMgr*)iface;
+ EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI EnumTfDocumentMgr_Release(IEnumTfDocumentMgrs *iface)
{
- EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface;
+ EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
static HRESULT WINAPI EnumTfDocumentMgr_Next(IEnumTfDocumentMgrs *iface,
ULONG ulCount, ITfDocumentMgr **rgDocumentMgr, ULONG *pcFetched)
{
- EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface;
+ EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
ULONG fetched = 0;
TRACE("(%p)\n",This);
static HRESULT WINAPI EnumTfDocumentMgr_Skip( IEnumTfDocumentMgrs* iface, ULONG celt)
{
+ EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
ULONG i;
- EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface;
+
TRACE("(%p)\n",This);
for(i = 0; i < celt && This->index != NULL; i++)
This->index = list_next(This->head, This->index);
static HRESULT WINAPI EnumTfDocumentMgr_Reset( IEnumTfDocumentMgrs* iface)
{
- EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface;
+ EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
TRACE("(%p)\n",This);
This->index = list_head(This->head);
return S_OK;
static HRESULT WINAPI EnumTfDocumentMgr_Clone( IEnumTfDocumentMgrs *iface,
IEnumTfDocumentMgrs **ppenum)
{
- EnumTfDocumentMgr *This = (EnumTfDocumentMgr *)iface;
+ EnumTfDocumentMgr *This = impl_from_IEnumTfDocumentMgrs(iface);
HRESULT res;
TRACE("(%p)\n",This);
res = EnumTfDocumentMgr_Constructor(This->head, ppenum);
if (SUCCEEDED(res))
{
- EnumTfDocumentMgr *new_This = (EnumTfDocumentMgr *)*ppenum;
+ EnumTfDocumentMgr *new_This = impl_from_IEnumTfDocumentMgrs(*ppenum);
new_This->index = This->index;
}
return res;
}
-static const IEnumTfDocumentMgrsVtbl IEnumTfDocumentMgrs_Vtbl ={
+static const IEnumTfDocumentMgrsVtbl EnumTfDocumentMgrsVtbl =
+{
EnumTfDocumentMgr_QueryInterface,
EnumTfDocumentMgr_AddRef,
EnumTfDocumentMgr_Release,
-
EnumTfDocumentMgr_Clone,
EnumTfDocumentMgr_Next,
EnumTfDocumentMgr_Reset,
if (This == NULL)
return E_OUTOFMEMORY;
- This->Vtbl= &IEnumTfDocumentMgrs_Vtbl;
+ This->IEnumTfDocumentMgrs_iface.lpVtbl= &EnumTfDocumentMgrsVtbl;
This->refCount = 1;
This->head = head;
This->index = list_head(This->head);
return S_OK;
}
-void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *tm, ITfDocumentMgr *mgr)
+void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *iface, ITfDocumentMgr *mgr)
{
- ThreadMgr *This = (ThreadMgr *)tm;
+ ThreadMgr *This = impl_from_ITfThreadMgr(iface);
struct list *cursor;
LIST_FOR_EACH(cursor, &This->CreatedDocumentMgrs)
{
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-1 WINE_REGISTRY "msctf.rgs"
+1 WINE_REGISTRY msctf_classes.rgs
#define WINE_FILEDESCRIPTION_STR "Wine Msctf"
#define WINE_FILENAME_STR "msctf.dll"
reactos/dll/win32/mscat32 # Synced to Wine-1.7.1
reactos/dll/win32/mscms # Synced to Wine-1.7.17
reactos/dll/win32/mscoree # Synced to Wine-1.5.4
-reactos/dll/win32/msctf # Synced to Wine-1.7.1
+reactos/dll/win32/msctf # Synced to Wine-1.7.17
reactos/dll/win32/msftedit # Synced to Wine-1.7.1
reactos/dll/win32/msg711.acm # Synced to Wine-1.7.1
reactos/dll/win32/msgsm32.acm # Synced to Wine-1.7.1