mirror of
https://github.com/reactos/reactos.git
synced 2025-06-24 22:59:46 +00:00
[MSCTF][SDK] Add stubs for CRange (#8096)
This PR is just a step, but a slightly great one for OS development history. JIRA issue: CORE-19361 - Add IAnchor interface into textstor.idl. - Fix ITfRangeAnchor interface (that was wrong). - Delete range.c. - Add range.cpp. - Add CRange class as stubs.
This commit is contained in:
parent
2c124893ec
commit
5b94656442
7 changed files with 583 additions and 446 deletions
|
@ -12,7 +12,6 @@ list(APPEND SOURCE
|
||||||
documentmgr.c
|
documentmgr.c
|
||||||
inputprocessor.c
|
inputprocessor.c
|
||||||
msctf.c
|
msctf.c
|
||||||
range.c
|
|
||||||
threadmgr.c
|
threadmgr.c
|
||||||
precomp.h
|
precomp.h
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/msctf_stubs.c)
|
${CMAKE_CURRENT_BINARY_DIR}/msctf_stubs.c)
|
||||||
|
@ -20,6 +19,7 @@ list(APPEND SOURCE
|
||||||
list(APPEND PCH_SKIP_SOURCE
|
list(APPEND PCH_SKIP_SOURCE
|
||||||
langbarmgr.cpp
|
langbarmgr.cpp
|
||||||
mlng.cpp
|
mlng.cpp
|
||||||
|
range.cpp
|
||||||
utils.cpp)
|
utils.cpp)
|
||||||
|
|
||||||
add_library(msctf MODULE
|
add_library(msctf MODULE
|
||||||
|
|
|
@ -1,365 +0,0 @@
|
||||||
/*
|
|
||||||
* ITfRange implementation
|
|
||||||
*
|
|
||||||
* Copyright 2009 Aric Stewart, CodeWeavers
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#define COBJMACROS
|
|
||||||
|
|
||||||
#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"
|
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
|
|
||||||
|
|
||||||
typedef struct tagRange {
|
|
||||||
ITfRange ITfRange_iface;
|
|
||||||
/* const ITfRangeACPVtb *RangeACPVtbl; */
|
|
||||||
LONG refCount;
|
|
||||||
|
|
||||||
ITextStoreACP *pITextStoreACP;
|
|
||||||
ITfContext *pITfContext;
|
|
||||||
|
|
||||||
DWORD lockType;
|
|
||||||
TfGravity gravityStart, gravityEnd;
|
|
||||||
DWORD anchorStart, anchorEnd;
|
|
||||||
|
|
||||||
} Range;
|
|
||||||
|
|
||||||
static inline Range *impl_from_ITfRange(ITfRange *iface)
|
|
||||||
{
|
|
||||||
return CONTAINING_RECORD(iface, Range, ITfRange_iface);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void Range_Destructor(Range *This)
|
|
||||||
{
|
|
||||||
TRACE("destroying %p\n", This);
|
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_QueryInterface(ITfRange *iface, REFIID iid, LPVOID *ppvOut)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
*ppvOut = NULL;
|
|
||||||
|
|
||||||
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfRange))
|
|
||||||
{
|
|
||||||
*ppvOut = &This->ITfRange_iface;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*ppvOut)
|
|
||||||
{
|
|
||||||
ITfRange_AddRef(iface);
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
WARN("unsupported interface: %s\n", debugstr_guid(iid));
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ULONG WINAPI Range_AddRef(ITfRange *iface)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
return InterlockedIncrement(&This->refCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ULONG WINAPI Range_Release(ITfRange *iface)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
ULONG ret;
|
|
||||||
|
|
||||||
ret = InterlockedDecrement(&This->refCount);
|
|
||||||
if (ret == 0)
|
|
||||||
Range_Destructor(This);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************
|
|
||||||
* ITfRange functions
|
|
||||||
*****************************************************/
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_GetText(ITfRange *iface, TfEditCookie ec,
|
|
||||||
DWORD dwFlags, WCHAR *pchText, ULONG cchMax, ULONG *pcch)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_SetText(ITfRange *iface, TfEditCookie ec,
|
|
||||||
DWORD dwFlags, const WCHAR *pchText, LONG cch)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_GetFormattedText(ITfRange *iface, TfEditCookie ec,
|
|
||||||
IDataObject **ppDataObject)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_GetEmbedded(ITfRange *iface, TfEditCookie ec,
|
|
||||||
REFGUID rguidService, REFIID riid, IUnknown **ppunk)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_InsertEmbedded(ITfRange *iface, TfEditCookie ec,
|
|
||||||
DWORD dwFlags, IDataObject *pDataObject)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_ShiftStart(ITfRange *iface, TfEditCookie ec,
|
|
||||||
LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_ShiftEnd(ITfRange *iface, TfEditCookie ec,
|
|
||||||
LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_ShiftStartToRange(ITfRange *iface, TfEditCookie ec,
|
|
||||||
ITfRange *pRange, TfAnchor aPos)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_ShiftEndToRange(ITfRange *iface, TfEditCookie ec,
|
|
||||||
ITfRange *pRange, TfAnchor aPos)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_ShiftStartRegion(ITfRange *iface, TfEditCookie ec,
|
|
||||||
TfShiftDir dir, BOOL *pfNoRegion)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_ShiftEndRegion(ITfRange *iface, TfEditCookie ec,
|
|
||||||
TfShiftDir dir, BOOL *pfNoRegion)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_IsEmpty(ITfRange *iface, TfEditCookie ec,
|
|
||||||
BOOL *pfEmpty)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_Collapse(ITfRange *iface, TfEditCookie ec,
|
|
||||||
TfAnchor aPos)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
TRACE("(%p) %i %i\n",This,ec,aPos);
|
|
||||||
|
|
||||||
switch (aPos)
|
|
||||||
{
|
|
||||||
case TF_ANCHOR_START:
|
|
||||||
This->anchorEnd = This->anchorStart;
|
|
||||||
break;
|
|
||||||
case TF_ANCHOR_END:
|
|
||||||
This->anchorStart = This->anchorEnd;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return E_INVALIDARG;
|
|
||||||
}
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_IsEqualStart(ITfRange *iface, TfEditCookie ec,
|
|
||||||
ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_IsEqualEnd(ITfRange *iface, TfEditCookie ec,
|
|
||||||
ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_CompareStart(ITfRange *iface, TfEditCookie ec,
|
|
||||||
ITfRange *pWith, TfAnchor aPos, LONG *plResult)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_CompareEnd(ITfRange *iface, TfEditCookie ec,
|
|
||||||
ITfRange *pWith, TfAnchor aPos, LONG *plResult)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_AdjustForInsert(ITfRange *iface, TfEditCookie ec,
|
|
||||||
ULONG cchInsert, BOOL *pfInsertOk)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_GetGravity(ITfRange *iface,
|
|
||||||
TfGravity *pgStart, TfGravity *pgEnd)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_SetGravity(ITfRange *iface, TfEditCookie ec,
|
|
||||||
TfGravity gStart, TfGravity gEnd)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_Clone(ITfRange *iface, ITfRange **ppClone)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
FIXME("STUB:(%p)\n",This);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI Range_GetContext(ITfRange *iface, ITfContext **ppContext)
|
|
||||||
{
|
|
||||||
Range *This = impl_from_ITfRange(iface);
|
|
||||||
TRACE("(%p)\n",This);
|
|
||||||
if (!ppContext)
|
|
||||||
return E_INVALIDARG;
|
|
||||||
*ppContext = This->pITfContext;
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const ITfRangeVtbl Range_RangeVtbl =
|
|
||||||
{
|
|
||||||
Range_QueryInterface,
|
|
||||||
Range_AddRef,
|
|
||||||
Range_Release,
|
|
||||||
|
|
||||||
Range_GetText,
|
|
||||||
Range_SetText,
|
|
||||||
Range_GetFormattedText,
|
|
||||||
Range_GetEmbedded,
|
|
||||||
Range_InsertEmbedded,
|
|
||||||
Range_ShiftStart,
|
|
||||||
Range_ShiftEnd,
|
|
||||||
Range_ShiftStartToRange,
|
|
||||||
Range_ShiftEndToRange,
|
|
||||||
Range_ShiftStartRegion,
|
|
||||||
Range_ShiftEndRegion,
|
|
||||||
Range_IsEmpty,
|
|
||||||
Range_Collapse,
|
|
||||||
Range_IsEqualStart,
|
|
||||||
Range_IsEqualEnd,
|
|
||||||
Range_CompareStart,
|
|
||||||
Range_CompareEnd,
|
|
||||||
Range_AdjustForInsert,
|
|
||||||
Range_GetGravity,
|
|
||||||
Range_SetGravity,
|
|
||||||
Range_Clone,
|
|
||||||
Range_GetContext
|
|
||||||
};
|
|
||||||
|
|
||||||
HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut)
|
|
||||||
{
|
|
||||||
Range *This;
|
|
||||||
|
|
||||||
This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Range));
|
|
||||||
if (This == NULL)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
TRACE("(%p) %p %p\n",This, context, textstore);
|
|
||||||
|
|
||||||
This->ITfRange_iface.lpVtbl = &Range_RangeVtbl;
|
|
||||||
This->refCount = 1;
|
|
||||||
This->pITfContext = context;
|
|
||||||
This->pITextStoreACP = textstore;
|
|
||||||
This->lockType = lockType;
|
|
||||||
This->anchorStart = anchorStart;
|
|
||||||
This->anchorEnd = anchorEnd;
|
|
||||||
|
|
||||||
*ppOut = &This->ITfRange_iface;
|
|
||||||
TRACE("returning %p\n", *ppOut);
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Internal conversion functions */
|
|
||||||
|
|
||||||
HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp)
|
|
||||||
{
|
|
||||||
Range *This;
|
|
||||||
|
|
||||||
if (!tf || !tsAcp || !tf->range)
|
|
||||||
return E_INVALIDARG;
|
|
||||||
|
|
||||||
This = impl_from_ITfRange(tf->range);
|
|
||||||
|
|
||||||
tsAcp->acpStart = This->anchorStart;
|
|
||||||
tsAcp->acpEnd = This->anchorEnd;
|
|
||||||
tsAcp->style.ase = tf->style.ase;
|
|
||||||
tsAcp->style.fInterimChar = tf->style.fInterimChar;
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
396
base/ctf/msctf/range.cpp
Normal file
396
base/ctf/msctf/range.cpp
Normal file
|
@ -0,0 +1,396 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS CTF
|
||||||
|
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
|
||||||
|
* PURPOSE: ITfRangeACP implementation
|
||||||
|
* COPYRIGHT: Copyright 2009 Aric Stewart, CodeWeavers
|
||||||
|
* Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <initguid.h>
|
||||||
|
#include <windef.h>
|
||||||
|
#include <winbase.h>
|
||||||
|
#include <winreg.h>
|
||||||
|
#include <msctf.h>
|
||||||
|
#include <msctf_undoc.h>
|
||||||
|
|
||||||
|
// Cicero
|
||||||
|
#include <cicbase.h>
|
||||||
|
#include <cicreg.h>
|
||||||
|
#include <cicutb.h>
|
||||||
|
|
||||||
|
class CInputContext;
|
||||||
|
#include "range.h"
|
||||||
|
#include "msctf_internal.h"
|
||||||
|
|
||||||
|
#include <wine/debug.h>
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
// CRange
|
||||||
|
|
||||||
|
CRange::CRange(
|
||||||
|
_In_ CInputContext *pIC,
|
||||||
|
_In_ DWORD dwLockType,
|
||||||
|
_In_ IAnchor *pAnchorStart,
|
||||||
|
_In_ IAnchor *pAnchorEnd,
|
||||||
|
_In_ TfGravity gravity)
|
||||||
|
{
|
||||||
|
m_dwLockType = dwLockType;
|
||||||
|
m_pAnchorStart = pAnchorStart;
|
||||||
|
m_pAnchorEnd = pAnchorEnd;
|
||||||
|
m_pInputContext = pIC;
|
||||||
|
m_dwCookie = MAXDWORD;
|
||||||
|
m_gravity = gravity;
|
||||||
|
m_cRefs = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CRange::~CRange()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CRange *CRange::_Clone()
|
||||||
|
{
|
||||||
|
CRange *pRange = new(cicNoThrow) CRange(m_pInputContext, 0, m_pAnchorStart, m_pAnchorEnd, (TfGravity)2);
|
||||||
|
if (!pRange)
|
||||||
|
return NULL;
|
||||||
|
pRange->m_dwCookie = m_dwCookie;
|
||||||
|
return pRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT CRange::_IsEqualX(TfEditCookie ec, BOOL bEnd, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
|
||||||
|
{
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT CRange::_CompareX(
|
||||||
|
TfEditCookie ec,
|
||||||
|
BOOL bEnd,
|
||||||
|
ITfRange *pWidth,
|
||||||
|
TfAnchor aPos,
|
||||||
|
LONG *plResult)
|
||||||
|
{
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
// ** IUnknown methods **
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::QueryInterface(REFIID riid, void **ppvObj)
|
||||||
|
{
|
||||||
|
if (IsEqualGUID(riid, IID_PRIV_CRANGE))
|
||||||
|
{
|
||||||
|
*ppvObj = this;
|
||||||
|
return S_OK; // No AddRef
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsEqualGUID(riid, IID_ITfRange) || IsEqualGUID(riid, IID_IUnknown))
|
||||||
|
*ppvObj = this;
|
||||||
|
else if (IsEqualGUID(riid, IID_ITfRangeACP))
|
||||||
|
*ppvObj = static_cast<ITfRangeACP *>(this);
|
||||||
|
else if (IsEqualGUID(riid, IID_ITfRangeAnchor))
|
||||||
|
*ppvObj = static_cast<ITfRangeAnchor *>(this);
|
||||||
|
else if (IsEqualGUID(riid, IID_ITfSource))
|
||||||
|
*ppvObj = static_cast<ITfSource *>(this);
|
||||||
|
else
|
||||||
|
*ppvObj = NULL;
|
||||||
|
|
||||||
|
if (*ppvObj)
|
||||||
|
{
|
||||||
|
AddRef();
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP_(ULONG) CRange::AddRef()
|
||||||
|
{
|
||||||
|
return InterlockedIncrement(&m_cRefs);
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP_(ULONG) CRange::Release()
|
||||||
|
{
|
||||||
|
if (InterlockedDecrement(&m_cRefs) == 0)
|
||||||
|
{
|
||||||
|
delete this;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return m_cRefs;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
// ** ITfRange methods **
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::GetText(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ DWORD dwFlags,
|
||||||
|
_Out_ WCHAR *pchText,
|
||||||
|
_In_ ULONG cchMax,
|
||||||
|
_Out_ ULONG *pcch)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::SetText(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ DWORD dwFlags,
|
||||||
|
_In_ const WCHAR *pchText,
|
||||||
|
_In_ LONG cch)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::GetFormattedText(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_Out_ IDataObject **ppDataObject)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::GetEmbedded(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ REFGUID rguidService,
|
||||||
|
_In_ REFIID riid,
|
||||||
|
_Out_ IUnknown **ppunk)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::InsertEmbedded(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ DWORD dwFlags,
|
||||||
|
_In_ IDataObject *pDataObject)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::ShiftStart(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ LONG cchReq,
|
||||||
|
_Out_ LONG *pcch,
|
||||||
|
_In_ const TF_HALTCOND *pHalt)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::ShiftEnd(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ LONG cchReq,
|
||||||
|
_Out_ LONG *pcch,
|
||||||
|
_In_ const TF_HALTCOND *pHalt)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::ShiftStartToRange(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pRange,
|
||||||
|
_In_ TfAnchor aPos)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::ShiftEndToRange(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pRange,
|
||||||
|
_In_ TfAnchor aPos)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::ShiftStartRegion(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ TfShiftDir dir,
|
||||||
|
_Out_ BOOL *pfNoRegion)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::ShiftEndRegion(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ TfShiftDir dir,
|
||||||
|
_Out_ BOOL *pfNoRegion)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::IsEmpty(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_Out_ BOOL *pfEmpty)
|
||||||
|
{
|
||||||
|
TRACE("(%d, %p)\n", ec, pfEmpty);
|
||||||
|
return IsEqualStart(ec, static_cast<ITfRangeACP *>(this), TF_ANCHOR_END, pfEmpty);
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::Collapse(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ TfAnchor aPos)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::IsEqualStart(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pWith,
|
||||||
|
_In_ TfAnchor aPos,
|
||||||
|
_Out_ BOOL *pfEqual)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return _IsEqualX(ec, FALSE, pWith, aPos, pfEqual);
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::IsEqualEnd(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pWith,
|
||||||
|
_In_ TfAnchor aPos,
|
||||||
|
_Out_ BOOL *pfEqual)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return _IsEqualX(ec, TRUE, pWith, aPos, pfEqual);
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::CompareStart(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pWith,
|
||||||
|
_In_ TfAnchor aPos,
|
||||||
|
_Out_ LONG *plResult)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::CompareEnd(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pWith,
|
||||||
|
_In_ TfAnchor aPos,
|
||||||
|
_Out_ LONG *plResult)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::AdjustForInsert(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ULONG cchInsert,
|
||||||
|
_Out_ BOOL *pfInsertOk)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::GetGravity(
|
||||||
|
_Out_ TfGravity *pgStart,
|
||||||
|
_Out_ TfGravity *pgEnd)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::SetGravity(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ TfGravity gStart,
|
||||||
|
_In_ TfGravity gEnd)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::Clone(
|
||||||
|
_Out_ ITfRange **ppClone)
|
||||||
|
{
|
||||||
|
TRACE("%p\n", ppClone);
|
||||||
|
|
||||||
|
if (!ppClone)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
CRange *pCloned = _Clone();
|
||||||
|
if (!pCloned)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
*ppClone = static_cast<ITfRangeACP *>(pCloned);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::GetContext(
|
||||||
|
_Out_ ITfContext **ppContext)
|
||||||
|
{
|
||||||
|
FIXME("%p\n", ppContext);
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
// ** ITfRangeACP methods **
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::GetExtent(_Out_ LONG *pacpAnchor, _Out_ LONG *pcch)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::SetExtent(_In_ LONG acpAnchor, _In_ LONG cch)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
// ** ITfRangeAnchor methods **
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::GetExtent(_Out_ IAnchor **ppStart, _Out_ IAnchor **ppEnd)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::SetExtent(_In_ IAnchor *pAnchorStart, _In_ IAnchor *pAnchorEnd)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
// ** ITfSource methods **
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::AdviseSink(
|
||||||
|
_In_ REFIID riid,
|
||||||
|
_In_ IUnknown *punk,
|
||||||
|
_Out_ DWORD *pdwCookie)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
STDMETHODIMP CRange::UnadviseSink(
|
||||||
|
_In_ DWORD dwCookie)
|
||||||
|
{
|
||||||
|
FIXME("\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
EXTERN_C
|
||||||
|
HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut)
|
||||||
|
{
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Internal conversion functions */
|
||||||
|
|
||||||
|
EXTERN_C
|
||||||
|
HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp)
|
||||||
|
{
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
141
base/ctf/msctf/range.h
Normal file
141
base/ctf/msctf/range.h
Normal file
|
@ -0,0 +1,141 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
DEFINE_GUID(IID_PRIV_CRANGE, 0xB68832F0, 0x34B9, 0x11D3, 0xA7, 0x45, 0x00, 0x50, 0x04, 0x0A, 0xB4, 0x07);
|
||||||
|
|
||||||
|
class CRange
|
||||||
|
: public ITfRangeACP
|
||||||
|
, public ITfRangeAnchor
|
||||||
|
, public ITfSource
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
DWORD m_dwLockType;
|
||||||
|
IAnchor *m_pAnchorStart;
|
||||||
|
IAnchor *m_pAnchorEnd;
|
||||||
|
CInputContext *m_pInputContext;
|
||||||
|
DWORD m_dwCookie;
|
||||||
|
TfGravity m_gravity;
|
||||||
|
LONG m_cRefs;
|
||||||
|
|
||||||
|
public:
|
||||||
|
CRange(
|
||||||
|
_In_ CInputContext *pIC,
|
||||||
|
_In_ DWORD dwLockType,
|
||||||
|
_In_ IAnchor *pAnchorStart,
|
||||||
|
_In_ IAnchor *pAnchorEnd,
|
||||||
|
_In_ TfGravity gravity);
|
||||||
|
|
||||||
|
virtual ~CRange();
|
||||||
|
|
||||||
|
// ** IUnknown methods **
|
||||||
|
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj) override;
|
||||||
|
STDMETHODIMP_(ULONG) AddRef() override;
|
||||||
|
STDMETHODIMP_(ULONG) Release() override;
|
||||||
|
|
||||||
|
// ** ITfRange methods **
|
||||||
|
STDMETHODIMP GetText(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ DWORD dwFlags,
|
||||||
|
_Out_ WCHAR *pchText,
|
||||||
|
_In_ ULONG cchMax,
|
||||||
|
_Out_ ULONG *pcch) override;
|
||||||
|
STDMETHODIMP SetText(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ DWORD dwFlags,
|
||||||
|
_In_ const WCHAR *pchText,
|
||||||
|
_In_ LONG cch) override;
|
||||||
|
STDMETHODIMP GetFormattedText(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_Out_ IDataObject **ppDataObject) override;
|
||||||
|
STDMETHODIMP GetEmbedded(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ REFGUID rguidService,
|
||||||
|
_In_ REFIID riid,
|
||||||
|
_Out_ IUnknown **ppunk) override;
|
||||||
|
STDMETHODIMP InsertEmbedded(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ DWORD dwFlags,
|
||||||
|
_In_ IDataObject *pDataObject) override;
|
||||||
|
STDMETHODIMP ShiftStart(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ LONG cchReq,
|
||||||
|
_Out_ LONG *pcch,
|
||||||
|
_In_ const TF_HALTCOND *pHalt) override;
|
||||||
|
STDMETHODIMP ShiftEnd(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ LONG cchReq,
|
||||||
|
_Out_ LONG *pcch,
|
||||||
|
_In_ const TF_HALTCOND *pHalt) override;
|
||||||
|
STDMETHODIMP ShiftStartToRange(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pRange,
|
||||||
|
_In_ TfAnchor aPos) override;
|
||||||
|
STDMETHODIMP ShiftEndToRange(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pRange,
|
||||||
|
_In_ TfAnchor aPos) override;
|
||||||
|
STDMETHODIMP ShiftStartRegion(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ TfShiftDir dir,
|
||||||
|
_Out_ BOOL *pfNoRegion) override;
|
||||||
|
STDMETHODIMP ShiftEndRegion(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ TfShiftDir dir,
|
||||||
|
_Out_ BOOL *pfNoRegion) override;
|
||||||
|
STDMETHODIMP IsEmpty(_In_ TfEditCookie ec, _Out_ BOOL *pfEmpty) override;
|
||||||
|
STDMETHODIMP Collapse(_In_ TfEditCookie ec, _In_ TfAnchor aPos) override;
|
||||||
|
STDMETHODIMP IsEqualStart(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pWith,
|
||||||
|
_In_ TfAnchor aPos,
|
||||||
|
_Out_ BOOL *pfEqual) override;
|
||||||
|
STDMETHODIMP IsEqualEnd(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pWith,
|
||||||
|
_In_ TfAnchor aPos,
|
||||||
|
_Out_ BOOL *pfEqual) override;
|
||||||
|
STDMETHODIMP CompareStart(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pWith,
|
||||||
|
_In_ TfAnchor aPos,
|
||||||
|
_Out_ LONG *plResult) override;
|
||||||
|
STDMETHODIMP CompareEnd(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ITfRange *pWith,
|
||||||
|
_In_ TfAnchor aPos,
|
||||||
|
_Out_ LONG *plResult) override;
|
||||||
|
STDMETHODIMP AdjustForInsert(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ ULONG cchInsert,
|
||||||
|
_Out_ BOOL *pfInsertOk) override;
|
||||||
|
STDMETHODIMP GetGravity(_Out_ TfGravity *pgStart, _Out_ TfGravity *pgEnd) override;
|
||||||
|
STDMETHODIMP SetGravity(
|
||||||
|
_In_ TfEditCookie ec,
|
||||||
|
_In_ TfGravity gStart,
|
||||||
|
_In_ TfGravity gEnd) override;
|
||||||
|
STDMETHODIMP Clone(_Out_ ITfRange **ppClone) override;
|
||||||
|
STDMETHODIMP GetContext(_Out_ ITfContext **ppContext) override;
|
||||||
|
|
||||||
|
// ** ITfRangeACP methods **
|
||||||
|
STDMETHODIMP GetExtent(_Out_ LONG *pacpAnchor, _Out_ LONG *pcch) override;
|
||||||
|
STDMETHODIMP SetExtent(_In_ LONG acpAnchor, _In_ LONG cch) override;
|
||||||
|
|
||||||
|
// ** ITfRangeAnchor methods **
|
||||||
|
STDMETHODIMP GetExtent(_Out_ IAnchor **ppStart, _Out_ IAnchor **ppEnd) override;
|
||||||
|
STDMETHODIMP SetExtent(_In_ IAnchor *pAnchorStart, _In_ IAnchor *pAnchorEnd) override;
|
||||||
|
|
||||||
|
// ** ITfSource methods **
|
||||||
|
STDMETHODIMP AdviseSink(_In_ REFIID riid, _In_ IUnknown *punk, _Out_ DWORD *pdwCookie) override;
|
||||||
|
STDMETHODIMP UnadviseSink(_In_ DWORD dwCookie) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
CRange *_Clone();
|
||||||
|
|
||||||
|
HRESULT _IsEqualX(TfEditCookie ec, BOOL bEnd, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual);
|
||||||
|
|
||||||
|
HRESULT _CompareX(
|
||||||
|
TfEditCookie ec,
|
||||||
|
BOOL bEnd,
|
||||||
|
ITfRange *pWidth,
|
||||||
|
TfAnchor aPos,
|
||||||
|
LONG *plResult);
|
||||||
|
};
|
|
@ -32,7 +32,6 @@
|
||||||
#include "mlng.h"
|
#include "mlng.h"
|
||||||
|
|
||||||
#include <wine/debug.h>
|
#include <wine/debug.h>
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
|
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
|
||||||
|
|
||||||
BOOL gf_CRT_INIT = FALSE;
|
BOOL gf_CRT_INIT = FALSE;
|
||||||
|
@ -93,6 +92,13 @@ UINT g_uKeyTipHotKeyModifiers = 0;
|
||||||
UINT g_uKeyTipHotKeyVKey = 0;
|
UINT g_uKeyTipHotKeyVKey = 0;
|
||||||
UINT g_uKeyTipHotKeyVKey2 = 0;
|
UINT g_uKeyTipHotKeyVKey2 = 0;
|
||||||
|
|
||||||
|
// Handle pure virtual function call errors
|
||||||
|
extern "C" void __cxa_pure_virtual(void)
|
||||||
|
{
|
||||||
|
ERR("__cxa_pure_virtual\n");
|
||||||
|
DebugBreak();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -300,3 +300,37 @@ interface ITextStoreACP : IUnknown
|
||||||
[in] TsViewCookie vcView,
|
[in] TsViewCookie vcView,
|
||||||
[out] HWND *phwnd);
|
[out] HWND *phwnd);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[
|
||||||
|
object,
|
||||||
|
uuid(0feb7e34-5a60-4356-8ef7-abdec2ff7cf8),
|
||||||
|
pointer_default(unique)
|
||||||
|
]
|
||||||
|
interface IAnchor : IUnknown
|
||||||
|
{
|
||||||
|
const DWORD TS_SHIFT_COUNT_HIDDEN = 0x1;
|
||||||
|
const DWORD TS_SHIFT_HALT_HIDDEN = 0x2;
|
||||||
|
const DWORD TS_SHIFT_HALT_VISIBLE = 0x4;
|
||||||
|
const DWORD TS_SHIFT_COUNT_ONLY = 0x8;
|
||||||
|
|
||||||
|
const DWORD TS_CH_PRECEDING_DEL = 1;
|
||||||
|
const DWORD TS_CH_FOLLOWING_DEL = 2;
|
||||||
|
|
||||||
|
typedef [uuid(daa8601e-7695-426f-9bb7-498a6aa64b68)]
|
||||||
|
enum { TS_GR_BACKWARD = 0, TS_GR_FORWARD = 1 } TsGravity;
|
||||||
|
|
||||||
|
typedef [uuid(898e19df-4fb4-4af3-8daf-9b3c1145c79d)]
|
||||||
|
enum { TS_SD_BACKWARD = 0, TS_SD_FORWARD = 1 } TsShiftDir;
|
||||||
|
|
||||||
|
HRESULT SetGravity([in] TsGravity gravity);
|
||||||
|
HRESULT GetGravity([out] TsGravity *pgravity);
|
||||||
|
HRESULT IsEqual([in] IAnchor *paWith, [out] BOOL *pfEqual);
|
||||||
|
HRESULT Compare([in] IAnchor *paWith, [out] LONG *plResult);
|
||||||
|
HRESULT Shift([in] DWORD dwFlags, [in] LONG cchReq, [out] LONG *pcch, [in] IAnchor *paHaltAnchor);
|
||||||
|
HRESULT ShiftTo([in] IAnchor *paSite);
|
||||||
|
HRESULT ShiftRegion([in] DWORD dwFlags, [in] TsShiftDir dir, [out] BOOL *pfNoRegion);
|
||||||
|
HRESULT SetChangeHistoryMask([in] DWORD dwMask);
|
||||||
|
HRESULT GetChangeHistory([out] DWORD *pdwHistory);
|
||||||
|
HRESULT ClearChangeHistory();
|
||||||
|
HRESULT Clone([out] IAnchor **ppaClone);
|
||||||
|
};
|
||||||
|
|
|
@ -13,86 +13,11 @@ import "inputscope.idl";
|
||||||
uuid(8b99712b-5815-4bcc-b9a9-53db1c8d6755),
|
uuid(8b99712b-5815-4bcc-b9a9-53db1c8d6755),
|
||||||
pointer_default(unique)
|
pointer_default(unique)
|
||||||
]
|
]
|
||||||
interface ITfRangeAnchor : IUnknown
|
interface ITfRangeAnchor : ITfRange
|
||||||
{
|
{
|
||||||
HRESULT GetFormattedText(
|
HRESULT GetExtent([out] IAnchor **ppStart, [out] IAnchor **ppEnd);
|
||||||
[in] TfEditCookie ec,
|
HRESULT SetExtent([in] IAnchor *pAnchorStart, [in] IAnchor *pAnchorEnd);
|
||||||
[out] IDataObject **ppDataObject);
|
};
|
||||||
HRESULT GetEmbedded(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] REFGUID rguidService,
|
|
||||||
[in] REFIID riid,
|
|
||||||
[out] IUnknown **ppunk);
|
|
||||||
HRESULT InsertEmbedded(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] DWORD dwFlags,
|
|
||||||
[in] IDataObject *pDataObject);
|
|
||||||
HRESULT ShiftStart(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] LONG cchReq,
|
|
||||||
[out] LONG *pcch,
|
|
||||||
[in] const TF_HALTCOND *pHalt);
|
|
||||||
HRESULT ShiftEnd(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] LONG cchReq,
|
|
||||||
[out] LONG *pcch,
|
|
||||||
[in] const TF_HALTCOND *pHalt);
|
|
||||||
HRESULT ShiftStartToRange(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] ITfRange *pRange,
|
|
||||||
[in] TfAnchor aPos);
|
|
||||||
HRESULT ShiftEndToRange(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] ITfRange *pRange,
|
|
||||||
[in] TfAnchor aPos);
|
|
||||||
HRESULT ShiftStartRegion(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] TfShiftDir dir,
|
|
||||||
[out] BOOL *pfNoRegion);
|
|
||||||
HRESULT ShiftEndRegion(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] TfShiftDir dir,
|
|
||||||
[out] BOOL *pfNoRegion);
|
|
||||||
HRESULT IsEmpty(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[out] BOOL *pfEmpty);
|
|
||||||
HRESULT Collapse(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] TfAnchor aPos);
|
|
||||||
HRESULT IsEqualStart(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] ITfRange *pWith,
|
|
||||||
[in] TfAnchor aPos,
|
|
||||||
[out] BOOL *pfEqual);
|
|
||||||
HRESULT IsEqualEnd(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] ITfRange *pWith,
|
|
||||||
[in] TfAnchor aPos,
|
|
||||||
[out] BOOL *pfEqual);
|
|
||||||
HRESULT CompareStart(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] ITfRange *pWith,
|
|
||||||
[in] TfAnchor aPos,
|
|
||||||
[out] LONG *plResult);
|
|
||||||
HRESULT CompareEnd(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] ITfRange *pWith,
|
|
||||||
[in] TfAnchor aPos,
|
|
||||||
[out] LONG *plResult);
|
|
||||||
HRESULT AdjustForInsert(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] ULONG cchInsert,
|
|
||||||
[out] BOOL *pfInsertOk);
|
|
||||||
HRESULT GetGravity(
|
|
||||||
[out] TfGravity *pgStart,
|
|
||||||
[out] TfGravity *pgEnd);
|
|
||||||
HRESULT SetGravity(
|
|
||||||
[in] TfEditCookie ec,
|
|
||||||
[in] TfGravity gStart,
|
|
||||||
[in] TfGravity gEnd);
|
|
||||||
HRESULT Clone([out] ITfRange **ppClone);
|
|
||||||
HRESULT GetContext([out] ITfContext **ppContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
cpp_quote("BOOL WINAPI TF_InitSystem(VOID);")
|
cpp_quote("BOOL WINAPI TF_InitSystem(VOID);")
|
||||||
cpp_quote("BOOL WINAPI TF_UninitSystem(VOID);")
|
cpp_quote("BOOL WINAPI TF_UninitSystem(VOID);")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue