annotate libgui/qterminal/libqterminal/unix/Screen.h @ 18976:dcb260e7a648

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Fri, 01 Aug 2014 12:10:05 -0400
parents d63878346099
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
1 /*
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
2 This file is part of Konsole, KDE's terminal.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
3
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 15681
diff changeset
4 Copyright (C) 2007, 2013 by Robert Knight <robertknight@gmail.com>
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
5 Copyright (C) 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
6
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
7 Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
8
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
9 This program is free software; you can redistribute it and/or modify
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
11 the Free Software Foundation; either version 2 of the License, or
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
12 (at your option) any later version.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
13
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
14 This program is distributed in the hope that it will be useful,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
17 GNU General Public License for more details.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
18
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
20 along with this program; if not, write to the Free Software
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22 02110-1301 USA.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25 #ifndef SCREEN_H
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26 #define SCREEN_H
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
27
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
28 // Qt
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29 #include <QtCore/QRect>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
30 #include <QtCore/QTextStream>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31 #include <QtCore/QVarLengthArray>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
33 // Konsole
15653
35c891dce299 Removed INCLUDEPATH.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15651
diff changeset
34 #include "unix/Character.h"
35c891dce299 Removed INCLUDEPATH.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15651
diff changeset
35 #include "unix/History.h"
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
36
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
37 #define MODE_Origin 0
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
38 #define MODE_Wrap 1
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39 #define MODE_Insert 2
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40 #define MODE_Screen 3
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
41 #define MODE_Cursor 4
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
42 #define MODE_NewLine 5
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
43 #define MODES_SCREEN 6
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
44
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
45 struct ScreenParm
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
46 {
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
47 int mode[MODES_SCREEN];
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
48 };
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
49
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
50 class TerminalCharacterDecoder;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
51
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
52 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
53 \brief An image of characters with associated attributes.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
54
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
55 The terminal emulation ( Emulation ) receives a serial stream of
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
56 characters from the program currently running in the terminal.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
57 From this stream it creates an image of characters which is ultimately
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
58 rendered by the display widget ( TerminalDisplay ). Some types of emulation
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
59 may have more than one screen image.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
60
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
61 getImage() is used to retrieve the currently visible image
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
62 which is then used by the display widget to draw the output from the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
63 terminal.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
64
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
65 The number of lines of output history which are kept in addition to the current
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
66 screen image depends on the history scroll being used to store the output.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
67 The scroll is specified using setScroll()
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
68 The output history can be retrieved using writeToStream()
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
69
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
70 The screen image has a selection associated with it, specified using
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
71 setSelectionStart() and setSelectionEnd(). The selected text can be retrieved
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
72 using selectedText(). When getImage() is used to retrieve the the visible image,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
73 characters which are part of the selection have their colours inverted.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
74 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
75 class Screen
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
76 {
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
77 public:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
78 /** Construct a new screen image of size @p lines by @p columns. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
79 Screen(int lines, int columns);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
80 ~Screen();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
81
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
82 // VT100/2 Operations
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
83 // Cursor Movement
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
84
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
85 /** Move the cursor up by @p n lines. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
86 void cursorUp (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
87 /** Move the cursor down by @p n lines. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
88 void cursorDown (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
89 /** Move the cursor to the left by @p n columns. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
90 void cursorLeft (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
91 /** Move the cursor to the right by @p n columns. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
92 void cursorRight (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
93 /** Position the cursor on line @p y. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
94 void setCursorY (int y);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
95 /** Position the cursor at column @p x. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
96 void setCursorX (int x);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
97 /** Position the cursor at line @p y, column @p x. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
98 void setCursorYX (int y, int x);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
99 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
100 * Sets the margins for scrolling the screen.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
101 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
102 * @param topLine The top line of the new scrolling margin.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
103 * @param bottomLine The bottom line of the new scrolling margin.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
104 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
105 void setMargins (int topLine , int bottomLine);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
106 /** Returns the top line of the scrolling region. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
107 int topMargin() const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
108 /** Returns the bottom line of the scrolling region. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
109 int bottomMargin() const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
110
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
111 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
112 * Resets the scrolling margins back to the top and bottom lines
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
113 * of the screen.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
114 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
115 void setDefaultMargins();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
116
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
117 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
118 * Moves the cursor down one line, if the MODE_NewLine mode
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
119 * flag is enabled then the cursor is returned to the leftmost
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
120 * column first.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
121 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
122 * Equivalent to NextLine() if the MODE_NewLine flag is set
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
123 * or index() otherwise.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
124 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
125 void NewLine ();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
126 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
127 * Moves the cursor down one line and positions it at the beginning
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
128 * of the line.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
129 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
130 void NextLine ();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
131
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
132 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
133 * Move the cursor down one line. If the cursor is on the bottom
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
134 * line of the scrolling region (as returned by bottomMargin()) the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
135 * scrolling region is scrolled up by one line instead.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
136 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
137 void index ();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
138 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
139 * Move the cursor up one line. If the cursor is on the top line
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
140 * of the scrolling region (as returned by topMargin()) the scrolling
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
141 * region is scrolled down by one line instead.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
142 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
143 void reverseIndex();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
144
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
145 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
146 * Scroll the scrolling region of the screen up by @p n lines.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
147 * The scrolling region is initially the whole screen, but can be changed
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
148 * using setMargins()
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
149 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
150 void scrollUp(int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
151 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
152 * Scroll the scrolling region of the screen down by @p n lines.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
153 * The scrolling region is initially the whole screen, but can be changed
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
154 * using setMargins()
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
155 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
156 void scrollDown(int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
157
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
158 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
159 * Moves the cursor to the beginning of the current line.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
160 * Equivalent to setCursorX(0)
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
161 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
162 void Return ();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
163 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
164 * Moves the cursor one column to the left and erases the character
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
165 * at the new cursor position.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
166 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
167 void BackSpace ();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
168 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
169 * Moves the cursor @p n tab-stops to the right.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
170 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
171 void Tabulate (int n = 1);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
172 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
173 * Moves the cursor @p n tab-stops to the left.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
174 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
175 void backTabulate(int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
176
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
177 // Editing
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
178
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
179 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
180 * Erase @p n characters beginning from the current cursor position.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
181 * This is equivalent to over-writing @p n characters starting with the current
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
182 * cursor position with spaces.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
183 * If @p n is 0 then one character is erased.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
184 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
185 void eraseChars (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
186 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
187 * Delete @p n characters beginning from the current cursor position.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
188 * If @p n is 0 then one character is deleted.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
189 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
190 void deleteChars (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
191 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
192 * Insert @p n blank characters beginning from the current cursor position.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
193 * The position of the cursor is not altered.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
194 * If @p n is 0 then one character is inserted.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
195 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
196 void insertChars (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
197 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
198 * Removes @p n lines beginning from the current cursor position.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
199 * The position of the cursor is not altered.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
200 * If @p n is 0 then one line is removed.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
201 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
202 void deleteLines (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
203 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
204 * Inserts @p lines beginning from the current cursor position.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
205 * The position of the cursor is not altered.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
206 * If @p n is 0 then one line is inserted.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
207 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
208 void insertLines (int n);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
209 /** Clears all the tab stops. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
210 void clearTabStops();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
211 /** Sets or removes a tab stop at the cursor's current column. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
212 void changeTabStop(bool set);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
213
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
214 /** Resets (clears) the specified screen @p mode. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
215 void resetMode (int mode);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
216 /** Sets (enables) the specified screen @p mode. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
217 void setMode (int mode);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
218 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
219 * Saves the state of the specified screen @p mode. It can be restored
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
220 * using restoreMode()
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
221 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
222 void saveMode (int mode);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
223 /** Restores the state of a screen @p mode saved by calling saveMode() */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
224 void restoreMode (int mode);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
225 /** Returns whether the specified screen @p mode is enabled or not .*/
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
226 bool getMode (int mode) const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
227
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
228 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
229 * Saves the current position and appearence (text color and style) of the cursor.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
230 * It can be restored by calling restoreCursor()
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
231 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
232 void saveCursor ();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
233 /** Restores the position and appearence of the cursor. See saveCursor() */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
234 void restoreCursor();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
235
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
236 /** Clear the whole screen, moving the current screen contents into the history first. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
237 void clearEntireScreen();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
238 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
239 * Clear the area of the screen from the current cursor position to the end of
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
240 * the screen.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
241 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
242 void clearToEndOfScreen();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
243 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
244 * Clear the area of the screen from the current cursor position to the start
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
245 * of the screen.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
246 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
247 void clearToBeginOfScreen();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
248 /** Clears the whole of the line on which the cursor is currently positioned. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
249 void clearEntireLine();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
250 /** Clears from the current cursor position to the end of the line. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
251 void clearToEndOfLine();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
252 /** Clears from the current cursor position to the beginning of the line. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
253 void clearToBeginOfLine();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
254
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
255 /** Fills the entire screen with the letter 'E' */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
256 void helpAlign ();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
257
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
258 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
259 * Enables the given @p rendition flag. Rendition flags control the appearence
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
260 * of characters on the screen.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
261 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
262 * @see Character::rendition
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
263 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
264 void setRendition (int rendition);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
265 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
266 * Disables the given @p rendition flag. Rendition flags control the appearence
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
267 * of characters on the screen.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
268 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
269 * @see Character::rendition
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
270 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
271 void resetRendition(int rendition);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
272
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
273 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
274 * Sets the cursor's foreground color.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
275 * @param space The color space used by the @p color argument
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
276 * @param color The new foreground color. The meaning of this depends on
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
277 * the color @p space used.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
278 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
279 * @see CharacterColor
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
280 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
281 void setForeColor (int space, int color);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
282 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
283 * Sets the cursor's background color.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
284 * @param space The color space used by the @p color argumnet.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
285 * @param color The new background color. The meaning of this depends on
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
286 * the color @p space used.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
287 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
288 * @see CharacterColor
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
289 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
290 void setBackColor (int space, int color);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
291 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
292 * Resets the cursor's color back to the default and sets the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
293 * character's rendition flags back to the default settings.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
294 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
295 void setDefaultRendition();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
296
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
297 /** Returns the column which the cursor is positioned at. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
298 int getCursorX() const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
299 /** Returns the line which the cursor is positioned on. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
300 int getCursorY() const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
301
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
302 /** TODO Document me */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
303 void clear();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
304 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
305 * Sets the position of the cursor to the 'home' position at the top-left
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
306 * corner of the screen (0,0)
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
307 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
308 void home();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
309 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
310 * Resets the state of the screen. This resets the various screen modes
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
311 * back to their default states. The cursor style and colors are reset
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
312 * (as if setDefaultRendition() had been called)
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
313 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
314 * <ul>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
315 * <li>Line wrapping is enabled.</li>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
316 * <li>Origin mode is disabled.</li>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
317 * <li>Insert mode is disabled.</li>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
318 * <li>Cursor mode is enabled. TODO Document me</li>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
319 * <li>Screen mode is disabled. TODO Document me</li>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
320 * <li>New line mode is disabled. TODO Document me</li>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
321 * </ul>
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
322 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
323 * If @p clearScreen is true then the screen contents are erased entirely,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
324 * otherwise they are unaltered.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
325 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
326 void reset(bool clearScreen = true);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
327
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
328 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
329 * Displays a new character at the current cursor position.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
330 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
331 * If the cursor is currently positioned at the right-edge of the screen and
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
332 * line wrapping is enabled then the character is added at the start of a new
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
333 * line below the current one.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
334 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
335 * If the MODE_Insert screen mode is currently enabled then the character
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
336 * is inserted at the current cursor position, otherwise it will replace the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
337 * character already at the current cursor position.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
338 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
339 void ShowCharacter(unsigned short c);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
340
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
341 // Do composition with last shown character FIXME: Not implemented yet for KDE 4
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
342 void compose(const QString& compose);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
343
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
344 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
345 * Resizes the image to a new fixed size of @p new_lines by @p new_columns.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
346 * In the case that @p new_columns is smaller than the current number of columns,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
347 * existing lines are not truncated. This prevents characters from being lost
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
348 * if the terminal display is resized smaller and then larger again.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
349 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
350 * (note that in versions of Konsole prior to KDE 4, existing lines were
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
351 * truncated when making the screen image smaller)
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
352 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
353 void resizeImage(int new_lines, int new_columns);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
354
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
355 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
356 * Returns the current screen image.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
357 * The result is an array of Characters of size [getLines()][getColumns()] which
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
358 * must be freed by the caller after use.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
359 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
360 * @param dest Buffer to copy the characters into
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
361 * @param size Size of @p dest in Characters
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
362 * @param startLine Index of first line to copy
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
363 * @param endLine Index of last line to copy
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
364 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
365 void getImage( Character* dest , int size , int startLine , int endLine ) const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
366
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
367 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
368 * Returns the additional attributes associated with lines in the image.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
369 * The most important attribute is LINE_WRAPPED which specifies that the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
370 * line is wrapped,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
371 * other attributes control the size of characters in the line.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
372 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
373 QVector<LineProperty> getLineProperties( int startLine , int endLine ) const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
374
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
375
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
376 /** Return the number of lines. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
377 int getLines() { return lines; }
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
378 /** Return the number of columns. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
379 int getColumns() { return columns; }
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
380 /** Return the number of lines in the history buffer. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
381 int getHistLines ();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
382 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
383 * Sets the type of storage used to keep lines in the history.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
384 * If @p copyPreviousScroll is true then the contents of the previous
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
385 * history buffer are copied into the new scroll.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
386 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
387 void setScroll(const HistoryType& , bool copyPreviousScroll = true);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
388 /** Returns the type of storage used to keep lines in the history. */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
389 const HistoryType& getScroll();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
390 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
391 * Returns true if this screen keeps lines that are scrolled off the screen
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
392 * in a history buffer.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
393 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
394 bool hasScroll();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
395
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
396 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
397 * Sets the start of the selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
398 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
399 * @param column The column index of the first character in the selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
400 * @param line The line index of the first character in the selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
401 * @param columnmode True if the selection is in column mode.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
402 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
403 void setSelectionStart(const int column, const int line, const bool columnmode);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
404
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
405 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
406 * Sets the end of the current selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
407 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
408 * @param column The column index of the last character in the selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
409 * @param line The line index of the last character in the selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
410 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
411 void setSelectionEnd(const int column, const int line);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
412
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
413 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
414 * Retrieves the start of the selection or the cursor position if there
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
415 * is no selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
416 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
417 void getSelectionStart(int& column , int& line);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
418
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
419 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
420 * Retrieves the end of the selection or the cursor position if there
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
421 * is no selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
422 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
423 void getSelectionEnd(int& column , int& line);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
424
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
425 /** Clears the current selection */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
426 void clearSelection();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
427
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
428 void setBusySelecting(bool busy) { sel_busy = busy; }
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
429
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
430 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
431 * Returns true if the character at (@p column, @p line) is part of the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
432 * current selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
433 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
434 bool isSelected(const int column,const int line) const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
435
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
436 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
437 * Convenience method. Returns the currently selected text.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
438 * @param preserveLineBreaks Specifies whether new line characters should
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
439 * be inserted into the returned text at the end of each terminal line.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
440 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
441 QString selectedText(bool preserveLineBreaks);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
442
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
443 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
444 * Copies part of the output to a stream.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
445 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
446 * @param decoder A decoder which coverts terminal characters into text
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
447 * @param from The first line in the history to retrieve
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
448 * @param to The last line in the history to retrieve
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
449 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
450 void writeToStream(TerminalCharacterDecoder* decoder, int from, int to);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
451
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
452 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
453 * Sets the selection to line @p no in the history and returns
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
454 * the text of that line from the history buffer.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
455 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
456 QString getHistoryLine(int no);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
457
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
458 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
459 * Copies the selected characters, set using @see setSelBeginXY and @see setSelExtentXY
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
460 * into a stream.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
461 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
462 * @param decoder A decoder which converts terminal characters into text.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
463 * PlainTextDecoder is the most commonly used decoder which coverts characters
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
464 * into plain text with no formatting.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
465 * @param preserveLineBreaks Specifies whether new line characters should
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
466 * be inserted into the returned text at the end of each terminal line.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
467 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
468 void writeSelectionToStream(TerminalCharacterDecoder* decoder , bool
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
469 preserveLineBreaks = true);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
470
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
471 /** TODO Document me */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
472 void checkSelection(int from, int to);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
473
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
474 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
475 * Sets or clears an attribute of the current line.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
476 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
477 * @param property The attribute to set or clear
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
478 * Possible properties are:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
479 * LINE_WRAPPED: Specifies that the line is wrapped.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
480 * LINE_DOUBLEWIDTH: Specifies that the characters in the current line should be double the normal width.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
481 * LINE_DOUBLEHEIGHT:Specifies that the characters in the current line should be double the normal height.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
482 * Double-height lines are formed of two lines containing the same characters,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
483 * with both having the LINE_DOUBLEHEIGHT attribute. This allows other parts of the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
484 * code to work on the assumption that all lines are the same height.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
485 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
486 * @param enable true to apply the attribute to the current line or false to remove it
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
487 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
488 void setLineProperty(LineProperty property , bool enable);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
489
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
490
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
491 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
492 * Returns the number of lines that the image has been scrolled up or down by,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
493 * since the last call to resetScrolledLines().
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
494 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
495 * a positive return value indicates that the image has been scrolled up,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
496 * a negative return value indicates that the image has been scrolled down.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
497 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
498 int scrolledLines() const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
499
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
500 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
501 * Returns the region of the image which was last scrolled.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
502 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
503 * This is the area of the image from the top margin to the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
504 * bottom margin when the last scroll occurred.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
505 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
506 QRect lastScrolledRegion() const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
507
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
508 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
509 * Resets the count of the number of lines that the image has been scrolled up or down by,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
510 * see scrolledLines()
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
511 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
512 void resetScrolledLines();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
513
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
514 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
515 * Returns the number of lines of output which have been
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
516 * dropped from the history since the last call
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
517 * to resetDroppedLines()
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
518 *
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
519 * If the history is not unlimited then it will drop
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
520 * the oldest lines of output if new lines are added when
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
521 * it is full.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
522 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
523 int droppedLines() const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
524
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
525 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
526 * Resets the count of the number of lines dropped from
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
527 * the history.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
528 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
529 void resetDroppedLines();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
530
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
531 /**
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
532 * Fills the buffer @p dest with @p count instances of the default (ie. blank)
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
533 * Character style.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
534 */
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
535 static void fillWithDefaultChar(Character* dest, int count);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
536
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
537 private:
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
538
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
539 //copies a line of text from the screen or history into a stream using a
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
540 //specified character decoder
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
541 //line - the line number to copy, from 0 (the earliest line in the history) up to
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
542 // hist->getLines() + lines - 1
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
543 //start - the first column on the line to copy
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
544 //count - the number of characters on the line to copy
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
545 //decoder - a decoder which coverts terminal characters (an Character array) into text
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
546 //appendNewLine - if true a new line character (\n) is appended to the end of the line
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
547 void copyLineToStream(int line,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
548 int start,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
549 int count,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
550 TerminalCharacterDecoder* decoder,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
551 bool appendNewLine,
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
552 bool preserveLineBreaks);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
553
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
554 //fills a section of the screen image with the character 'c'
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
555 //the parameters are specified as offsets from the start of the screen image.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
556 //the loc(x,y) macro can be used to generate these values from a column,line pair.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
557 void clearImage(int loca, int loce, char c);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
558
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
559 //move screen image between 'sourceBegin' and 'sourceEnd' to 'dest'.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
560 //the parameters are specified as offsets from the start of the screen image.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
561 //the loc(x,y) macro can be used to generate these values from a column,line pair.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
562 void moveImage(int dest, int sourceBegin, int sourceEnd);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
563
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
564 void scrollUp(int from, int i);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
565 void scrollDown(int from, int i);
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
566
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
567 void addHistLine();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
568
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
569 void initTabStops();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
570
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
571 void effectiveRendition();
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
572 void reverseRendition(Character& p) const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
573
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
574 bool isSelectionValid() const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
575
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
576 // copies 'count' lines from the screen buffer into 'dest',
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
577 // starting from 'startLine', where 0 is the first line in the screen buffer
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
578 void copyFromScreen(Character* dest, int startLine, int count) const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
579 // copies 'count' lines from the history buffer into 'dest',
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
580 // starting from 'startLine', where 0 is the first line in the history
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
581 void copyFromHistory(Character* dest, int startLine, int count) const;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
582
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
583
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
584 // screen image ----------------
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
585 int lines;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
586 int columns;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
587
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
588 typedef QVector<Character> ImageLine; // [0..columns]
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
589 ImageLine* screenLines; // [lines]
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
590
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
591 int _scrolledLines;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
592 QRect _lastScrolledRegion;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
593
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
594 int _droppedLines;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
595
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
596 QVarLengthArray<LineProperty,64> lineProperties;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
597
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
598 // history buffer ---------------
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
599 HistoryScroll *hist;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
600
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
601 // cursor location
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
602 int cuX;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
603 int cuY;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
604
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
605 // cursor color and rendition info
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
606 CharacterColor cu_fg; // foreground
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
607 CharacterColor cu_bg; // background
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
608 quint8 cu_re; // rendition
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
609
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
610 // margins ----------------
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
611 int tmargin; // top margin
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
612 int bmargin; // bottom margin
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
613
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
614 // states ----------------
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
615 ScreenParm currParm;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
616
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
617 // ----------------------------
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
618
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
619 bool* tabstops;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
620
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
621 // selection -------------------
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
622 int sel_begin; // The first location selected.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
623 int sel_TL; // TopLeft Location.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
624 int sel_BR; // Bottom Right Location.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
625 bool sel_busy; // Busy making a selection.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
626 bool columnmode; // Column selection mode
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
627
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
628 // effective colors and rendition ------------
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
629 CharacterColor ef_fg; // These are derived from
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
630 CharacterColor ef_bg; // the cu_* variables above
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
631 quint8 ef_re; // to speed up operation
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
632
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
633 //
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
634 // save cursor, rendition & states ------------
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
635 //
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
636
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
637 // cursor location
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
638 int sa_cuX;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
639 int sa_cuY;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
640
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
641 // rendition info
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
642 quint8 sa_cu_re;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
643 CharacterColor sa_cu_fg;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
644 CharacterColor sa_cu_bg;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
645
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
646 // last position where we added a character
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
647 int lastPos;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
648
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
649 // modes
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
650 ScreenParm saveParm;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
652 static Character defaultChar;
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
653 };
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
654
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
655 #endif // SCREEN_H