https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7d0b5482f6ae2997d85f9…
commit 7d0b5482f6ae2997d85f9bba819333de2077f184
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Feb 22 17:28:40 2024 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Feb 22 17:28:40 2024 +0900
[MSCTFIME] Implement CicBridge::OnSetOpenStatus (#6514)
Supporting TIPs...
JIRA issue: CORE-19360
- Add CicInputContext::EscbCompComplete
method (stub).
- Implement CicBridge::OnSetOpenStatus
method.
---
dll/ime/msctfime/bridge.cpp | 13 +++++++++++--
dll/ime/msctfime/functions.cpp | 2 +-
dll/ime/msctfime/functions.h | 2 +-
dll/ime/msctfime/inputcontext.cpp | 6 ++++++
dll/ime/msctfime/inputcontext.h | 1 +
dll/ime/msctfime/tls.h | 2 +-
dll/ime/msctfime/ui.cpp | 13 ++++++-------
7 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/dll/ime/msctfime/bridge.cpp b/dll/ime/msctfime/bridge.cpp
index e7801024cf9..ed74a566328 100644
--- a/dll/ime/msctfime/bridge.cpp
+++ b/dll/ime/msctfime/bridge.cpp
@@ -178,6 +178,7 @@ HRESULT CicBridge::DestroyInputContext(TLS *pTLS, HIMC hIMC)
return hr;
}
+/// @implemented
ITfContext *
CicBridge::GetInputContext(CicIMCCLock<CTFIMECONTEXT>& imeContext)
{
@@ -187,14 +188,22 @@ CicBridge::GetInputContext(CicIMCCLock<CTFIMECONTEXT>&
imeContext)
return pCicIC->m_pContext;
}
-/// @unimplemented
+/// @implemented
HRESULT CicBridge::OnSetOpenStatus(
TLS *pTLS,
ITfThreadMgr_P *pThreadMgr,
CicIMCLock& imcLock,
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.
diff --git a/dll/ime/msctfime/functions.cpp b/dll/ime/msctfime/functions.cpp
index 2852aece1cd..e3133022023 100644
--- a/dll/ime/msctfime/functions.cpp
+++ b/dll/ime/msctfime/functions.cpp
@@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS msctfime.ime
* 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(a)gmail.com>
*/
diff --git a/dll/ime/msctfime/functions.h b/dll/ime/msctfime/functions.h
index 6938162a6e5..d0b7d8c2ebe 100644
--- a/dll/ime/msctfime/functions.h
+++ b/dll/ime/msctfime/functions.h
@@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS msctfime.ime
* 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(a)gmail.com>
*/
diff --git a/dll/ime/msctfime/inputcontext.cpp b/dll/ime/msctfime/inputcontext.cpp
index 81344d26545..7362040c8fb 100644
--- a/dll/ime/msctfime/inputcontext.cpp
+++ b/dll/ime/msctfime/inputcontext.cpp
@@ -260,6 +260,12 @@ HRESULT CicInputContext::EscbClearDocFeedBuffer(CicIMCLock&
imcLock, BOOL bFlag)
return E_NOTIMPL;
}
+/// @unimplemented
+HRESULT CicInputContext::EscbCompComplete(CicIMCLock& imcLock)
+{
+ return E_NOTIMPL;
+}
+
/// @unimplemented
HRESULT
CicInputContext::SetupReconvertString(
diff --git a/dll/ime/msctfime/inputcontext.h b/dll/ime/msctfime/inputcontext.h
index b567304b779..185d9b8161b 100644
--- a/dll/ime/msctfime/inputcontext.h
+++ b/dll/ime/msctfime/inputcontext.h
@@ -91,6 +91,7 @@ public:
HRESULT SetupDocFeedString(CicIMCLock& imcLock, UINT uCodePage);
HRESULT EscbClearDocFeedBuffer(CicIMCLock& imcLock, BOOL bFlag);
+ HRESULT EscbCompComplete(CicIMCLock& imcLock);
HRESULT SetupReconvertString(
CicIMCLock& imcLock,
ITfThreadMgr_P *pThreadMgr,
diff --git a/dll/ime/msctfime/tls.h b/dll/ime/msctfime/tls.h
index 28f6d427177..ae1a6000e9c 100644
--- a/dll/ime/msctfime/tls.h
+++ b/dll/ime/msctfime/tls.h
@@ -25,7 +25,7 @@ public:
DWORD m_dwFlags2;
DWORD m_dwUnknown2;
BOOL m_bDestroyed;
- DWORD m_dwNowOpening;
+ BOOL m_bNowOpening;
DWORD m_NonEAComposition;
DWORD m_cWnds;
diff --git a/dll/ime/msctfime/ui.cpp b/dll/ime/msctfime/ui.cpp
index 2fec663f97f..fb8ae4105a9 100644
--- a/dll/ime/msctfime/ui.cpp
+++ b/dll/ime/msctfime/ui.cpp
@@ -444,15 +444,14 @@ UI::~UI()
delete m_pComp;
}
-/// @unimplemented
+/// @implemented
HRESULT UI::_Create()
{
m_pComp = new(cicNoThrow) UIComposition();
if (!m_pComp)
return E_OUTOFMEMORY;
- SetWindowLongPtrW(m_hWnd, UIGWLP_UI, (LONG_PTR)this);
- //FIXME
+ ::SetWindowLongPtrW(m_hWnd, UIGWLP_UI, (LONG_PTR)this);
return S_OK;
}
@@ -460,13 +459,13 @@ HRESULT UI::_Create()
void UI::_Destroy()
{
m_pComp->OnDestroy();
- SetWindowLongPtrW(m_hWnd, UIGWLP_UI, 0);
+ ::SetWindowLongPtrW(m_hWnd, UIGWLP_UI, 0);
}
/// @implemented
void UI::OnCreate(HWND hWnd)
{
- UI *pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI);
+ UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UIGWLP_UI);
if (pUI)
return;
pUI = new(cicNoThrow) UI(hWnd);
@@ -477,7 +476,7 @@ void UI::OnCreate(HWND hWnd)
/// @implemented
void UI::OnDestroy(HWND hWnd)
{
- UI *pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI);
+ UI *pUI = (UI*)::GetWindowLongPtrW(hWnd, UIGWLP_UI);
if (!pUI)
return;
@@ -656,7 +655,7 @@ UIWndProc(
/***********************************************************************/
-/// @unimplemented
+/// @implemented
BOOL RegisterImeClass(VOID)
{
WNDCLASSEXW wcx;