diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2010-11-06 14:29:12 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2010-11-06 14:29:12 +0000 |
| commit | 8ae745f5b3b868abba4ce394e3e298306d9f3261 (patch) | |
| tree | da9046cd2faf26ee7a07526abc811a8dfac40807 /FL | |
| parent | d1a09ad73c18d321c56c050a2352d29ef22068d3 (diff) | |
UTF8 Text Display and Editor: added tons of tests for utf8 alignment, fixed a bunch of methods that did not understand utf8. Still lots of places to visit.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7800 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Text_Buffer.H | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H index dcceb59cb..e5ca4e47b 100644 --- a/FL/Fl_Text_Buffer.H +++ b/FL/Fl_Text_Buffer.H @@ -33,6 +33,17 @@ #ifndef FL_TEXT_BUFFER_H #define FL_TEXT_BUFFER_H + +#define ASSERT_UTF8 + +#ifdef ASSERT_UTF8 +# include <assert.h> +# define IS_UTF8_ALIGNED(a) if (a && *a) assert(fl_utf8len(*(a))>0); +#else +# define IS_UTF8_ALIGNED(a) +#endif + + /* Suggested UTF-8 terminology for this file: @@ -736,6 +747,11 @@ public: char *next_char(char *c) const; const char *next_char(const char *c) const; + /** + Align an index into the buffer to the current or previous utf8 boundary. + */ + int utf8_align(int) const; + protected: /** |
