Example #1
0
 //これはメインスレッドから呼び出すこと
 public virtual void FullReset()
 {
     lock (_document) {
         ChangeMode(TerminalMode.Normal);
         _document.ClearScrollingRegion();
         ResetInternal();
         _decoder = new ISO2022CharDecoder(this, EncodingProfile.Get(GetTerminalSettings().Encoding));
     }
 }
Example #2
0
 public void Reset()
 {
     //Encodingが同じ時は簡単に済ませることができる
     if (_decoder.CurrentEncoding.Type == GetTerminalSettings().Encoding)
     {
         _decoder.Reset(_decoder.CurrentEncoding);
     }
     else
     {
         _decoder = new ISO2022CharDecoder(this, EncodingProfile.Get(GetTerminalSettings().Encoding));
     }
 }
Example #3
0
 private void mwgSendChar(char ch)
 {
     if (ch < 0x80)
     {
         // Unicode の 0x80<=ch<0x100 は、文字コードによって異なる
         mwgSendCharBuff[0] = (byte)ch;
         mwgSendBytes(mwgSendCharBuff, 1);
     }
     else
     {
         int len = EncodingProfile.Get(GetTerminalSettings().Encoding).GetBytes(ch, mwgSendCharBuff);
         mwgSendBytes(mwgSendCharBuff, len);
     }
 }
Example #4
0
 public void SendChar(char ch)           //ISからのコールバックあるので
 {
     if (ch < 0x80)
     {
         //Debug.WriteLine("SendChar " + (int)ch);
         _sendCharBuffer[0] = (byte)ch;
         SendBytes(_sendCharBuffer);
     }
     else
     {
         byte[] data = EncodingProfile.Get(GetTerminalSettings().Encoding).GetBytes(ch);
         SendBytes(data);
     }
 }
Example #5
0
        public AbstractTerminal(TerminalInitializeInfo info)
        {
            TerminalEmulatorPlugin.Instance.LaterInitialize();

            _session = info.Session;

            //_invalidateParam = new InvalidateParam();
            _document = new TerminalDocument(info.InitialWidth, info.InitialHeight);
            _document.SetOwner(_session.ISession);
            _afterExitLockActions = new List <AfterExitLockDelegate>();

            _decoder                 = new ISO2022CharDecoder(this, EncodingProfile.Get(info.Session.TerminalSettings.Encoding));
            _terminalMode            = TerminalMode.Normal;
            _currentdecoration       = TextDecoration.Default;
            _manipulator             = new GLineManipulator();
            _scrollBarValues         = new ScrollBarValues();
            _logService              = new LogService(info.TerminalParameter, _session.TerminalSettings);
            _promptRecognizer        = new PromptRecognizer(this);
            _intelliSense            = new IntelliSense(this);
            _commandResultRecognizer = new PopupStyleCommandResultRecognizer(this);

            if (info.Session.TerminalSettings.LogSettings != null)
            {
                _logService.ApplyLogSettings(_session.TerminalSettings.LogSettings, false);
            }

            //event handlers
            ITerminalSettings ts = info.Session.TerminalSettings;

            ts.ChangeEncoding += delegate(EncodingType t) {
                this.Reset();
            };
            ts.ChangeRenderProfile += delegate(RenderProfile prof) {
                TerminalControl tc = _session.TerminalControl;
                if (tc != null)
                {
                    tc.ApplyRenderProfile(prof);
                }
            };
        }
Example #6
0
 public void InvalidCharDetected(byte[] buf)
 {
     CharDecodeError(String.Format(GEnv.Strings.GetString("Message.AbstractTerminal.UnexpectedChar"), EncodingProfile.Get(GetTerminalSettings().Encoding).Encoding.WebName));
 }
Example #7
0
 public void SendCharArray(char[] chs)
 {
     byte[] bytes = EncodingProfile.Get(GetTerminalSettings().Encoding).GetBytes(chs);
     SendBytes(bytes);
 }
 //改行は入っていない前提で
 /// <summary>
 /// <ja>
 /// Char型の配列を送信します。
 /// </ja>
 /// <en>
 /// Send a array of Char type.
 /// </en>
 /// </summary>
 /// <param name="chars"><ja>送信する文字配列</ja><en>String array to send</en></param>
 /// <remarks>
 /// <ja>
 /// 文字は現在のエンコード設定によりエンコードされてから送信されます。
 /// </ja>
 /// <en>
 /// After it is encoded by a present encode setting, the character is transmitted.
 /// </en>
 /// </remarks>
 public void SendString(char[] chars)
 {
     byte[] data = EncodingProfile.Get(_settings.Encoding).GetBytes(chars);
     Transmit(data);
 }