コード例 #1
0
ファイル: TerminalOutput.cs プロジェクト: VirusFree/Poderosa
 /// <summary>
 /// 
 /// </summary>
 /// <param name="host"></param>
 /// <param name="settings"></param>
 /// <param name="connection"></param>
 /// <exclude/>
 public TerminalTransmission(AbstractTerminal host, ITerminalSettings settings, ITerminalConnection connection)
 {
     _host = host;
     _settings = settings;
     _connection = connection;
     _dataForLocalEcho = new ByteDataFragment();
 }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="host"></param>
 /// <param name="settings"></param>
 /// <param name="connection"></param>
 /// <exclude/>
 public TerminalTransmission(AbstractTerminal host, ITerminalSettings settings, ITerminalConnection connection)
 {
     _host             = host;
     _settings         = settings;
     _connection       = connection;
     _dataForLocalEcho = new ByteDataFragment();
 }
コード例 #3
0
ファイル: IntelliSense.cs プロジェクト: saitoha/poderosa
        public void Init(AbstractTerminal terminal, IShellScheme scheme, string[] current_input, IntelliSenseMode mode, char append_char)
        {
            _ownerControl = terminal.TerminalHost.TerminalControl;
            Debug.Assert(_ownerControl != null);
            TerminalDocument doc = terminal.GetDocument();

            _commandStartPoint = new Point(doc.CaretColumn + (append_char == '\0' ? 0 : 1), doc.CurrentLineNumber - doc.TopLineNumber);
            Debug.WriteLineIf(DebugOpt.IntelliSense, String.Format("IS CtxInit M={0} CaretC={1}", mode.ToString(), doc.CaretColumn));
            _scheme           = scheme;
            _currentInput     = current_input;
            _intelliSenseMode = mode;
            Debug.Assert(_currentInput != null);

            _charQueue.LockedInit(append_char);

            _buffer.Remove(0, _buffer.Length);
            if (_intelliSenseMode == IntelliSenseMode.CharComplement)
            {
                string last_arg = current_input[current_input.Length - 1];
                _buffer.Append(last_arg);
                _commandStartPoint.X -= last_arg.Length;
            }

            BuildCandidates();
        }
コード例 #4
0
        public PromptRecognizer(AbstractTerminal term)
        {
            _terminal      = term;
            _commandBuffer = new StringBuilder();
            ITerminalSettings ts = term.TerminalHost.TerminalSettings;

            ts.AddListener(this);
            _promptExpression = new Regex(ts.ShellScheme.PromptExpression, RegexOptions.Compiled); //これはシェルにより可変
            _listeners        = new List <IPromptProcessor>();
        }
コード例 #5
0
        public TerminalSession(ITerminalConnection connection, ITerminalSettings terminalSettings) {
            _terminalSettings = terminalSettings;
            //VT100指定でもxtermシーケンスを送ってくるアプリケーションが後をたたないので
            _terminal = AbstractTerminal.Create(new TerminalInitializeInfo(this, connection.Destination));
            _output = new TerminalTransmission(_terminal, _terminalSettings, connection);

            _terminalSettings.ChangeCaption += delegate(string caption) {
                this.OwnerWindow.DocumentTabFeature.Update(_terminal.IDocument);
            };

        }
コード例 #6
0
ファイル: PromptRecognizer.cs プロジェクト: FNKGino/poderosa
 public PromptRecognizer(AbstractTerminal term)
 {
     _terminal = term;
     _commandBuffer = new StringBuilder();
     ITerminalSettings ts = term.TerminalHost.TerminalSettings;
     ts.AddListener(this);
     _promptExpression = new Regex(ts.ShellScheme.PromptExpression, RegexOptions.Compiled); //これはシェルにより可変
     _listeners = new List<IPromptProcessor>();
     _lineCache = new LineCache(PromptRecognizerPreferences.Instance.PromptSearchMaxLines);
     _lastCachedLineID = -1;
 }
コード例 #7
0
        public TerminalSession(ITerminalConnection connection, ITerminalSettings terminalSettings)
        {
            _terminalSettings = terminalSettings;
            //VT100�w��ł�xterm�V�[�P���X�𑗂��Ă���A�v���P�[�V�������������Ȃ��̂�
            _terminal = AbstractTerminal.Create(new TerminalInitializeInfo(this, connection.Destination));
            _output = new TerminalTransmission(_terminal, _terminalSettings, connection);

            _terminalSettings.ChangeCaption += delegate(string caption) {
                this.OwnerWindow.DocumentTabFeature.Update(_terminal.IDocument);
            };
        }
