include and ifdef clean-up

This commit is contained in:
unK
2008-10-07 16:03:09 +02:00
parent c6fea611bf
commit fc00baa300
5 changed files with 16 additions and 21 deletions

View File

@@ -18,6 +18,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#include <algorithm>
#include <iostream> #include <iostream>
#include "helpers.h" #include "helpers.h"

View File

@@ -18,7 +18,11 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#include <clocale>
#include <algorithm>
#include <iostream> #include <iostream>
#include <map>
#include "mpdpp.h" #include "mpdpp.h"
#include "ncmpcpp.h" #include "ncmpcpp.h"

View File

@@ -21,22 +21,6 @@
#ifndef HAVE_NCMPCPP_H #ifndef HAVE_NCMPCPP_H
#define HAVE_NCMPCPP_H #define HAVE_NCMPCPP_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef UTF8_ENABLED
# define UNICODE 1
#else
# define UNICODE 0
#endif
#include <cstdio>
#include <clocale>
#include <ctime>
#include <algorithm>
#include <map>
#include "window.h" #include "window.h"
#include "menu.h" #include "menu.h"
#include "scrollpad.h" #include "scrollpad.h"

View File

@@ -36,13 +36,13 @@ void Scrollpad::Add(string str)
itsRawContent += str; itsRawContent += str;
#ifdef UTF8_ENABLED # ifdef UTF8_ENABLED
wstring s = ToWString(str); wstring s = ToWString(str);
wstring tmp; wstring tmp;
#else # else
string &s = str; string &s = str;
string tmp; string tmp;
#endif # endif
int x_pos = 0; int x_pos = 0;
int space_pos = 0; int space_pos = 0;

View File

@@ -21,6 +21,10 @@
#ifndef HAVE_WINDOW_H #ifndef HAVE_WINDOW_H
#define HAVE_WINDOW_H #define HAVE_WINDOW_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "ncurses.h" #include "ncurses.h"
#include <stack> #include <stack>
@@ -30,10 +34,12 @@
#include <cstring> #include <cstring>
#ifdef UTF8_ENABLED #ifdef UTF8_ENABLED
# define UNICODE 1
# define my_string_t wstring # define my_string_t wstring
# define TO_STRING(x) ToString(x) # define TO_STRING(x) ToString(x)
# define TO_WSTRING(x) ToWString(x) # define TO_WSTRING(x) ToWString(x)
#else #else
# define UNICODE 0
# define my_string_t string # define my_string_t string
# define TO_STRING(x) x # define TO_STRING(x) x
# define TO_WSTRING(x) x # define TO_WSTRING(x) x
@@ -91,12 +97,12 @@ class Window
virtual void Write(int, const string &, bool = 0); virtual void Write(int, const string &, bool = 0);
virtual void WriteXY(int x, int y, const string &s, bool ete = 0) { WriteXY(x, y, 0xFFFF, s, ete); } virtual void WriteXY(int x, int y, const string &s, bool ete = 0) { WriteXY(x, y, 0xFFFF, s, ete); }
virtual void WriteXY(int, int, int, const string &, bool = 0); virtual void WriteXY(int, int, int, const string &, bool = 0);
#ifdef UTF8_ENABLED # ifdef UTF8_ENABLED
virtual void Write(const wstring &s, bool cte = 0) { Write(0xFFFF, s, cte); } virtual void Write(const wstring &s, bool cte = 0) { Write(0xFFFF, s, cte); }
virtual void Write(int, const wstring &, bool = 0); virtual void Write(int, const wstring &, bool = 0);
virtual void WriteXY(int x, int y, const wstring &s, bool ete = 0) { WriteXY(x, y, 0xFFFF, s, ete); } virtual void WriteXY(int x, int y, const wstring &s, bool ete = 0) { WriteXY(x, y, 0xFFFF, s, ete); }
virtual void WriteXY(int, int, int, const wstring &, bool = 0); virtual void WriteXY(int, int, int, const wstring &, bool = 0);
#endif # endif
virtual string GetString(const string &, unsigned int = -1, int = 0) const; virtual string GetString(const string &, unsigned int = -1, int = 0) const;
virtual string GetString(unsigned int length = -1, int width = 0) const { return GetString("", length, width); } virtual string GetString(unsigned int length = -1, int width = 0) const { return GetString("", length, width); }
virtual void Scrollable(bool) const; virtual void Scrollable(bool) const;