ReactOS 0.4.16-dev-289-g096a551
range.c File Reference
#include <stdarg.h>
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "shlwapi.h"
#include "winerror.h"
#include "objbase.h"
#include "msctf.h"
#include "msctf_internal.h"
Include dependency graph for range.c:

Go to the source code of this file.

Classes

struct  tagRange
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct tagRange Range
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msctf)
 
static Rangeimpl_from_ITfRange (ITfRange *iface)
 
static void Range_Destructor (Range *This)
 
static HRESULT WINAPI Range_QueryInterface (ITfRange *iface, REFIID iid, LPVOID *ppvOut)
 
static ULONG WINAPI Range_AddRef (ITfRange *iface)
 
static ULONG WINAPI Range_Release (ITfRange *iface)
 
static HRESULT WINAPI Range_GetText (ITfRange *iface, TfEditCookie ec, DWORD dwFlags, WCHAR *pchText, ULONG cchMax, ULONG *pcch)
 
static HRESULT WINAPI Range_SetText (ITfRange *iface, TfEditCookie ec, DWORD dwFlags, const WCHAR *pchText, LONG cch)
 
static HRESULT WINAPI Range_GetFormattedText (ITfRange *iface, TfEditCookie ec, IDataObject **ppDataObject)
 
static HRESULT WINAPI Range_GetEmbedded (ITfRange *iface, TfEditCookie ec, REFGUID rguidService, REFIID riid, IUnknown **ppunk)
 
static HRESULT WINAPI Range_InsertEmbedded (ITfRange *iface, TfEditCookie ec, DWORD dwFlags, IDataObject *pDataObject)
 
static HRESULT WINAPI Range_ShiftStart (ITfRange *iface, TfEditCookie ec, LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt)
 
static HRESULT WINAPI Range_ShiftEnd (ITfRange *iface, TfEditCookie ec, LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt)
 
static HRESULT WINAPI Range_ShiftStartToRange (ITfRange *iface, TfEditCookie ec, ITfRange *pRange, TfAnchor aPos)
 
static HRESULT WINAPI Range_ShiftEndToRange (ITfRange *iface, TfEditCookie ec, ITfRange *pRange, TfAnchor aPos)
 
static HRESULT WINAPI Range_ShiftStartRegion (ITfRange *iface, TfEditCookie ec, TfShiftDir dir, BOOL *pfNoRegion)
 
static HRESULT WINAPI Range_ShiftEndRegion (ITfRange *iface, TfEditCookie ec, TfShiftDir dir, BOOL *pfNoRegion)
 
static HRESULT WINAPI Range_IsEmpty (ITfRange *iface, TfEditCookie ec, BOOL *pfEmpty)
 
static HRESULT WINAPI Range_Collapse (ITfRange *iface, TfEditCookie ec, TfAnchor aPos)
 
