28#include <FL/Fl_Scrollbar.H>
29#include <FL/Fl_Rect.H>
405 class FL_EXPORT Margin {
406 int left_, right_, top_, bottom_;
408 Margin(
void) { left_ = right_ = top_ = bottom_ = 3; }
409 int left(
void)
const {
return left_; }
410 int right(
void)
const {
return right_; }
411 int top(
void)
const {
return top_; }
412 int bottom(
void)
const {
return bottom_; }
413 void left(
int val) { left_ = val; }
414 void right(
int val) { right_ = val; }
415 void top(
int val) { top_ = val; }
416 void bottom(
int val) { bottom_ = val; }
425 class FL_EXPORT CharStyle {
438 CharStyle(
bool fontsize_defer);
439 uchar attrib(
void)
const {
return attrib_; }
440 uchar charflags(
void)
const {
return charflags_; }
448 Fl_Color defaultfgcolor(
void)
const {
return defaultfgcolor_; }
449 Fl_Color defaultbgcolor(
void)
const {
return defaultbgcolor_; }
450 Fl_Font fontface(
void)
const {
return fontface_; }
451 Fl_Fontsize fontsize(
void)
const {
return fontsize_; }
452 int fontheight(
void)
const {
return fontheight_; }
453 int fontdescent(
void)
const {
return fontdescent_; }
454 int charwidth(
void)
const {
return charwidth_; }
456 void attrib(
uchar val) { attrib_ = val; }
457 void charflags(
uchar val) { charflags_ = val; }
458 void set_charflag(
uchar val) { charflags_ |= val; }
459 void clr_charflag(
uchar val) { charflags_ &= ~val; }
461 void fgcolor(
int r,
int g,
int b) { fgcolor_ = (r<<24) | (g<<16) | (b<<8); clr_charflag(
FG_XTERM); }
462 void bgcolor(
int r,
int g,
int b) { bgcolor_ = (r<<24) | (g<<16) | (b<<8); clr_charflag(
BG_XTERM); }
466 void fgcolor_xterm(
Fl_Color val) { fgcolor_ = val; set_charflag(
FG_XTERM); }
467 void bgcolor_xterm(
Fl_Color val) { bgcolor_ = val; set_charflag(
BG_XTERM); }
468 void fgcolor_xterm(
uchar val);
469 void bgcolor_xterm(
uchar val);
471 void defaultfgcolor(
Fl_Color val) { defaultfgcolor_ = val; }
472 void defaultbgcolor(
Fl_Color val) { defaultbgcolor_ = val; }
473 void fontface(
Fl_Font val) { fontface_ = val; update(); }
474 void fontsize(
Fl_Fontsize val) { fontsize_ = val; update(); }
476 void update_fake(
void);
478 void sgr_reset(
void) {
480 if (charflags() &
FG_XTERM) fgcolor_xterm(defaultfgcolor_);
481 else fgcolor(defaultfgcolor_);
482 if (charflags() &
BG_XTERM) bgcolor_xterm(defaultbgcolor_);
483 else bgcolor(defaultbgcolor_);
485 int onoff(
bool flag,
Attrib a) {
return (flag ? (attrib_ | a) : (attrib_ & ~a)); }
491 void sgr_blink(
bool val) { (void)val; }
501 class FL_EXPORT Cursor {
512 fgcolor_ = 0xfffff000;
513 bgcolor_ = 0x00d00000;
515 int col(
void)
const {
return col_; }
516 int row(
void)
const {
return row_; }
517 int h(
void)
const {
return h_; }
518 Fl_Color fgcolor(
void)
const {
return fgcolor_; }
519 Fl_Color bgcolor(
void)
const {
return bgcolor_; }
520 void col(
int val) { col_ = val >= 0 ? val : 0; }
521 void row(
int val) { row_ = val >= 0 ? val : 0; }
522 void h(
int val) { h_ = val; }
523 void fgcolor(
Fl_Color val) { fgcolor_ = val; }
524 void bgcolor(
Fl_Color val) { bgcolor_ = val; }
525 int left(
void) { col_ = (col_>0) ? (col_-1) : 0;
return col_; }
526 int right(
void) {
return ++col_; }
527 int up(
void) { row_ = (row_>0) ? (row_-1) : 0;
return row_; }
528 int down(
void) {
return ++row_; }
529 bool is_rowcol(
int drow,
int dcol)
const;
530 void scroll(
int nrows);
531 void home(
void) { row_ = 0; col_ = 0; }
539 class FL_EXPORT Utf8Char {
540 static const int max_utf8_ = 4;
541 char text_[max_utf8_];
548 void text_utf8_(
const char *
text,
int len);
553 Utf8Char(
const Utf8Char& o);
555 Utf8Char& operator=(
const Utf8Char& o);
556 inline int max_utf8()
const {
return max_utf8_; }
557 void text_utf8(
const char *
text,
int len,
const CharStyle& style);
558 void text_ascii(
char c,
const CharStyle& style);
559 void fl_font_set(
const CharStyle& style)
const;
564 const char* text_utf8(
void)
const {
return text_; }
566 uchar attrib(
void)
const {
return attrib_; }
567 uchar charflags(
void)
const {
return charflags_; }
571 int length(
void)
const {
return int(len_); }
572 double pwidth(
void)
const;
573 int pwidth_int(
void)
const;
575 void clear(
const CharStyle& style) { text_utf8(
" ", 1, style); charflags_ = 0; attrib_ = 0; }
576 bool is_char(
char c)
const {
return *text_ == c; }
577 void show_char(
void)
const {
::printf(
"%.*s", len_, text_); }
578 void show_char_info(
void)
const { ::fprintf(stderr,
"UTF-8('%.*s', len=%d)\n", len_, text_, len_); }
579 Fl_Color attr_fg_color(
const Fl_Widget *grp)
const;
580 Fl_Color attr_bg_color(
const Fl_Widget *grp)
const;
587 class FL_EXPORT RingBuffer {
598 void new_copy(
int drows,
int dcols,
int hrows,
const CharStyle& style);
607 void clear_hist(
void);
609 RingBuffer(
int drows,
int dcols,
int hrows);
636 inline int ring_rows(
void)
const {
return ring_rows_; }
637 inline int ring_cols(
void)
const {
return ring_cols_; }
638 inline int ring_srow(
void)
const {
return(0); }
639 inline int ring_erow(
void)
const {
return(ring_rows_ - 1); }
640 inline int hist_rows(
void)
const {
return hist_rows_; }
641 inline int hist_cols(
void)
const {
return ring_cols_; }
642 inline int hist_srow(
void)
const {
return((offset_ + 0) % ring_rows_); }
643 inline int hist_erow(
void)
const {
return((offset_ + hist_rows_ - 1) % ring_rows_); }
644 inline int disp_rows(
void)
const {
return disp_rows_; }
645 inline int disp_cols(
void)
const {
return ring_cols_; }
646 inline int disp_srow(
void)
const {
return((offset_ + hist_rows_) % ring_rows_); }
647 inline int disp_erow(
void)
const {
return((offset_ + hist_rows_ + disp_rows_ - 1) % ring_rows_); }
648 inline int offset(
void)
const {
return offset_; }
649 void offset_adjust(
int rows);
650 void hist_rows(
int val) { hist_rows_ = val; }
651 void disp_rows(
int val) { disp_rows_ = val; }
654 inline int hist_use(
void)
const {
return hist_use_; }
655 inline void hist_use(
int val) { hist_use_ = val; }
656 inline int hist_use_srow(
void)
const {
return((offset_ + hist_rows_ - hist_use_) % ring_rows_); }
657 inline Utf8Char *ring_chars(
void) {
return ring_chars_; }
658 inline Utf8Char *ring_chars(
void)
const {
return ring_chars_; }
660 bool is_hist_ring_row(
int grow)
const;
661 bool is_disp_ring_row(
int grow)
const;
663 void move_disp_row(
int src_row,
int dst_row);
664 void clear_disp_rows(
int sdrow,
int edrow,
const CharStyle& style);
665 void scroll(
int rows,
const CharStyle& style);
667 const Utf8Char* u8c_ring_row(
int row)
const;
668 const Utf8Char* u8c_hist_row(
int hrow)
const;
669 const Utf8Char* u8c_hist_use_row(
int hurow)
const;
670 const Utf8Char* u8c_disp_row(
int drow)
const;
676 Utf8Char* u8c_hist_use_row(
int hurow);
679 void create(
int drows,
int dcols,
int hrows);
682 void change_disp_rows(
int drows,
const CharStyle& style);
683 void change_disp_cols(
int dcols,
const CharStyle& style);
690 class FL_EXPORT Selection {
692 int srow_, scol_, erow_, ecol_;
693 int push_row_, push_col_;
694 bool push_char_right_;
701 int srow(
void)
const {
return srow_; }
702 int scol(
void)
const {
return scol_; }
703 int erow(
void)
const {
return erow_; }
704 int ecol(
void)
const {
return ecol_; }
705 void push_clear() { push_row_ = push_col_ = -1; push_char_right_ =
false; }
706 void push_rowcol(
int row,
int col,
bool char_right) {
707 push_row_ = row; push_col_ = col; push_char_right_ = char_right; }
708 void start_push() { start(push_row_, push_col_, push_char_right_); }
709 bool dragged_off(
int row,
int col,
bool char_right) {
710 return (push_row_ != row) || (push_col_+push_char_right_ != col+char_right); }
711 void selectionfgcolor(
Fl_Color val) { selectionfgcolor_ = val; }
712 void selectionbgcolor(
Fl_Color val) { selectionbgcolor_ = val; }
713 Fl_Color selectionfgcolor(
void)
const {
return selectionfgcolor_; }
714 Fl_Color selectionbgcolor(
void)
const {
return selectionbgcolor_; }
715 bool is_selection(
void)
const {
return is_selection_; }
716 bool get_selection(
int &srow,
int &scol,
int &erow,
int &ecol)
const;
717 bool start(
int row,
int col,
bool char_right);
718 bool extend(
int row,
int col,
bool char_right);
720 void select(
int srow,
int scol,
int erow,
int ecol);
722 int state(
void)
const {
return state_; }
723 void scroll(
int nrows);
735 class FL_EXPORT EscapeSeq {
739 static const int maxbuff = 80;
740 static const int maxvals = 20;
742 static const int success = 0;
743 static const int fail = -1;
744 static const int completed = 1;
754 int save_row_, save_col_;
756 int append_buff(
char c);
757 int append_val(
void);
762 char esc_mode(
void)
const;
763 void esc_mode(
char val);
764 int total_vals(
void)
const;
765 int val(
int i)
const;
766 int defvalmax(
int dval,
int max)
const;
767 bool parse_in_progress(
void)
const;
768 bool is_csi(
void)
const;
770 void save_cursor(
int row,
int col);
771 void restore_cursor(
int &row,
int &col);
778 class FL_EXPORT PartialUtf8Buf {
783 void clear(
void) { buflen_ = clen_ = 0; }
784 PartialUtf8Buf(
void) {
clear(); }
786 bool is_continuation(
char c) {
797 return ((c & 0xc0) == 0x80);
800 const char* buf(
void)
const {
return buf_; }
802 int buflen(
void)
const {
return buflen_; }
812 bool append(
const char* p,
int len) {
813 if (len <= 0)
return true;
814 if (buflen_ + len >= (
int)
sizeof(buf_))
815 {
clear();
return false; }
817 while (len>0) { buf_[buflen_++] = *p++; len--; }
820 bool is_complete(
void)
const {
return (buflen_ && (buflen_ == clen_)); }
856 const char *error_char_;
857 bool fontsize_defer_;
881 bool redraw_modified_;
900 void create_ring(
int drows,
int dcols,
int hrows);
901 void init_(
int X,
int Y,
int W,
int H,
const char*L,
int rows,
int cols,
int hist,
bool fontsize_defer);
903 void init_tabstops(
int newsize);
904 void default_tabstops(
void);
905 void clear_all_tabstops(
void);
906 void set_tabstop(
void);
907 void clear_tabstop(
void);
909 void update_screen_xywh(
void);
910 void update_screen(
bool font_changed);
912 void update_scrollbar(
void);
914 void resize_display_rows(
int drows);
915 void resize_display_columns(
int dcols);
916 void refit_disp_to_screen(
void);
918 static void scrollbar_cb(Fl_Widget*,
void*);
919 static void autoscroll_timer_cb(
void*);
920 void autoscroll_timer_cb2(
void);
921 static void redraw_timer_cb(
void*);
922 void redraw_timer_cb2(
void);
929 int x_to_glob_col(
int X,
int grow,
int &gcol,
bool &gcr)
const;
930 int xy_to_glob_rowcol(
int X,
int Y,
int &grow,
int &gcol,
bool &gcr)
const;
942 bool get_selection(
int &srow,
int &scol,
int &erow,
int &ecol)
const;
946 bool is_hist_ring_row(
int grow)
const;
947 bool is_disp_ring_row(
int grow)
const;
984 void cursor_up(
int count=1,
bool do_scroll=
false);
985 void cursor_down(
int count=1,
bool do_scroll=
false);
1001 void handle_lf(
void);
1002 void handle_cr(
void);
1003 void handle_esc(
void);
1005 void handle_ctrl(
char c);
1006 bool is_printable(
char c);
1007 bool is_ctrl(
char c);
1008 void handle_SGR(
void);
1009 void handle_DECRARA(
void);
1010 void handle_escseq(
char c);
1012 void display_modified(
void);
1013 void display_modified_clear(
void);
1014 void clear_char_at_disp(
int drow,
int dcol);
1019 void repeat_char(
char c,
int rep);
1020 void utf8_cache_clear(
void);
1021 void utf8_cache_flush(
void);
1024 void plot_char(
const char *
text,
int len,
int drow,
int dcol);
1025 void plot_char(
char c,
int drow,
int dcol);
1031 void append(
const char *s,
int len=-1);
1037 void draw_row(
int grow,
int Y)
const;
1040 void handle_selection_autoscroll(
void);
1041 int handle_selection(
int e);
1047 const char*
text(
bool lines_below_cursor=
false)
const;
1055 inline int ring_rows(
void)
const {
return ring_.ring_rows(); }
1057 inline int ring_cols(
void)
const {
return ring_.ring_cols(); }
1059 inline int ring_srow(
void)
const {
return ring_.ring_srow(); }
1061 inline int ring_erow(
void)
const {
return ring_.ring_erow(); }
1063 inline int hist_rows(
void)
const {
return ring_.hist_rows(); }
1065 inline int hist_cols(
void)
const {
return ring_.hist_cols(); }
1067 inline int hist_srow(
void)
const {
return ring_.hist_srow(); }
1069 inline int hist_erow(
void)
const {
return ring_.hist_erow(); }
1071 inline int hist_use(
void)
const {
return ring_.hist_use(); }
1075 inline int disp_rows(
void)
const {
return ring_.disp_rows(); }
1077 inline int disp_cols(
void)
const {
return ring_.disp_cols(); }
1079 inline int disp_srow(
void)
const {
return ring_.disp_srow(); }
1081 inline int disp_erow(
void)
const {
return ring_.disp_erow(); }
1083 inline int offset(
void)
const {
return ring_.offset(); }
1091 int scrollbar_size(
void)
const;
1092 void scrollbar_size(
int val);
1093 int scrollbar_actual_size(
void)
const;
1094 void hscrollbar_style(ScrollbarStyle val);
1095 ScrollbarStyle hscrollbar_style(
void)
const;
1097 int history_rows(
void)
const;
1098 void history_rows(
int val);
1099 int history_use(
void)
const;
1101 int display_rows(
void)
const;
1102 void display_rows(
int val);
1103 int display_columns(
void)
const;
1104 void display_columns(
int val);
1125 void margin_left(
int val);
1126 void margin_right(
int val);
1127 void margin_top(
int val);
1128 void margin_bottom(
int val);
1136 void textfgcolor_default(
Fl_Color val);
1137 void textbgcolor_default(
Fl_Color val);
1154 void textfgcolor_xterm(
uchar val);
1155 void textbgcolor_xterm(
uchar val);
1165 void textattrib(
uchar val);
1166 uchar textattrib()
const;
1168 RedrawStyle redraw_style(
void)
const;
1169 void redraw_style(RedrawStyle val);
1171 bool is_redraw_style(RedrawStyle val) {
return redraw_style_ == val; }
1173 float redraw_rate(
void)
const;
1174 void redraw_rate(
float val);
1176 bool show_unknown(
void)
const;
1177 void show_unknown(
bool val);
1186 bool ansi(
void)
const;
1187 void ansi(
bool val);
1189 int history_lines(
void)
const;
1190 void history_lines(
int val);
1192 void printf(
const char *fmt, ...);
1193 void vprintf(
const char *fmt, va_list ap);
1195 Fl_Terminal(
int X,
int Y,
int W,
int H,
const char*L=0);
1196 Fl_Terminal(
int X,
int Y,
int W,
int H,
const char*L,
int rows,
int cols,
int hist);
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1063
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:1120
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1092
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:644
Fl_Group and Fl_End classes.
void end()
Exactly the same as current(this->parent()).
Definition Fl_Group.cxx:73
int handle(int) FL_OVERRIDE
Handles the specified event.
Definition Fl_Group.cxx:145
void resize(int, int, int, int) FL_OVERRIDE
Resizes the Fl_Group widget and all of its children.
Definition Fl_Group.cxx:825
void draw() FL_OVERRIDE
Draws the widget.
Definition Fl_Group.cxx:943
void clear()
Deletes all child widgets from memory recursively.
Definition Fl_Group.cxx:381
Rectangle with standard FLTK coordinates (X, Y, W, H).
Definition Fl_Rect.H:30
Definition Fl_Terminal.H:425
Definition Fl_Terminal.H:501
Definition Fl_Terminal.H:735
Definition Fl_Terminal.H:405
Definition Fl_Terminal.H:778
Definition Fl_Terminal.H:587
Definition Fl_Terminal.H:690
bool get_selection(int &srow, int &scol, int &erow, int &ecol) const
Return selection start/end.
Definition Fl_Terminal.cxx:162
Definition Fl_Terminal.H:539
Terminal widget supporting Unicode/utf-8, ANSI/xterm escape codes with full RGB color control.
Definition Fl_Terminal.H:320
void selectionbgcolor(Fl_Color val)
Set mouse selection background color.
Definition Fl_Terminal.H:1159
void printf(const char *fmt,...)
Appends printf formatted messages to the terminal.
Definition Fl_Terminal.cxx:4157
Fl_Terminal(int X, int Y, int W, int H, const char *L=0)
The constructor for Fl_Terminal.
Definition Fl_Terminal.cxx:3398
void select_word(int grow, int gcol)
Select the word around the given row and column.
Definition Fl_Terminal.cxx:2191
Utf8Char * u8c_cursor(void)
Return the Utf8Char* for character under cursor.
Definition Fl_Terminal.cxx:1189
const char * error_char(void) const
Returns the "error character" utf8 string, which is shown for invalid utf8 or bad ANSI sequences if s...
Definition Fl_Terminal.H:1184
void insert_char(char c, int rep)
Insert char 'c' at the current cursor position for 'rep' times.
Definition Fl_Terminal.cxx:2312
int disp_srow(void) const
Return the starting row# in the display area.
Definition Fl_Terminal.H:1079
void cursor_tab_right(int count=1)
Tab right, do not wrap beyond right edge.
Definition Fl_Terminal.cxx:2533
void cursor_cr(void)
Move cursor as if a CR (\r) was received.
Definition Fl_Terminal.cxx:2522
void clear_screen_home(bool scroll_to_hist=true)
Clear the terminal screen and home the cursor.
Definition Fl_Terminal.cxx:1929
Fl_Color color(void) const
Return base widget Fl_Group's box() color()
Definition Fl_Terminal.H:1143
const char * selection_text(void) const
Return text selection (for copy()/paste() operations)
Definition Fl_Terminal.cxx:2135
void clear_eol(void)
Clear from cursor to End Of Line (EOL), like "<ESC>[K".
Definition Fl_Terminal.cxx:1959
void cursor_eol(void)
Move cursor to the last column (at the far right) on the current line.
Definition Fl_Terminal.cxx:2516
int hist_rows(void) const
Return the number of rows in the scrollback history.
Definition Fl_Terminal.H:1063
bool is_selection(void) const
Returns true if there's a mouse selection.
Definition Fl_Terminal.cxx:1988
Fl_Color textbgcolor_default(void) const
Return text's default background color.
Definition Fl_Terminal.H:1153
void draw_row(int grow, int Y) const
Draw the specified global row, which is the row in ring_chars[].
Definition Fl_Terminal.cxx:3632
void append(const char *s, int len=-1)
Appends string s to the terminal at the current cursor position using the current text color/attribut...
Definition Fl_Terminal.cxx:3280
int margin_left(void) const
Return the left margin; see Margins.
Definition Fl_Terminal.H:1118
void cursor_home(void)
Move cursor to the home position (top/left).
Definition Fl_Terminal.cxx:2513
void draw_row_bg(int grow, int X, int Y) const
Draw the background for the specified ring_chars[] global row grow starting at FLTK coords X and Y.
Definition Fl_Terminal.cxx:3595
bool selection_extend(int X, int Y)
Extend selection to FLTK coords X,Y.
Definition Fl_Terminal.cxx:2173
Fl_Color selectionfgcolor(void) const
Get mouse selection foreground color.
Definition Fl_Terminal.H:1161
int w_to_col(int W) const
Given a width in pixels, return number of columns that "fits" into that area.
Definition Fl_Terminal.cxx:3771
void delete_chars(int drow, int dcol, int rep)
Delete char(s) at (drow,dcol) for 'rep' times.
Definition Fl_Terminal.cxx:2317
void plot_char(const char *text, int len, int drow, int dcol)
Plot the UTF-8 character text of length len at display position (drow,dcol).
Definition Fl_Terminal.cxx:3041
void cursor_tab_left(int count=1)
Tab left, do not wrap beyond left edge.
Definition Fl_Terminal.cxx:2547
Attrib
Bits for the per-character attributes, which control text features such as italic,...
Definition Fl_Terminal.H:346
@ NORMAL
all attributes off
Definition Fl_Terminal.H:347
@ ITALIC
italic font text
Definition Fl_Terminal.H:350
@ DIM
dim text; color slightly darker than normal
Definition Fl_Terminal.H:349
@ STRIKEOUT
strikeout text
Definition Fl_Terminal.H:355
@ UNDERLINE
underlined text
Definition Fl_Terminal.H:351
@ BOLD
bold text: uses bold font, color brighter than normal
Definition Fl_Terminal.H:348
@ _RESERVED_2
(reserved for internal future use)
Definition Fl_Terminal.H:354
@ _RESERVED_1
(reserved for internal future use)
Definition Fl_Terminal.H:352
@ INVERSE
inverse text; fg/bg color are swapped
Definition Fl_Terminal.H:353
void cursor_sol(void)
Move cursor to the first column (at the far left) on the current line.
Definition Fl_Terminal.cxx:2519
Fl_Color selectionbgcolor(void) const
Get mouse selection background color.
Definition Fl_Terminal.H:1163
int offset(void) const
Returns the current offset into the ring buffer.
Definition Fl_Terminal.H:1083
void clear_line(int row)
Clear entire line for specified row.
Definition Fl_Terminal.cxx:1975
const Utf8Char * walk_selection(const Utf8Char *u8c, int &row, int &col) const
Walk the mouse selection one character at a time from beginning to end, returning a Utf8Char* to the ...
Definition Fl_Terminal.cxx:2014
void cursorfgcolor(Fl_Color val)
Set the cursor's foreground color used for text under the cursor.
Definition Fl_Terminal.cxx:2429
int margin_bottom(void) const
Return the bottom margin; see Margins.
Definition Fl_Terminal.H:1124
Fl_Scrollbar * scrollbar
Vertical scrollbar.
Definition Fl_Terminal.H:842
bool is_inside_selection(int row, int col) const
Is global row/column inside the current mouse selection?
Definition Fl_Terminal.cxx:2082
const Utf8Char * u8c_ring_row(int grow) const
See docs for non-const version of u8c_ring_row(int)
Definition Fl_Terminal.cxx:1054
int selection_text_len(void) const
Return byte length of all UTF-8 chars in selection, or 0 if no selection.
Definition Fl_Terminal.cxx:2121
const Utf8Char * u8c_disp_row(int drow) const
See docs for non-const version of u8c_disp_row(int)
Definition Fl_Terminal.cxx:1066
int margin_top(void) const
Return the top margin; see Margins.
Definition Fl_Terminal.H:1122
int hist_srow(void) const
Return the starting row# of the scrollback history.
Definition Fl_Terminal.H:1067
void reset_terminal(void)
Resets terminal to default colors, clears screen, history and mouse selection, homes cursor,...
Definition Fl_Terminal.cxx:2355
Fl_Font textfont(void) const
Return text font used to draw all text in the terminal.
Definition Fl_Terminal.H:1139
void error_char(const char *val)
Sets the "error character" utf8 string shown for invalid utf8 or bad ANSI sequences if show_unknown()...
Definition Fl_Terminal.H:1181
void cursor_left(int count=1)
Moves cursor left count columns, and cursor stops (does not wrap) if it hits screen edge.
Definition Fl_Terminal.cxx:2489
int disp_erow(void) const
Return the ending row# in the display area.
Definition Fl_Terminal.H:1081
const Utf8Char * utf8_char_at_disp(int drow, int dcol) const
Return Utf8Char* for char at specified display row and column.
Definition Fl_Terminal.cxx:3007
void restore_cursor(void)
Restore previously saved cursor position, if any. Used by ESC [ u.
Definition Fl_Terminal.cxx:2563
void output_translate(Fl_Terminal::OutFlags val)
Sets the combined output translation flags to val.
Definition Fl_Terminal.cxx:2611
void clear_eod(void)
Clear from cursor to End Of Display (EOD), like "<ESC>[J<ESC>[0J".
Definition Fl_Terminal.cxx:1947
const char * text(bool lines_below_cursor=false) const
Return a string copy of all lines in the terminal (including history).
Definition Fl_Terminal.cxx:3983
Fl_Color textfgcolor(void) const
Return text's current foreground color.
Definition Fl_Terminal.H:1147
Fl_Fontsize textsize(void) const
Return text font size used to draw all text in the terminal.
Definition Fl_Terminal.H:1141
void scroll(int rows)
Scroll the display up(+) or down(-) the specified rows.
Definition Fl_Terminal.cxx:2224
void cursor_crlf(int count=1)
Move cursor as if a CR/LF pair (\r\n) was received.
Definition Fl_Terminal.cxx:2525
void clear_mouse_selection(void)
Clear any current mouse selection.
Definition Fl_Terminal.cxx:2165
CharStyle & current_style(void) const
Return reference to internal current style for rendering text.
Definition Fl_Terminal.cxx:1556
void save_cursor(void)
Save current cursor position. Used by ESC [ s.
Definition Fl_Terminal.cxx:2558
void draw_buff(int Y) const
Draws the buffer position we are scrolled to onto the FLTK screen starting at pixel position Y.
Definition Fl_Terminal.cxx:3709
void insert_rows(int count)
Insert (count) rows at current cursor position.
Definition Fl_Terminal.cxx:2236
int ring_cols(void) const
Return the number of columns in the ring buffer.
Definition Fl_Terminal.H:1057
void cursorbgcolor(Fl_Color val)
Set the cursor's background color used for the cursor itself.
Definition Fl_Terminal.cxx:2431
CharFlags
Per-character 8 bit flags (uchar) used to manage special states for characters.
Definition Fl_Terminal.H:362
@ BG_XTERM
this char's bg color is an XTERM color; can be affected by Dim+Bold
Definition Fl_Terminal.H:364
@ FG_XTERM
this char's fg color is an XTERM color; can be affected by Dim+Bold
Definition Fl_Terminal.H:363
@ EOL
TODO: char at EOL, used for line re-wrap during screen resizing.
Definition Fl_Terminal.H:365
ScrollbarStyle
Behavior of scrollbars.
Definition Fl_Terminal.H:389
@ SCROLLBAR_OFF
scrollbar always invisible
Definition Fl_Terminal.H:390
@ SCROLLBAR_AUTO
scrollbar visible if widget resized in a way that hides columns (default)
Definition Fl_Terminal.H:391
@ SCROLLBAR_ON
scrollbar always visible
Definition Fl_Terminal.H:392
void clear_history(void)
Clears the scroll history buffer and adjusts scrollbar, forcing it to redraw().
Definition Fl_Terminal.cxx:2336
int hist_cols(void) const
Return the number of columns in the scrollback history.
Definition Fl_Terminal.H:1065
Fl_Color textbgcolor(void) const
Return text's current background color.
Definition Fl_Terminal.H:1149
Fl_Color textfgcolor_default(void) const
Return text's default foreground color.
Definition Fl_Terminal.H:1151
RedrawStyle
Determines when Fl_Terminal calls redraw() if new text is added.
Definition Fl_Terminal.H:332
@ NO_REDRAW
app must call redraw() as needed to update text to screen
Definition Fl_Terminal.H:333
@ PER_WRITE
redraw triggered after every append() / printf() / etc. operation
Definition Fl_Terminal.H:335
@ RATE_LIMITED
timer controlled redraws. (DEFAULT)
Definition Fl_Terminal.H:334
const Utf8Char * u8c_hist_use_row(int hrow) const
See docs for non-const version of u8c_hist_use_row(int)
Definition Fl_Terminal.cxx:1062
void print_char(const char *text, int len=-1)
Prints single UTF-8 char text of optional byte length len at current cursor position,...
Definition Fl_Terminal.cxx:3099
void cursor_right(int count=1, bool do_scroll=false)
Moves cursor right count columns.
Definition Fl_Terminal.cxx:2501
int margin_right(void) const
Return the right margin; see Margins.
Definition Fl_Terminal.H:1120
int ring_rows(void) const
Return the number of rows in the ring buffer.
Definition Fl_Terminal.H:1055
void textfgcolor_default(Fl_Color val)
Set the default text foreground color used by <ESC>c, <ESC>[0m, and reset_terminal().
Definition Fl_Terminal.cxx:1793
const Utf8Char * utf8_char_at_glob(int grow, int gcol) const
Return Utf8Char* for char at specified global (grow,gcol).
Definition Fl_Terminal.cxx:3021
int hist_use(void) const
Return number of rows in use by the scrollback history.
Definition Fl_Terminal.H:1071
int disp_rows(void) const
Return the number of rows in the display area.
Definition Fl_Terminal.H:1075
int hist_use_srow(void) const
Return the starting row of the "in use" scrollback history.
Definition Fl_Terminal.H:1073
int disp_cols(void) const
Return the number of columns in the display area.
Definition Fl_Terminal.H:1077
Fl_Scrollbar * hscrollbar
Horizontal scrollbar.
Definition Fl_Terminal.H:853
int ring_srow(void) const
Return the starting row# in the ring buffer. (Always 0)
Definition Fl_Terminal.H:1059
int h_to_row(int H) const
Given a height in pixels, return number of rows that "fits" into that area.
Definition Fl_Terminal.cxx:3779
bool get_selection(int &srow, int &scol, int &erow, int &ecol) const
Return mouse selection's start/end position in the ring buffer, if any.
Definition Fl_Terminal.cxx:2067
OutFlags
Output translation flags for special control character translations.
Definition Fl_Terminal.H:378
@ LF_TO_CR
line-feed generates a carriage return (\n -> \r)
Definition Fl_Terminal.H:381
@ CR_TO_LF
carriage return generates a vertical line-feed (\r -> \n)
Definition Fl_Terminal.H:380
@ OFF
no output translation
Definition Fl_Terminal.H:379
@ LF_TO_CRLF
line-feed generates a carriage return line-feed (\n -> \r\n)
Definition Fl_Terminal.H:382
int ring_erow(void) const
Return the ending row# in the ring buffer (Always ring_rows()-1)
Definition Fl_Terminal.H:1061
Fl_Boxtype box(void) const
Returns the current box type.
Definition Fl_Terminal.H:1115
void box(Fl_Boxtype val)
Sets the box type, updates terminal margins et al.
Definition Fl_Terminal.H:1113
void cursor_col(int col)
Move cursor to the specified column col.
Definition Fl_Terminal.cxx:2445
void cursor_up(int count=1, bool do_scroll=false)
Moves cursor up count lines.
Definition Fl_Terminal.cxx:2456
void selectionfgcolor(Fl_Color val)
Set mouse selection foreground color.
Definition Fl_Terminal.H:1157
void select_line(int grow)
Select the entire row.
Definition Fl_Terminal.cxx:2214
void cursor_down(int count=1, bool do_scroll=false)
Moves cursor down count lines.
Definition Fl_Terminal.cxx:2472
const Utf8Char * u8c_hist_row(int hrow) const
See docs for non-const version of u8c_hist_row(int)
Definition Fl_Terminal.cxx:1058
void clear_sod(void)
Clear from cursor to Start Of Display (EOD), like "<ESC>[1J".
Definition Fl_Terminal.cxx:1935
Fl_Color textcolor(void) const
Return textcolor(). This is a convenience method that returns textfgcolor_default()
Definition Fl_Terminal.H:1145
void clear_screen(bool scroll_to_hist=true)
Clear the terminal screen only; does not affect the cursor position.
Definition Fl_Terminal.cxx:1907
void cursor_row(int row)
Move cursor to the specified row row.
Definition Fl_Terminal.cxx:2441
void insert_char_eol(char c, int drow, int dcol, int rep)
Insert char 'c' for 'rep' times at display row 'drow' and column 'dcol'.
Definition Fl_Terminal.cxx:2283
int handle_unknown_char(void)
Handle an unknown char by either emitting an error symbol to the tty, or do nothing,...
Definition Fl_Terminal.cxx:3294
int hist_erow(void) const
Return the ending row# of the scrollback history.
Definition Fl_Terminal.H:1069
void append_utf8(const char *buf, int len=-1)
Append NULL terminated UTF-8 string to terminal.
Definition Fl_Terminal.cxx:3154
void clear_sol(void)
Clear from cursor to Start Of Line (SOL), like "<ESC>[1K".
Definition Fl_Terminal.cxx:1967
void append_ascii(const char *s)
Append NULL terminated ASCII string to terminal, slightly more efficient than append_utf8().
Definition Fl_Terminal.cxx:3210
void delete_rows(int count)
Delete (count) rows at cursor position.
Definition Fl_Terminal.cxx:2258
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
unsigned char uchar
unsigned char
Definition fl_types.h:30
int fl_utf8len(char c)
Returns the byte length of the UTF-8 sequence with first byte c, or -1 if c is not valid.
Definition fl_utf8.cxx:69