4#include "../../kernel/core/ui/language.hpp"
5#include "../../kernel/core/utils/tools.hpp"
24 return (flags & 15) | (fg << 4) | (bg << 8);
46 wxLogDebug(
"Updating Terminal");
52 for (
int i = 0; i <
height; i++)
62 for (
size_t j = 1; j < line.length(); j++)
64 if (colors[j] != colors[j - 1])
66 string sSubstr = line.substr(lastPos, j - lastPos);
68 DrawText((c >> 4) & 0xf, (c >> 8) & 0xf, c, lastPos, i, sSubstr);
76 string sSubstr = line.substr(lastPos);
78 DrawText((c >> 4) & 0xf, (c >> 8) & 0xf, c, lastPos, i, sSubstr);
207 if ((
int)vColors.size() <= x || x < 0)
219 bool isInParens =
false;
251 while (posStart > 0 && vColors[posStart-1] == vColors[x])
254 while (posEnd < vColors.size() && vColors[posEnd] == vColors[x])
257 std::string sSyntaxElement = sLine.substr(posStart, posEnd - posStart);
261 switch ((vColors[x] >> 4) & 0xf)
void clear_mode_flag(int flag)
Clears a mode flag (mainly used to make the cursor visible again).
int calc_color(int fg, int bg, int flags)
Returns the encoded color bitlist.
virtual void ClearChars(int bg_color, int x, int y, int w, int h)
void set_mode_flag(int flag)
Sets a mode flag (only used to make the cursor invisble).
virtual void CalltipCancel()
void move_cursor(int x, int y)
virtual void ModeChange(int state)
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)
NumeRe::CallTipProvider m_tipProvider
void handle_calltip(int x, int y)
Check, whether a calltip is needed and select the corresponding text from the CallTipProvider.
void clear_area(int start_x, int start_y, int end_x, int end_y)
void move_cursor_editable_area(int x, int y)
Moves the cursor to a location, if this location is editable.
bool IsScrolledUp()
Determine, whether the terminal is scrolled up.
virtual void DrawText(int fg_color, int bg_color, int flags, int x, int y, const std::string &sText)=0
This class handles the internal language system and returns the language strings of the selected lang...
CallTip getProcedure(std::string sToken) const
Get the calltip for the selected (global) procedure.
CallTip getOption(std::string sToken) const
Get the calltip for the selected option.
CallTip getConstant(std::string sToken) const
Get the calltip for the selected constant.
CallTip getMethod(std::string sToken) const
Get the calltip for the selected method.
CallTip getFunction(std::string sToken) const
Get the calltip for the selected (built-in) function.
CallTip getCommand(std::string sToken) const
Get the calltip for the selected command.
This class is the immutable (const) version of a string view. It can be constructed from a MutableStr...
bool clearRange(const ViewCursor &cursor1, const ViewCursor &cursor2)
Clears the range between two view cursors.
unsigned short GetColorAdjusted(int y, int x) const
std::string getRenderedString(size_t viewLine) const
Return the rendered line for the current viewport setting.
std::vector< unsigned short > getRenderedColors(size_t viewLine) const
Return the rendered colors for the selected viewport line.
char GetCharAdjusted(int y, int x) const
ViewCursor getCurrentViewPos() const
Returns the current cursor position as view cursor.
bool IsEditable(int y, int x) const
Determines, whether the character at (x,y) is editable text.
LogicalCursor toLogicalCursor(const ViewCursor &viewCursor) const
Convert a view cursor into a logical cursor.
unsigned int getMatchingParenthesis(const StringView &)
Returns the position of the closing parenthesis.
This structure contains the data for a single calltip, which might be shown in the editor or the term...
Cursor, which is used in the terminal. The TextManager is able to convert this cursor into a LogicalC...
void move(size_t _x, size_t _y)
static bool hasContextToolTip(short int c, bool inParens)
Returns true, if a color corresponds to a syntax element, which has a (context, e....
static bool hasNonContextToolTip(short int c)
Returns true, if a color corresponds to a syntax element, which doesn't have a (context,...