diff options
| author | Manolo Gouy <Manolo> | 2016-02-18 16:21:51 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-18 16:21:51 +0000 |
| commit | f33b45f1d30653fb5da4817089e38ff0a2413cfb (patch) | |
| tree | 9edc759690defa581b00b6ada80bb334f4ac5da8 /src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx | |
| parent | 6ce27012a9412c4964e0ae40c81ea92ff39a61d3 (diff) | |
Remove all uses of the fl_gc global variable. Towards a clean driver model.
fl_gc remains usable by the application as a hook into the system.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11189 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx')
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx index 691c1f0d2..d275d7bba 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx @@ -642,14 +642,14 @@ double Fl_Xlib_Graphics_Driver::width(unsigned int c) { } void Fl_Xlib_Graphics_Driver::text_extents(const char *c, int n, int &dx, int &dy, int &W, int &H) { - if (font_gc != fl_gc) { + if (font_gc != gc) { if (!font_descriptor()) font(FL_HELVETICA, FL_NORMAL_SIZE); - font_gc = fl_gc; - XSetFont(fl_display, fl_gc, font_descriptor()->font->fid); + font_gc = gc; + XSetFont(fl_display, gc, font_descriptor()->font->fid); } int xx, yy, ww, hh; xx = yy = ww = hh = 0; - if (fl_gc) XUtf8_measure_extents(fl_display, fl_window, font_descriptor()->font, fl_gc, &xx, &yy, &ww, &hh, c, n); + if (gc) XUtf8_measure_extents(fl_display, fl_window, font_descriptor()->font, gc, &xx, &yy, &ww, &hh, c, n); W = ww; H = hh; dx = xx; dy = yy; // This is the safe but mostly wrong thing we used to do... @@ -660,12 +660,12 @@ void Fl_Xlib_Graphics_Driver::text_extents(const char *c, int n, int &dx, int &d } void Fl_Xlib_Graphics_Driver::draw(const char* c, int n, int x, int y) { - if (font_gc != fl_gc) { + if (font_gc != gc) { if (!font_descriptor()) this->font(FL_HELVETICA, FL_NORMAL_SIZE); - font_gc = fl_gc; - XSetFont(fl_display, fl_gc, font_descriptor()->font->fid); + font_gc = gc; + XSetFont(fl_display, gc, font_descriptor()->font->fid); } - if (fl_gc) XUtf8DrawString(fl_display, fl_window, font_descriptor()->font, fl_gc, x, y, c, n); + if (gc) XUtf8DrawString(fl_display, fl_window, font_descriptor()->font, gc, x, y, c, n); } void Fl_Xlib_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) { @@ -674,11 +674,11 @@ void Fl_Xlib_Graphics_Driver::draw(int angle, const char *str, int n, int x, int } void Fl_Xlib_Graphics_Driver::rtl_draw(const char* c, int n, int x, int y) { - if (font_gc != fl_gc) { + if (font_gc != gc) { if (!font_descriptor()) this->font(FL_HELVETICA, FL_NORMAL_SIZE); - font_gc = fl_gc; + font_gc = gc; } - if (fl_gc) XUtf8DrawRtlString(fl_display, fl_window, font_descriptor()->font, fl_gc, x, y, c, n); + if (gc) XUtf8DrawRtlString(fl_display, fl_window, font_descriptor()->font, gc, x, y, c, n); } #endif // FL_DOXYGEN // |
