Fix STR 2339 by defining new member function rtl_draw of class Fl_Graphics_Driver

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7652 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2010-06-21 15:49:45 +00:00
parent 6c2274f011
commit 449b99dd86
6 changed files with 9 additions and 6 deletions

View File

@ -129,6 +129,7 @@ protected:
friend void fl_line(int x, int y, int x1, int y1, int x2, int y2);
friend void fl_draw(const char *str, int n, int x, int y);
friend void fl_draw(int angle, const char *str, int n, int x, int y);
friend void fl_rtl_draw(const char *str, int n, int x, int y);
friend void fl_font(Fl_Font face, Fl_Fontsize size);
friend void fl_color(Fl_Color c);
friend void fl_color(uchar r, uchar g, uchar b);
@ -193,6 +194,8 @@ protected:
virtual void draw(const char *str, int n, int x, int y);
/** \brief see fl_draw(int angle, const char *str, int n, int x, int y). */
virtual void draw(int angle, const char *str, int n, int x, int y);
/** \brief see fl_rtl_draw(const char *str, int n, int x, int y). */
virtual void rtl_draw(const char *str, int n, int x, int y);
/** \brief see fl_font(Fl_Font face, Fl_Fontsize size). */
virtual void font(Fl_Font face, Fl_Fontsize size);
/** \brief see fl_color(Fl_Color c). */

View File

@ -563,7 +563,7 @@ inline void fl_draw(int angle,const char* str, int n, int x, int y) {fl_device->
/**
Draws an array of \p n characters right to left starting at given location.
*/
FL_EXPORT void fl_rtl_draw(const char*, int n, int x, int y);
inline void fl_rtl_draw(const char* str, int n, int x, int y) {fl_device->rtl_draw(str,n,x,y); };
FL_EXPORT void fl_measure(const char* str, int& x, int& y,
int draw_symbols = 1);
FL_EXPORT void fl_draw(const char* str, int x, int y, int w, int h,

View File

@ -488,8 +488,8 @@ void Fl_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) {
CGContextRestoreGState(fl_gc);
}
void fl_rtl_draw(const char* c, int n, int x, int y) {
fl_draw(c, n, x - fl_width(c, n), y); //to check;
void Fl_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
draw(c, n, x - fl_width(c, n), y);
}
//

View File

@ -386,7 +386,7 @@ void Fl_Graphics_Driver::draw(int angle, const char* str, int n, int x, int y) {
fl_font(fl_font_, fl_size_);
}
void fl_rtl_draw(const char* c, int n, int x, int y) {
void Fl_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
int wn;
int i = 0;
int lx = 0;

View File

@ -335,7 +335,7 @@ void Fl_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) {
// fl_draw(str, n, (int)x, (int)y);
//}
void fl_rtl_draw(const char* c, int n, int x, int y) {
void Fl_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
if (font_gc != fl_gc) {
if (!current_font) fl_font(FL_HELVETICA, 12);
font_gc = fl_gc;

View File

@ -584,7 +584,7 @@ static void fl_drawUCS4(const FcChar32 *str, int n, int x, int y) {
}
void fl_rtl_draw(const char* c, int n, int x, int y) {
void Fl_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) {
#if defined(__GNUC__)
#warning Need to improve this XFT right to left draw function