NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
GenericTerminal Class Referenceabstract

An implementation of a generic terminal, which has to be specialized in the child classes. More...

#include <gterm.hpp>

Inheritance diagram for GenericTerminal:
Collaboration diagram for GenericTerminal:

Public Types

enum  {
  BOLD =0x1 , BLINK =0x2 , UNDERLINE =0x4 , INVERSE =0x8 ,
  NOEOLWRAP =0x10 , CURSORAPPMODE =0x20 , CURSORRELATIVE =0x40 , NEWLINE =0x80 ,
  INSERT =0x100 , KEYAPPMODE =0x200 , DEFERUPDATE =0x400 , DESTRUCTBS =0x800 ,
  TEXTONLY =0x1000 , LOCALECHO =0x2000 , CURSORINVISIBLE =0x4000 , PC =0x8000 ,
  SELECTED =0x8000
}
 
enum  { RESETTAB =0x1 , RESETCURSOR =0x2 }
 

Public Member Functions

 GenericTerminal (int w, int h)
 Constructor. More...
 
virtual ~GenericTerminal ()
 Empty destructor. More...
 
NumeReSyntaxgetSyntax ()
 
NumeRe::CallTipProvidergetProvider ()
 
virtual void ProcessInput (int len, const std::string &sData)
 
virtual void ProcessOutput (int len, const std::string &sData)
 Processes output returned from the kernel and hands it over to the internal buffer. More...
 
virtual void ResizeTerminal (int _width, int _height)
 
int Width () const
 
int Height () const
 
virtual void Update ()
 Simple wrapper around update_changes() More...
 
virtual void Reset ()
 Simple wrapper around reset(). More...
 
bool Scroll (int numLines, bool scrollUp)
 
int GetScrollHeight ()
 
int GetScrollPosition ()
 Returns the current scroll position. More...
 
TextManagerGetTM ()
 Get a pointer to the internal text buffer. More...
 
void SetTerminalHistory (int size)
 Set the terminal buffer size (not the length of the input history). The length of the history (i.e. the terminal length) is determined by the width of the terminal and the number of calculated line breaks. More...
 
bool IsScrolledUp ()
 Determine, whether the terminal is scrolled up. More...
 
int GetMode () const
 
void SetMode (int mode)
 
void set_mode_flag (int flag)
 Sets a mode flag (only used to make the cursor invisble). More...
 
void clear_mode_flag (int flag)
 Clears a mode flag (mainly used to make the cursor visible again). More...
 
virtual void DrawText (int fg_color, int bg_color, int flags, int x, int y, const std::string &sText)=0
 
virtual void DrawCursor (int fg_color, int bg_color, int flags, int x, int y, unsigned char c)=0
 
virtual void Calltip (int x, int y, NumeRe::CallTip &_cTip)
 
virtual void CalltipCancel ()
 
virtual void ClearChars (int bg_color, int x, int y, int w, int h)
 
virtual void SendBack (int len, char *data)
 
virtual void SendBack (char *data)
 
virtual void ModeChange (int state)
 
virtual void Bell ()
 
virtual int IsSelected (int x, int y)
 
virtual void Select (int x, int y, int select)
 
virtual unsigned char GetChar (int x, int y)
 Gets the character at the selected location. More...
 
std::string get_selected_text ()
 Gets the selected text (if any). More...
 

Public Attributes

enum GenericTerminal:: { ... }  MODES
 

Protected Member Functions

void move_cursor_editable_area (int x, int y)
 Moves the cursor to a location, if this location is editable. More...
 
void update_changes ()
 
void normal_input ()
 
void normal_output ()
 This member function is for printing the kernel's output to the console. More...
 
void resetAutoComp (int mode)
 Reset the current autocompletion list and the corresponding variables. More...
 
std::string getProcNameSpace ()
 This member function evalutes the procedure signature and returns its namespace. Will only be called from GTerm::tab(). More...
 
void cr ()
 Insert a carriage return. More...
 
void lf ()
 Insert a line feed. More...
 
void ff ()
 Insert a form feed (not used). More...
 
void bell ()
 Perform a bell sound (not used). More...
 
void tab ()
 Evaluate the tab key (do not insert a tab character but try to autocomplete the current input). More...
 
bool bs ()
 Perform a backspace operation. More...
 
bool del ()
 Perform a delete key operation. More...
 