static HRESULT WINAPI Range_IsEqualStart (ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
 
static HRESULT WINAPI Range_IsEqualEnd (ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
 
static HRESULT WINAPI Range_CompareStart (ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, LONG *plResult)
 
static HRESULT WINAPI Range_CompareEnd (ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, LONG *plResult)
 
static HRESULT WINAPI Range_AdjustForInsert (ITfRange *iface, TfEditCookie ec, ULONG cchInsert, BOOL *pfInsertOk)
 
static HRESULT WINAPI Range_GetGravity (ITfRange *iface, TfGravity *pgStart, TfGravity *pgEnd)
 
static HRESULT WINAPI Range_SetGravity (ITfRange *iface, TfEditCookie ec, TfGravity gStart, TfGravity gEnd)
 
static HRESULT WINAPI Range_Clone (ITfRange *iface, ITfRange **ppClone)
 
static HRESULT WINAPI Range_GetContext (ITfRange *iface, ITfContext **ppContext)
 
HRESULT Range_Constructor (ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut)
 
HRESULT TF_SELECTION_to_TS_SELECTION_ACP (const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp)
 

Variables

static const ITfRangeVtbl Range_RangeVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file range.c.

Typedef Documentation

◆ Range

Function Documentation

◆ impl_from_ITfRange()

◆ Range_AddRef()

static ULONG WINAPI Range_AddRef ( ITfRange iface)
static

Definition at line 84 of file range.c.

85{
87 return InterlockedIncrement(&This->refCount);
88}
#define InterlockedIncrement
Definition: armddk.h:53
static Range * impl_from_ITfRange(ITfRange *iface)
Definition: range.c:53

◆ Range_AdjustForInsert()

static HRESULT WINAPI Range_AdjustForInsert ( ITfRange iface,
TfEditCookie  ec,
ULONG  cchInsert,
BOOL pfInsertOk 
)
static

Definition at line 254 of file range.c.

256{
257 Range *This = impl_from_ITfRange(iface);
258 FIXME("STUB:(%p)\n",This);
259 return E_NOTIMPL;
260}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Range_Clone()

static HRESULT WINAPI Range_Clone ( ITfRange iface,
ITfRange **  ppClone 
)
static

Definition at line 278 of file range.c.

279{
280 Range *This = impl_from_ITfRange(iface);
281 FIXME("STUB:(%p)\n",This);
282 return E_NOTIMPL;
283}

◆ Range_Collapse()

static HRESULT WINAPI Range_Collapse ( ITfRange iface,
TfEditCookie  ec,
TfAnchor  aPos 
)
static

Definition at line 201 of file range.c.

203{
204 Range *This = impl_from_ITfRange(iface);
205 TRACE("(%p) %i %i\n",This,ec,aPos);
206
207 switch (aPos)
208 {
209 case TF_ANCHOR_START:
210 This->anchorEnd = This->anchorStart;
211 break;
212 case TF_ANCHOR_END:
213 This->anchorStart = This->anchorEnd;
214 break;
215 default:
216 return E_INVALIDARG;
217 }
218
219 return S_OK;
220}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52
@ TF_ANCHOR_END
Definition: msctf.idl:171
@ TF_ANCHOR_START
Definition: msctf.idl:171
#define TRACE(s)
Definition: solgame.cpp:4

◆ Range_CompareEnd()

static HRESULT WINAPI Range_CompareEnd ( ITfRange iface,
TfEditCookie  ec,
ITfRange pWith,
TfAnchor  aPos,
LONG plResult 
)
static

Definition at line 246 of file range.c.

248{
249 Range *This = impl_from_ITfRange(iface);
250 FIXME("STUB:(%p)\n",This);
251 return E_NOTIMPL;
252}

◆ Range_CompareStart()

static HRESULT WINAPI Range_CompareStart ( ITfRange iface,
TfEditCookie  ec,
ITfRange pWith,
TfAnchor  aPos,
LONG plResult 
)
static

Definition at line 238 of file range.c.

240{
241 Range *This = impl_from_ITfRange(iface);
242 FIXME("STUB:(%p)\n",This);
243 return E_NOTIMPL;
244}

◆ Range_Constructor()

HRESULT Range_Constructor ( ITfContext context,
ITextStoreACP textstore,
DWORD  lockType,
DWORD  anchorStart,
DWORD  anchorEnd,
ITfRange **  ppOut 
)

Definition at line 325 of file range.c.

326{
327 Range *This;
328
330 if (This == NULL)
331 return E_OUTOFMEMORY;
332
333 TRACE("(%p) %p %p\n",This, context, textstore);
334
335 This->ITfRange_iface.lpVtbl = &Range_RangeVtbl;
336 This->refCount = 1;
337 This->pITfContext = context;
338 This->pITextStoreACP = textstore;
339 This->lockType = lockType;
340 This->anchorStart = anchorStart;
341 This->anchorEnd = anchorEnd;
342
343 *ppOut = &This->ITfRange_iface;
344 TRACE("returning %p\n", *ppOut);
345
346 return S_OK;
347}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static const ITfRangeVtbl Range_RangeVtbl
Definition: range.c:295
Definition: http.c:7252

Referenced by Context_GetEnd(), Context_GetSelection(), Context_GetStart(), and InsertAtSelection_InsertTextAtSelection().

◆ Range_Destructor()

static void Range_Destructor ( Range This)
static

Definition at line 58 of file range.c.

59{
60 TRACE("destroying %p\n", This);
62}
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by Range_Release().

◆ Range_GetContext()

static HRESULT WINAPI Range_GetContext ( ITfRange iface,
ITfContext **  ppContext 
)
static

Definition at line 285 of file range.c.

286{
287 Range *This = impl_from_ITfRange(iface);
288 TRACE("(%p)\n",This);
289 if (!ppContext)
290 return E_INVALIDARG;
291 *ppContext = This->pITfContext;
292 return S_OK;
293}

◆ Range_GetEmbedded()

static HRESULT WINAPI Range_GetEmbedded ( ITfRange iface,
TfEditCookie  ec,
REFGUID  rguidService,
REFIID  riid,
IUnknown **  ppunk 
)
static

Definition at line 129 of file range.c.

131{
132 Range *This = impl_from_ITfRange(iface);
133 FIXME("STUB:(%p)\n",This);
134 return E_NOTIMPL;
135}

◆ Range_GetFormattedText()

static HRESULT WINAPI Range_GetFormattedText ( ITfRange iface,
TfEditCookie  ec,
IDataObject **  ppDataObject 
)
static

Definition at line 121 of file range.c.

123{
124 Range *This = impl_from_ITfRange(iface);
125 FIXME("STUB:(%p)\n",This);
126 return E_NOTIMPL;
127}

◆ Range_GetGravity()

static HRESULT WINAPI Range_GetGravity ( ITfRange iface,
TfGravity *  pgStart,
TfGravity *  pgEnd 
)
static

Definition at line 262 of file range.c.

264{
265 Range *This = impl_from_ITfRange(iface);
266 FIXME("STUB:(%p)\n",This);
267 return E_NOTIMPL;
268}

◆ Range_GetText()

static HRESULT WINAPI Range_GetText ( ITfRange iface,
TfEditCookie  ec,
DWORD  dwFlags,
WCHAR pchText,
ULONG  cchMax,
ULONG pcch 
)
static

Definition at line 105 of file range.c.

107{
108 Range *This = impl_from_ITfRange(iface);
109 FIXME("STUB:(%p)\n",This);
110 return E_NOTIMPL;
111}

◆ Range_InsertEmbedded()

static HRESULT WINAPI Range_InsertEmbedded ( ITfRange iface,
TfEditCookie  ec,
DWORD  dwFlags,
IDataObject pDataObject 
)
static

Definition at line 137 of file range.c.

139{
140 Range *This = impl_from_ITfRange(iface);
141 FIXME("STUB:(%p)\n",This);
142 return E_NOTIMPL;
143}

◆ Range_IsEmpty()

static HRESULT WINAPI Range_IsEmpty ( ITfRange iface,
TfEditCookie  ec,
BOOL pfEmpty 
)
static

Definition at line 193 of file range.c.

195{
196 Range *This = impl_from_ITfRange(iface);
197 FIXME("STUB:(%p)\n",This);
198 return E_NOTIMPL;
199}

◆ Range_IsEqualEnd()

static HRESULT WINAPI Range_IsEqualEnd ( ITfRange iface,
TfEditCookie  ec,
ITfRange pWith,
TfAnchor  aPos,
BOOL pfEqual 
)
static

Definition at line 230 of file range.c.

232{
233 Range *This = impl_from_ITfRange(iface);
234 FIXME("STUB:(%p)\n",This);
235 return E_NOTIMPL;
236}

◆ Range_IsEqualStart()

static HRESULT WINAPI Range_IsEqualStart ( ITfRange iface,
TfEditCookie  ec,
ITfRange pWith,
TfAnchor  aPos,
BOOL pfEqual 
)
static

Definition at line 222 of file range.c.

224{
225 Range *This = impl_from_ITfRange(iface);
226 FIXME("STUB:(%p)\n",This);
227 return E_NOTIMPL;
228}

◆ Range_QueryInterface()

static HRESULT WINAPI Range_QueryInterface ( ITfRange iface,
REFIID  iid,
LPVOID ppvOut 
)
static

Definition at line 64 of file range.c.

65{
67 *ppvOut = NULL;
68
69 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfRange))
70 {
71 *ppvOut = &This->ITfRange_iface;
72 }
73
74 if (*ppvOut)
75 {
76 ITfRange_AddRef(iface);
77 return S_OK;
78 }
79
80 WARN("unsupported interface: %s\n", debugstr_guid(iid));
81 return E_NOINTERFACE;
82}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ Range_Release()

