From dc9793c90af75fd6e3d3e512abc2167a5544caba Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 10 Jan 2015 22:57:00 +0100 Subject: Code cleanup Reorder some includes; remove unused includes --- src/FbTk/Font.cc | 52 ++++++++++++++++---------------------------------- src/FbTk/TextTheme.cc | 1 - src/FbTk/XmbFontImp.cc | 20 ++++--------------- 3 files changed, 20 insertions(+), 53 deletions(-) diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index 98fcc4f..0164e77 100644 --- a/src/FbTk/Font.cc +++ b/src/FbTk/Font.cc @@ -19,11 +19,13 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -#include "StringUtil.hh" -#include "stringstream.hh" #include "Font.hh" #include "FontImp.hh" +#include "StringUtil.hh" +#include "stringstream.hh" #include "App.hh" +#include "GContext.hh" +#include "XFontImp.hh" // for antialias #ifdef USE_XFT @@ -35,42 +37,21 @@ #include "XmbFontImp.hh" #endif //USE_XMB -// standard font system -#include "XFontImp.hh" - -#include "GContext.hh" - -#ifndef __USE_GNU -#define __USE_GNU -#endif //__USE_GNU - -#ifdef HAVE_CSTRING - #include -#else - #include -#endif -#ifdef HAVE_CSTDLIB - #include -#else - #include -#endif +#include +#include #include #include #include #include -#include -#include +#ifdef HAVE_SETLOCALE +#include +#endif //HAVE_SETLOCALE using std::string; using std::map; using std::list; - -#ifdef HAVE_SETLOCALE -#include -#endif //HAVE_SETLOCALE - namespace { // use to map || => @@ -207,12 +188,13 @@ bool Font::load(const string &name) { // Xft and X/Xmb fonts have different defaults // (fixed doesn't really work right with Xft, especially rotated) - // HOWEVER, note that if a Xft-style font is requested (not start with "-"), and - // it turns out to be a bitmapped XFont, then Xft will load it, BUT it does not - // currently (5jan2007) rotate bitmapped fonts (ok-ish), nor adjust the baseline for its - // lack of rotation (not ok: messes up placement). I can't see a neat way around this, - // other than the user re-specifying their font explicitly in XFont form so we don't use the - // Xft backend. + // HOWEVER, note that if a Xft-style font is requested (does not start + // with "-"), and it turns out to be a bitmapped XFont, then Xft will + // load it, BUT it does not currently (2007-01-05) rotate bitmapped + // fonts (ok-ish), nor adjust the baseline for its lack of rotation + // (not ok: messes up placement). I can't see a neat way around this, + // other than the user re-specifying their font explicitly in XFont + // form so we don't use the Xft backend. std::string realname = *name_it; @@ -304,8 +286,6 @@ void Font::drawText(const FbDrawable &w, int screen, GC gc, } m_fontimp->drawText(w, screen, gc, text, len, x, y, orient); - - } } diff --git a/src/FbTk/TextTheme.cc b/src/FbTk/TextTheme.cc index 68eaa5f..da09f27 100644 --- a/src/FbTk/TextTheme.cc +++ b/src/FbTk/TextTheme.cc @@ -21,7 +21,6 @@ // DEALINGS IN THE SOFTWARE. #include "TextTheme.hh" - #include "App.hh" #include diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc index 557708a..2d6c6f4 100644 --- a/src/FbTk/XmbFontImp.cc +++ b/src/FbTk/XmbFontImp.cc @@ -31,29 +31,17 @@ #include #endif // HAVE_SETLOCALE -#ifdef HAVE_CSTDIO - #include -#else - #include -#endif -#ifdef HAVE_CSTDARG - #include -#else - #include -#endif -#ifdef HAVE_CSTRING - #include -#else - #include -#endif +#include +#include using std::string; namespace { XFontSet createFontSet(const char *fontname, bool& utf8mode) { + Display *display = FbTk::App::instance()->display(); - XFontSet fs; + XFontSet fs = 0; char **missing; const char *constdef = "-"; char *def = const_cast(constdef); -- cgit v0.11.2