aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/XFontImp.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-09-11 23:01:34 (GMT)
committerfluxgen <fluxgen>2004-09-11 23:01:34 (GMT)
commit049e40c9eb6e6e8651b171a2a78465398c87f6a1 (patch)
tree7aef9d57e82336221d6d953617c7a5d53ee95db0 /src/FbTk/XFontImp.cc
parentacd2176355876a7bb7afe9d026f9780a3d1c2737 (diff)
downloadfluxbox_pavel-049e40c9eb6e6e8651b171a2a78465398c87f6a1.zip
fluxbox_pavel-049e40c9eb6e6e8651b171a2a78465398c87f6a1.tar.bz2
Font::drawText takes reference to FbDrawable instead of X Drawable + some code cleaning
Diffstat (limited to 'src/FbTk/XFontImp.cc')
-rw-r--r--src/FbTk/XFontImp.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/FbTk/XFontImp.cc b/src/FbTk/XFontImp.cc
index 0818634..0a01eb0 100644
--- a/src/FbTk/XFontImp.cc
+++ b/src/FbTk/XFontImp.cc
@@ -1,5 +1,5 @@
1// XFontImp.cc for FbTk fluxbox toolkit 1// XFontImp.cc for FbTk fluxbox toolkit
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) 2// Copyright (c) 2002-2004 Henrik Kinnunen (fluxgen at users.sourceforge.net)
3// 3//
4// Permission is hereby granted, free of charge, to any person obtaining a 4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"), 5// copy of this software and associated documentation files (the "Software"),
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: XFontImp.cc,v 1.9 2004/08/31 15:26:39 rathnor Exp $ 22// $Id: XFontImp.cc,v 1.10 2004/09/11 22:58:20 fluxgen Exp $
23 23
24#include "XFontImp.hh" 24#include "XFontImp.hh"
25#include "App.hh" 25#include "App.hh"
@@ -79,18 +79,17 @@ bool XFontImp::load(const std::string &fontname) {
79 return true; 79 return true;
80} 80}
81 81
82void XFontImp::drawText(Drawable w, int screen, GC gc, const char *text, size_t len, int x, int y) const { 82void XFontImp::drawText(const FbDrawable &w, int screen, GC gc, const char *text, size_t len, int x, int y) const {
83 if (m_fontstruct == 0) 83 if (m_fontstruct == 0)
84 return; 84 return;
85 // use roated font functions? 85 // use roated font functions?
86 if (m_rotfont != 0 && m_rotate) { 86 if (m_rotfont != 0 && m_rotate) {
87 drawRotText(w, screen, gc, text, len, x, y); 87 drawRotText(w.drawable(), screen, gc, text, len, x, y);
88 return; 88 return;
89 } 89 }
90 90
91 Display *disp = App::instance()->display(); 91 XSetFont(w.display(), gc, m_fontstruct->fid);
92 XSetFont(disp, gc, m_fontstruct->fid); 92 XDrawString(w.display(), w.drawable(), gc, x, y, text, len);
93 XDrawString(disp, w, gc, x, y, text, len);
94} 93}
95 94
96unsigned int XFontImp::textWidth(const char * const text, unsigned int size) const { 95unsigned int XFontImp::textWidth(const char * const text, unsigned int size) const {