include and ifdef clean-up
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
#include "helpers.h"
|
||||
|
||||
@@ -18,7 +18,11 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <clocale>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
#include "mpdpp.h"
|
||||
#include "ncmpcpp.h"
|
||||
|
||||
@@ -21,22 +21,6 @@
|
||||
#ifndef 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 "menu.h"
|
||||
#include "scrollpad.h"
|
||||
|
||||
@@ -36,13 +36,13 @@ void Scrollpad::Add(string str)
|
||||
|
||||
itsRawContent += str;
|
||||
|
||||
#ifdef UTF8_ENABLED
|
||||
# ifdef UTF8_ENABLED
|
||||
wstring s = ToWString(str);
|
||||
wstring tmp;
|
||||
#else
|
||||
# else
|
||||
string &s = str;
|
||||
string tmp;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
int x_pos = 0;
|
||||
int space_pos = 0;
|
||||
|
||||
10
src/window.h
10
src/window.h
@@ -21,6 +21,10 @@
|
||||
#ifndef HAVE_WINDOW_H
|
||||
#define HAVE_WINDOW_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "ncurses.h"
|
||||
|
||||
#include <stack>
|
||||
@@ -30,10 +34,12 @@
|
||||
#include <cstring>
|
||||
|
||||
#ifdef UTF8_ENABLED
|
||||
# define UNICODE 1
|
||||
# define my_string_t wstring
|
||||
# define TO_STRING(x) ToString(x)
|
||||
# define TO_WSTRING(x) ToWString(x)
|
||||
#else
|
||||
# define UNICODE 0
|
||||
# define my_string_t string
|
||||
# define TO_STRING(x) x
|
||||
# define TO_WSTRING(x) x
|
||||
@@ -91,12 +97,12 @@ class Window
|
||||
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, 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(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, int, int, const wstring &, bool = 0);
|
||||
#endif
|
||||
# endif
|
||||
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 void Scrollable(bool) const;
|
||||
|
||||
Reference in New Issue
Block a user