コード例 #8
0
        public PromptRecognizer(AbstractTerminal term)
        {
            _terminal      = term;
            _commandBuffer = new StringBuilder();
            ITerminalSettings ts = term.TerminalHost.TerminalSettings;

            ts.AddListener(this);
            _promptExpression = new Regex(ts.ShellScheme.PromptExpression, RegexOptions.Compiled); //これはシェルにより可変
            _listeners        = new List <IPromptProcessor>();
            _lineCache        = new LineCache(PromptRecognizerPreferences.Instance.PromptSearchMaxLines);
            _lastCachedLineID = -1;
        }
コード例 #9
0
ファイル: XZModemDialog.cs プロジェクト: Ricordanza/poderosa
        public void Initialize(AbstractTerminal terminal) {
            StringResource sr = XZModemPlugin.Instance.Strings;
            _terminal = terminal;
            this.Text = String.Format(sr.GetString("Caption.XZModemDialog.DialogTitle"), _terminal.TerminalHost.ISession.Caption);

            //ウィンドウのセンタリング
            Rectangle r = terminal.TerminalHost.OwnerWindow.AsForm().DesktopBounds;
            this.Location = new Point(r.Left + r.Width / 2 - this.Width / 2, r.Top + r.Height / 2 - this.Height / 2);

            //TODO 前回の起動時の設定を覚えておくとよい
            _protocolBox.SelectedIndex = 1;
            _directionBox.SelectedIndex = 0;
#if DEBUG
            //テスト時にはここに初期値を設定
            _fileNameBox.Text = "C:\\P4\\Work\\FF4K_R.bin";
#endif
        }
