[MSCTFIME] Implement CicBridge::OnSetOpenStatus (#6514)

Supporting TIPs...
JIRA issue: CORE-19360
- Add CicInputContext::EscbCompComplete
  method (stub).
- Implement CicBridge::OnSetOpenStatus
  method.
This commit is contained in:
Katayama Hirofumi MZ 2024-02-22 17:28:40 +09:00 committed by GitHub
parent f53f1334ed
commit 7d0b5482f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 12 deletions

View file

@ -178,6 +178,7 @@ HRESULT CicBridge::DestroyInputContext(TLS *pTLS, HIMC hIMC)
return hr; return hr;
} }
/// @implemented
ITfContext * ITfContext *
CicBridge::GetInputContext(CicIMCCLock<CTFIMECONTEXT>& imeContext) CicBridge::GetInputContext(CicIMCCLock<CTFIMECONTEXT>& imeContext)
{ {
@ -187,14 +188,22 @@ CicBridge::GetInputContext(CicIMCCLock<CTFIMECONTEXT>& imeContext)
return pCicIC->m_pContext; return pCicIC->m_pContext;
} }
/// @unimplemented /// @implemented
HRESULT CicBridge::OnSetOpenStatus( HRESULT CicBridge::OnSetOpenStatus(
TLS *pTLS, TLS *pTLS,
ITfThreadMgr_P *pThreadMgr, ITfThreadMgr_P *pThreadMgr,
CicIMCLock& imcLock, CicIMCLock& imcLock,
CicInputContext *pCicIC) CicInputContext *pCicIC)
{ {
return E_NOTIMPL; if (!imcLock.get().fOpen && imcLock.ValidCompositionString())
pCicIC->EscbCompComplete(imcLock);
pTLS->m_bNowOpening = TRUE;
HRESULT hr = SetCompartmentDWORD(m_cliendId, pThreadMgr,
GUID_COMPARTMENT_KEYBOARD_OPENCLOSE,
imcLock.get().fOpen, FALSE);
pTLS->m_bNowOpening = FALSE;
return hr;
} }
/// Selects the IME context. /// Selects the IME context.

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: ReactOS msctfime.ime * PROJECT: ReactOS msctfime.ime
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later) * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
* PURPOSE: The functions of msctfime.ime * PURPOSE: The functionalities of msctfime.ime
* COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: ReactOS msctfime.ime * PROJECT: ReactOS msctfime.ime
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later) * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
* PURPOSE: The functions of msctfime.ime * PURPOSE: The functionalities of msctfime.ime
* COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/ */

View file

@ -260,6 +260,12 @@ HRESULT CicInputContext::EscbClearDocFeedBuffer(CicIMCLock& imcLock, BOOL bFlag)
return E_NOTIMPL; return E_NOTIMPL;
} }
/// @unimplemented
HRESULT CicInputContext::EscbCompComplete(CicIMCLock& imcLock)
{
return E_NOTIMPL;
}
/// @unimplemented /// @unimplemented
HRESULT HRESULT
CicInputContext::SetupReconvertString( CicInputContext::SetupReconvertString(

View file

@ -91,6 +91,7 @@ public:
HRESULT SetupDocFeedString(CicIMCLock& imcLock, UINT uCodePage); HRESULT SetupDocFeedString(CicIMCLock& imcLock, UINT uCodePage);
HRESULT EscbClearDocFeedBuffer(CicIMCLock& imcLock, BOOL bFlag); HRESULT EscbClearDocFeedBuffer(CicIMCLock& imcLock, BOOL bFlag);
HRESULT EscbCompComplete(CicIMCLock& imcLock);
HRESULT SetupReconvertString( HRESULT SetupReconvertString(
CicIMCLock& imcLock, CicIMCLock& imcLock,
ITfThreadMgr_P *pThreadMgr, ITfThreadMgr_P *pThreadMgr,

View file

@ -25,7 +25,7 @@ public:
DWORD m_dwFlags2; DWORD m_dwFlags2;
DWORD m_dwUnknown2; DWORD m_dwUnknown2;
BOOL m_bDestroyed; BOOL m_bDestroyed;
DWORD m_dwNowOpening; BOOL m_bNowOpening;
DWORD m_NonEAComposition; DWORD m_NonEAComposition;
DWORD m_cWnds; DWORD m_cWnds;

View file

@ -444,15 +444,14 @@ UI::~UI()
delete m_pComp; delete m_pComp;
} }
/// @unimplemented /// @implemented
HRESULT UI::_Create() HRESULT UI::_Create()
{ {
m_pComp = new(cicNoThrow) UIComposition(); m_pComp = new(cicNoThrow) UIComposition();
if (!m_pComp) if (!m_pComp)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
SetWindowLongPtrW(m_hWnd, UIGWLP_UI, (LONG_PTR)this); ::SetWindowLongPtrW(m_hWnd, UIGWLP_UI, (LONG_PTR)this);
//FIXME
return S_OK; return S_OK;
} }
@ -460,13 +459,13 @@ HRESULT UI::_Create()
void UI::_Destroy() void UI::_Destroy()
{ {
m_pComp->OnDestroy(); m_pComp->OnDestroy();
SetWindowLongPtrW(m_hWnd, UIGWLP_UI, 0); ::SetWindowLongPtrW(m_hWnd, UIGWLP_UI, 0);
} }
/// @implemented /// @implemented
void UI::OnCreate(HWND hWnd) void UI::OnCreate(HWND hWnd)
{ {
UI *pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI); UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UIGWLP_UI);
if (pUI) if (pUI)
return; return;
pUI = new(cicNoThrow) UI(hWnd); pUI = new(cicNoThrow) UI(hWnd);
@ -477,7 +476,7 @@ void UI::OnCreate(HWND hWnd)
/// @implemented /// @implemented
void UI::OnDestroy(HWND hWnd) void UI::OnDestroy(HWND hWnd)
{ {
UI *pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI); UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UIGWLP_UI);
if (!pUI) if (!pUI)
return; return;
@ -656,7 +655,7 @@ UIWndProc(
/***********************************************************************/ /***********************************************************************/
/// @unimplemented /// @implemented
BOOL RegisterImeClass(VOID) BOOL RegisterImeClass(VOID)
{ {
WNDCLASSEXW wcx; WNDCLASSEXW wcx;