diff --git a/src/browsedialog.cpp b/src/browsedialog.cpp index 240ad0d..1737beb 100644 --- a/src/browsedialog.cpp +++ b/src/browsedialog.cpp @@ -3,8 +3,8 @@ #include "FastDelegate.h" #include "filelister.h" #include "gmenu2x.h" - -#include +#include "iconbutton.h" +#include "utilities.h" using namespace fastdelegate; using std::string; diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 6ee4d88..4af5582 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -60,6 +60,8 @@ #include "gmenu2x.h" #include "filelister.h" #include "cpu.h" +#include "utilities.h" +#include "powersaver.h" #include "iconbutton.h" #include "messagebox.h" @@ -86,9 +88,30 @@ //#include #endif +typedef fastdelegate::FastDelegate0<> MenuAction; +struct MenuOption { + std::string text; + MenuAction action; +}; + using namespace std; using namespace fastdelegate; +#ifndef DEFAULT_WALLPAPER_PATH +#define DEFAULT_WALLPAPER_PATH \ + GMENU2X_SYSTEM_DIR "/skins/Default/wallpapers/default.png" +#endif + +const int MAX_VOLUME_SCALE_FACTOR = 200; +// Default values - going to add settings adjustment, saving, loading and such +const int VOLUME_SCALER_MUTE = 0; +const int VOLUME_SCALER_PHONES = 65; +const int VOLUME_SCALER_NORMAL = 100; +const int VOLUME_MODE_MUTE = 0; +const int VOLUME_MODE_PHONES = 1; +const int VOLUME_MODE_NORMAL = 2; +const int BATTERY_READS = 10; + #ifdef _CARD_ROOT const char *CARD_ROOT = _CARD_ROOT; #elif defined(PLATFORM_DINGUX) @@ -1964,6 +1987,11 @@ void GMenu2X::scanPath(string path, vector *files) { closedir(dirp); } +typedef struct { + unsigned short batt; + unsigned short remocon; +} MMSP2ADC; + unsigned short GMenu2X::getBatteryLevel() { #ifdef PLATFORM_GP2X /* if (batteryHandle<=0) return 0; diff --git a/src/gmenu2x.h b/src/gmenu2x.h index 16ef2e5..164ae82 100644 --- a/src/gmenu2x.h +++ b/src/gmenu2x.h @@ -22,41 +22,27 @@ #define GMENU2X_H #include "surfacecollection.h" -#include "iconbutton.h" #include "translator.h" #include "FastDelegate.h" -#include "utilities.h" #include "touchscreen.h" #include "inputmanager.h" -#include "asfont.h" #include "surface.h" -#include "powersaver.h" #include #include #include #include +class ASFont; +class Button; +class Menu; +class Surface; + #ifndef GMENU2X_SYSTEM_DIR #define GMENU2X_SYSTEM_DIR "/usr/share/gmenu2x" #endif -#ifndef DEFAULT_WALLPAPER_PATH -#define DEFAULT_WALLPAPER_PATH \ - GMENU2X_SYSTEM_DIR "/skins/Default/wallpapers/default.png" -#endif - -const int MAX_VOLUME_SCALE_FACTOR = 200; -// Default values - going to add settings adjustment, saving, loading and such -const int VOLUME_SCALER_MUTE = 0; -const int VOLUME_SCALER_PHONES = 65; -const int VOLUME_SCALER_NORMAL = 100; -const int VOLUME_MODE_MUTE = 0; -const int VOLUME_MODE_PHONES = 1; -const int VOLUME_MODE_NORMAL = 2; -const int BATTERY_READS = 10; - -const int LOOP_DELAY=30000; +const int LOOP_DELAY = 30000; extern const char *CARD_ROOT; extern const int CARD_ROOT_LEN; @@ -73,22 +59,9 @@ enum color { NUM_COLORS, }; -typedef fastdelegate::FastDelegate0<> MenuAction; typedef std::tr1::unordered_map > ConfStrHash; typedef std::tr1::unordered_map > ConfIntHash; -typedef struct { - unsigned short batt; - unsigned short remocon; -} MMSP2ADC; - -struct MenuOption { - std::string text; - MenuAction action; -}; - -class Menu; - class GMenu2X { private: std::string path; //!< Contains the working directory of GMenu2X diff --git a/src/imagedialog.cpp b/src/imagedialog.cpp index bfe24de..1565b31 100644 --- a/src/imagedialog.cpp +++ b/src/imagedialog.cpp @@ -22,6 +22,7 @@ #include "filelister.h" #include "gmenu2x.h" +#include "utilities.h" #include #include diff --git a/src/inputdialog.cpp b/src/inputdialog.cpp index 1098b66..1f335a4 100644 --- a/src/inputdialog.cpp +++ b/src/inputdialog.cpp @@ -22,6 +22,8 @@ #include "buttonbox.h" #include "gmenu2x.h" +#include "iconbutton.h" +#include "utilities.h" #include diff --git a/src/link.cpp b/src/link.cpp index 7fea615..921b42f 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -23,6 +23,7 @@ #include "gmenu2x.h" #include "menu.h" #include "selector.h" +#include "utilities.h" #include #include diff --git a/src/linkapp.cpp b/src/linkapp.cpp index 0992db5..5e35687 100644 --- a/src/linkapp.cpp +++ b/src/linkapp.cpp @@ -25,6 +25,7 @@ #include "menu.h" #include "selector.h" #include "textmanualdialog.h" +#include "utilities.h" #include #include diff --git a/src/menusettingbool.cpp b/src/menusettingbool.cpp index add56bf..78f5e14 100644 --- a/src/menusettingbool.cpp +++ b/src/menusettingbool.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Massimiliano Torromeo * - * massimiliano.torromeo@gmail.com * + * Copyright (C) 2006 by Massimiliano Torromeo * + * massimiliano.torromeo@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -17,8 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #include "menusettingbool.h" + #include "gmenu2x.h" +#include "iconbutton.h" #include "utilities.h" #include diff --git a/src/menusettingint.cpp b/src/menusettingint.cpp index 05fc785..f82e48f 100644 --- a/src/menusettingint.cpp +++ b/src/menusettingint.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Massimiliano Torromeo * - * massimiliano.torromeo@gmail.com * + * Copyright (C) 2006 by Massimiliano Torromeo * + * massimiliano.torromeo@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -17,8 +17,11 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #include "menusettingint.h" + #include "gmenu2x.h" +#include "iconbutton.h" #include "utilities.h" #include diff --git a/src/menusettingrgba.cpp b/src/menusettingrgba.cpp index 6fe420c..3f175da 100644 --- a/src/menusettingrgba.cpp +++ b/src/menusettingrgba.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Massimiliano Torromeo * - * massimiliano.torromeo@gmail.com * + * Copyright (C) 2006 by Massimiliano Torromeo * + * massimiliano.torromeo@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -17,8 +17,12 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #include "menusettingrgba.h" + #include "gmenu2x.h" +#include "iconbutton.h" +#include "utilities.h" #include diff --git a/src/menusettingrgba.h b/src/menusettingrgba.h index 806610d..f33b4df 100644 --- a/src/menusettingrgba.h +++ b/src/menusettingrgba.h @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Massimiliano Torromeo * - * massimiliano.torromeo@gmail.com * + * Copyright (C) 2006 by Massimiliano Torromeo * + * massimiliano.torromeo@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -17,6 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #ifndef MENUSETTINGRGBA_H #define MENUSETTINGRGBA_H diff --git a/src/selector.cpp b/src/selector.cpp index 1b82b03..cb00706 100644 --- a/src/selector.cpp +++ b/src/selector.cpp @@ -18,6 +18,15 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include "selector.h" + +#include "debug.h" +#include "filelister.h" +#include "gmenu2x.h" +#include "linkapp.h" +#include "menu.h" +#include "utilities.h" + #include #include #include @@ -28,13 +37,6 @@ #include #include -#include "menu.h" -#include "linkapp.h" -#include "selector.h" -#include "filelister.h" -#include "gmenu2x.h" -#include "debug.h" - using namespace std; using std::tr1::unordered_map; diff --git a/src/selector.h b/src/selector.h index b34e8b9..b445933 100644 --- a/src/selector.h +++ b/src/selector.h @@ -24,6 +24,7 @@ #include "dialog.h" #include +#include #include class LinkApp; diff --git a/src/textdialog.cpp b/src/textdialog.cpp index 118f5a2..b67f33a 100644 --- a/src/textdialog.cpp +++ b/src/textdialog.cpp @@ -21,6 +21,7 @@ #include "textdialog.h" #include "gmenu2x.h" +#include "utilities.h" using namespace std; diff --git a/src/textmanualdialog.cpp b/src/textmanualdialog.cpp index 44ad763..e50b370 100644 --- a/src/textmanualdialog.cpp +++ b/src/textmanualdialog.cpp @@ -21,6 +21,7 @@ #include "textmanualdialog.h" #include "gmenu2x.h" +#include "utilities.h" #include #include diff --git a/src/translator.cpp b/src/translator.cpp index 1883dc2..4a37ffb 100644 --- a/src/translator.cpp +++ b/src/translator.cpp @@ -22,6 +22,7 @@ #include "debug.h" #include "gmenu2x.h" +#include "utilities.h" #include #include diff --git a/src/wallpaperdialog.cpp b/src/wallpaperdialog.cpp index 5ec3c34..024f76d 100644 --- a/src/wallpaperdialog.cpp +++ b/src/wallpaperdialog.cpp @@ -24,6 +24,8 @@ #include "buttonbox.h" #include "filelister.h" #include "gmenu2x.h" +#include "iconbutton.h" +#include "utilities.h" #include