Code cleanup

Reorder some includes; remove unused includes
This commit is contained in:
Mathias Gumz 2015-01-10 22:57:00 +01:00
parent b16528de87
commit dc9793c90a
3 changed files with 21 additions and 54 deletions

View file

@ -19,11 +19,13 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
#include "StringUtil.hh"
#include "stringstream.hh"
#include "Font.hh" #include "Font.hh"
#include "FontImp.hh" #include "FontImp.hh"
#include "StringUtil.hh"
#include "stringstream.hh"
#include "App.hh" #include "App.hh"
#include "GContext.hh"
#include "XFontImp.hh"
// for antialias // for antialias
#ifdef USE_XFT #ifdef USE_XFT
@ -35,42 +37,21 @@
#include "XmbFontImp.hh" #include "XmbFontImp.hh"
#endif //USE_XMB #endif //USE_XMB
// standard font system #include <cstring>
#include "XFontImp.hh" #include <cstdlib>
#include "GContext.hh"
#ifndef __USE_GNU
#define __USE_GNU
#endif //__USE_GNU
#ifdef HAVE_CSTRING
#include <cstring>
#else
#include <string.h>
#endif
#ifdef HAVE_CSTDLIB
#include <cstdlib>
#else
#include <stdlib.h>
#endif
#include <list> #include <list>
#include <map> #include <map>
#include <typeinfo> #include <typeinfo>
#include <langinfo.h> #include <langinfo.h>
#include <cstdio>
#include <errno.h>
using std::string;
using std::map;
using std::list;
#ifdef HAVE_SETLOCALE #ifdef HAVE_SETLOCALE
#include <locale.h> #include <locale.h>
#endif //HAVE_SETLOCALE #endif //HAVE_SETLOCALE
using std::string;
using std::map;
using std::list;
namespace { namespace {
// use to map <font1>|<font2>|<font3> => <fontthatworks> // use to map <font1>|<font2>|<font3> => <fontthatworks>
@ -207,12 +188,13 @@ bool Font::load(const string &name) {
// Xft and X/Xmb fonts have different defaults // Xft and X/Xmb fonts have different defaults
// (fixed doesn't really work right with Xft, especially rotated) // (fixed doesn't really work right with Xft, especially rotated)
// HOWEVER, note that if a Xft-style font is requested (not start with "-"), and // HOWEVER, note that if a Xft-style font is requested (does not start
// it turns out to be a bitmapped XFont, then Xft will load it, BUT it does not // with "-"), and it turns out to be a bitmapped XFont, then Xft will
// currently (5jan2007) rotate bitmapped fonts (ok-ish), nor adjust the baseline for its // load it, BUT it does not currently (2007-01-05) rotate bitmapped
// lack of rotation (not ok: messes up placement). I can't see a neat way around this, // fonts (ok-ish), nor adjust the baseline for its lack of rotation
// other than the user re-specifying their font explicitly in XFont form so we don't use the // (not ok: messes up placement). I can't see a neat way around this,
// Xft backend. // 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; 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); m_fontimp->drawText(w, screen, gc, text, len, x, y, orient);
} }
} }

View file

@ -21,7 +21,6 @@
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
#include "TextTheme.hh" #include "TextTheme.hh"
#include "App.hh" #include "App.hh"
#include <X11/Xlib.h> #include <X11/Xlib.h>

View file

@ -31,29 +31,17 @@
#include <locale.h> #include <locale.h>
#endif // HAVE_SETLOCALE #endif // HAVE_SETLOCALE
#ifdef HAVE_CSTDIO #include <cstdarg>
#include <cstdio> #include <cstring>
#else
#include <stdio.h>
#endif
#ifdef HAVE_CSTDARG
#include <cstdarg>
#else
#include <stdarg.h>
#endif
#ifdef HAVE_CSTRING
#include <cstring>
#else
#include <string.h>
#endif
using std::string; using std::string;
namespace { namespace {
XFontSet createFontSet(const char *fontname, bool& utf8mode) { XFontSet createFontSet(const char *fontname, bool& utf8mode) {
Display *display = FbTk::App::instance()->display(); Display *display = FbTk::App::instance()->display();
XFontSet fs; XFontSet fs = 0;
char **missing; char **missing;
const char *constdef = "-"; const char *constdef = "-";
char *def = const_cast<char *>(constdef); char *def = const_cast<char *>(constdef);