diff options
| author | Greg Ercolano <erco@seriss.com> | 2024-01-10 09:10:07 -0800 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2024-01-10 09:10:07 -0800 |
| commit | 08e64283aacf0c26453c1be956bf15569b6d3585 (patch) | |
| tree | 1e3a228e07965bda81296c3e9e8d3d12ba0895d4 | |
| parent | 2db1929985f430d3be1f87222aa85599bb2b8222 (diff) | |
Add textattrib() get method+docs
Requested by Jonathan Griffitts during rust bindings.
| -rw-r--r-- | FL/Fl_Terminal.H | 7 | ||||
| -rw-r--r-- | src/Fl_Terminal.cxx | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/FL/Fl_Terminal.H b/FL/Fl_Terminal.H index 1c8187b12..e012c061f 100644 --- a/FL/Fl_Terminal.H +++ b/FL/Fl_Terminal.H @@ -417,18 +417,20 @@ protected: int charwidth_; // width of a fixed width ASCII character public: CharStyle(bool fontsize_defer); + uchar attrib(void) const { return attrib_; } + uchar charflags(void) const { return charflags_; } Fl_Color fgcolor(void) const; Fl_Color bgcolor(void) const; Fl_Color defaultfgcolor(void) const { return defaultfgcolor_; } Fl_Color defaultbgcolor(void) const { return defaultbgcolor_; } - uchar attrib(void) const { return attrib_; } Fl_Font fontface(void) const { return fontface_; } Fl_Fontsize fontsize(void) const { return fontsize_; } int fontheight(void) const { return fontheight_; } int fontdescent(void) const { return fontdescent_; } int charwidth(void) const { return charwidth_; } uchar colorbits_only(uchar inflags) const; - void attrib(uchar val) { attrib_ = val; } + void attrib(uchar val) { attrib_ = val; } + void charflags(uchar val) { charflags_ = val; } void set_charflag(uchar val) { charflags_ |= val; } void clr_charflag(uchar val) { charflags_ &= ~val; } void fgcolor_uchar(uchar val); @@ -1092,6 +1094,7 @@ public: Fl_Color selectionbgcolor(void) const { return select_.selectionbgcolor(); } // API: Text attrib void textattrib(uchar val); + uchar textattrib() const; // API: Redraw style/rate RedrawStyle redraw_style(void) const; void redraw_style(RedrawStyle val); diff --git a/src/Fl_Terminal.cxx b/src/Fl_Terminal.cxx index 2b53c4a77..b4266b8fb 100644 --- a/src/Fl_Terminal.cxx +++ b/src/Fl_Terminal.cxx @@ -1634,6 +1634,16 @@ void Fl_Terminal::textattrib(uchar val) { } /** + Get text attribute bits (underline, inverse, etc). + This is the default attribute used for all newly printed text. + + \see textattrib(uchar), Fl_Terminal::Attrib +*/ +uchar Fl_Terminal::textattrib() const { + return current_style_->attrib(); +} + +/** Convert fltk window X coord to column 'gcol' on specified global 'grow' \returns - 1 if 'gcol' was found |
