Пример #1
0
        protected override void ChangeMode(TerminalMode mode)
        {
            if (_terminalMode == mode)
            {
                return;
            }

            if (mode == TerminalMode.Normal)
            {
                GetDocument().ClearScrollingRegion();
                GetConnection().TerminalOutput.Resize(GetDocument().TerminalWidth, GetDocument().TerminalHeight);                 //たとえばemacs起動中にリサイズし、シェルへ戻るとシェルは新しいサイズを認識していない
                //RMBoxで確認されたことだが、無用に後方にドキュメントを広げてくる奴がいる。カーソルを123回後方へ、など。
                //場当たり的だが、ノーマルモードに戻る際に後ろの空行を削除することで対応する。
                GLine l = GetDocument().LastLine;
                while (l != null && l.DisplayLength == 0 && l.ID > GetDocument().CurrentLineNumber)
                {
                    l = l.PrevLine;
                }

                if (l != null)
                {
                    l = l.NextLine;
                }
                if (l != null)
                {
                    GetDocument().RemoveAfter(l.ID);
                }
            }
            else
            {
                GetDocument().SetScrollingRegion(0, GetDocument().TerminalHeight - 1);
            }

            _terminalMode = mode;
        }
Пример #2
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;
            _logService   = new LogService(info.TerminalParameter, _session.TerminalSettings, _session.TerminalOptions);
            //_promptRecognizer = new PromptRecognizer(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(); };
            _document.DebugFlag = ts.DebugFlag;

            _document.LineFeedRule = GetTerminalSettings().LineFeedRule; //(Telnet.LineFeedRule)
            //ToDo: Set Encoding
            //_document.Encoding = Encoding.GetEncoding("iso-2022-jp")
        }
Пример #3
0
        protected override void ChangeMode(TerminalMode mode)
        {
            if (_terminalMode == mode)
            {
                return;
            }

            if (mode == TerminalMode.Normal)
            {
                GetDocument().ClearScrollingRegion();
                GetConnection().TerminalOutput.Resize(GetDocument().TerminalWidth, GetDocument().TerminalHeight);                 //‚½‚Æ‚¦‚Îemacs‹N“®’†‚ɃŠƒTƒCƒY‚µAƒVƒFƒ‹‚Ö–ß‚é‚ƃVƒFƒ‹‚͐V‚µ‚¢ƒTƒCƒY‚ð”FŽ¯‚µ‚Ä‚¢‚È‚¢
                //RMBox‚ÅŠm”F‚³‚ꂽ‚±‚Æ‚¾‚ªA–³—p‚ÉŒã•û‚ɃhƒLƒ…ƒƒ“ƒg‚ðL‚°‚Ä‚­‚é“z‚ª‚¢‚éBƒJ[ƒ\ƒ‹‚ð123‰ñŒã•û‚ցA‚ȂǁB
                //ê“–‚½‚è“I‚¾‚ªAƒm[ƒ}ƒ‹ƒ‚[ƒh‚É–ß‚éÛ‚ÉŒã‚ë‚Ì‹ós‚ðíœ‚·‚邱‚ƂőΉž‚·‚éB
                int l = GetDocument().TopLineNumber + GetDocument().TerminalHeight;                 // .LastLine;
                while (l > GetDocument().CurrentLineNumber)
                {
                    l--;
                }

                l++;
                GetDocument().ClearAfter(l);                 // .RemoveAfter(l);
            }
            else
            {
                GetDocument().SetScrollingRegion(0, GetDocument().TerminalHeight - 1);
            }

            _terminalMode = mode;
        }
Пример #4
0
 /// <summary>
 /// 操作の対象になるドキュメントと文字のエンコーディングを指定して構築
 /// </summary>
 public AbstractTerminal(ConnectionTag tag, ICharDecoder decoder)
 {
     _tag               = tag;
     _decoder           = decoder;
     _terminalMode      = TerminalMode.Normal;
     _currentdecoration = TextDecoration.Default;
     _manipulator       = new GLineManipulator(80);
     _bufferForMacro    = new StringBuilder();
     _signalForMacro    = new AutoResetEvent(false);
 }
