mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-20 04:47:42 +00:00
* Keyman for Windows 10.0 Open Source * Squashed 'windows/src/ext/jedi/jedi/' content from commit f444ad2 git-subtree-dir: windows/src/ext/jedi/jedi git-subtree-split: f444ad2da4693851e523f1ea6bd541f701904c24 * Squashed 'windows/src/ext/jedi/jcl/' content from commit d63d3c9fd git-subtree-dir: windows/src/ext/jedi/jcl git-subtree-split: d63d3c9fd9ff84efdd8159084ec6a60313644243 * Squashed 'windows/src/ext/jedi/jvcl/' content from commit bee19f3b4 git-subtree-dir: windows/src/ext/jedi/jvcl git-subtree-split: bee19f3b46909fde2fa92c06cd2706f41d99f6c3 * Add required .res files * Add required .res files * Add docbook files (forced) * Add required libxslt * Add required jedi files * Add installation files * Tweak .gitignore for open * CI * Remove KMW from Developer source (#122) * Remove KMW from Developer source (copies during build) * Remove KMW from Developer source (copies during build) * Remove KMW from Developer source (copies during build) * Fixup release build and copy license, readme from kmw during build * Remove obsolete build help documentation * Keyman Engine 10 on Windows regression for shift states (#129) * Improve #128 -- cleaner debug messages * Fixes #127, shift state now resets correctly; and more work for #128 * Fixes #130 (#131)
80 lines
2.2 KiB
C++
80 lines
2.2 KiB
C++
//////////////////////////////////////////////////////////////////////
|
|
//
|
|
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
|
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
// TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
|
// PARTICULAR PURPOSE.
|
|
//
|
|
// Copyright (C) 2003 Microsoft Corporation. All rights reserved.
|
|
//
|
|
// EndComposition.cpp
|
|
//
|
|
// terminate the compositon object
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#include "Globals.h"
|
|
#include "EditSession.h"
|
|
#include "TextService.h"
|
|
|
|
//+---------------------------------------------------------------------------
|
|
//
|
|
// CEndCompositionEditSession
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
class CEndCompositionEditSession : public CEditSessionBase
|
|
{
|
|
public:
|
|
CEndCompositionEditSession(CTextService *pTextService, ITfContext *pContext) : CEditSessionBase(pTextService, pContext)
|
|
{
|
|
}
|
|
|
|
// ITfEditSession
|
|
STDMETHODIMP DoEditSession(TfEditCookie ec)
|
|
{
|
|
_pTextService->_TerminateComposition(ec, _pContext);
|
|
return S_OK;
|
|
}
|
|
|
|
};
|
|
|
|
//+---------------------------------------------------------------------------
|
|
//
|
|
// _TerminateComposition
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
void CTextService::_TerminateComposition(TfEditCookie ec, ITfContext *pContext)
|
|
{
|
|
if (_pComposition != NULL)
|
|
{
|
|
//
|
|
// remove the display attribute from the composition range.
|
|
//
|
|
_ClearCompositionDisplayAttributes(ec, pContext);
|
|
|
|
_pComposition->EndComposition(ec);
|
|
_pComposition->Release();
|
|
_pComposition = NULL;
|
|
}
|
|
}
|
|
|
|
//+---------------------------------------------------------------------------
|
|
//
|
|
// _EndComposition
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
void CTextService::_EndComposition(ITfContext *pContext)
|
|
{
|
|
CEndCompositionEditSession *pEditSession;
|
|
HRESULT hr;
|
|
|
|
if (pEditSession = new CEndCompositionEditSession(this, pContext))
|
|
{
|
|
pContext->RequestEditSession(_tfClientId, pEditSession, TF_ES_ASYNCDONTCARE | TF_ES_READWRITE, &hr);
|
|
pEditSession->Release();
|
|
}
|
|
}
|
|
|