Beispiel #1
0
        public HRESULT ActivateEx(ITfThreadMgr pThreadMgr, uint tfClientId, TF_TMAE dwFlags)
        {
            _pThreadMgr      = pThreadMgr;
            _tfClientId      = tfClientId;
            _dwActivateFlags = dwFlags;

            try
            {
                if (!_InitThreadMgrEventSink())
                {
                    throw new Exception();
                }

                if (pThreadMgr.GetFocus(out ITfDocumentMgr pDocMgrFocus).Succeeded&& pDocMgrFocus != null)
                {
                    _InitTextEditSink(pDocMgrFocus);
                }

                if (!_InitKeyEventSink())
                {
                    throw new Exception();
                }

                if (!_InitActiveLanguageProfileNotifySink())
                {
                    throw new Exception();
                }

                if (!_InitThreadFocusSink())
                {
                    throw new Exception();
                }

                if (!_InitDisplayAttributeGuidAtom())
                {
                    throw new Exception();
                }

                if (!_InitFunctionProviderSink())
                {
                    throw new Exception();
                }

                if (!_AddTextProcessorEngine())
                {
                    throw new Exception();
                }

                return(new HRESULT {
                    Code = 0
                });
            }
            catch (Exception err)
            {
                Deactivate();
                throw err;
            }
        }
        private void SetupPreserved(ITfThreadMgr pThreadMgr, uint tfClientId)
        {
            TF_PRESERVEDKEY preservedKeyImeMode;

            preservedKeyImeMode.uVKey      = VirtualKeys.VK_SHIFT;
            preservedKeyImeMode.uModifiers = DefinedModifiers._TF_MOD_ON_KEYUP_SHIFT_ONLY;
            SetPreservedKey(Globals.SampleIMEGuidImeModePreserveKey, preservedKeyImeMode, Globals.ImeModeDescription);

            throw new NotImplementedException();
        }
Beispiel #3
0
        public HRESULT ActivateEx(ITfThreadMgr ptim, uint tid, TF_TMAE dwFlags)
        {
            _candidateManager   = new YimeCandidateManager();
            _compositionManager = new YimeCompositionManager();
            _threadmgr          = ptim;
            _clientid           = tid;
            _flag = dwFlags;
            InitThreadMgrEventSink();
            InitThreadFocusSink();
            InitKeyEventSink(_compositionManager, _clientid);

            return(new HRESULT()
            {
                Code = 0
            });
        }
        /// <summary>
        /// Setup language profile for Composition Processor Engine.
        /// </summary>
        /// <param name="langid">Specify language ID</param>
        /// <param name="guidLanguageProfile">Specify GUID language profile which GUID is as same as Text Service Framework language profile.</param>
        /// <param name="pThreadMgr">ITfThreadMgr.</param>
        /// <param name="tfClientId">TfClientId value.</param>
        /// <param name="isSecureMode">secure mode</param>
        /// <param name="isComLessMode"></param>
        /// <returns></returns>
        public bool SetupLanguageProfile(LangID langid, Guid guidLanguageProfile, ITfThreadMgr pThreadMgr, uint tfClientId, bool isSecureMode, bool isComLessMode)
        {
            if ((tfClientId == 0) && (pThreadMgr == null))
            {
                return(false);
            }

            _isComLessMode = isComLessMode;
            _langid        = langid;
            _guidProfile   = guidLanguageProfile;
            _tfClientId    = tfClientId;

            SetupPreserved(pThreadMgr, tfClientId);
            InitializeSampleIMECompartment(pThreadMgr, tfClientId);
            SetupPunctuationPair();
            SetupLanguageBar(pThreadMgr, tfClientId, isSecureMode);
            SetupKeystroke();
            SetupConfiguration();
            SetupDictionaryFile();

            return(true);
        }
Beispiel #5
0
 static extern int TF_CreateThreadMgr(out ITfThreadMgr pptim);
Beispiel #6
0
 static extern int TF_CreateThreadMgr(out ITfThreadMgr threadMgr);
 static extern int TF_CreateThreadMgr(out ITfThreadMgr threadMgr);
Beispiel #8
0
 public static extern Int32 TF_CreateThreadMgr(out ITfThreadMgr threadMgr);
 internal static extern int TF_CreateThreadMgr(out ITfThreadMgr threadManager);
Beispiel #10
0
 public static extern Int32 TF_CreateThreadMgr(out ITfThreadMgr threadMgr);
Beispiel #11
0
 HRESULT ITfTextInputProcessor.Activate(ITfThreadMgr ptim, uint tid)
 {
     throw new NotImplementedException();
 }
Beispiel #12
0
 HRESULT ITfTextInputProcessorEx.ActivateEx(ITfThreadMgr ptim, uint tid, TF_TMAE dwFlags)
 {
     throw new NotImplementedException();
 }
 private void SetupLanguageBar(ITfThreadMgr pThreadMgr, uint tfClientId, bool isSecureMode)
 {
     throw new NotImplementedException();
 }
Beispiel #14
0
 //是否需要状态条? statusWindow
 HRESULT ITfTextInputProcessor.Activate(ITfThreadMgr ptim, uint tid)
 {
     return(this.ActivateEx(ptim, tid, 0));
 }
Beispiel #15
0
			static extern int TF_CreateThreadMgr(out ITfThreadMgr pptim);
Beispiel #16
0
 public static extern void TF_GetThreadMgr(
     [Out, MarshalAs(UnmanagedType.Interface)] out ITfThreadMgr o_threadManager
     );
 private void InitializeSampleIMECompartment(ITfThreadMgr pThreadMgr, uint tfClientId)
 {
     throw new NotImplementedException();
 }
Beispiel #18
0
        // destructor

        public HRESULT Activate(ITfThreadMgr ptim, uint tid)
        {
            return(ActivateEx(ptim, tid, 0));
        }