Пример #5
0
 /// <summary>
 /// ����̑ΏۂɂȂ�h�L�������g�ƕ����̃G���R�[�f�B���O��w�肵�č\�z
 /// </summary>
 public AbstractTerminal(ConnectionTag tag, ICharDecoder decoder)
 {
     _tag = tag;
     _decoder = decoder;
     _terminalMode = TerminalMode.Normal;
     _currentdecoration = TextDecoration.Default;
     _manipulator = new GLineManipulator(80);
     _bufferForMacro = new StringBuilder();
     _signalForMacro = new AutoResetEvent(false);
 }
Пример #6
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>();

            _encodingProfile         = EncodingProfile.Create(info.Session.TerminalSettings.Encoding);
            _decoder                 = new ISO2022CharDecoder(this, _encodingProfile);
            _unicodeCharConverter    = _encodingProfile.CreateUnicodeCharConverter();
            _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);
                }
            };
        }
Пример #7
0
        protected TerminalMode _cursorKeyMode;         //_terminalMode‚Í•Ê•¨BAIX‚Å‚Ìvi‚ŁAƒJ[ƒ\ƒ‹ƒL[‚Í•s•Ï‚Æ‚¢‚¤—ႪŠm”F‚³‚ê‚Ä‚¢‚é

        protected abstract void ChangeMode(TerminalMode tm);
Пример #8
0
 protected virtual void ChangeCursorKeyMode(TerminalMode tm)
 {
     _cursorKeyMode = tm;
 }
Пример #9
0
        protected override void ChangeMode(TerminalMode mode) {
            if (_terminalMode == mode)
                return;

            if (mode == TerminalMode.Normal) {
                GetDocument().ClearScrollingRegion();
                GetConnection().TerminalOutput.Resize(GetDocument().TerminalWidth, GetDocument().TerminalHeight); //たとえばemacs起動中にリサイズし、シェルへ戻るとシェルは新しいサイズを認識していない
                //RMBoxで確認されたことだが、無用に後方にドキュメントを広げてくる奴がいる。カーソルを123回後方へ、など。
                //場当たり的だが、ノーマルモードに戻る際に後ろの空行を削除することで対応する。
                GLine l = GetDocument().LastLine;
                while (l != null && l.DisplayLength == 0 && l.ID > GetDocument().CurrentLineNumber)
                    l = l.PrevLine;

                if (l != null)
                    l = l.NextLine;
                if (l != null)
                    GetDocument().RemoveAfter(l.ID);

                GetDocument().IsApplicationMode = false;
            }
            else {
                GetDocument().ApplicationModeBackColor = Color.Empty;
                GetDocument().SetScrollingRegion(0, GetDocument().TerminalHeight - 1);
                GetDocument().IsApplicationMode = true;
            }

            GetDocument().InvalidateAll();

            _terminalMode = mode;
        }
Пример #10
0
 protected abstract void ChangeMode(TerminalMode tm);
Пример #11
0
 protected virtual void ChangeCursorKeyMode(TerminalMode tm)
 {
     _cursorKeyMode = tm;
 }
Пример #12
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);
            };
        }
Пример #13
0
        protected override void ChangeMode(TerminalMode mode)
        {
            if(_terminalMode==mode) return;

            if(mode==TerminalMode.Normal) {
                GetDocument().ClearScrollingRegion();
                GetConnection().Resize(GetConnection().TerminalWidth, GetConnection().TerminalHeight); //���Ƃ���emacs�N�����Ƀ��T�C�Y���A�V�F���֖߂�ƃV�F���͐V�����T�C�Y��F�����Ă��Ȃ�
                //RMBox�Ŋm�F���ꂽ���Ƃ����A���p�Ɍ���Ƀh�L�������g��L���Ă���z������B�J�[�\����123�����ցA�ȂǁB
                //�ꓖ����I�����A�m�[�}�����[�h�ɖ߂�ۂɌ��̋�s��폜���邱�ƂőΉ�����B
                GLine l = GetDocument().LastLine;
                while(l!=null && l.DisplayLength==0 && l.ID>GetDocument().CurrentLineNumber)
                    l = l.PrevLine;

                if(l!=null)	l = l.NextLine;
                if(l!=null)	GetDocument().RemoveAfter(l.ID);
            }
            else
                GetDocument().SetScrollingRegion(0, _tag.Connection.TerminalHeight-1);

            _terminalMode = mode;
        }