#include "el.h"
#include <stack>
#include <set>
#include <string>
#include "TROOT.h"
#include "TInterpreter.h"
Go to the source code of this file.
Functions | |
void | setKeywordColors (const char *colorTab, const char *colorBracket, const char *colorBadBracket) |
int | selectColor (const char *str) |
void | highlightKeywords (EditLine_t *el) |
int | matchParentheses (EditLine_t *el) |
void | colorWord (EditLine_t *el, int first, int num, int color) |
void | colorBrackets (EditLine_t *el, int open, int close, int color) |
char ** | rl_complete2ROOT (const char *, int, int) |
void | setKeywordColors (int colorType, int colorBracket, int colorBadBracket) |
Variables | |
int | color_class = 4 |
int | color_type = 4 |
int | color_bracket = 2 |
int | color_badbracket = 1 |
void colorBrackets | ( | EditLine_t * | el, | |
int | open, | |||
int | close, | |||
int | color | |||
) |
Definition at line 246 of file enhance.cxx.
References ElColor_t::fBackColor, ElLine_t::fBufColor, ElColor_t::fForeColor, EditLine_t::fLine, term__repaint(), and term__setcolor().
void colorWord | ( | EditLine_t * | el, | |
int | first, | |||
int | num, | |||
int | textColor | |||
) |
Highlight a word within the buffer. Requires the start and end index of the word, and the color pair index (class or type). Writes colour info for each char in range to el->fLine.bufcol. Background colour is set to the same as the current terminal background colour. Foreground (text) colour is set according to the type of word being highlighted (e.g. class or type).
Definition at line 219 of file enhance.cxx.
References ElColor_t::fBackColor, ElLine_t::fBufColor, ElColor_t::fForeColor, EditLine_t::fLine, if(), term__repaint(), and term__setcolor().
Referenced by highlightKeywords().
void highlightKeywords | ( | EditLine_t * | el | ) |
Definition at line 58 of file enhance.cxx.
References color_class, color_type, colorWord(), ElLine_t::fBuffer, TCollection::FindObject(), ElLine_t::fLastChar, EditLine_t::fLine, TROOT::GetListOfTypes(), gInterpreter, gROOT, TString::Index(), kFALSE, TString::Length(), and TString::Tokenize().
Referenced by el_gets().
int matchParentheses | ( | EditLine_t * | el | ) |
if buffer has content, check each char to see if it is an opening bracket, if so, check for its closing one and return the indices to both alt: check each char for a match against each type of open and close bracket if open found, push index onto a seperate stack for each type of bracket if close found, pop previous value off relevant stack and pass both pointers to highlight()
Definition at line 99 of file enhance.cxx.
References c, color_badbracket, color_bracket, ElLine_t::fBufColor, ElLine_t::fBuffer, ElColor_t::fForeColor, ElLine_t::fLastChar, EditLine_t::fLine, i, and term__repaint().
Referenced by el_gets().
char** rl_complete2ROOT | ( | const char * | , | |
int | , | |||
int | ||||
) |
int selectColor | ( | const char * | str | ) |
void setKeywordColors | ( | int | colorType, | |
int | colorBracket, | |||
int | colorBadBracket | |||
) |
Sets the colours to use for highlighting keywords (types and classnames), matching bracket pairs, mismatched brackets and tab completion. Overrides the default colour settings: class and type: 4 (blue) bracket pair: 2 (green) bad bracket: 1 (red)
Definition at line 45 of file enhance.cxx.
References color_badbracket, color_bracket, color_class, and color_type.
void setKeywordColors | ( | const char * | colorTab, | |
const char * | colorBracket, | |||
const char * | colorBadBracket | |||
) |
Referenced by setColors().
int color_badbracket = 1 |
Definition at line 34 of file enhance.cxx.
Referenced by matchParentheses(), and setKeywordColors().
int color_bracket = 2 |
Definition at line 33 of file enhance.cxx.
Referenced by matchParentheses(), and setKeywordColors().
int color_class = 4 |
Definition at line 31 of file enhance.cxx.
Referenced by highlightKeywords(), and setKeywordColors().
int color_type = 4 |
Definition at line 32 of file enhance.cxx.
Referenced by highlightKeywords(), png2ASImage_int(), png_handle_IHDR(), png_init_read_transformations(), and setKeywordColors().