5#pragma implementation "gterm.hpp"
9#include <wx/stdpaths.h>
11#include <wx/filename.h>
114 wxLogDebug(
"Resizing terminal: _width = %d, _height = %d", _width, _height);
121 if (cursor && (cursor.
pos || cursor.
line))
162 wxFileName f(wxStandardPaths::Get().GetExecutablePath());
163 _syntax.
loadSyntax(f.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR).ToStdString());
196 if (x >= 0 && x <
Width() && y >= 0 && y <
Height())
217 if (x >= 0 && x <
Width() && y >= 0 && y <
Height())
235 if (x >= 0 && x <
Width() && y >= 0 && y <
Height())
318 if (scrollHeight > maxSize)
319 scrollHeight = maxSize;
TextManager * GetTM()
Get a pointer to the internal text buffer.
virtual ~GenericTerminal()
Empty destructor.
bool Scroll(int numLines, bool scrollUp)
virtual void Reset()
Simple wrapper around reset().
virtual void ProcessInput(int len, const std::string &sData)
std::string get_selected_text()
Gets the selected text (if any).
virtual unsigned char GetChar(int x, int y)
Gets the character at the selected location.
virtual void Update()
Simple wrapper around update_changes()
virtual void CalltipCancel()
virtual void ProcessOutput(int len, const std::string &sData)
Processes output returned from the kernel and hands it over to the internal buffer.
void resetAutoComp(int mode)
Reset the current autocompletion list and the corresponding variables.
virtual void Select(int x, int y, int select)
GenericTerminal(int w, int h)
Constructor.
virtual void ResizeTerminal(int _width, int _height)
void SetTerminalHistory(int size)
Set the terminal buffer size (not the length of the input history). The length of the history (i....
int GetScrollPosition()
Returns the current scroll position.
void handle_calltip(int x, int y)
Check, whether a calltip is needed and select the corresponding text from the CallTipProvider.
void reset()
Resets the terminal, so that it starts with an empty buffer.
virtual int IsSelected(int x, int y)
bool IsScrolledUp()
Determine, whether the terminal is scrolled up.
void normal_output()
This member function is for printing the kernel's output to the console.
void loadSyntax(const std::string &_sPath="")
Member function for loading the syntax element definitions.
This class manages the actual text by storing it in an internal buffer. During an update the TextMana...
std::string getSelectedText() const
This member function returns the selected text.
bool Scroll(int numLines, bool scrollUp)
ViewCursor toViewCursor(const LogicalCursor &logCursor) const
Convert a logical cursor to a view cursor.
void Resize(int width, int height)
char GetCharAdjusted(int y, int x) const
void selectText(const ViewCursor &viewCursor, bool bSelect=true)
Selects the text at the view cursor position.
void SetMaxSize(int newSize)
ViewCursor getCurrentViewPos() const
Returns the current cursor position as view cursor.
bool isSelected(const ViewCursor &viewCursor) const
Determines, whether the pointed character is selected.
LogicalCursor toLogicalCursor(const ViewCursor &viewCursor) const
Convert a view cursor into a logical cursor.
int GetLinesReceived() const
int GetNumLinesScrolled() const
int GetMaxSize() const
Returns the buffer size of the terminal.
Cursor, which is used in the TextManager to identify the actual line and position in the m_text varia...
Cursor, which is used in the terminal. The TextManager is able to convert this cursor into a LogicalC...