static ULONG WINAPI Range_Release ( ITfRange iface)
static

Definition at line 90 of file range.c.

91{
93 ULONG ret;
94
95 ret = InterlockedDecrement(&This->refCount);
96 if (ret == 0)
98 return ret;
99}
#define InterlockedDecrement
Definition: armddk.h:52
static void Range_Destructor(Range *This)
Definition: range.c:58
uint32_t ULONG
Definition: typedefs.h:59
int ret

◆ Range_SetGravity()

static HRESULT WINAPI Range_SetGravity ( ITfRange iface,
TfEditCookie  ec,
TfGravity  gStart,
TfGravity  gEnd 
)
static

Definition at line 270 of file range.c.

272{
273 Range *This = impl_from_ITfRange(iface);
274 FIXME("STUB:(%p)\n",This);
275 return E_NOTIMPL;
276}

◆ Range_SetText()

static HRESULT WINAPI Range_SetText ( ITfRange iface,
TfEditCookie  ec,
DWORD  dwFlags,
const WCHAR pchText,
LONG  cch 
)
static

Definition at line 113 of file range.c.

115{
116 Range *This = impl_from_ITfRange(iface);
117 FIXME("STUB:(%p)\n",This);
118 return E_NOTIMPL;
119}

◆ Range_ShiftEnd()

