aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorMathias Gumz <akira@fluxbox.org>2015-01-10 21:57:00 (GMT)
committerMathias Gumz <akira@fluxbox.org>2015-01-10 21:57:00 (GMT)
commitdc9793c90af75fd6e3d3e512abc2167a5544caba (patch)
treea4f3488a2bc19f182e426d7d6debd6bc3ce40ceb /src/FbTk
parentb16528de87e80dcd1ae9f70c8c76fd8da722d2da (diff)
downloadfluxbox-dc9793c90af75fd6e3d3e512abc2167a5544caba.zip
fluxbox-dc9793c90af75fd6e3d3e512abc2167a5544caba.tar.bz2
Code cleanup
Reorder some includes; remove unused includes
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Font.cc52
-rw-r--r--src/FbTk/TextTheme.cc1
-rw-r--r--src/FbTk/XmbFontImp.cc20
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 @@
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#include "StringUtil.hh"
23#include "stringstream.hh"
24#include "Font.hh" 22#include "Font.hh"
25#include "FontImp.hh" 23#include "FontImp.hh"
24#include "StringUtil.hh"
25#include "stringstream.hh"
26#include "App.hh" 26#include "App.hh"
27#include "GContext.hh"
28#include "XFontImp.hh"
27 29
28// for antialias 30// for antialias
29#ifdef USE_XFT 31#ifdef USE_XFT
@@ -35,42 +37,21 @@
35#include "XmbFontImp.hh" 37#include "XmbFontImp.hh"
36#endif //USE_XMB 38#endif //USE_XMB
37 39
38// standard font system 40#include <cstring>
39#include "XFontImp.hh" 41#include <cstdlib>
40
41#include "GContext.hh"
42
43#ifndef __USE_GNU
44#define __USE_GNU
45#endif //__USE_GNU
46
47#ifdef HAVE_CSTRING
48 #include <cstring>
49#else
50 #include <string.h>
51#endif
52#ifdef HAVE_CSTDLIB
53 #include <cstdlib>
54#else
55 #include <stdlib.h>
56#endif
57#include <list> 42#include <list>
58#include <map> 43#include <map>
59#include <typeinfo> 44#include <typeinfo>
60#include <langinfo.h> 45#include <langinfo.h>
61#include <cstdio>
62 46
63#include <errno.h> 47#ifdef HAVE_SETLOCALE
48#include <locale.h>
49#endif //HAVE_SETLOCALE
64 50
65using std::string; 51using std::string;
66using std::map; 52using std::map;
67using std::list; 53using std::list;
68 54
69
70#ifdef HAVE_SETLOCALE
71#include <locale.h>
72#endif //HAVE_SETLOCALE
73
74namespace { 55namespace {
75 56
76// use to map <font1>|<font2>|<font3> => <fontthatworks> 57// use to map <font1>|<font2>|<font3> => <fontthatworks>
@@ -207,12 +188,13 @@ bool Font::load(const string &name) {
207 // Xft and X/Xmb fonts have different defaults 188 // Xft and X/Xmb fonts have different defaults
208 // (fixed doesn't really work right with Xft, especially rotated) 189 // (fixed doesn't really work right with Xft, especially rotated)
209 190
210 // HOWEVER, note that if a Xft-style font is requested (not start with "-"), and 191 // HOWEVER, note that if a Xft-style font is requested (does not start
211 // it turns out to be a bitmapped XFont, then Xft will load it, BUT it does not 192 // with "-"), and it turns out to be a bitmapped XFont, then Xft will
212 // currently (5jan2007) rotate bitmapped fonts (ok-ish), nor adjust the baseline for its 193 // load it, BUT it does not currently (2007-01-05) rotate bitmapped
213 // lack of rotation (not ok: messes up placement). I can't see a neat way around this, 194 // fonts (ok-ish), nor adjust the baseline for its lack of rotation
214 // other than the user re-specifying their font explicitly in XFont form so we don't use the 195 // (not ok: messes up placement). I can't see a neat way around this,
215 // Xft backend. 196 // other than the user re-specifying their font explicitly in XFont
197 // form so we don't use the Xft backend.
216 198
217 std::string realname = *name_it; 199 std::string realname = *name_it;
218 200
@@ -304,8 +286,6 @@ void Font::drawText(const FbDrawable &w, int screen, GC gc,
304 } 286 }
305 287
306 m_fontimp->drawText(w, screen, gc, text, len, x, y, orient); 288 m_fontimp->drawText(w, screen, gc, text, len, x, y, orient);
307
308
309} 289}
310 290
311} 291}
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 @@
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23#include "TextTheme.hh" 23#include "TextTheme.hh"
24
25#include "App.hh" 24#include "App.hh"
26 25
27#include <X11/Xlib.h> 26#include <X11/Xlib.h>
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 @@
31#include <locale.h> 31#include <locale.h>
32#endif // HAVE_SETLOCALE 32#endif // HAVE_SETLOCALE
33 33
34#ifdef HAVE_CSTDIO 34#include <cstdarg>
35 #include <cstdio> 35#include <cstring>
36#else
37 #include <stdio.h>
38#endif
39#ifdef HAVE_CSTDARG
40 #include <cstdarg>
41#else
42 #include <stdarg.h>
43#endif
44#ifdef HAVE_CSTRING
45 #include <cstring>
46#else
47 #include <string.h>
48#endif
49 36
50using std::string; 37using std::string;
51 38
52namespace { 39namespace {
53 40
54XFontSet createFontSet(const char *fontname, bool& utf8mode) { 41XFontSet createFontSet(const char *fontname, bool& utf8mode) {
42
55 Display *display = FbTk::App::instance()->display(); 43 Display *display = FbTk::App::instance()->display();
56 XFontSet fs; 44 XFontSet fs = 0;
57 char **missing; 45 char **missing;
58 const char *constdef = "-"; 46 const char *constdef = "-";
59 char *def = const_cast<char *>(constdef); 47 char *def = const_cast<char *>(constdef);