コード例 #10
0
        private static void SessionEntryPoint(AbstractTerminal terminal, CommandResultDocument document)
        {
            try {
                TerminalControl tc = terminal.TerminalHost.TerminalControl;
                Debug.Assert(tc != null);
                RenderProfile          rp          = (RenderProfile)tc.GetRenderProfile().Clone();
                CommandResultSession   session     = new CommandResultSession(document, rp); //現在のRenderProfileを使ってセッションを作る
                TerminalDocument       terminaldoc = terminal.GetDocument();
                PopupViewCreationParam cp          = new PopupViewCreationParam(_viewFactory);
                //結果のサイズに合わせる。ただし高さは20行を上限とする
                cp.InitialSize = new Size(tc.ClientSize.Width, (int)(RuntimeUtil.AdjustIntRange(document.Size, 0, 20) * rp.Pitch.Height) + 2);
                cp.OwnedByCommandTargetWindow = GEnv.Options.CommandPopupAlwaysOnTop;
                cp.ShowInTaskBar = GEnv.Options.CommandPopupInTaskBar;

                IWindowManager       wm     = TerminalEmulatorPlugin.Instance.GetWindowManager();
                ISessionManager      sm     = TerminalEmulatorPlugin.Instance.GetSessionManager();
                IPoderosaPopupWindow window = wm.CreatePopupView(cp);
                sm.StartNewSession(session, window.InternalView);
                sm.ActivateDocument(session.Document, ActivateReason.InternalAction);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }
コード例 #11
0
ファイル: ModalTaskEx.cs プロジェクト: yueker/poderosa
 public ModalTerminalTaskSite(AbstractTerminal terminal)
 {
     _terminal = terminal;
 }
コード例 #12
0
 public void Attach(ITerminalControlHost session)
 {
     lock (_terminalSync) {
         _terminal = session.Terminal;
     }
 }
コード例 #13
0
 public void Detach()
 {
     lock (_terminalSync) {
         _terminal = null;
     }
 }
コード例 #14
0
ファイル: IntelliSense.cs プロジェクト: saitoha/poderosa
        private bool _cancelLockFlag;   //手動キャンセルしたら手動Enterがあるまで自動ポップアップはしない

        public IntelliSense(AbstractTerminal terminal)
        {
            _terminal = terminal;
            _context  = new IntelliSenseContext(this);
            _terminal.PromptRecognizer.AddListener(this);
        }
コード例 #15
0
ファイル: XZModemDialog.cs プロジェクト: VirusFree/Poderosa
        public void Initialize(AbstractTerminal terminal)
        {
            StringResource sr = XZModemPlugin.Instance.Strings;
            _terminal = terminal;
            this.Text = String.Format(sr.GetString("Caption.XZModemDialog.DialogTitle"), _terminal.TerminalHost.ISession.Caption);

            //�E�B���h�E�̃Z���^�����O
            Rectangle r = terminal.TerminalHost.OwnerWindow.AsForm().DesktopBounds;
            this.Location = new Point(r.Left + r.Width / 2 - this.Width / 2, r.Top + r.Height / 2 - this.Height / 2);

            //TODO �O��̋N�����̐ݒ��o���Ă����Ƃ悢
            _protocolBox.SelectedIndex = 1;
            _directionBox.SelectedIndex = 0;
            #if DEBUG
            //�e�X�g���ɂ͂����ɏ����l��ݒ�
            _fileNameBox.Text = "C:\\P4\\Work\\FF4K_R.bin";
            #endif
        }
コード例 #16
0
 public void StartCommand(AbstractTerminal terminal, string command_text, GLine prompt_line)
 {
 }
コード例 #17
0
ファイル: ModalTaskEx.cs プロジェクト: FNKGino/poderosa
 public ModalTerminalTaskSite(AbstractTerminal terminal)
 {
     _terminal = terminal;
 }
コード例 #18
0
 public bool IsEnabled(AbstractTerminal control_host)
 {
     return(true);
 }
コード例 #19
0
        private static void SessionEntryPoint(AbstractTerminal terminal, CommandResultDocument document) {
            try {
                TerminalControl tc = terminal.TerminalHost.TerminalControl;
                Debug.Assert(tc != null);
                RenderProfile rp = (RenderProfile)tc.GetRenderProfile().Clone();
                CommandResultSession session = new CommandResultSession(document, rp); //現在のRenderProfileを使ってセッションを作る
                TerminalDocument terminaldoc = terminal.GetDocument();
                PopupViewCreationParam cp = new PopupViewCreationParam(_viewFactory);
                //結果のサイズに合わせる。ただし高さは20行を上限とする
                cp.InitialSize = new Size(tc.ClientSize.Width, (int)(RuntimeUtil.AdjustIntRange(document.Size, 0, 20) * rp.Pitch.Height) + 2);
                cp.OwnedByCommandTargetWindow = GEnv.Options.CommandPopupAlwaysOnTop;
                cp.ShowInTaskBar = GEnv.Options.CommandPopupInTaskBar;

                IWindowManager wm = TerminalEmulatorPlugin.Instance.GetWindowManager();
                ISessionManager sm = TerminalEmulatorPlugin.Instance.GetSessionManager();
                IPoderosaPopupWindow window = wm.CreatePopupView(cp);
                sm.StartNewSession(session, window.InternalView);
                sm.ActivateDocument(session.Document, ActivateReason.InternalAction);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }
コード例 #20
0
 public PopupStyleCommandResultRecognizer(AbstractTerminal terminal) : base(terminal)
 {
 }
コード例 #21
0
 public void StartCommand(AbstractTerminal terminal, string command_text, GLine prompt_line)
 {
     _executingCommand = command_text;
     _terminal         = terminal;
 }
コード例 #22
0
 public CommandResultRecognizer(AbstractTerminal terminal)
 {
     _terminal = terminal;
     _terminal.PromptRecognizer.AddListener(this);
     _state = State.NotPrompt;
 }
コード例 #23
0
 public bool IsEnabled(AbstractTerminal control_host)
 {
     return true;
 }
コード例 #24
0
 public void StartCommand(AbstractTerminal terminal, string command_text, GLine prompt_line)
 {
     _executingCommand = command_text;
     _terminal = terminal;
 }
コード例 #25
0
 public PopupStyleCommandResultRecognizer(AbstractTerminal terminal)
     : base(terminal)
 {
 }
コード例 #26
0
 public CommandResultRecognizer(AbstractTerminal terminal)
 {
     _terminal = terminal;
     _terminal.PromptRecognizer.AddListener(this);
     _state = State.NotPrompt;
 }