static HRESULT WINAPI Range_ShiftEnd ( ITfRange iface,
TfEditCookie  ec,
LONG  cchReq,
LONG pcch,
const TF_HALTCOND *  pHalt 
)
static

Definition at line 153 of file range.c.

155{
156 Range *This = impl_from_ITfRange(iface);
157 FIXME("STUB:(%p)\n",This);
158 return E_NOTIMPL;
159}

◆ Range_ShiftEndRegion()

static HRESULT WINAPI Range_ShiftEndRegion ( ITfRange iface,
TfEditCookie  ec,
TfShiftDir  dir,
BOOL pfNoRegion 
)
static

Definition at line 185 of file range.c.

187{
188 Range *This = impl_from_ITfRange(iface);
189 FIXME("STUB:(%p)\n",This);
190 return E_NOTIMPL;
191}

◆ Range_ShiftEndToRange()

static HRESULT WINAPI Range_ShiftEndToRange ( ITfRange iface,
TfEditCookie  ec,
ITfRange pRange,
TfAnchor  aPos 
)
static

Definition at line 169 of file range.c.

171{
172 Range *This = impl_from_ITfRange(iface);
173 FIXME("STUB:(%p)\n",This);
174 return E_NOTIMPL;
175}

◆ Range_ShiftStart()

static HRESULT WINAPI Range_ShiftStart ( ITfRange iface,
TfEditCookie  ec,
LONG  cchReq,
LONG pcch,
const TF_HALTCOND *  pHalt 
)
static

Definition at line 145 of file range.c.

147{
148 Range *This = impl_from_ITfRange(iface);
149 FIXME("STUB:(%p)\n",This);
150 return E_NOTIMPL;
151}

◆ Range_ShiftStartRegion()

static HRESULT WINAPI Range_ShiftStartRegion ( ITfRange iface,
TfEditCookie  ec,
TfShiftDir  dir,
BOOL pfNoRegion 
)
static

Definition at line 177 of file range.c.

179{
180 Range *This = impl_from_ITfRange(iface);
181 FIXME("STUB:(%p)\n",This);
182 return E_NOTIMPL;
183}

◆ Range_ShiftStartToRange()

static HRESULT WINAPI Range_ShiftStartToRange ( ITfRange iface,
TfEditCookie  ec,
ITfRange pRange,
TfAnchor  aPos 
)
static

Definition at line 161 of file range.c.

163{
164 Range *This = impl_from_ITfRange(iface);
165 FIXME("STUB:(%p)\n",This);
166 return E_NOTIMPL;
167}

◆ TF_SELECTION_to_TS_SELECTION_ACP()

HRESULT TF_SELECTION_to_TS_SELECTION_ACP ( const TF_SELECTION *  tf,
TS_SELECTION_ACP tsAcp 
)

Definition at line 351 of file range.c.

