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
// 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 <cstring>
#else
#include <string.h>
#endif
#ifdef HAVE_CSTDLIB
#include <cstdlib>
#else
#include <stdlib.h>
#endif
#include <list>
#include <map>
#include <typeinfo>
#include <langinfo.h>
#include <cstdio>
#include <errno.h>
using std::string;
using std::map;
using std::list;
#ifdef HAVE_SETLOCALE
#include <locale.h>
#endif //HAVE_SETLOCALE
using std::string;
using std::map;
using std::list;
namespace {
// 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
// (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);
}
}

View file

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

View file

@ -31,29 +31,17 @@
#include <locale.h>
#endif // HAVE_SETLOCALE
#ifdef HAVE_CSTDIO
#include <cstdio>
#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;
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<char *>(constdef);