ReactOS 0.4.15-dev-7961-gdcf9eb0
bridge.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS msctfime.ime
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: The bridge of msctfime.ime
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "msctfime.h"
9
11
14{
22 m_cliendId = 0;
23 m_cRefs = 1;
24}
25
28{
29 static const QITAB c_tab[] =
30 {
32 { NULL }
33 };
34 return ::QISearch(this, c_tab, riid, ppvObj);
35}
36
39{
40 return ::InterlockedIncrement(&m_cRefs);
41}
42
45{
47 {
48 delete this;
49 return 0;
50 }
51 return m_cRefs;
52}
53
56{
57 TLS *pTLS = TLS::PeekTLS();
58 if (!pTLS || !pTLS->m_pThreadMgr)
59 return;
60
61 if (SUCCEEDED(DeactivateIMMX(pTLS, pTLS->m_pThreadMgr)))
62 UnInitIMMX(pTLS);
63}
64
68{
69 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
70 if (!pCicIC)
71 return NULL;
72
73 pCicIC->m_pDocumentMgr->AddRef();
74 return pCicIC->m_pDocumentMgr;
75}
76
80 _Inout_ TLS *pTLS,
81 _In_ HIMC hIMC)
82{
83 CicIMCLock imcLock(hIMC);
84 if (FAILED(imcLock.m_hr))
85 return imcLock.m_hr;
86
87 if (!imcLock.get().hCtfImeContext)
88 {
89 HIMCC hCtfImeContext = ImmCreateIMCC(sizeof(CTFIMECONTEXT));
90 if (!hCtfImeContext)
91 return E_OUTOFMEMORY;
92 imcLock.get().hCtfImeContext = hCtfImeContext;
93 }
94
95 CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext);
96 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
97 if (pCicIC)
98 return S_OK;
99
100 pCicIC = new(cicNoThrow) CicInputContext(m_cliendId, &m_LibThread, hIMC);
101 if (!pCicIC)
102 {
103 imeContext.unlock();
104 imcLock.unlock();
105 DestroyInputContext(pTLS, hIMC);
106 return E_OUTOFMEMORY;
107 }
108
109 if (!pTLS->m_pThreadMgr)
110 {
111 pCicIC->Release();
112 imeContext.unlock();
113 imcLock.unlock();
114 DestroyInputContext(pTLS, hIMC);
115 return E_NOINTERFACE;
116 }
117
118 imeContext.get().m_pCicIC = pCicIC;
119
120 HRESULT hr = pCicIC->CreateInputContext(pTLS->m_pThreadMgr, imcLock);
121 if (FAILED(hr))
122 {
123 pCicIC->Release();
124 imeContext.get().m_pCicIC = NULL;
125 return hr;
126 }
127
128 HWND hWnd = imcLock.get().hWnd;
129 if (hWnd && hWnd == ::GetFocus())
130 {
131 ITfDocumentMgr *pDocMgr = GetDocumentManager(imeContext);
132 if (pDocMgr)
133 {
134 SetAssociate(pTLS, hWnd, hIMC, pTLS->m_pThreadMgr, pDocMgr);
135 pDocMgr->Release();
136 }
137 }
138
139 return hr;
140}
141
144{
145 CicIMCLock imcLock(hIMC);
146 HRESULT hr = imcLock.m_hr;
147 if (FAILED(hr))
148 return hr;
149
150 hr = E_FAIL;
151 CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext);
152 if (imeContext)
153 hr = imeContext.m_hr;
154
155 if (SUCCEEDED(hr) && !(imeContext.get().m_dwCicFlags & 1))
156 {
157 imeContext.get().m_dwCicFlags |= 1;
158
159 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
160 if (pCicIC)
161 {
162 imeContext.get().m_pCicIC = NULL;
163 hr = pCicIC->DestroyInputContext();
164 pCicIC->Release();
165 imeContext.get().m_pCicIC = NULL;
166 }
167 }
168
169 if (imcLock.get().hCtfImeContext)
170 {
172 imcLock.get().hCtfImeContext = NULL;
173 hr = S_OK;
174 }
175
176 return hr;
177}
178
182{
183 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
184 if (!pCicIC)
185 return NULL;
186 return pCicIC->m_pContext;
187}
188
191 TLS *pTLS,
192 ITfThreadMgr_P *pThreadMgr,
193 CicIMCLock& imcLock,
194 CicInputContext *pCicIC)
195{
196 if (!imcLock.get().fOpen && imcLock.ValidCompositionString())
197 pCicIC->EscbCompComplete(imcLock);
198
199 pTLS->m_bNowOpening = TRUE;
202 imcLock.get().fOpen, FALSE);
203 pTLS->m_bNowOpening = FALSE;
204 return hr;
205}
206
211 _Inout_ TLS *pTLS,
212 _Inout_ ITfThreadMgr_P *pThreadMgr,
213 _In_ HIMC hIMC,
214 _In_ BOOL fSelect,
215 _In_ HKL hKL)
216{
217 CicIMCLock imcLock(hIMC);
218 if (FAILED(imcLock.m_hr))
219 return imcLock.m_hr;
220
221 CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext);
222 if (FAILED(imeContext.m_hr))
223 return imeContext.m_hr;
224
225 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
226 if (pCicIC)
227 pCicIC->m_bSelecting = TRUE;
228
229 if (fSelect)
230 {
231 if (pCicIC)
232 pCicIC->m_bCandidateOpen = FALSE;
233 if (imcLock.get().fOpen)
234 OnSetOpenStatus(pTLS, pThreadMgr, imcLock, pCicIC);
235 }
236 else
237 {
238 ITfContext *pContext = GetInputContext(imeContext);
239 pThreadMgr->RequestPostponedLock(pContext);
240 if (pCicIC)
241 pCicIC->m_bSelecting = FALSE;
242 if (pContext)
243 pContext->Release();
244 }
245
246 return imeContext.m_hr;
247}
248
252{
256
260{
262 pData->m_pBridge->CreateInputContext(pData->m_pTLS, hIMC);
263 return TRUE;
264}
265
269{
271 pData->m_pBridge->DestroyInputContext(pData->m_pTLS, hIMC);
272 return TRUE;
273}
274
278 _Inout_ TLS *pTLS,
279 _Inout_ ITfThreadMgr_P *pThreadMgr)
280{
281 HRESULT hr = pThreadMgr->ActivateEx(&m_cliendId, 1);
282 if (hr != S_OK)
283 {
284 m_cliendId = 0;
285 return E_FAIL;
286 }
287
288 if (m_cActivateLocks++ != 0)
289 return S_OK;
290
291 ITfSourceSingle *pSource = NULL;
292 hr = pThreadMgr->QueryInterface(IID_ITfSourceSingle, (void**)&pSource);
293 if (FAILED(hr))
294 {
295 DeactivateIMMX(pTLS, pThreadMgr);
296 return hr;
297 }
298
300 if (!pProvider)
301 {
302 hr = E_FAIL;
303 goto Finish;
304 }
305
306 pSource->AdviseSingleSink(m_cliendId, IID_ITfFunctionProvider, pProvider);
308
309 if (!m_pDocMgr)
310 {
311 hr = pThreadMgr->CreateDocumentMgr(&m_pDocMgr);
312 if (FAILED(hr))
313 {
314 hr = E_FAIL;
315 goto Finish;
316 }
317
318 SetCompartmentDWORD(m_cliendId, m_pDocMgr, GUID_COMPARTMENT_CTFIME_DIMFLAGS, TRUE, FALSE);
319 }
320
321 pThreadMgr->SetSysHookSink(this);
322
323 hr = S_OK;
324 if (pTLS->m_bDestroyed)
325 {
326 ENUM_CREATE_DESTROY_IC Data = { pTLS, this };
328 }
329
330Finish:
331 if (FAILED(hr))
332 DeactivateIMMX(pTLS, pThreadMgr);
333 if (pSource)
334 pSource->Release();
335 return hr;
336}
337
341 _Inout_ TLS *pTLS,
342 _Inout_ ITfThreadMgr_P *pThreadMgr)
343{
344 if (m_bDeactivating)
345 return TRUE;
346
348
349 if (m_cliendId)
350 {
351 ENUM_CREATE_DESTROY_IC Data = { pTLS, this };
353 pTLS->m_bDestroyed = TRUE;
354
355 ITfSourceSingle *pSource = NULL;
356 if (pThreadMgr->QueryInterface(IID_ITfSourceSingle, (void **)&pSource) == S_OK)
357 pSource->UnadviseSingleSink(m_cliendId, IID_ITfFunctionProvider);
358
359 m_cliendId = 0;
360
361 while (m_cActivateLocks > 0)
362 {
364 pThreadMgr->Deactivate();
365 }
366
367 if (pSource)
368 pSource->Release();
369 }
370
371 if (m_pDocMgr)
372 {
374 m_pDocMgr = NULL;
375 }
376
377 pThreadMgr->SetSysHookSink(NULL);
378
380
381 return S_OK;
382}
383
387{
388 if (m_bImmxInited)
389 return S_OK;
390
391 HRESULT hr = S_OK;
392 if (!pTLS->m_pThreadMgr)
393 {
394 ITfThreadMgr *pThreadMgr = NULL;
395 hr = TF_CreateThreadMgr(&pThreadMgr);
396 if (FAILED(hr))
397 return E_FAIL;
398
399 hr = pThreadMgr->QueryInterface(IID_ITfThreadMgr_P, (void **)&pTLS->m_pThreadMgr);
400 if (pThreadMgr)
401 pThreadMgr->Release();
402 if (FAILED(hr))
403 return E_FAIL;
404 }
405
407 {
411 {
412 UnInitIMMX(pTLS);
413 return E_FAIL;
414 }
415 }
416
418 m_pThreadMgrEventSink->_Advise(pTLS->m_pThreadMgr);
419
420 if (!pTLS->m_pProfile)
421 {
422 pTLS->m_pProfile = new(cicNoThrow) CicProfile();
423 if (!pTLS->m_pProfile)
424 return E_OUTOFMEMORY;
425
426 hr = pTLS->m_pProfile->InitProfileInstance(pTLS);
427 if (FAILED(hr))
428 {
429 UnInitIMMX(pTLS);
430 return E_FAIL;
431 }
432 }
433
434 hr = pTLS->m_pThreadMgr->QueryInterface(IID_ITfKeystrokeMgr_P, (void **)&m_pKeystrokeMgr);
435 if (FAILED(hr))
436 {
437 UnInitIMMX(pTLS);
438 return E_FAIL;
439 }
440
442 if (FAILED(hr))
443 {
444 UnInitIMMX(pTLS);
445 return E_FAIL;
446 }
447
449 return S_OK;
450}
451
454{
457
458 if (m_pKeystrokeMgr)
459 {
462 }
463
464 if (pTLS->m_pProfile)
465 {
466 pTLS->m_pProfile->Release();
467 pTLS->m_pProfile = NULL;
468 }
469
471 {
475 }
476
477 if (pTLS->m_pThreadMgr)
478 {
479 pTLS->m_pThreadMgr->Release();
480 pTLS->m_pThreadMgr = NULL;
481 }
482
484 return TRUE;
485}
486
489{
490 return S_OK;
491}
492
495{
496 return E_NOTIMPL;
497}
498
501{
502 return S_OK;
503}
504
506void
508 _In_ HWND hWnd,
509 _In_ INT cTransMsgs,
510 _In_ const TRANSMSG *pTransMsgs)
511{
512 for (INT i = 0; i < cTransMsgs; ++i, ++pTransMsgs)
513 {
514 ::PostMessageW(hWnd, pTransMsgs->message, pTransMsgs->wParam, pTransMsgs->lParam);
515 }
516}
517
521 _Inout_ TLS* pTLS,
522 _In_ ITfThreadMgr *pThreadMgr,
523 _In_ HKL hKL,
524 _In_ HWND hWnd)
525{
526 CicProfile *pProfile = pTLS->m_pProfile;
527 if (!pProfile)
528 return E_OUTOFMEMORY;
529
532 if (FAILED(hr))
533 return hr;
534
536 hr = pThreadMgr->GetFunctionProvider(profile.clsid, &pProvider);
537 if (FAILED(hr))
538 return hr;
539
540 ITfFnConfigure *pFnConfigure = NULL;
541 hr = pProvider->GetFunction(GUID_NULL, IID_ITfFnConfigure, (IUnknown**)&pFnConfigure);
542 if (FAILED(hr))
543 {
545 return hr;
546 }
547
548 hr = pFnConfigure->Show(hWnd, profile.langid, profile.guidProfile);
549
550 pFnConfigure->Release();
552 return hr;
553}
554
558 _Inout_ TLS* pTLS,
559 _In_ ITfThreadMgr *pThreadMgr,
560 _In_ HKL hKL,
561 _In_ HWND hWnd,
562 _Inout_opt_ LPVOID lpData)
563{
564 CicProfile *pProfile = pTLS->m_pProfile;
565 if (!pProfile)
566 return E_OUTOFMEMORY;
567
570 if (FAILED(hr))
571 return hr;
572
574 hr = pThreadMgr->GetFunctionProvider(profile.clsid, &pProvider);
575 if (FAILED(hr))
576 return hr;
577
578 ITfFnConfigureRegisterWord *pFunction = NULL;
579 hr = pProvider->GetFunction(GUID_NULL, IID_ITfFnConfigureRegisterWord, (IUnknown**)&pFunction);
580 if (FAILED(hr))
581 {
583 return hr;
584 }
585
586 REGISTERWORDW* pRegWord = (REGISTERWORDW*)lpData;
587 if (pRegWord)
588 {
589 if (pRegWord->lpWord)
590 {
592 BSTR bstrWord = SysAllocString(pRegWord->lpWord);
593 if (bstrWord)
594 {
595 hr = pFunction->Show(hWnd, profile.langid, profile.guidProfile, bstrWord);
596 SysFreeString(bstrWord);
597 }
598 }
599 else
600 {
601 hr = pFunction->Show(hWnd, profile.langid, profile.guidProfile, NULL);
602 }
603 }
604
606 pFunction->Release();
607 return hr;
608}
609
612 TLS *pTLS,
613 HWND hWnd,
614 HIMC hIMC,
615 ITfThreadMgr_P *pThreadMgr,
616 ITfDocumentMgr *pDocMgr)
617{
618 //FIXME
619}
620
623{
624 auto pThreadMgr = pTLS->m_pThreadMgr;
625 if (!pThreadMgr)
626 return E_OUTOFMEMORY;
627
628 if (fActive)
629 {
630 if (!hIMC)
631 {
632 SetAssociate(pTLS, hWnd, hIMC, pThreadMgr, m_pDocMgr);
633 return S_OK;
634 }
635
636 CicIMCLock imcLock(hIMC);
637 if (FAILED(imcLock.m_hr))
638 return imcLock.m_hr;
639
640 CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext);
641 if (FAILED(imeContext.m_hr))
642 return imeContext.m_hr;
643
644 if (hIMC == ::ImmGetContext(hWnd))
645 {
646 ITfDocumentMgr *pDocMgr = GetDocumentManager(imeContext);
647 if (pDocMgr)
648 {
649 SetAssociate(pTLS, imcLock.get().hWnd, hIMC, pThreadMgr, pDocMgr);
650 pDocMgr->Release();
651 }
652 }
653
654 return S_OK;
655 }
656
657 if (hIMC && !IsEALang(LOWORD(hKL)))
658 {
659 CicIMCLock imcLock(hIMC);
660 if (FAILED(imcLock.m_hr))
661 return imcLock.m_hr;
662
663 CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext);
664 if (FAILED(imeContext.m_hr))
665 return imeContext.m_hr;
666
667 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
668 if (!pCicIC->m_dwUnknown6_5[2] && !pCicIC->m_dwUnknown6_5[3])
670 }
671
672 if (!hIMC || (::GetFocus() != hWnd) || (hIMC != ::ImmGetContext(hWnd)))
673 SetAssociate(pTLS, hWnd, hIMC, pThreadMgr, m_pDocMgr);
674
675 return S_OK;
676}
677
679BOOL
681 ITfThreadMgr_P *pThreadMgr,
682 CicIMCLock& imcLock,
683 CicInputContext *pCicIC)
684{
685 return FALSE;
686}
687
691 ITfThreadMgr_P *pThreadMgr,
692 CicIMCLock& imcLock,
693 CicInputContext *pCicIC,
694 DWORD dwValue,
696{
697 return E_NOTIMPL;
698}
699
702 TLS *pTLS,
703 ITfThreadMgr_P *pThreadMgr,
704 HIMC hIMC,
705 DWORD dwAction,
706 DWORD dwIndex,
707 DWORD_PTR dwValue)
708{
709 CicIMCLock imcLock(hIMC);
710 if (FAILED(imcLock.m_hr))
711 return imcLock.m_hr;
712
713 CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext);
714 if (FAILED(imeContext.m_hr))
715 return imeContext.m_hr;
716
717 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
718 if (!pCicIC)
719 return E_OUTOFMEMORY;
720
721 CicProfile *pProfile = pTLS->m_pProfile;
722 if (!pProfile)
723 return E_OUTOFMEMORY;
724
726 pProfile->GetLangId(&LangID);
727
728 switch (dwAction)
729 {
730 case NI_OPENCANDIDATE:
732 {
733 if (DoOpenCandidateHanja(pThreadMgr, imcLock, pCicIC))
734 return S_OK;
735 return E_FAIL;
736 }
737 return E_NOTIMPL;
738
740 switch (dwIndex)
741 {
742 case CPS_COMPLETE:
743 pCicIC->EscbCompComplete(imcLock);
744 break;
745
746 case CPS_CONVERT:
747 case CPS_REVERT:
748 return E_NOTIMPL;
749
750 case CPS_CANCEL:
751 pCicIC->EscbCompCancel(imcLock);
752 break;
753
754 default:
755 return E_FAIL;
756 }
757 return S_OK;
758
760 switch (dwValue)
761 {
764 return OnSetConversionSentenceMode(pThreadMgr, imcLock, pCicIC, dwValue, LangID);
765
767 return OnSetOpenStatus(pTLS, pThreadMgr, imcLock, pCicIC);
768
770 return pCicIC->OnSetCandidatePos(pTLS, imcLock);
771
774 return E_NOTIMPL;
775
776 default:
777 return E_FAIL;
778 }
779 break;
780
781 default:
782 return E_NOTIMPL;
783 }
784}
785
788 TLS *pTLS,
789 ITfThreadMgr_P *pThreadMgr,
790 HIMC hIMC,
793 CONST LPBYTE lpbKeyState,
794 INT *pnUnknown60)
795{
796 return FALSE; // FIXME
797}
798
802 TLS *pTLS,
803 ITfThreadMgr_P *pThreadMgr,
804 UINT uVirtKey,
805 UINT uScanCode,
806 CONST LPBYTE lpbKeyState,
807 LPTRANSMSGLIST lpTransBuf,
808 UINT fuState,
809 HIMC hIMC,
810 UINT *pResult)
811{
812 return E_NOTIMPL; // FIXME
813}
814
816BOOL
818 TLS *pTLS,
819 ITfThreadMgr_P *pThreadMgr,
820 HIMC hIMC,
821 DWORD dwIndex,
822 LPCVOID lpComp,
823 DWORD dwCompLen,
824 LPCVOID lpRead,
825 DWORD dwReadLen)
826{
827 CicIMCLock imcLock(hIMC);
828 if (FAILED(imcLock.m_hr))
829 return FALSE;
830
831 CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext);
832 if (FAILED(imeContext.m_hr))
833 return FALSE;
834
835 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
836 auto pProfile = pTLS->m_pProfile;
837 if (!pCicIC || !pProfile)
838 return FALSE;
839
840 UINT uCodePage;
841 pProfile->GetCodePageA(&uCodePage);
842
844 if (dwIndex != SCS_SETSTR ||
845 !lpComp || *(WORD*)lpComp ||
846 !dwCompLen ||
847 FAILED(pProfile->GetLangId(&LangID)) ||
849 {
850 return pCicIC->SetCompositionString(imcLock, pThreadMgr, dwIndex,
851 lpComp, dwCompLen, lpRead, dwReadLen,
852 uCodePage);
853 }
854
855 if (imcLock.get().fdwConversion & IME_CMODE_NATIVE)
856 {
858 return TRUE;
859 }
860
861 return FALSE;
862}
863
867{
868 CicIMCLock imcLock(hIMC);
869 if (FAILED(imcLock.m_hr))
870 return imcLock.m_hr;
871
872 CicIMCCLock<CTFIMECONTEXT> imeContext(imcLock.get().hCtfImeContext);
873 if (FAILED(imeContext.m_hr))
874 return imeContext.m_hr;
875
876 CicInputContext *pCicIC = imeContext.get().m_pCicIC;
877 if (!pCicIC)
878 return TRUE;
879
880 if (pCicIC->m_bCandidateOpen)
881 return TRUE;
882
883 pCicIC->m_dwUnknown6_5[4] |= 0x1;
884
885 //FIXME
886
887 pCicIC->m_dwUnknown6_5[4] &= ~0x1;
888
889 return TRUE;
890}
891
894CicBridge::EscapeKorean(TLS *pTLS, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
895{
896 if (uSubFunc == IME_ESC_QUERY_SUPPORT)
897 return *(DWORD*)lpData == IME_ESC_HANJA_MODE;
898 if (uSubFunc == IME_ESC_HANJA_MODE)
899 return EscHanjaMode(pTLS, hIMC, lpData);
900 return 0;
901}
902
905{
906 DWORD dwDimFlags = 0;
907 HRESULT hr = ::GetCompartmentDWORD(pDocMgr, GUID_COMPARTMENT_CTFIME_DIMFLAGS,
908 &dwDimFlags, FALSE);
909 if (FAILED(hr))
910 return FALSE;
911 return !!(dwDimFlags & 0x1);
912}
#define InterlockedDecrement
Definition: armddk.h:52
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define STDMETHODIMP
Definition: basetyps.h:43
#define STDMETHODIMP_(t)
Definition: basetyps.h:44
struct ENUM_CREATE_DESTROY_IC * PENUM_CREATE_DESTROY_IC
#define cicNoThrow
Definition: cicbase.h:34
void TFUninitLib_Thread(PCIC_LIBTHREAD pLibThread)
Definition: cicutb.h:44
HRESULT m_hr
Definition: cicimc.h:32
HRESULT m_hr
Definition: cicimc.h:96
HRESULT _Unadvise()
Definition: sinks.cpp:385
static INT CALLBACK DIMCallback(UINT nCode, ITfDocumentMgr *pDocMgr1, ITfDocumentMgr *pDocMgr2, LPVOID pUserData)
Definition: sinks.cpp:314
void SetCallbackPV(_Inout_ LPVOID pv)
Definition: sinks.cpp:359
HRESULT _Advise(ITfThreadMgr *pThreadMgr)
Definition: sinks.cpp:365
STDMETHODIMP OnPreFocusDIM(HWND hwnd) override
@implemented
Definition: bridge.cpp:488
ITfContext * GetInputContext(CicIMCCLock< CTFIMECONTEXT > &imeContext)
@implemented
Definition: bridge.cpp:181
LRESULT EscapeKorean(TLS *pTLS, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
@implemented
Definition: bridge.cpp:894
static BOOL IsOwnDim(ITfDocumentMgr *pDocMgr)
@implemented
Definition: bridge.cpp:904
HRESULT DestroyInputContext(TLS *pTLS, HIMC hIMC)
@implemented
Definition: bridge.cpp:143
HRESULT CreateInputContext(TLS *pTLS, HIMC hIMC)
@implemented
Definition: bridge.cpp:79
BOOL ProcessKey(TLS *pTLS, ITfThreadMgr_P *pThreadMgr, HIMC hIMC, WPARAM wParam, LPARAM lParam, CONST LPBYTE lpbKeyState, INT *pnUnknown60)
@unimplemented
Definition: bridge.cpp:787
CicBridge()
@implemented
Definition: bridge.cpp:13
HRESULT SetActiveContextAlways(TLS *pTLS, HIMC hIMC, BOOL fActive, HWND hWnd, HKL hKL)
Definition: bridge.cpp:622
LRESULT EscHanjaMode(TLS *pTLS, HIMC hIMC, LPVOID lpData)
@unimplemented
Definition: bridge.cpp:866
virtual ~CicBridge()
@implemented
Definition: bridge.cpp:55
DWORD m_cActivateLocks
Definition: bridge.h:20
static BOOL CALLBACK EnumCreateInputContextCallback(HIMC hIMC, LPARAM lParam)
Definition: bridge.cpp:259
CThreadMgrEventSink * m_pThreadMgrEventSink
Definition: bridge.h:23
ITfDocumentMgr * m_pDocMgr
Definition: bridge.h:22
BOOL m_bImmxInited
Definition: bridge.h:17
void PostTransMsg(_In_ HWND hWnd, _In_ INT cTransMsgs, _In_ const TRANSMSG *pTransMsgs)
@implemented
Definition: bridge.cpp:507
BOOL SetCompositionString(TLS *pTLS, ITfThreadMgr_P *pThreadMgr, HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen)
@implemented
Definition: bridge.cpp:817
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj) override
@implemented
Definition: bridge.cpp:27
BOOL m_bUnknown2
Definition: bridge.h:26
HRESULT OnSetOpenStatus(TLS *pTLS, ITfThreadMgr_P *pThreadMgr, CicIMCLock &imcLock, CicInputContext *pCicIC)
@implemented
Definition: bridge.cpp:190
HRESULT ActivateIMMX(_Inout_ TLS *pTLS, _Inout_ ITfThreadMgr_P *pThreadMgr)
@implemented
Definition: bridge.cpp:277
static BOOL CALLBACK EnumDestroyInputContextCallback(HIMC hIMC, LPARAM lParam)
Definition: bridge.cpp:268
STDMETHODIMP OnSysKeyboardProc(UINT, LONG) override
@unimplemented
Definition: bridge.cpp:494
HRESULT SelectEx(_Inout_ TLS *pTLS, _Inout_ ITfThreadMgr_P *pThreadMgr, _In_ HIMC hIMC, _In_ BOOL fSelect, _In_ HKL hKL)
Definition: bridge.cpp:210
BOOL m_bDeactivating
Definition: bridge.h:19
HRESULT ToAsciiEx(TLS *pTLS, ITfThreadMgr_P *pThreadMgr, UINT uVirtKey, UINT uScanCode, CONST LPBYTE lpbKeyState, LPTRANSMSGLIST lpTransBuf, UINT fuState, HIMC hIMC, UINT *pResult)
@unimplemented
Definition: bridge.cpp:801
HRESULT ConfigureRegisterWord(_Inout_ TLS *pTLS, _In_ ITfThreadMgr *pThreadMgr, _In_ HKL hKL, _In_ HWND hWnd, _Inout_opt_ LPVOID lpData)
@implemented
Definition: bridge.cpp:557
HRESULT Notify(TLS *pTLS, ITfThreadMgr_P *pThreadMgr, HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD_PTR dwValue)
@implemented
Definition: bridge.cpp:701
LONG m_cRefs
Definition: bridge.h:16
BOOL UnInitIMMX(_Inout_ TLS *pTLS)
@implemented
Definition: bridge.cpp:453
HRESULT DeactivateIMMX(_Inout_ TLS *pTLS, _Inout_ ITfThreadMgr_P *pThreadMgr)
@implemented
Definition: bridge.cpp:340
CIC_LIBTHREAD m_LibThread
Definition: bridge.h:25
BOOL DoOpenCandidateHanja(ITfThreadMgr_P *pThreadMgr, CicIMCLock &imcLock, CicInputContext *pCicIC)
@unimplemented
Definition: bridge.cpp:680
ITfDocumentMgr * GetDocumentManager(_Inout_ CicIMCCLock< CTFIMECONTEXT > &imeContext)
@implemented
Definition: bridge.cpp:67
BOOL m_bUnknown1
Definition: bridge.h:18
HRESULT OnSetConversionSentenceMode(ITfThreadMgr_P *pThreadMgr, CicIMCLock &imcLock, CicInputContext *pCicIC, DWORD dwValue, LANGID LangID)
@unimplemented
Definition: bridge.cpp:690
void SetAssociate(TLS *pTLS, HWND hWnd, HIMC hIMC, ITfThreadMgr_P *pThreadMgr, ITfDocumentMgr *pDocMgr)
@unimplemented
Definition: bridge.cpp:611
HRESULT InitIMMX(_Inout_ TLS *pTLS)
@implemented
Definition: bridge.cpp:386
STDMETHODIMP OnSysShellProc(INT, UINT, LONG) override
@implemented
Definition: bridge.cpp:500
TfClientId m_cliendId
Definition: bridge.h:24
ITfKeystrokeMgr * m_pKeystrokeMgr
Definition: bridge.h:21
HRESULT ConfigureGeneral(_Inout_ TLS *pTLS, _In_ ITfThreadMgr *pThreadMgr, _In_ HKL hKL, _In_ HWND hWnd)
@implemented
Definition: bridge.cpp:520
void unlock()
Definition: cicimc.h:55
T_DATA & get() const
Definition: cicimc.h:68
void unlock()
Definition: cicimc.h:125
INPUTCONTEXTDX & get() const
Definition: cicimc.h:165
BOOL ValidCompositionString()
Definition: cicimc.h:142
ITfContext * m_pContext
Definition: inputcontext.h:83
BOOL SetCompositionString(CicIMCLock &imcLock, ITfThreadMgr_P *pThreadMgr, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen, UINT uCodePage)
@unimplemented
HRESULT EscbCompComplete(CicIMCLock &imcLock)
@unimplemented
DWORD m_dwUnknown6_5[9]
Definition: inputcontext.h:97
ITfDocumentMgr * m_pDocumentMgr
Definition: inputcontext.h:82
HRESULT OnSetCandidatePos(TLS *pTLS, CicIMCLock &imcLock)
@unimplemented
HRESULT DestroyInputContext()
@unimplemented
HRESULT EscbCompCancel(CicIMCLock &imcLock)
@unimplemented
HRESULT CreateInputContext(_Inout_ ITfThreadMgr *pThreadMgr, _Inout_ CicIMCLock &imcLock)
@unimplemented
HRESULT GetLangId(_Out_ LANGID *pLangID)
@implemented
Definition: profile.cpp:114
HRESULT GetActiveLanguageProfile(_In_ HKL hKL, _In_ REFGUID rguid, _Out_ TF_LANGUAGEPROFILE *pProfile)
@unimplemented
Definition: profile.cpp:167
virtual ULONG Release(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxobject.hpp:853
Definition: tls.h:14
static TLS * PeekTLS()
@implemented
Definition: tls.cpp:41
ITfThreadMgr_P * m_pThreadMgr
Definition: tls.h:21
BOOL m_bNowOpening
Definition: tls.h:26
CicProfile * m_pProfile
Definition: tls.h:20
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
DWORD HIMCC
Definition: dimm.idl:76
DWORD HIMC
Definition: dimm.idl:75
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT GetCompartmentDWORD(IUnknown *pUnknown, REFGUID rguid, LPDWORD pdwValue, BOOL bThread)
@implemented
Definition: misc.cpp:285
HRESULT InitDisplayAttrbuteLib(PCIC_LIBTHREAD pLibThread)
@implemented
Definition: misc.cpp:156
HRESULT UninitDisplayAttrbuteLib(PCIC_LIBTHREAD pLibThread)
@implemented
Definition: misc.cpp:201
BOOL IsEALang(_In_opt_ LANGID LangID)
Definition: misc.cpp:14
HRESULT SetCompartmentDWORD(TfEditCookie cookie, IUnknown *pUnknown, REFGUID rguid, DWORD dwValue, BOOL bThread)
@implemented
Definition: misc.cpp:262
OLECHAR * BSTR
Definition: compat.h:2293
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI ImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD_PTR dwValue)
Definition: ime.c:907
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1044
BOOL WINAPI ImmEnumInputContext(DWORD dwThreadId, IMCENUMPROC lpfn, LPARAM lParam)
Definition: imm.c:1096
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: utils.c:1178
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: utils.c:1188
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
FxWmiProvider * pProvider
Definition: fxwmiapi.cpp:54
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define IMC_SETCANDIDATEPOS
Definition: imm.h:149
#define CPS_CANCEL
Definition: imm.h:181
#define IME_CMODE_NATIVE
Definition: imm.h:337
#define CPS_CONVERT
Definition: imm.h:179
#define CPS_COMPLETE
Definition: imm.h:178
#define IME_ESC_QUERY_SUPPORT
Definition: imm.h:410
#define IMC_SETCOMPOSITIONWINDOW
Definition: imm.h:153
#define SCS_SETSTR
Definition: imm.h:308
#define IME_ESC_HANJA_MODE
Definition: imm.h:421
#define CPS_REVERT
Definition: imm.h:180
#define IMC_SETCOMPOSITIONFONT
Definition: imm.h:151
#define IMC_SETOPENSTATUS
Definition: immdev.h:394
#define IMC_SETCONVERSIONMODE
Definition: immdev.h:392
#define IMC_SETSENTENCEMODE
Definition: immdev.h:393
#define NI_CONTEXTUPDATED
Definition: immdev.h:397
#define NI_OPENCANDIDATE
Definition: immdev.h:398
#define NI_COMPOSITIONSTR
Definition: immdev.h:403
REFIID riid
Definition: atlbase.h:39
HRESULT Show([in] HWND hwndParent, [in] LANGID langid, [in] REFGUID rguidProfile, [in] BSTR bstrRegistered)
HRESULT Show([in] HWND hwndParent, [in] LANGID langid, [in] REFGUID rguidProfile)
HRESULT UnadviseSingleSink([in] TfClientId tid, [in] REFIID riid)
HRESULT AdviseSingleSink([in] TfClientId tid, [in] REFIID riid, [in, iid_is(riid)] IUnknown *punk)
ULONG AddRef()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define profile
Definition: kernel32.h:12
#define GUID_NULL
Definition: ks.h:106
USHORT LANGID
Definition: mui.h:9
#define _Inout_
Definition: ms_sal.h:378
#define _Inout_opt_
Definition: ms_sal.h:379
#define _In_
Definition: ms_sal.h:308
HRESULT WINAPI TF_CreateThreadMgr(ITfThreadMgr **pptim)
Definition: msctf.c:619
UINT_PTR HKL
Definition: msctf.idl:143
EXTERN_C const GUID GUID_TFCAT_TIP_KEYBOARD
Definition: msctf.idl:99
EXTERN_C const GUID GUID_COMPARTMENT_KEYBOARD_OPENCLOSE
Definition: msctf.idl:89
unsigned int UINT
Definition: ndis.h:50
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define LOWORD(l)
Definition: pedump.c:82
#define CONST
Definition: pedump.c:81
long LONG
Definition: pedump.c:60
#define REFIID
Definition: guiddef.h:118
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define LANG_KOREAN
Definition: nls.h:84
HRESULT hr
Definition: shlfolder.c:183
#define QITABENT(Cthis, Ifoo)
Definition: shlwapi.h:2094
CicBridge * m_pBridge
Definition: bridge.cpp:254
HIMCC hCtfImeContext
Definition: imm32_undoc.h:166
LPWSTR lpWord
Definition: dimm.idl:36
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1083
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
CONST void * LPCVOID
Definition: windef.h:191
#define E_NOINTERFACE
Definition: winerror.h:2364
HWND WINAPI GetFocus(void)
Definition: window.c:1893
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)