bool delSelected ()
 Delete a selected block. More...
 
void reset ()
 Resets the terminal, so that it starts with an empty buffer. More...
 
bool cursor_left ()
 Moves the cursor to the left. More...
 
bool cursor_down ()
 Either moves the cursor down or performs a history jump. More...
 
bool cursor_right ()
 Moves the cursor to the right. More...
 
bool cursor_up ()
 Either moves the cursor up or performs a history jump. More...
 
bool ctrl_left ()
 Moves the cursor one word to the left. More...
 
bool ctrl_right ()
 Moves the cursor one word to the right. More...
 
bool home ()
 Moves the cursor to the leftmost position in the current line. More...
 
bool end ()
 Moves the cursor to the rightmost position in the current line. More...
 
bool front ()
 Moves the cursor to the leftmost position in the whole input. More...
 
bool back ()
 Moves the cursor to the rightmost position in the whole input. More...
 
void erase_line ()
 Erases the current line in the internal buffer. More...
 
void erase_usercontent_line ()
 Erases alle user-written contents from the current line. More...
 

Protected Attributes

int doing_update
 
int nTabStartPos
 
int nCursorUpDownStartPos
 
std::string sAutoCompWordStart
 
std::string sAutoCompList
 
bool m_useSmartSense
 

Private Member Functions

void clear_area (int start_x, int start_y, int end_x, int end_y)
 
int calc_color (int fg, int bg, int flags)
 Returns the encoded color bitlist. More...
 
void move_cursor (int x, int y)
 
void handle_calltip (int x, int y)
 Check, whether a calltip is needed and select the corresponding text from the CallTipProvider. More...
 

Private Attributes

int width
 
int height
 
int scroll_top
 
int scroll_bot
 
TextManager tm
 
NumeRe::CallTipProvider m_tipProvider
 
ViewCursor termCursor
 
int fg_color
 
int bg_color
 
int mode_flags
 
int nparam
 
int param [30]
 
std::string sInput_Data
 
int data_len
 
NumeReSyntax _syntax
 

Detailed Description

An implementation of a generic terminal, which has to be specialized in the child classes.

Definition at line 41 of file gterm.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
BOLD 
BLINK 
UNDERLINE 
INVERSE 
NOEOLWRAP 
CURSORAPPMODE 
CURSORRELATIVE 
NEWLINE 
INSERT 
KEYAPPMODE 
DEFERUPDATE 
DESTRUCTBS 
TEXTONLY 
LOCALECHO 
CURSORINVISIBLE 
PC 
SELECTED 

Definition at line 45 of file gterm.hpp.

◆ anonymous enum

anonymous enum
Enumerator
RESETTAB 
RESETCURSOR 

Definition at line 69 of file gterm.hpp.

Constructor & Destructor Documentation

◆ GenericTerminal()

GenericTerminal::GenericTerminal ( int  w,
int  h 
)

Constructor.

Parameters
wint
hint

Definition at line 154 of file gterm.cpp.

References _syntax, doing_update, NumeReSyntax::loadSyntax(), MAXHEIGHT, MAXWIDTH, mode_flags, reset(), resetAutoComp(), RESETCURSOR, RESETTAB, termCursor, and tm.

Here is the call graph for this function:

◆ ~GenericTerminal()

GenericTerminal::~GenericTerminal ( )
virtual

Empty destructor.

Definition at line 177 of file gterm.cpp.

Member Function Documentation

◆ back()

bool GenericTerminal::back ( )
protected

Moves the cursor to the rightmost position in the whole input.

Returns
bool

Definition at line 748 of file actions.cpp.

References TextManager::IsEditableLogical(), move_cursor(), termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by end(), and erase_usercontent_line().

Here is the call graph for this function:

◆ bell()

void GenericTerminal::bell ( )
protected

Perform a bell sound (not used).

Returns
void

Definition at line 396 of file actions.cpp.

References Bell().

Here is the call graph for this function:

◆ Bell()

virtual void GenericTerminal::Bell ( )
inlinevirtual

Reimplemented in NumeReTerminal.

Definition at line 199 of file gterm.hpp.

Referenced by bell().

◆ bs()

bool GenericTerminal::bs ( )
protected

Perform a backspace operation.

Returns
bool

Definition at line 292 of file actions.cpp.

