diff options
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Text_Buffer.H | 25 | ||||
| -rw-r--r-- | FL/Fl_Text_Display.H | 2 |
2 files changed, 14 insertions, 13 deletions
diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H index c23a4a4e7..d74582deb 100644 --- a/FL/Fl_Text_Buffer.H +++ b/FL/Fl_Text_Buffer.H @@ -248,6 +248,18 @@ public: */ unsigned int character(int pos) const; + /** + Convert a byte offset in buffer into a memory address. + */ + const char *address(int pos) const + { return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; } + + /** + Convert a byte offset in buffer into a memory address. + */ + char *address(int pos) + { return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; } + /** Returns the text from the given rectangle. When you are done with the text, free it using the free() function. @@ -681,6 +693,7 @@ public: \return number of byte in substitution */ static int character_width(const char *src, int indent, int tabDist); + static int character_width(const char c, int indent, int tabDist); /** Count the number of displayed characters between buffer position @@ -934,18 +947,6 @@ protected: */ void update_selections(int pos, int nDeleted, int nInserted); - /** - Convert a byte offset in buffer into a memory address. - */ - const char *address(int pos) const - { return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; } - - /** - Convert a byte offset in buffer into a memory address. - */ - char *address(int pos) - { return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; } - Fl_Text_Selection mPrimary; /**< highlighted areas */ Fl_Text_Selection mSecondary; /**< highlighted areas */ Fl_Text_Selection mHighlight; /**< highlighted areas */ diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H index 08dc8dad1..1268b1bf2 100644 --- a/FL/Fl_Text_Display.H +++ b/FL/Fl_Text_Display.H @@ -251,7 +251,7 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group { bool countLastLineMissingNewLine = true) const; void find_line_end(int pos, bool start_pos_is_line_start, int *lineEnd, int *nextLineStart) const; - int measure_proportional_character(char c, int colNum, int pos) const; + int measure_proportional_character(const char *s, int colNum, int pos) const; int wrap_uses_character(int lineEndPos) const; int range_touches_selection(const Fl_Text_Selection *sel, int rangeStart, int rangeEnd) const; |
