Пример #1
0
        //再接続用に現在ドキュメントの前に挿入
        public void InsertBefore(TerminalDocument olddoc, int paneheight)
        {
            lock (this) {
                GLine c      = olddoc.LastLine;
                int   offset = _currentLine.ID - _topLine.ID;
                bool  flag   = false;
                while (c != null)
                {
                    if (flag || c.Text[0] != '\0')
                    {
                        flag = true;
                        GLine nl = c.Clone();
                        nl.ID = _firstLine.ID - 1;
                        InsertBefore(_firstLine, nl);                         //最初に空でない行があれば以降は全部挿入
                        offset++;
                    }
                    c = c.PrevLine;
                }

                //IDが負になるのはちょっと怖いので修正
                if (_firstLine.ID < 0)
                {
                    int t = -_firstLine.ID;
                    c = _firstLine;
                    while (c != null)
                    {
                        c.ID += t;
                        c     = c.NextLine;
                    }
                }

                _topLine = FindLineOrEdge(_currentLine.ID - Math.Min(offset, paneheight));
                //Dump("insert doc");
            }
        }
 public SelectionKeyProcessor(TerminalPane owner, TerminalDocument doc, GLine line, int pos)
 {
     _owner    = owner;
     _document = doc;
     Debug.Assert(line != null);
     _currentLine = line;
     _caretPos    = pos;
 }
Пример #3
0
 //�����̊e���\�b�h�͂��ꂼ�ꃍ�b�N���Ȃ�����s�����
 internal void Warning(TerminalDocument doc, string msg)
 {
     Monitor.Exit(doc);
     lock(this) {
         _msg = msg;
         SendMessageCore(Service.Warning);
     }
     Monitor.Enter(doc);
 }
Пример #4
0
 internal void UnsupportedEscapeSequence(TerminalDocument doc, string msg)
 {
     Monitor.Exit(doc);
     lock(this) {
         _msg = msg;
         SendMessageCore(Service.UnsupportedEscapeSequence);
     }
     Monitor.Enter(doc);
 }
Пример #5
0
 internal void UnsupportedCharSetDetected(TerminalDocument doc, string msg)
 {
     Monitor.Exit(doc);
     lock(this) {
         _msg = msg;
         SendMessageCore(Service.UnsupportedCharSetDetected);
     }
     Monitor.Enter(doc);
 }
Пример #6
0
 internal void ToggleTextSelectionMode(IntPtr hWnd, TerminalDocument doc)
 {
     Monitor.Exit(doc);
     lock(this) {
         Win32.SendMessage(hWnd, GConst.WMG_MAINTHREADTASK, new IntPtr(GConst.WPG_TOGGLESELECTIONMODE), IntPtr.Zero);
     }
     Monitor.Enter(doc);
 }
Пример #7
0
 internal void ReportCriticalError(TerminalDocument doc, Exception ex)
 {
     Monitor.Exit(doc);
     lock(this) {
         _exception = ex;
         SendMessageCore(Service.CriticalError);
     }
     Monitor.Enter(doc);
 }
Пример #8
0
 internal void InvalidDocumentOperation(TerminalDocument doc, string msg)
 {
     Monitor.Exit(doc);
     lock(this) {
         _msg = msg;
         SendMessageCore(Service.InvalidDocumentOperation);
     }
     Monitor.Enter(doc);
 }
Пример #9
0
 internal void InvalidCharDetected(TerminalDocument doc, string msg)
 {
     Monitor.Exit(doc);
     lock(this) {
         _msg = msg;
         SendMessageCore(Service.InvalidCharDetected);
     }
     Monitor.Enter(doc);
 }
Пример #10
0
 internal void IndicateBell(TerminalDocument doc)
 {
     Monitor.Exit(doc);
     lock(this) {
         SendMessageCore(Service.IndicateBell);
     }
     Monitor.Enter(doc);
 }
Пример #11
0
 internal void AdjustIMEComposition(IntPtr hWnd, TerminalDocument doc)
 {
     Monitor.Exit(doc);
     lock(this) {
         Win32.SendMessage(hWnd, GConst.WMG_MAINTHREADTASK, new IntPtr(GConst.WPG_ADJUSTIMECOMPOSITION), IntPtr.Zero);
     }
     Monitor.Enter(doc);
 }
Пример #12
0
        //�Đڑ��p�Ɍ��݃h�L�������g�̑O�ɑ}��
        public void InsertBefore(TerminalDocument olddoc, int paneheight)
        {
            lock(this) {
                GLine c = olddoc.LastLine;
                int offset = _currentLine.ID - _topLine.ID;
                bool flag = false;
                while(c!=null) {
                    if(flag || c.Text[0]!='\0') {
                        flag = true;
                        GLine nl = c.Clone();
                        nl.ID = _firstLine.ID-1;
                        InsertBefore(_firstLine, nl); //�ŏ��ɋ�łȂ��s������Έȍ~�͑S���}��
                        offset++;
                    }
                    c = c.PrevLine;
                }

                //ID�����ɂȂ�̂͂�����ƕ|���̂ŏC��
                if(_firstLine.ID<0) {
                    int t = -_firstLine.ID;
                    c = _firstLine;
                    while(c!=null) {
                        c.ID += t;
                        c = c.NextLine;
                    }
                }

                _topLine = FindLineOrEdge(_currentLine.ID - Math.Min(offset, paneheight));
                //Dump("insert doc");
            }
        }