Screen::Screen(int l, int c) : lines(l), columns(c), screenLines(new ImageLine[lines+1] ), _scrolledLines(0), _droppedLines(0), hist(new HistoryScrollNone()), cuX(0), cuY(0), cu_re(0), tmargin(0), bmargin(0), tabstops(0), sel_begin(0), sel_TL(0), sel_BR(0), sel_busy(false), columnmode(false), ef_fg(CharacterColor()), ef_bg(CharacterColor()), ef_re(0), sa_cuX(0), sa_cuY(0), sa_cu_re(0), lastPos(-1) { lineProperties.resize(lines+1); for (int i=0;i<lines+1;i++) lineProperties[i]=LINE_DEFAULT; initTabStops(); clearSelection(); reset(); }
void Screen::setBackColor(int space, int color) { currentBackground = CharacterColor(space, color); if ( currentBackground.isValid() ) updateEffectiveRendition(); else setBackColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR); }
void Screen::setBackColor(int space, int color) { cu_bg = CharacterColor(space, color); if ( cu_bg.isValid() ) effectiveRendition(); else setBackColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR); }
void Screen::setForeColor(int space, int color) { cu_fg = CharacterColor(space, color); if ( cu_fg.isValid() ) effectiveRendition(); else setForeColor(COLOR_SPACE_DEFAULT,DEFAULT_FORE_COLOR); }
Screen::Screen(int l, int c) : lines(l), columns(c), screenLines(new ImageLine[lines+1] ), _scrolledLines(0), _droppedLines(0), history(new HistoryScrollNone()), cuX(0), cuY(0), currentRendition(0), _topMargin(0), _bottomMargin(0), selBegin(0), selTopLeft(0), selBottomRight(0), blockSelectionMode(false), effectiveForeground(CharacterColor()), effectiveBackground(CharacterColor()), effectiveRendition(0), lastPos(-1) { lineProperties.resize(lines+1); for (int i=0;i<lines+1;i++) lineProperties[i]=LINE_DEFAULT; initTabStops(); clearSelection(); reset(); }
//Macro to convert x,y position on screen to position within an image. // //Originally the image was stored as one large contiguous block of //memory, so a position within the image could be represented as an //offset from the beginning of the block. For efficiency reasons this //is no longer the case. //Many internal parts of this class still use this representation for parameters and so on, //notably moveImage() and clearImage(). //This macro converts from an X,Y position into an image offset. #ifndef loc #define loc(X,Y) ((Y)*columns+(X)) #endif Character Screen::defaultChar = Character(' ', CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_FORE_COLOR), CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR), DEFAULT_RENDITION); //#define REVERSE_WRAPPED_LINES // for wrapped line debug Screen::Screen(int l, int c) : lines(l), columns(c), screenLines(new ImageLine[lines+1] ), _scrolledLines(0), _droppedLines(0), history(new HistoryScrollNone()), cuX(0), cuY(0), currentRendition(0), _topMargin(0), _bottomMargin(0),