diff options
author | fluxgen <fluxgen> | 2004-09-11 23:01:34 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-09-11 23:01:34 (GMT) |
commit | 049e40c9eb6e6e8651b171a2a78465398c87f6a1 (patch) | |
tree | 7aef9d57e82336221d6d953617c7a5d53ee95db0 /src/FbTk/Font.cc | |
parent | acd2176355876a7bb7afe9d026f9780a3d1c2737 (diff) | |
download | fluxbox-049e40c9eb6e6e8651b171a2a78465398c87f6a1.zip fluxbox-049e40c9eb6e6e8651b171a2a78465398c87f6a1.tar.bz2 |
Font::drawText takes reference to FbDrawable instead of X Drawable + some code cleaning
Diffstat (limited to 'src/FbTk/Font.cc')
-rw-r--r-- | src/FbTk/Font.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index 6ac7d74..5bbe6de 100644 --- a/src/FbTk/Font.cc +++ b/src/FbTk/Font.cc | |||
@@ -1,5 +1,5 @@ | |||
1 | // Font.cc | 1 | // Font.cc |
2 | // Copyright (c) 2002-2004 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: Font.cc,v 1.20 2004/09/03 14:17:47 akir Exp $ | 22 | //$Id: Font.cc,v 1.21 2004/09/11 22:58:20 fluxgen Exp $ |
23 | 23 | ||
24 | 24 | ||
25 | #include "StringUtil.hh" | 25 | #include "StringUtil.hh" |
@@ -350,7 +350,7 @@ void Font::setAntialias(bool flag) { | |||
350 | bool Font::load(const std::string &name) { | 350 | bool Font::load(const std::string &name) { |
351 | if (name.size() == 0) | 351 | if (name.size() == 0) |
352 | return false; | 352 | return false; |
353 | 353 | // default values for font options | |
354 | m_shadow = false; | 354 | m_shadow = false; |
355 | m_halo = false; | 355 | m_halo = false; |
356 | 356 | ||
@@ -380,12 +380,12 @@ bool Font::load(const std::string &name) { | |||
380 | else if ( (*token).find("shadow", 0) != std::string::npos ) { | 380 | else if ( (*token).find("shadow", 0) != std::string::npos ) { |
381 | m_shadow= true; | 381 | m_shadow= true; |
382 | extract_shadow_options(*token, m_shadow_color, m_shadow_offx, m_shadow_offy); | 382 | extract_shadow_options(*token, m_shadow_color, m_shadow_offx, m_shadow_offy); |
383 | } | 383 | } |
384 | else { | 384 | else { |
385 | if ( !firstone ) | 385 | if ( !firstone ) |
386 | fname+= ", "; | 386 | fname+= ", "; |
387 | else | 387 | else |
388 | firstone= false; | 388 | firstone= false; |
389 | fname= fname + *token; | 389 | fname= fname + *token; |
390 | } | 390 | } |
391 | } | 391 | } |
@@ -424,7 +424,7 @@ int Font::descent() const { | |||
424 | return m_fontimp->descent(); | 424 | return m_fontimp->descent(); |
425 | } | 425 | } |
426 | 426 | ||
427 | void Font::drawText(Drawable w, int screen, GC gc, | 427 | void Font::drawText(const FbDrawable &w, int screen, GC gc, |
428 | const char *text, size_t len, int x, int y, | 428 | const char *text, size_t len, int x, int y, |
429 | bool rotate) const { | 429 | bool rotate) const { |
430 | if (text == 0 || len == 0) | 430 | if (text == 0 || len == 0) |
@@ -450,12 +450,12 @@ void Font::drawText(Drawable w, int screen, GC gc, | |||
450 | // draw "effects" first | 450 | // draw "effects" first |
451 | if (first_run) { | 451 | if (first_run) { |
452 | if (m_shadow) { | 452 | if (m_shadow) { |
453 | FbTk::GContext shadow_gc(w); | 453 | FbTk::GContext shadow_gc(w); |
454 | shadow_gc.setForeground(FbTk::Color(m_shadow_color.c_str(), screen)); | 454 | shadow_gc.setForeground(FbTk::Color(m_shadow_color.c_str(), screen)); |
455 | first_run = false; | 455 | first_run = false; |
456 | drawText(w, screen, shadow_gc.gc(), real_text, len, | 456 | drawText(w, screen, shadow_gc.gc(), real_text, len, |
457 | x + m_shadow_offx, y + m_shadow_offy, rotate); | 457 | x + m_shadow_offx, y + m_shadow_offy, rotate); |
458 | first_run = true; | 458 | first_run = true; |
459 | } else if (m_halo) { | 459 | } else if (m_halo) { |
460 | FbTk::GContext halo_gc(w); | 460 | FbTk::GContext halo_gc(w); |
461 | halo_gc.setForeground(FbTk::Color(m_halo_color.c_str(), screen)); | 461 | halo_gc.setForeground(FbTk::Color(m_halo_color.c_str(), screen)); |