UI-KeyboardLayout
view release on metacpan or search on metacpan
TSF-framework view on Meta::CPAN
void ToggleCase(TfEditCookie ec, ITfRange *pRange, BOOL fIgnoreRangeEnd)
{
ITfRange *pRangeToggle;
ULONG cch;
ULONG i;
DWORD dwFlags;
WCHAR achText[64];
// backup the current range
if (pRange->Clone(&pRangeToggle) != S_OK)
return;
dwFlags = TF_TF_MOVESTART | (fIgnoreRangeEnd ? TF_TF_IGNOREEND : 0);
while (TRUE)
{
// grab the next block of chars
if (pRange->GetText(ec, dwFlags, achText, ARRAYSIZE(achText), &cch) != S_OK)
break;
// out of text?
if (cch == 0)
{
break;
}
// toggle the case
for (i=0; i<cch; i++)
{
achText[i] = ToggleChar(achText[i]);
}
// shift pRangeToggle so it covers just the text we read
if (pRangeToggle->ShiftEndToRange(ec, pRange, TF_ANCHOR_START) != S_OK)
break;
// replace the text
pRangeToggle->SetText(ec, 0, achText, cch);
// prepare for next iteration
pRangeToggle->Collapse(ec, TF_ANCHOR_END);
}
pRangeToggle->Release();
}
æ¯å 为 notepad ç tsf æ¯ææ¯éè¿ CUASå®ç°ç. æä»¥ä¸¦ä¸å®å
¨æ¯æ TSF ç text storeç颿¥å¯¹æåå
容åå.
VwTextStore is the point of interaction between Fieldworks and Text Services. VwTxtSrc designates VwTextStore as a friend class.
Events:
Amongst other things, it receives messages from Text Services, listens for mouse events, manipulates the document and responds to internal Fieldworks events, such as document changes and lazy box changes.
The messages from text services arrive through the interface methods provided by ITfContextOwnerCompositionSink and ITextStoreACP.
Storage:
What kind of changes can happen to the document that do not come from text services is not known (clipboard, formatting etc. possibly)
The section of the document which is being edited is stored as a DocMgr. This interface looks pretty simple. It is not clear how much of the document is stored at one time (assumedly the amount which is seen on the screen, which would be dictated by ...
Porting:
This class will be replaced in Linux Fieldworks by VwTextInputManager.
Contents [hide]
1 Public Methods
1.1 ITextStoreACP methods.
1.2 ITfContextOwnerCompositionSink methods
1.3 ITfMouseTrackerACP
1.4 Other Public Methods.
Public Methods
ITextStoreACP methods.
STDMETHOD AdviseSink (REFIID riid, IUnknown * punk, DWORD dwMask);
STDMETHOD UnadviseSink (IUnknown * punk);
STDMETHOD RequestLock (DWORD dwLockFlags, HRESULT * phrSession);
STDMETHOD GetStatus (TS_STATUS * pdcs);
STDMETHOD QueryInsert (LONG acpTestStart, LONG acpTestEnd, ULONG cch, LONG * pacpResultStart, LONG * pacpResultEnd);
STDMETHOD GetSelection (ULONG ulIndex, ULONG ulCount, TS_SELECTION_ACP * pSelection, ULONG * pcFetched);
STDMETHOD SetSelection (ULONG ulCount, const TS_SELECTION_ACP * pSelection);
STDMETHOD GetText (LONG acpStart, LONG acpEnd, WCHAR * pchPlain, ULONG cchPlainReq, ULONG * pcchPlainOut, TS_RUNINFO * prgRunInfo, ULONG ulRunInfoReq, ULONG * pulRunInfoOut, LONG * pacpNext);
STDMETHOD SetText (DWORD dwFlags, LONG acpStart, LONG acpEnd, const WCHAR * pchText, ULONG cch, TS_TEXTCHANGE * pChange);
These look fairly GtkIM like.
STDMETHOD GetFormattedText (LONG acpStart, LONG acpEnd, IDataObject ** ppDataObject);
Embedding not supported
STDMETHOD GetEmbedded (LONG acpPos, REFGUID rguidService, REFIID riid, IUnknown ** ppunk);
STDMETHOD QueryInsertEmbedded (const GUID * pguidService, const FORMATETC * pFormatEtc, BOOL * pfInsertable);
STDMETHOD InsertEmbedded (DWORD dwFlags, LONG acpStart, LONG acpEnd, IDataObject * pDataObject, TS_TEXTCHANGE * pChange);
STDMETHOD RequestSupportedAttrs (DWORD dwFlags, ULONG cFilterAttrs, const TS_ATTRID * paFilterAttrs);
STDMETHOD RequestAttrsAtPosition (LONG acpPos, ULONG cFilterAttrs, const TS_ATTRID * paFilterAttrs, DWORD dwFlags);
STDMETHOD RequestAttrsTransitioningAtPosition (LONG acpPos, ULONG cFilterAttrs, const TS_ATTRID * paFilterAttrs, DWORD dwFlags);
STDMETHOD FindNextAttrTransition (LONG acpStart, LONG acpHalt, ULONG cFilterAttrs, const TS_ATTRID * paFilterAttrs, DWORD dwFlags, LONG * pacpNext, BOOL * pfFound, LONG * plFoundOffset);
STDMETHOD RetrieveRequestedAttrs (ULONG ulCount, TS_ATTRVAL * paAttrVals, ULONG * pcFetched);
STDMETHOD GetEndACP (LONG * pacp);
STDMETHOD GetActiveView (TsViewCookie * pvcView);
STDMETHOD GetACPFromPoint (TsViewCookie vcView, const POINT * pt, DWORD dwFlags, LONG * pacp);
STDMETHOD GetTextExt (TsViewCookie vcView, LONG acpStart, LONG acpEnd, RECT * prc, BOOL * pfClipped);
STDMETHOD GetScreenExt (TsViewCookie vcView, RECT * prc);
STDMETHOD GetWnd (TsViewCookie vcView, HWND * phwnd);
STDMETHOD InsertTextAtSelection (DWORD dwFlags, const WCHAR * pchText, ULONG cch, LONG * pacpStart, LONG * pacpEnd, TS_TEXTCHANGE * pChange);
Equivalent to IM commit callback and keyboard event handler?
STDMETHOD InsertEmbeddedAtSelection (DWORD dwFlags, IDataObject * pDataObject, LONG * pacpStart, LONG * pacpEnd, TS_TEXTCHANGE * pChange);
ITfContextOwnerCompositionSink methods
( run in 2.083 seconds using v1.01-cache-2.11-cpan-84e82930d8c )