352{
353 Range *This;
354
355 if (!tf || !tsAcp || !tf->range)
356 return E_INVALIDARG;
357
358 This = impl_from_ITfRange(tf->range);
359
360 tsAcp->acpStart = This->anchorStart;
361 tsAcp->acpEnd = This->anchorEnd;
362 tsAcp->style.ase = tf->style.ase;
363 tsAcp->style.fInterimChar = tf->style.fInterimChar;
364 return S_OK;
365}
HFONT tf
Definition: icontest.c:17
TsActiveSelEnd ase
Definition: textstor.idl:86
TS_SELECTIONSTYLE style
Definition: textstor.idl:94

Referenced by Context_SetSelection().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msctf  )

Variable Documentation

◆ Range_RangeVtbl

const ITfRangeVtbl Range_RangeVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI Range_ShiftEndRegion(ITfRange *iface, TfEditCookie ec, TfShiftDir dir, BOOL *pfNoRegion)
Definition: range.c:185
static HRESULT WINAPI Range_GetContext(ITfRange *iface, ITfContext **ppContext)
Definition: range.c:285
static HRESULT WINAPI Range_ShiftStart(ITfRange *iface, TfEditCookie ec, LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt)
Definition: range.c:145
static HRESULT WINAPI Range_ShiftEnd(ITfRange *iface, TfEditCookie ec, LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt)
Definition: range.c:153
static HRESULT WINAPI Range_Collapse(ITfRange *iface, TfEditCookie ec, TfAnchor aPos)
Definition: range.c:201
static HRESULT WINAPI Range_GetFormattedText(ITfRange *iface, TfEditCookie ec, IDataObject **ppDataObject)
Definition: range.c:121
static HRESULT WINAPI Range_IsEqualStart(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
Definition: range.c:222
static HRESULT WINAPI Range_IsEqualEnd(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
Definition: range.c:230
static HRESULT WINAPI Range_Clone(ITfRange *iface, ITfRange **ppClone)
Definition: range.c:278
static HRESULT WINAPI Range_ShiftStartRegion(ITfRange *iface, TfEditCookie ec, TfShiftDir dir, BOOL *pfNoRegion)
Definition: range.c:177
static HRESULT WINAPI Range_QueryInterface(ITfRange *iface, REFIID iid, LPVOID *ppvOut)
Definition: range.c:64
static HRESULT WINAPI Range_GetGravity(ITfRange *iface, TfGravity *pgStart, TfGravity *pgEnd)
Definition: range.c:262
static HRESULT WINAPI Range_GetText(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, WCHAR *pchText, ULONG cchMax, ULONG *pcch)
Definition: range.c:105
static HRESULT WINAPI Range_AdjustForInsert(ITfRange *iface, TfEditCookie ec, ULONG cchInsert, BOOL *pfInsertOk)
Definition: range.c:254
static HRESULT WINAPI Range_SetGravity(ITfRange *iface, TfEditCookie ec, TfGravity gStart, TfGravity gEnd)
Definition: range.c:270
static HRESULT WINAPI Range_SetText(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, const WCHAR *pchText, LONG cch)
Definition: range.c:113
static ULONG WINAPI Range_AddRef(ITfRange *iface)
Definition: range.c:84
static HRESULT WINAPI Range_InsertEmbedded(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, IDataObject *pDataObject)
Definition: range.c:137
static ULONG WINAPI Range_Release(ITfRange *iface)
Definition: range.c:90
static HRESULT WINAPI Range_CompareEnd(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, LONG *plResult)
Definition: range.c:246
static HRESULT WINAPI Range_ShiftEndToRange(ITfRange *iface, TfEditCookie ec, ITfRange *pRange, TfAnchor aPos)
Definition: range.c:169
static HRESULT WINAPI Range_ShiftStartToRange(ITfRange *iface, TfEditCookie ec, ITfRange *pRange, TfAnchor aPos)
Definition: range.c:161
static HRESULT WINAPI Range_IsEmpty(ITfRange *iface, TfEditCookie ec, BOOL *pfEmpty)
Definition: range.c:193
static HRESULT WINAPI Range_GetEmbedded(ITfRange *iface, TfEditCookie ec, REFGUID rguidService, REFIID riid, IUnknown **ppunk)
Definition: range.c:129
static HRESULT WINAPI Range_CompareStart(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, LONG *plResult)
Definition: range.c:238

Definition at line 295 of file range.c.

Referenced by Range_Constructor().