Skip to content

Commit

Permalink
UTF8 Text Display and Editor: added tons of tests for utf8 alignment,…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
Matthias Melcher committed Nov 6, 2010
1 parent d1a09ad commit 8ae745f
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 172 deletions.
16 changes: 16 additions & 0 deletions FL/Fl_Text_Buffer.H
Expand Up @@ -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:
Expand Down Expand Up @@ -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:

/**
Expand Down

0 comments on commit 8ae745f

Please sign in to comment.