mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-29 15:52:48 +02:00
Massive header cleanup.
The main goal is to avoid including "gmenu2x.h" from headers. But I did various other cleanups as well while I was at it.
This commit is contained in:
parent
33e7f1ef56
commit
e0e7e87ebc
@ -1,11 +1,11 @@
|
||||
#include <string>
|
||||
|
||||
#include "browsedialog.h"
|
||||
|
||||
#include "FastDelegate.h"
|
||||
#include "filelister.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
using namespace fastdelegate;
|
||||
|
||||
BrowseDialog::BrowseDialog(GMenu2X *gmenu2x, const string &title,
|
||||
|
@ -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 *
|
||||
@ -18,26 +18,24 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef BROWSEDIALOG_H_
|
||||
#define BROWSEDIALOG_H_
|
||||
#ifndef BROWSEDIALOG_H
|
||||
#define BROWSEDIALOG_H
|
||||
|
||||
#include <string>
|
||||
#include "filelister.h"
|
||||
#include "gmenu2x.h"
|
||||
#include "buttonbox.h"
|
||||
#include "dialog.h"
|
||||
#include "filelister.h"
|
||||
#include "inputmanager.h"
|
||||
|
||||
class FileLister;
|
||||
|
||||
using std::string;
|
||||
#include <SDL.h>
|
||||
#include <string>
|
||||
|
||||
class BrowseDialog : protected Dialog {
|
||||
protected:
|
||||
BrowseDialog(GMenu2X *gmenu2x, const string &title, const string &subtitle);
|
||||
BrowseDialog(GMenu2X *gmenu2x, const std::string &title,
|
||||
const std::string &subtitle);
|
||||
virtual ~BrowseDialog();
|
||||
|
||||
void setPath(const string &path) {
|
||||
void setPath(const std::string &path) {
|
||||
fl->setPath(path);
|
||||
}
|
||||
|
||||
@ -59,8 +57,8 @@ private:
|
||||
|
||||
bool close, result;
|
||||
|
||||
string title;
|
||||
string subtitle;
|
||||
std::string title;
|
||||
std::string subtitle;
|
||||
|
||||
SDL_Rect clipRect;
|
||||
SDL_Rect touchRect;
|
||||
@ -89,14 +87,12 @@ private:
|
||||
public:
|
||||
bool exec();
|
||||
|
||||
const std::string &getPath()
|
||||
{
|
||||
const std::string &getPath() {
|
||||
return fl->getPath();
|
||||
}
|
||||
std::string getFile()
|
||||
{
|
||||
std::string getFile() {
|
||||
return (*fl)[selected];
|
||||
}
|
||||
};
|
||||
|
||||
#endif /*INPUTDIALOG_H_*/
|
||||
#endif // INPUTDIALOG_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 *
|
||||
@ -20,10 +20,12 @@
|
||||
|
||||
#include "dirdialog.h"
|
||||
|
||||
#include "filelister.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
DirDialog::DirDialog(GMenu2X *gmenu2x, const string &text, const string &dir) :
|
||||
BrowseDialog(gmenu2x, "Directory Browser", text)
|
||||
DirDialog::DirDialog(GMenu2X *gmenu2x, const string &text, const string &dir)
|
||||
: BrowseDialog(gmenu2x, "Directory Browser", text)
|
||||
{
|
||||
fl = new FileLister(dir, true, false);
|
||||
}
|
||||
|
@ -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 *
|
||||
@ -18,19 +18,18 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef DIRDIALOG_H_
|
||||
#define DIRDIALOG_H_
|
||||
|
||||
#include <string>
|
||||
#include "gmenu2x.h"
|
||||
#ifndef DIRDIALOG_H
|
||||
#define DIRDIALOG_H
|
||||
|
||||
#include "browsedialog.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class DirDialog : public BrowseDialog {
|
||||
public:
|
||||
DirDialog(GMenu2X *gmenu2x, const string &text, const string &dir="");
|
||||
DirDialog(GMenu2X *gmenu2x, const std::string &text,
|
||||
const std::string &dir="");
|
||||
~DirDialog();
|
||||
};
|
||||
|
||||
#endif /*INPUTDIALOG_H_*/
|
||||
#endif // DIRDIALOG_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 *
|
||||
@ -19,6 +19,8 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "filedialog.h"
|
||||
|
||||
#include "filelister.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -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 *
|
||||
@ -18,6 +18,11 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "imagedialog.h"
|
||||
|
||||
#include "filelister.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_gfxPrimitives.h>
|
||||
|
||||
@ -26,9 +31,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#include "imagedialog.h"
|
||||
#include "filelister.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
ImageDialog::ImageDialog(GMenu2X *gmenu2x, const string &text,
|
||||
|
@ -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 *
|
||||
@ -18,24 +18,24 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef IMAGEDIALOG_H_
|
||||
#define IMAGEDIALOG_H_
|
||||
#ifndef IMAGEDIALOG_H
|
||||
#define IMAGEDIALOG_H
|
||||
|
||||
#include "filedialog.h"
|
||||
#include "surfacecollection.h"
|
||||
|
||||
#include <string>
|
||||
#include "filedialog.h"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
class ImageDialog : public FileDialog {
|
||||
protected:
|
||||
SurfaceCollection previews;
|
||||
public:
|
||||
ImageDialog(GMenu2X *gmenu2x, const string &text, const string &filter="", const string &file="");
|
||||
ImageDialog(GMenu2X *gmenu2x, const std::string &text,
|
||||
const std::string &filter="", const string &file="");
|
||||
virtual ~ImageDialog();
|
||||
|
||||
virtual void beforeFileList();
|
||||
virtual void onChangeDir();
|
||||
};
|
||||
|
||||
#endif /*IMAGEDIALOG_H_*/
|
||||
#endif // IMAGEDIALOG_H
|
||||
|
12
src/link.cpp
12
src/link.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,12 +17,16 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#include "link.h"
|
||||
|
||||
#include "gmenu2x.h"
|
||||
#include "menu.h"
|
||||
#include "selector.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
using namespace std;
|
||||
using namespace fastdelegate;
|
||||
|
||||
|
10
src/link.h
10
src/link.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,14 +17,16 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LINK_H
|
||||
#define LINK_H
|
||||
|
||||
#include "button.h"
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include "button.h"
|
||||
#include "surface.h"
|
||||
class Surface;
|
||||
|
||||
using std::string;
|
||||
|
||||
|
@ -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,15 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "linkapp.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "gmenu2x.h"
|
||||
#include "menu.h"
|
||||
#include "selector.h"
|
||||
#include "textmanualdialog.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
@ -26,12 +35,6 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#include "linkapp.h"
|
||||
#include "menu.h"
|
||||
#include "selector.h"
|
||||
#include "textmanualdialog.h"
|
||||
#include "debug.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
LinkApp::LinkApp(GMenu2X *gmenu2x_, InputManager &inputMgr_,
|
||||
|
@ -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,14 +17,15 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LINKAPP_H
|
||||
#define LINKAPP_H
|
||||
|
||||
#include "link.h"
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include "link.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
class GMenu2X;
|
||||
|
@ -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,9 +17,12 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "menusettingdir.h"
|
||||
#include "iconbutton.h"
|
||||
|
||||
#include "dirdialog.h"
|
||||
#include "gmenu2x.h"
|
||||
#include "iconbutton.h"
|
||||
|
||||
using std::string;
|
||||
using fastdelegate::MakeDelegate;
|
||||
@ -31,11 +34,13 @@ MenuSettingDir::MenuSettingDir(
|
||||
{
|
||||
IconButton *btn;
|
||||
|
||||
btn = new IconButton(gmenu2x, "skin:imgs/buttons/cancel.png", gmenu2x->tr["Clear"]);
|
||||
btn = new IconButton(gmenu2x, "skin:imgs/buttons/cancel.png",
|
||||
gmenu2x->tr["Clear"]);
|
||||
btn->setAction(MakeDelegate(this, &MenuSettingDir::clear));
|
||||
buttonBox.add(btn);
|
||||
|
||||
btn = new IconButton(gmenu2x, "skin:imgs/buttons/accept.png", gmenu2x->tr["Select a directory"]);
|
||||
btn = new IconButton(gmenu2x, "skin:imgs/buttons/accept.png",
|
||||
gmenu2x->tr["Select a directory"]);
|
||||
btn->setAction(MakeDelegate(this, &MenuSettingDir::edit));
|
||||
buttonBox.add(btn);
|
||||
}
|
||||
@ -43,5 +48,5 @@ MenuSettingDir::MenuSettingDir(
|
||||
void MenuSettingDir::edit()
|
||||
{
|
||||
DirDialog dd(gmenu2x, description, value());
|
||||
if (dd.exec()) setValue( dd.getPath() );
|
||||
if (dd.exec()) setValue(dd.getPath());
|
||||
}
|
||||
|
@ -17,9 +17,12 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "menusettingfile.h"
|
||||
#include "iconbutton.h"
|
||||
|
||||
#include "filedialog.h"
|
||||
#include "gmenu2x.h"
|
||||
#include "iconbutton.h"
|
||||
|
||||
using std::string;
|
||||
using fastdelegate::MakeDelegate;
|
||||
|
@ -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,7 +17,10 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "menusettingimage.h"
|
||||
|
||||
#include "gmenu2x.h"
|
||||
#include "imagedialog.h"
|
||||
#include "utilities.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 *
|
||||
@ -36,6 +36,8 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define SELECTOR_ELEMENTS 11
|
||||
|
||||
Selector::Selector(GMenu2X *gmenu2x, LinkApp *link, const string &selectorDir) :
|
||||
Dialog(gmenu2x)
|
||||
{
|
||||
|
@ -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 *
|
||||
@ -18,15 +18,13 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SELECTOR_H_
|
||||
#define SELECTOR_H_
|
||||
#ifndef SELECTOR_H
|
||||
#define SELECTOR_H
|
||||
|
||||
#include <string>
|
||||
#include "gmenu2x.h"
|
||||
#include "utilities.h"
|
||||
#include "dialog.h"
|
||||
|
||||
#define SELECTOR_ELEMENTS 11
|
||||
#include <string>
|
||||
#include <tr1/unordered_map>
|
||||
|
||||
class LinkApp;
|
||||
class FileLister;
|
||||
@ -38,21 +36,23 @@ class Selector : protected Dialog {
|
||||
private:
|
||||
int selRow;
|
||||
LinkApp *link;
|
||||
string file, dir;
|
||||
unordered_map<string, string> aliases;
|
||||
std::string file, dir;
|
||||
std::tr1::unordered_map<std::string, std::string> aliases;
|
||||
|
||||
void loadAliases();
|
||||
string getAlias(const string &key);
|
||||
void prepare(FileLister *fl, vector<string> *screens, vector<string> *titles);
|
||||
void freeScreenshots(vector<string> *screens);
|
||||
string getAlias(const std::string &key);
|
||||
void prepare(FileLister *fl, std::vector<std::string> *screens,
|
||||
std::vector<std::string> *titles);
|
||||
void freeScreenshots(std::vector<std::string> *screens);
|
||||
|
||||
public:
|
||||
Selector(GMenu2X *gmenu2x, LinkApp *link, const string &selectorDir="");
|
||||
Selector(GMenu2X *gmenu2x, LinkApp *link,
|
||||
const std::string &selectorDir = "");
|
||||
|
||||
int exec(int startSelection=0);
|
||||
int exec(int startSelection = 0);
|
||||
|
||||
const string &getFile() { return file; }
|
||||
const string &getDir() { return dir; }
|
||||
const std::string &getFile() { return file; }
|
||||
const std::string &getDir() { return dir; }
|
||||
};
|
||||
|
||||
#endif /*SELECTOR_H_*/
|
||||
#endif // SELECTOR_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 *
|
||||
@ -18,11 +18,14 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "settingsdialog.h"
|
||||
|
||||
#include "gmenu2x.h"
|
||||
#include "menusetting.h"
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_gfxPrimitives.h>
|
||||
|
||||
#include "settingsdialog.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
SettingsDialog::SettingsDialog(
|
||||
|
@ -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 *
|
||||
@ -18,29 +18,29 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SETTINGSDIALOG_H_
|
||||
#define SETTINGSDIALOG_H_
|
||||
#ifndef SETTINGSDIALOG_H
|
||||
#define SETTINGSDIALOG_H
|
||||
|
||||
#include <string>
|
||||
#include "gmenu2x.h"
|
||||
#include "menusetting.h"
|
||||
#include "dialog.h"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class InputManager;
|
||||
class MenuSetting;
|
||||
class Touchscreen;
|
||||
|
||||
class SettingsDialog : protected Dialog {
|
||||
private:
|
||||
InputManager &inputMgr;
|
||||
Touchscreen &ts;
|
||||
vector<MenuSetting *> voices;
|
||||
string text, icon;
|
||||
std::vector<MenuSetting *> voices;
|
||||
std::string text, icon;
|
||||
|
||||
public:
|
||||
SettingsDialog(GMenu2X *gmenu2x, InputManager &inputMgr, Touchscreen &ts, const string &text, const string &icon="skin:sections/settings.png");
|
||||
SettingsDialog(GMenu2X *gmenu2x, InputManager &inputMgr, Touchscreen &ts,
|
||||
const std::string &text,
|
||||
const std::string &icon = "skin:sections/settings.png");
|
||||
~SettingsDialog();
|
||||
|
||||
bool edited();
|
||||
@ -48,4 +48,4 @@ public:
|
||||
void addSetting(MenuSetting* set);
|
||||
};
|
||||
|
||||
#endif /*INPUTDIALOG_H_*/
|
||||
#endif // SETTINGSDIALOG_H
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "textdialog.h"
|
||||
|
||||
#include "gmenu2x.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
TextDialog::TextDialog(GMenu2X *gmenu2x, const string &title, const string &description, const string &icon, vector<string> *text)
|
||||
@ -33,7 +35,7 @@ TextDialog::TextDialog(GMenu2X *gmenu2x, const string &title, const string &desc
|
||||
}
|
||||
|
||||
void TextDialog::preProcess() {
|
||||
uint i=0;
|
||||
unsigned i = 0;
|
||||
string row;
|
||||
|
||||
while (i<text->size()) {
|
||||
@ -45,12 +47,12 @@ void TextDialog::preProcess() {
|
||||
vector<string> words;
|
||||
split(words, row, " ");
|
||||
|
||||
uint numWords = words.size();
|
||||
unsigned numWords = words.size();
|
||||
//find the maximum number of rows that can be printed on screen
|
||||
while (gmenu2x->font->getTextWidth(row)>(int)gmenu2x->resX-15 && numWords>0) {
|
||||
numWords--;
|
||||
row = "";
|
||||
for (uint x=0; x<numWords; x++)
|
||||
for (unsigned x=0; x<numWords; x++)
|
||||
row += words[x] + " ";
|
||||
row = trim(row);
|
||||
}
|
||||
@ -62,7 +64,7 @@ void TextDialog::preProcess() {
|
||||
|
||||
//build the remaining text in another row
|
||||
row = "";
|
||||
for (uint x=numWords; x<words.size(); x++)
|
||||
for (unsigned x=numWords; x<words.size(); x++)
|
||||
row += words[x] + " ";
|
||||
row = trim(row);
|
||||
|
||||
@ -74,10 +76,11 @@ void TextDialog::preProcess() {
|
||||
}
|
||||
}
|
||||
|
||||
void TextDialog::drawText(vector<string> *text, uint firstRow, uint rowsPerPage) {
|
||||
void TextDialog::drawText(vector<string> *text, unsigned firstRow,
|
||||
unsigned rowsPerPage) {
|
||||
gmenu2x->s->setClipRect(0,41,gmenu2x->resX-10,gmenu2x->resY-60);
|
||||
|
||||
for (uint i=firstRow; i<firstRow+rowsPerPage && i<text->size(); i++) {
|
||||
for (unsigned i=firstRow; i<firstRow+rowsPerPage && i<text->size(); i++) {
|
||||
int rowY;
|
||||
if (text->at(i)=="----") { //draw a line
|
||||
rowY = 42+(int)((i-firstRow+0.5)*gmenu2x->font->getHeight());
|
||||
@ -113,8 +116,8 @@ void TextDialog::exec() {
|
||||
|
||||
bg.convertToDisplayFormat();
|
||||
|
||||
uint firstRow = 0;
|
||||
uint rowsPerPage = (gmenu2x->resY - 60) / gmenu2x->font->getHeight();
|
||||
unsigned firstRow = 0;
|
||||
unsigned rowsPerPage = (gmenu2x->resY - 60) / gmenu2x->font->getHeight();
|
||||
while (!close) {
|
||||
bg.blit(gmenu2x->s, 0, 0);
|
||||
drawText(text, firstRow, rowsPerPage);
|
||||
|
@ -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 *
|
||||
@ -18,27 +18,28 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef TEXTDIALOG_H_
|
||||
#define TEXTDIALOG_H_
|
||||
#ifndef TEXTDIALOG_H
|
||||
#define TEXTDIALOG_H
|
||||
|
||||
#include <string>
|
||||
#include "gmenu2x.h"
|
||||
#include "dialog.h"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class TextDialog : protected Dialog {
|
||||
protected:
|
||||
vector<string> *text;
|
||||
string title, description, icon;
|
||||
std::vector<std::string> *text;
|
||||
std::string title, description, icon;
|
||||
|
||||
void preProcess();
|
||||
void drawText(vector<string> *text, uint firstRow, uint rowsPerPage);
|
||||
void drawText(std::vector<std::string> *text, unsigned firstRow,
|
||||
unsigned rowsPerPage);
|
||||
|
||||
public:
|
||||
TextDialog(GMenu2X *gmenu2x, const string &title, const string &description, const string &icon, vector<string> *text);
|
||||
TextDialog(GMenu2X *gmenu2x, const std::string &title,
|
||||
const std::string &description, const std::string &icon,
|
||||
std::vector<std::string> *text);
|
||||
void exec();
|
||||
};
|
||||
|
||||
#endif /*TEXTDIALOG_H_*/
|
||||
#endif // TEXTDIALOG_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 *
|
||||
@ -18,9 +18,12 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <sstream>
|
||||
#include "textmanualdialog.h"
|
||||
|
||||
#include "gmenu2x.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
TextManualDialog::TextManualDialog(GMenu2X *gmenu2x, const string &title, const string &icon, vector<string> *text)
|
||||
|
@ -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 *
|
||||
@ -18,28 +18,27 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef TEXTMANUALDIALOG_H_
|
||||
#define TEXTMANUALDIALOG_H_
|
||||
#ifndef TEXTMANUALDIALOG_H
|
||||
#define TEXTMANUALDIALOG_H
|
||||
|
||||
#include "textdialog.h"
|
||||
|
||||
#include <string>
|
||||
#include "textdialog.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
#include <vector>
|
||||
|
||||
struct ManualPage {
|
||||
string title;
|
||||
vector<string> text;
|
||||
std::string title;
|
||||
std::vector<std::string> text;
|
||||
};
|
||||
|
||||
class TextManualDialog : public TextDialog {
|
||||
private:
|
||||
vector<ManualPage> pages;
|
||||
std::vector<ManualPage> pages;
|
||||
|
||||
public:
|
||||
TextManualDialog(GMenu2X *gmenu2x, const string &title, const string &icon, vector<string> *text);
|
||||
TextManualDialog(GMenu2X *gmenu2x, const std::string &title,
|
||||
const std::string &icon, std::vector<std::string> *text);
|
||||
void exec();
|
||||
};
|
||||
|
||||
#endif /*TEXTMANUALDIALOG_H_*/
|
||||
#endif // TEXTMANUALDIALOG_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 *
|
||||
@ -18,12 +18,14 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "wallpaperdialog.h"
|
||||
#include "filelister.h"
|
||||
#include "buttonbox.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "buttonbox.h"
|
||||
#include "filelister.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -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 *
|
||||
@ -18,22 +18,19 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef WALLPAPERDIALOG_H_
|
||||
#define WALLPAPERDIALOG_H_
|
||||
#ifndef WALLPAPERDIALOG_H
|
||||
#define WALLPAPERDIALOG_H
|
||||
|
||||
#include <string>
|
||||
#include "gmenu2x.h"
|
||||
#include "dialog.h"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
#include <string>
|
||||
|
||||
class WallpaperDialog : protected Dialog {
|
||||
public:
|
||||
WallpaperDialog(GMenu2X *gmenu2x);
|
||||
string wallpaper;
|
||||
std::string wallpaper;
|
||||
|
||||
bool exec();
|
||||
};
|
||||
|
||||
#endif /*WALLPAPERDIALOG_H_*/
|
||||
#endif // WALLPAPERDIALOG_H
|
||||
|
Loading…
Reference in New Issue
Block a user