29 #include <QtCore/QRect>
30 #include <QtCore/QTextStream>
31 #include <QtCore/QVarLengthArray>
42 #define MODE_NewLine 5
43 #define MODES_SCREEN 6
105 void setMargins (
int topLine ,
int bottomLine);
326 void reset(
bool clearScreen =
true);
469 preserveLineBreaks =
true);
552 bool preserveLineBreaks);
562 void moveImage(
int dest,
int sourceBegin,
int sourceEnd);
unsigned char LineProperty
Describes the color of a single character in the terminal.
A single character in the terminal which consists of a unicode character value, foreground and backgr...
An image of characters with associated attributes.
void backTabulate(int n)
Moves the cursor n tab-stops to the left.
void setCursorYX(int y, int x)
Position the cursor at line y, column x.
void saveMode(int mode)
Saves the state of the specified screen mode.
int getCursorY() const
Returns the line which the cursor is positioned on.
QVector< Character > ImageLine
void clearToEndOfScreen()
Clear the area of the screen from the current cursor position to the end of the screen.
void resizeImage(int new_lines, int new_columns)
Resizes the image to a new fixed size of new_lines by new_columns.
void deleteChars(int n)
Delete n characters beginning from the current cursor position.
void compose(const QString &compose)
void setMargins(int topLine, int bottomLine)
Sets the margins for scrolling the screen.
void getImage(Character *dest, int size, int startLine, int endLine) const
Returns the current screen image.
void checkSelection(int from, int to)
TODO Document me.
int getColumns()
Return the number of columns.
void setScroll(const HistoryType &, bool copyPreviousScroll=true)
Sets the type of storage used to keep lines in the history.
void reverseRendition(Character &p) const
void copyFromScreen(Character *dest, int startLine, int count) const
void reset(bool clearScreen=true)
Resets the state of the screen.
void clearEntireScreen()
Clear the whole screen, moving the current screen contents into the history first.
void setBusySelecting(bool busy)
void writeToStream(TerminalCharacterDecoder *decoder, int from, int to)
Copies part of the output to a stream.
QString selectedText(bool preserveLineBreaks)
Convenience method.
void saveCursor()
Saves the current position and appearence (text color and style) of the cursor.
void clearToBeginOfLine()
Clears from the current cursor position to the beginning of the line.
void clearEntireLine()
Clears the whole of the line on which the cursor is currently positioned.
void clear()
TODO Document me.
void setCursorY(int y)
Position the cursor on line y.
void BackSpace()
Moves the cursor one column to the left and erases the character at the new cursor position.
void insertChars(int n)
Insert n blank characters beginning from the current cursor position.
void writeSelectionToStream(TerminalCharacterDecoder *decoder, bool preserveLineBreaks=true)
Copies the selected characters, set using.
Screen(int lines, int columns)
Construct a new screen image of size lines by columns.
QString getHistoryLine(int no)
Sets the selection to line no in the history and returns the text of that line from the history buffe...
void Return()
Moves the cursor to the beginning of the current line.
static Character defaultChar
int getHistLines()
Return the number of lines in the history buffer.
void changeTabStop(bool set)
Sets or removes a tab stop at the cursor's current column.
void cursorDown(int n)
Move the cursor down by n lines.
static void fillWithDefaultChar(Character *dest, int count)
Fills the buffer dest with count instances of the default (ie.
void setDefaultMargins()
Resets the scrolling margins back to the top and bottom lines of the screen.
bool isSelectionValid() const
bool hasScroll()
Returns true if this screen keeps lines that are scrolled off the screen in a history buffer.
void home()
Sets the position of the cursor to the 'home' position at the top-left corner of the screen (0,...
void copyFromHistory(Character *dest, int startLine, int count) const
void setCursorX(int x)
Position the cursor at column x.
void setSelectionEnd(const int column, const int line)
Sets the end of the current selection.
void NewLine()
Moves the cursor down one line, if the MODE_NewLine mode flag is enabled then the cursor is returned ...
void clearTabStops()
Clears all the tab stops.
void clearToBeginOfScreen()
Clear the area of the screen from the current cursor position to the start of the screen.
void eraseChars(int n)
Erase n characters beginning from the current cursor position.
void getSelectionStart(int &column, int &line)
Retrieves the start of the selection or the cursor position if there is no selection.
void helpAlign()
Fills the entire screen with the letter 'E'.
int getCursorX() const
Returns the column which the cursor is positioned at.
void getSelectionEnd(int &column, int &line)
Retrieves the end of the selection or the cursor position if there is no selection.
void Tabulate(int n=1)
Moves the cursor n tab-stops to the right.
QRect lastScrolledRegion() const
Returns the region of the image which was last scrolled.
void cursorUp(int n)
Move the cursor up by n lines.
int topMargin() const
Returns the top line of the scrolling region.
void clearImage(int loca, int loce, char c)
int scrolledLines() const
Returns the number of lines that the image has been scrolled up or down by, since the last call to re...
void clearSelection()
Clears the current selection.
bool getMode(int mode) const
Returns whether the specified screen mode is enabled or not .
void setLineProperty(LineProperty property, bool enable)
Sets or clears an attribute of the current line.
void setMode(int mode)
Sets (enables) the specified screen mode.
bool isSelected(const int column, const int line) const
Returns true if the character at (column, line) is part of the current selection.
void setDefaultRendition()
Resets the cursor's color back to the default and sets the character's rendition flags back to the de...
void setSelectionStart(const int column, const int line, const bool columnmode)
Sets the start of the selection.
QRect _lastScrolledRegion
void moveImage(int dest, int sourceBegin, int sourceEnd)
void resetScrolledLines()
Resets the count of the number of lines that the image has been scrolled up or down by,...
void scrollDown(int n)
Scroll the scrolling region of the screen down by n lines.
void scrollUp(int n)
Scroll the scrolling region of the screen up by n lines.
void effectiveRendition()
void NextLine()
Moves the cursor down one line and positions it at the beginning of the line.
void cursorRight(int n)
Move the cursor to the right by n columns.
void restoreMode(int mode)
Restores the state of a screen mode saved by calling saveMode()
int bottomMargin() const
Returns the bottom line of the scrolling region.
QVector< LineProperty > getLineProperties(int startLine, int endLine) const
Returns the additional attributes associated with lines in the image.
void resetRendition(int rendition)
Disables the given rendition flag.
void resetDroppedLines()
Resets the count of the number of lines dropped from the history.
const HistoryType & getScroll()
Returns the type of storage used to keep lines in the history.
void restoreCursor()
Restores the position and appearence of the cursor.
void setRendition(int rendition)
Enables the given rendition flag.
void setBackColor(int space, int color)
Sets the cursor's background color.
void ShowCharacter(unsigned short c)
Displays a new character at the current cursor position.
int droppedLines() const
Returns the number of lines of output which have been dropped from the history since the last call to...
void deleteLines(int n)
Removes n lines beginning from the current cursor position.
void resetMode(int mode)
Resets (clears) the specified screen mode.
QVarLengthArray< LineProperty, 64 > lineProperties
void index()
Move the cursor down one line.
void copyLineToStream(int line, int start, int count, TerminalCharacterDecoder *decoder, bool appendNewLine, bool preserveLineBreaks)
void reverseIndex()
Move the cursor up one line.
void clearToEndOfLine()
Clears from the current cursor position to the end of the line.
int getLines()
Return the number of lines.
void cursorLeft(int n)
Move the cursor to the left by n columns.
void setForeColor(int space, int color)
Sets the cursor's foreground color.
void insertLines(int n)
Inserts lines beginning from the current cursor position.
Base class for terminal character decoders.
F77_RET_T const F77_DBLE * x