[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:
Katayama Hirofumi MZ 2025-06-09 23:51:17 +09:00 committed by GitHub
parent 2c124893ec
commit 5b94656442
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 583 additions and 446 deletions

View file

@ -300,3 +300,37 @@ interface ITextStoreACP : IUnknown
[in] TsViewCookie vcView,
[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);
};

View file

@ -13,86 +13,11 @@ import "inputscope.idl";
uuid(8b99712b-5815-4bcc-b9a9-53db1c8d6755),
pointer_default(unique)
]
interface ITfRangeAnchor : IUnknown
interface ITfRangeAnchor : ITfRange
{
HRESULT GetFormattedText(
[in] TfEditCookie ec,
[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);
}
HRESULT GetExtent([out] IAnchor **ppStart, [out] IAnchor **ppEnd);
HRESULT SetExtent([in] IAnchor *pAnchorStart, [in] IAnchor *pAnchorEnd);
};
cpp_quote("BOOL WINAPI TF_InitSystem(VOID);")
cpp_quote("BOOL WINAPI TF_UninitSystem(VOID);")