References TextManager::backspace(), TextManager::getCurrentViewPos(), handle_calltip(), TextManager::IsEditable(), termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), update_changes(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ calc_color()

int GenericTerminal::calc_color ( int  fg,
int  bg,
int  flags 
)
private

Returns the encoded color bitlist.

Parameters
fgint
bgint
flagsint
Returns
int

Definition at line 22 of file utils.cpp.

◆ Calltip()

virtual void GenericTerminal::Calltip ( int  x,
int  y,
NumeRe::CallTip _cTip 
)
inlinevirtual

Reimplemented in NumeReTerminal.

Definition at line 188 of file gterm.hpp.

Referenced by handle_calltip().

◆ CalltipCancel()

virtual void GenericTerminal::CalltipCancel ( )
inlinevirtual

Reimplemented in NumeReTerminal.

Definition at line 189 of file gterm.hpp.

Referenced by handle_calltip(), and ProcessOutput().

◆ clear_area()

void GenericTerminal::clear_area ( int  start_x,
int  start_y,
int  end_x,
int  end_y 
)
private

private clear_area Clears out a given area on the screen

Parameters
start_xint The starting x coordinate
start_yint The starting y coordinate
end_xint The ending x coordinate
end_yint The ending y coordinate
Returns
void
Author
Timothy Miller
Date
04-23-2004

Definition at line 117 of file utils.cpp.

References TextManager::clearRange(), and tm.

Referenced by ff(), reset(), and tab().

Here is the call graph for this function:

◆ clear_mode_flag()

void GenericTerminal::clear_mode_flag ( int  flag)

Clears a mode flag (mainly used to make the cursor visible again).

Parameters
flagint
Returns
void

Definition at line 336 of file utils.cpp.

References mode_flags, and ModeChange().

Referenced by NumeReTerminal::OnGainFocus(), and reset().

Here is the call graph for this function:

◆ ClearChars()

virtual void GenericTerminal::ClearChars ( int  bg_color,
int  x,
int  y,
int  w,
int  h 
)
inlinevirtual

Reimplemented in NumeReTerminal.

Definition at line 192 of file gterm.hpp.

Referenced by update_changes().

◆ cr()

void GenericTerminal::cr ( )
protected

Insert a carriage return.

Returns
void

Definition at line 179 of file actions.cpp.

References move_cursor(), termCursor, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ ctrl_left()

bool GenericTerminal::ctrl_left ( )
protected

Moves the cursor one word to the left.

Returns
bool

Definition at line 599 of file actions.cpp.

References TextManager::GetCharLogical(), handle_calltip(), TextManager::IsEditableLogical(), termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ ctrl_right()

bool GenericTerminal::ctrl_right ( )
protected

Moves the cursor one word to the right.

Returns
bool

Definition at line 637 of file actions.cpp.

References TextManager::GetCharLogical(), handle_calltip(), TextManager::IsEditableLogical(), termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ cursor_down()

bool GenericTerminal::cursor_down ( )
protected

Either moves the cursor down or performs a history jump.

Returns
bool

Definition at line 535 of file actions.cpp.

References data_len, erase_usercontent_line(), TextManager::getCurrentInputLine(), TextManager::GetInputHistory(), height, TextManager::IsEditable(), move_cursor(), nCursorUpDownStartPos, normal_input(), param, LogicalCursor::pos, sInput_Data, termCursor, tm, TextManager::toLogicalCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ cursor_left()

bool GenericTerminal::cursor_left ( )
protected

Moves the cursor to the left.

Returns
bool

Definition at line 432 of file actions.cpp.

References handle_calltip(), TextManager::IsEditableLogical(), termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ cursor_right()

bool GenericTerminal::cursor_right ( )
protected

Moves the cursor to the right.

Returns
bool

Definition at line 456 of file actions.cpp.

References handle_calltip(), TextManager::IsEditableLogical(), termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ cursor_up()

bool GenericTerminal::cursor_up ( )
protected

Either moves the cursor up or performs a history jump.

Returns
bool

Definition at line 480 of file actions.cpp.

References data_len, erase_usercontent_line(), TextManager::getCurrentInputLine(), TextManager::GetInputHistory(), TextManager::IsEditable(), move_cursor(), nCursorUpDownStartPos, normal_input(), param, LogicalCursor::pos, sInput_Data, termCursor, tm, TextManager::toLogicalCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ del()

bool GenericTerminal::del ( )
protected

Perform a delete key operation.

Returns
bool

Definition at line 329 of file actions.cpp.

References TextManager::backspace(), handle_calltip(), TextManager::IsEditable(), termCursor, tm, TextManager::toLogicalCursor(), update_changes(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ delSelected()

bool GenericTerminal::delSelected ( )
protected

Delete a selected block.

Returns
bool

Definition at line 360 of file actions.cpp.

References TextManager::clearRange(), TextManager::getCurrentLogicalPos(), handle_calltip(), TextManager::IsEditable(), TextManager::IsEditableLogical(), TextManager::isSelected(), TextManager::isSelectedLogical(), LogicalCursor::pos, termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), update_changes(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::cutText(), NumeReTerminal::OnChar(), and NumeReTerminal::ProcessInput().

Here is the call graph for this function:

◆ DrawCursor()

virtual void GenericTerminal::DrawCursor ( int  fg_color,
int  bg_color,
int  flags,
int  x,
int  y,
unsigned char  c 
)
pure virtual

Implemented in NumeReTerminal.

Referenced by update_changes().

◆ DrawText()

virtual void GenericTerminal::DrawText ( int  fg_color,
int  bg_color,
int  flags,
int  x,
int  y,
const std::string &  sText 
)
pure virtual

Implemented in NumeReTerminal.

Referenced by update_changes().

◆ end()

bool GenericTerminal::end ( )
protected

Moves the cursor to the rightmost position in the current line.

Returns
bool

Definition at line 692 of file actions.cpp.

References back(), TextManager::IsEditable(), move_cursor(), termCursor, tm, ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ erase_line()

void GenericTerminal::erase_line ( )
protected

Erases the current line in the internal buffer.

Returns
void

Definition at line 779 of file actions.cpp.

References TextManager::eraseLine(), and tm.

Referenced by NumeReTerminal::EndKernelTask(), and NumeReTerminal::pass_command().

Here is the call graph for this function:

◆ erase_usercontent_line()

void GenericTerminal::erase_usercontent_line ( )
protected

Erases alle user-written contents from the current line.

Returns
void

Definition at line 792 of file actions.cpp.

References back(), TextManager::backspace(), TextManager::getCurrentViewPos(), handle_calltip(), TextManager::IsEditable(), TextManager::IsEditableLogical(), LogicalCursor::pos, termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by cursor_down(), cursor_up(), and NumeReTerminal::OnKeyDown().

Here is the call graph for this function:

◆ ff()

void GenericTerminal::ff ( )
protected

Insert a form feed (not used).

Returns
void

Definition at line 208 of file actions.cpp.

References clear_area(), move_cursor(), scroll_bot, scroll_top, and width.

Here is the call graph for this function:

◆ front()

bool GenericTerminal::front ( )
protected

Moves the cursor to the leftmost position in the whole input.

Returns
bool

Definition at line 717 of file actions.cpp.

References TextManager::IsEditableLogical(), move_cursor(), termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by home().

Here is the call graph for this function:

◆ get_selected_text()

std::string GenericTerminal::get_selected_text ( )

Gets the selected text (if any).

Returns
std::string

Definition at line 248 of file gterm.cpp.

References TextManager::getSelectedText(), and tm.

Referenced by NumeReTerminal::GetSelection().

Here is the call graph for this function:

◆ GetChar()

unsigned char GenericTerminal::GetChar ( int  x,
int  y 
)
virtual

Gets the character at the selected location.

Parameters
xint
yint
Returns
unsigned char

Definition at line 233 of file gterm.cpp.

References TextManager::GetCharAdjusted(), Height(), tm, and Width().

Here is the call graph for this function:

◆ GetMode()

int GenericTerminal::GetMode ( ) const
inline

Definition at line 171 of file gterm.hpp.

References mode_flags.

Referenced by NumeReTerminal::OnChar(), NumeReTerminal::OnKeyDown(), and NumeReTerminal::OnTimer().

◆ getProcNameSpace()

std::string GenericTerminal::getProcNameSpace ( )
protected

This member function evalutes the procedure signature and returns its namespace. Will only be called from GTerm::tab().

Returns
std::string

Definition at line 148 of file actions.cpp.

References TextManager::GetCharAdjusted(), TextManager::GetColorAdjusted(), TextManager::GetTextRange(), nTabStartPos, sAutoCompWordStart, NumeReSyntax::SYNTAX_PROCEDURE, termCursor, tm, toLowerCase(), and ViewCursor::y.

Referenced by tab().

Here is the call graph for this function:

◆ getProvider()

NumeRe::CallTipProvider * GenericTerminal::getProvider ( )
inline

Definition at line 146 of file gterm.hpp.

References m_tipProvider.

Referenced by NumeReEditor::HandleFunctionCallTip(), and NumeReEditor::OnMouseDwell().

◆ GetScrollHeight()

int GenericTerminal::GetScrollHeight ( )

public GetScrollHeight Calculates and returns a value used to determine what the size of the scrollbar thumb should be

Returns
int The number of lines received, capped at MAXHEIGHT
Author
Mark Erikson
Date
04-22-2004

Definition at line 312 of file gterm.cpp.

References TextManager::GetLinesReceived(), TextManager::GetMaxSize(), and tm.

Referenced by wxTermContainer::OnUpdateUI(), and wxTermContainer::updateThumbPosition().

Here is the call graph for this function:

◆ GetScrollPosition()

int GenericTerminal::GetScrollPosition ( )

Returns the current scroll position.

Returns
int

Definition at line 331 of file gterm.cpp.

References TextManager::GetNumLinesScrolled(), and tm.

Referenced by wxTermContainer::OnUpdateUI(), and wxTermContainer::updateThumbPosition().

Here is the call graph for this function:

◆ getSyntax()

◆ GetTM()

TextManager * GenericTerminal::GetTM ( )

Get a pointer to the internal text buffer.

Returns
TextManager*

Definition at line 261 of file gterm.cpp.

References tm.

Referenced by NumeReTerminal::ClearSelection(), NumeReTerminal::clearTerminal(), NumeReTerminal::filterKeyCodes(), NumeReTerminal::MarkSelection(), NumeReTerminal::OnThreadUpdate(), and NumeReTerminal::scrollToInput().

◆ handle_calltip()

◆ Height()

◆ home()

bool GenericTerminal::home ( )
protected

Moves the cursor to the leftmost position in the current line.

Returns
bool

Definition at line 667 of file actions.cpp.

References front(), TextManager::IsEditable(), move_cursor(), termCursor, tm, ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ IsScrolledUp()

bool GenericTerminal::IsScrolledUp ( )

Determine, whether the terminal is scrolled up.

Returns
bool

Definition at line 298 of file gterm.cpp.

References TextManager::GetNumLinesScrolled(), and tm.

Referenced by NumeReTerminal::DoDrawCursor(), handle_calltip(), ResizeTerminal(), and NumeReTerminal::scrollToInput().

Here is the call graph for this function:

◆ IsSelected()

int GenericTerminal::IsSelected ( int  x,
int  y 
)
virtual

public virtual IsSelected Checks if a given character is selected

Parameters
xint The x coordinate of the character to check
yint The y coordinate of the character to check
Returns
int Greater than zero if the character is selected
Author
Timothy Miller
Date
04-22-2004

Definition at line 194 of file gterm.cpp.

References Height(), TextManager::isSelected(), tm, and Width().

Here is the call graph for this function:

◆ lf()

void GenericTerminal::lf ( )
protected

Insert a line feed.

Returns
void

Definition at line 191 of file actions.cpp.

References move_cursor(), TextManager::newLine(), scroll_bot, termCursor, tm, ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ ModeChange()

virtual void GenericTerminal::ModeChange ( int  state)
inlinevirtual

Reimplemented in NumeReTerminal.

Definition at line 198 of file gterm.hpp.

Referenced by clear_mode_flag(), NumeReTerminal::ModeChange(), and set_mode_flag().

◆ move_cursor()

void GenericTerminal::move_cursor ( int  x,
int  y 
)
private

private move_cursor Moves the cursor to a new location

Parameters
xint The new x coordinate
yint The new y coordinate
Returns
void
Author
Timothy Miller
Date
04-23-2004

Definition at line 134 of file utils.cpp.

References TextManager::getCurrentViewPos(), handle_calltip(), ViewCursor::move(), termCursor, tm, TextManager::toLogicalCursor(), width, ViewCursor::x, and ViewCursor::y.

Referenced by back(), cr(), cursor_down(), cursor_up(), end(), ff(), front(), home(), lf(), move_cursor_editable_area(), reset(), and tab().

Here is the call graph for this function:

◆ move_cursor_editable_area()

void GenericTerminal::move_cursor_editable_area ( int  x,
int  y 
)
protected

Moves the cursor to a location, if this location is editable.

Parameters
xint
yint
Returns
void

Definition at line 305 of file utils.cpp.

References TextManager::IsEditable(), move_cursor(), and tm.

Referenced by NumeReTerminal::OnLeftUp().

Here is the call graph for this function:

◆ normal_input()

void GenericTerminal::normal_input ( )
protected

private normal_input Handles most of the input stuff for the GenericTerminal

Returns
void
Author
Timothy Miller
Date
04-22-2004

Definition at line 21 of file actions.cpp.

References TextManager::getCurrentLogicalPos(), TextManager::getCurrentViewPos(), handle_calltip(), TextManager::insertInput(), LogicalCursor::pos, sInput_Data, termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), ViewCursor::x, and ViewCursor::y.

Referenced by cursor_down(), cursor_up(), ProcessInput(), and tab().

Here is the call graph for this function:

◆ normal_output()

void GenericTerminal::normal_output ( )
protected

This member function is for printing the kernel's output to the console.

Returns
void

Definition at line 59 of file actions.cpp.

References TextManager::eraseLine(), TextManager::getCurrentViewPos(), TextManager::newLine(), TextManager::printOutput(), sInput_Data, TextManager::tab(), termCursor, and tm.

Referenced by ProcessOutput().

Here is the call graph for this function:

◆ ProcessInput()

void GenericTerminal::ProcessInput ( int  len,
const std::string &  sData 
)
virtual

public virtual ProcessInput Processes the input of the GenericTerminal and hands it over to the internal buffer

Parameters
lenint The number of characters to process.
dataunsigned char * The text to process.
Returns
void
Author
Timothy Miller
Date
04-22-2004

Reimplemented in NumeReTerminal.

Definition at line 36 of file gterm.cpp.

References data_len, DESTRUCTBS, INSERT, mode_flags, normal_input(), sInput_Data, and update_changes().

Referenced by NumeReTerminal::OnChar(), and NumeReTerminal::ProcessInput().

Here is the call graph for this function:

◆ ProcessOutput()

void GenericTerminal::ProcessOutput ( int  len,
const std::string &  sData 
)
virtual

Processes output returned from the kernel and hands it over to the internal buffer.

Parameters
lenint
sDataconst string&
Returns
void

Reimplemented in NumeReTerminal.

Definition at line 63 of file gterm.cpp.

References CalltipCancel(), data_len, normal_output(), sInput_Data, and update_changes().

Referenced by NumeReTerminal::ProcessOutput().

Here is the call graph for this function:

◆ reset()

void GenericTerminal::reset ( )
protected

Resets the terminal, so that it starts with an empty buffer.

Returns
void

Definition at line 409 of file actions.cpp.

References bg_color, BLINK, clear_area(), clear_mode_flag(), CURSORAPPMODE, CURSORINVISIBLE, CURSORRELATIVE, fg_color, height, INSERT, KEYAPPMODE, move_cursor(), NEWLINE, NOEOLWRAP, TextManager::Reset(), scroll_bot, scroll_top, tm, UNDERLINE, and width.

Referenced by GenericTerminal(), and Reset().

Here is the call graph for this function:

◆ Reset()

void GenericTerminal::Reset ( )
virtual

Simple wrapper around reset().

Returns
void

Definition at line 83 of file gterm.cpp.

References reset().

Here is the call graph for this function:

◆ resetAutoComp()

void GenericTerminal::resetAutoComp ( int  mode)
protected

Reset the current autocompletion list and the corresponding variables.

Returns
void

Definition at line 120 of file actions.cpp.

References nCursorUpDownStartPos, nTabStartPos, RESETCURSOR, RESETTAB, TextManager::ResetVirtualCursorLine(), sAutoCompList, sAutoCompWordStart, and tm.

Referenced by NumeReTerminal::filterKeyCodes(), GenericTerminal(), NumeReTerminal::OnChar(), NumeReTerminal::OnKeyDown(), and tab().

Here is the call graph for this function:

◆ ResizeTerminal()

void GenericTerminal::ResizeTerminal ( int  _width,
int  _height 
)
virtual

public virtual ResizeTerminal Resizes the terminal's display. This ONLY changes what's being displayed, and does NOT change the size as far as the server is concerned!

Parameters
_widthint The new width, in characters
_heightint The new height, in characters
Returns
void
Author
Timothy Miller
Date
04-22-2004

Reimplemented in NumeReTerminal.

Definition at line 101 of file gterm.cpp.

References TextManager::getCurrentViewPos(), height, IsScrolledUp(), LogicalCursor::line, LogicalCursor::pos, TextManager::Resize(), scroll_bot, scroll_top, termCursor, tm, TextManager::toLogicalCursor(), TextManager::toViewCursor(), update_changes(), and width.

Referenced by NumeReTerminal::ResizeTerminal().

Here is the call graph for this function:

◆ Scroll()

bool GenericTerminal::Scroll ( int  numLines,
bool  scrollUp 
)

public Scroll Scrolls the terminal a given number of lines

Parameters
numLinesint How many lines to scroll
scrollUpbool True to scroll up, false to scroll down
Returns
void
Author
Mark Erikson
Date
04-25-2004

Definition at line 278 of file gterm.cpp.

References handle_calltip(), TextManager::Scroll(), termCursor, tm, update_changes(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::ScrollTerminal(), and NumeReTerminal::scrollToInput().

Here is the call graph for this function:

◆ Select()

void GenericTerminal::Select ( int  x,
int  y,
int  select 
)
virtual

public virtual Select Selects a given character

Parameters
xint The x coordinate of the character
yint The y coordinate of the character
selectint Effectively a boolean
Returns
void
Author
Timothy Miller
Date
04-22-2004

Definition at line 215 of file gterm.cpp.

References Height(), TextManager::selectText(), tm, and Width().

Referenced by NumeReTerminal::MarkSelection().

Here is the call graph for this function:

◆ SendBack() [1/2]

virtual void GenericTerminal::SendBack ( char *  data)
inlinevirtual

Definition at line 194 of file gterm.hpp.

References SendBack().

Here is the call graph for this function:

◆ SendBack() [2/2]

virtual void GenericTerminal::SendBack ( int  len,
char *  data 
)
inlinevirtual

Definition at line 193 of file gterm.hpp.

Referenced by SendBack().

◆ set_mode_flag()

void GenericTerminal::set_mode_flag ( int  flag)

Sets a mode flag (only used to make the cursor invisble).

Parameters
flagint
Returns
void

Definition at line 320 of file utils.cpp.

References mode_flags, and ModeChange().

Referenced by NumeReWindow::NumeReWindow(), and NumeReTerminal::OnLoseFocus().

Here is the call graph for this function:

◆ SetMode()

void GenericTerminal::SetMode ( int  mode)
inline

Definition at line 175 of file gterm.hpp.

References mode_flags.

◆ SetTerminalHistory()

void GenericTerminal::SetTerminalHistory ( int  size)

Set the terminal buffer size (not the length of the input history). The length of the history (i.e. the terminal length) is determined by the width of the terminal and the number of calculated line breaks.

Parameters
sizeint
Returns
void

Definition at line 348 of file gterm.cpp.

References TextManager::SetMaxSize(), and tm.

Referenced by wxTermContainer::SetTerminalHistory().

Here is the call graph for this function:

◆ tab()

void GenericTerminal::tab ( )
protected

Evaluate the tab key (do not insert a tab character but try to autocomplete the current input).

Returns
void

Definition at line 224 of file actions.cpp.

References _syntax, clear_area(), data_len, NumeReSyntax::getAutoCompList(), TextManager::GetCharAdjusted(), TextManager::GetColorAdjusted(), NumeReSyntax::getProcAutoCompList(), getProcNameSpace(), TextManager::GetWordStartAt(), m_useSmartSense, move_cursor(), normal_input(), nTabStartPos, resetAutoComp(), RESETCURSOR, RESETTAB, sAutoCompList, sAutoCompWordStart, sInput_Data, NumeReSyntax::SYNTAX_PROCEDURE, termCursor, tm, toLowerCase(), ViewCursor::x, and ViewCursor::y.

Referenced by NumeReTerminal::filterKeyCodes().

Here is the call graph for this function:

◆ Update()

void GenericTerminal::Update ( )
virtual

Simple wrapper around update_changes()

Returns
void

Definition at line 19 of file gterm.cpp.

References update_changes().

Referenced by NumeReTerminal::OnGainFocus(), NumeReTerminal::OnLoseFocus(), and NumeReTerminal::scrollToInput().

Here is the call graph for this function:

◆ update_changes()

void GenericTerminal::update_changes ( )
protected

private update_changes The main update function. Is responsible for preparing the text, which shall be printed on screen

Returns
void
Author
Timothy Miller
Date
04-23-2004

Definition at line 37 of file utils.cpp.

References bg_color, ClearChars(), CURSORINVISIBLE, doing_update, DrawCursor(), DrawText(), TextManager::GetCharAdjusted(), TextManager::GetColorAdjusted(), TextManager::getRenderedColors(), TextManager::getRenderedString(), height, mode_flags, termCursor, tm, width, ViewCursor::x, and ViewCursor::y.

Referenced by bs(), del(), delSelected(), NumeReTerminal::OnPaint(), ProcessInput(), ProcessOutput(), ResizeTerminal(), Scroll(), Update(), and NumeReTerminal::UpdateColors().

Here is the call graph for this function:

◆ Width()

int GenericTerminal::Width ( ) const
inline

Definition at line 152 of file gterm.hpp.

References width.

Referenced by GetChar(), IsSelected(), NumeReTerminal::MarkSelection(), NumeReTerminal::OnMouseMove(), and Select().

Member Data Documentation

◆ _syntax

NumeReSyntax GenericTerminal::_syntax
private

Definition at line 99 of file gterm.hpp.

Referenced by GenericTerminal(), getSyntax(), and tab().

◆ bg_color

int GenericTerminal::bg_color
private

◆ data_len

int GenericTerminal::data_len
private

Definition at line 98 of file gterm.hpp.

Referenced by cursor_down(), cursor_up(), ProcessInput(), ProcessOutput(), and tab().

◆ doing_update

int GenericTerminal::doing_update
protected

Definition at line 103 of file gterm.hpp.

Referenced by GenericTerminal(), and update_changes().

◆ fg_color

int GenericTerminal::fg_color
private

◆ height

int GenericTerminal::height
private

◆ m_tipProvider

NumeRe::CallTipProvider GenericTerminal::m_tipProvider
private

Definition at line 82 of file gterm.hpp.

Referenced by getProvider(), and handle_calltip().

◆ m_useSmartSense

bool GenericTerminal::m_useSmartSense
protected

Definition at line 117 of file gterm.hpp.

Referenced by NumeReTerminal::setKernelSettings(), and tab().

◆ mode_flags

int GenericTerminal::mode_flags
private

◆ 

enum { ... } GenericTerminal::MODES

◆ nCursorUpDownStartPos

int GenericTerminal::nCursorUpDownStartPos
protected

Definition at line 112 of file gterm.hpp.

Referenced by cursor_down(), cursor_up(), and resetAutoComp().

◆ nparam

int GenericTerminal::nparam
private

Definition at line 96 of file gterm.hpp.

◆ nTabStartPos

int GenericTerminal::nTabStartPos
protected

Definition at line 111 of file gterm.hpp.

Referenced by getProcNameSpace(), resetAutoComp(), and tab().

◆ param

int GenericTerminal::param[30]
private

Definition at line 96 of file gterm.hpp.

Referenced by cursor_down(), and cursor_up().

◆ sAutoCompList

std::string GenericTerminal::sAutoCompList
protected

Definition at line 114 of file gterm.hpp.

Referenced by resetAutoComp(), and tab().

◆ sAutoCompWordStart

std::string GenericTerminal::sAutoCompWordStart
protected

Definition at line 113 of file gterm.hpp.

Referenced by getProcNameSpace(), resetAutoComp(), and tab().

◆ scroll_bot

int GenericTerminal::scroll_bot
private

Definition at line 77 of file gterm.hpp.

Referenced by ff(), lf(), reset(), and ResizeTerminal().

◆ scroll_top

int GenericTerminal::scroll_top
private

Definition at line 77 of file gterm.hpp.

Referenced by ff(), reset(), and ResizeTerminal().

◆ sInput_Data

std::string GenericTerminal::sInput_Data
private

◆ termCursor

◆ tm

◆ width

int GenericTerminal::width
private

The documentation for this class was generated from the following files: