mirror of https://github.com/stella-emu/stella.git
Pass OSystem and DialogContainer as reference instead of pointer in
all GUI classes. This makes sense, since the underlying classes were returning them as references anyway. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3019 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
09912c689b
commit
958d8940fc
|
@ -35,7 +35,7 @@
|
||||||
#include "CheatCodeDialog.hxx"
|
#include "CheatCodeDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
CheatCodeDialog::CheatCodeDialog(OSystem* osystem, DialogContainer* parent,
|
CheatCodeDialog::CheatCodeDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@ class OSystem;
|
||||||
class CheatCodeDialog : public Dialog
|
class CheatCodeDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CheatCodeDialog(OSystem* osystem, DialogContainer* parent,
|
CheatCodeDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font);
|
const GUI::Font& font);
|
||||||
virtual ~CheatCodeDialog();
|
virtual ~CheatCodeDialog();
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ static const char* pseudo_registers[][2] = {
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Debugger::Debugger(OSystem& osystem, Console& console)
|
Debugger::Debugger(OSystem& osystem, Console& console)
|
||||||
: DialogContainer(&osystem),
|
: DialogContainer(osystem),
|
||||||
myConsole(console),
|
myConsole(console),
|
||||||
mySystem(console.system()),
|
mySystem(console.system()),
|
||||||
myDialog(NULL),
|
myDialog(NULL),
|
||||||
|
@ -166,8 +166,8 @@ Debugger::~Debugger()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Debugger::initialize()
|
void Debugger::initialize()
|
||||||
{
|
{
|
||||||
const GUI::Size& s = myOSystem->settings().getSize("dbg.res");
|
const GUI::Size& s = myOSystem.settings().getSize("dbg.res");
|
||||||
const GUI::Size& d = myOSystem->frameBuffer().desktopSize();
|
const GUI::Size& d = myOSystem.frameBuffer().desktopSize();
|
||||||
myWidth = s.w; myHeight = s.h;
|
myWidth = s.w; myHeight = s.h;
|
||||||
|
|
||||||
// The debugger dialog is resizable, within certain bounds
|
// The debugger dialog is resizable, within certain bounds
|
||||||
|
@ -177,13 +177,13 @@ void Debugger::initialize()
|
||||||
myWidth = BSPF_min(myWidth, (uInt32)d.w);
|
myWidth = BSPF_min(myWidth, (uInt32)d.w);
|
||||||
myHeight = BSPF_min(myHeight, (uInt32)d.h);
|
myHeight = BSPF_min(myHeight, (uInt32)d.h);
|
||||||
|
|
||||||
myOSystem->settings().setValue("dbg.res", GUI::Size(myWidth, myHeight));
|
myOSystem.settings().setValue("dbg.res", GUI::Size(myWidth, myHeight));
|
||||||
|
|
||||||
delete myBaseDialog; myBaseDialog = myDialog = NULL;
|
delete myBaseDialog; myBaseDialog = myDialog = NULL;
|
||||||
myDialog = new DebuggerDialog(myOSystem, this, 0, 0, myWidth, myHeight);
|
myDialog = new DebuggerDialog(myOSystem, *this, 0, 0, myWidth, myHeight);
|
||||||
myBaseDialog = myDialog;
|
myBaseDialog = myDialog;
|
||||||
|
|
||||||
myRewindManager = new RewindManager(*myOSystem, myDialog->rewindButton());
|
myRewindManager = new RewindManager(myOSystem, myDialog->rewindButton());
|
||||||
myCartDebug->setDebugWidget(&(myDialog->cartDebug()));
|
myCartDebug->setDebugWidget(&(myDialog->cartDebug()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,13 +191,13 @@ void Debugger::initialize()
|
||||||
FBInitStatus Debugger::initializeVideo()
|
FBInitStatus Debugger::initializeVideo()
|
||||||
{
|
{
|
||||||
string title = string("Stella ") + STELLA_VERSION + ": Debugger mode";
|
string title = string("Stella ") + STELLA_VERSION + ": Debugger mode";
|
||||||
return myOSystem->frameBuffer().createDisplay(title, myWidth, myHeight);
|
return myOSystem.frameBuffer().createDisplay(title, myWidth, myHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool Debugger::start(const string& message, int address)
|
bool Debugger::start(const string& message, int address)
|
||||||
{
|
{
|
||||||
if(myOSystem->eventHandler().enterDebugMode())
|
if(myOSystem.eventHandler().enterDebugMode())
|
||||||
{
|
{
|
||||||
// This must be done *after* we enter debug mode,
|
// This must be done *after* we enter debug mode,
|
||||||
// so the message isn't erased
|
// so the message isn't erased
|
||||||
|
@ -215,7 +215,7 @@ bool Debugger::start(const string& message, int address)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool Debugger::startWithFatalError(const string& message)
|
bool Debugger::startWithFatalError(const string& message)
|
||||||
{
|
{
|
||||||
if(myOSystem->eventHandler().enterDebugMode())
|
if(myOSystem.eventHandler().enterDebugMode())
|
||||||
{
|
{
|
||||||
// This must be done *after* we enter debug mode,
|
// This must be done *after* we enter debug mode,
|
||||||
// so the dialog is properly shown
|
// so the dialog is properly shown
|
||||||
|
@ -229,9 +229,9 @@ bool Debugger::startWithFatalError(const string& message)
|
||||||
void Debugger::quit(bool exitrom)
|
void Debugger::quit(bool exitrom)
|
||||||
{
|
{
|
||||||
if(exitrom)
|
if(exitrom)
|
||||||
myOSystem->eventHandler().handleEvent(Event::LauncherMode, 1);
|
myOSystem.eventHandler().handleEvent(Event::LauncherMode, 1);
|
||||||
else
|
else
|
||||||
myOSystem->eventHandler().leaveDebugMode();
|
myOSystem.eventHandler().leaveDebugMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -240,12 +240,12 @@ string Debugger::autoExec()
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
||||||
// autoexec.stella is always run
|
// autoexec.stella is always run
|
||||||
FilesystemNode autoexec(myOSystem->baseDir() + "autoexec.stella");
|
FilesystemNode autoexec(myOSystem.baseDir() + "autoexec.stella");
|
||||||
buf << "autoExec():" << endl
|
buf << "autoExec():" << endl
|
||||||
<< myParser->exec(autoexec) << endl;
|
<< myParser->exec(autoexec) << endl;
|
||||||
|
|
||||||
// Also, "romname.stella" if present
|
// Also, "romname.stella" if present
|
||||||
FilesystemNode romname(myOSystem->romFile().getPathWithExt(".stella"));
|
FilesystemNode romname(myOSystem.romFile().getPathWithExt(".stella"));
|
||||||
buf << myParser->exec(romname) << endl;
|
buf << myParser->exec(romname) << endl;
|
||||||
|
|
||||||
// Init builtins
|
// Init builtins
|
||||||
|
@ -310,7 +310,7 @@ void Debugger::saveState(int state)
|
||||||
mySystem.clearDirtyPages();
|
mySystem.clearDirtyPages();
|
||||||
|
|
||||||
unlockBankswitchState();
|
unlockBankswitchState();
|
||||||
myOSystem->state().saveState(state);
|
myOSystem.state().saveState(state);
|
||||||
lockBankswitchState();
|
lockBankswitchState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ void Debugger::loadState(int state)
|
||||||
mySystem.clearDirtyPages();
|
mySystem.clearDirtyPages();
|
||||||
|
|
||||||
unlockBankswitchState();
|
unlockBankswitchState();
|
||||||
myOSystem->state().loadState(state);
|
myOSystem.state().loadState(state);
|
||||||
lockBankswitchState();
|
lockBankswitchState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ int Debugger::step()
|
||||||
int cyc = mySystem.cycles();
|
int cyc = mySystem.cycles();
|
||||||
|
|
||||||
unlockBankswitchState();
|
unlockBankswitchState();
|
||||||
myOSystem->console().tia().updateScanlineByStep();
|
myOSystem.console().tia().updateScanlineByStep();
|
||||||
lockBankswitchState();
|
lockBankswitchState();
|
||||||
|
|
||||||
return mySystem.cycles() - cyc;
|
return mySystem.cycles() - cyc;
|
||||||
|
@ -362,7 +362,7 @@ int Debugger::trace()
|
||||||
int targetPC = myCpuDebug->pc() + 3; // return address
|
int targetPC = myCpuDebug->pc() + 3; // return address
|
||||||
|
|
||||||
unlockBankswitchState();
|
unlockBankswitchState();
|
||||||
myOSystem->console().tia().updateScanlineByTrace(targetPC);
|
myOSystem.console().tia().updateScanlineByTrace(targetPC);
|
||||||
lockBankswitchState();
|
lockBankswitchState();
|
||||||
|
|
||||||
return mySystem.cycles() - cyc;
|
return mySystem.cycles() - cyc;
|
||||||
|
@ -439,7 +439,7 @@ void Debugger::nextScanline(int lines)
|
||||||
unlockBankswitchState();
|
unlockBankswitchState();
|
||||||
while(lines)
|
while(lines)
|
||||||
{
|
{
|
||||||
myOSystem->console().tia().updateScanline();
|
myOSystem.console().tia().updateScanline();
|
||||||
--lines;
|
--lines;
|
||||||
}
|
}
|
||||||
lockBankswitchState();
|
lockBankswitchState();
|
||||||
|
@ -454,7 +454,7 @@ void Debugger::nextFrame(int frames)
|
||||||
unlockBankswitchState();
|
unlockBankswitchState();
|
||||||
while(frames)
|
while(frames)
|
||||||
{
|
{
|
||||||
myOSystem->console().tia().update();
|
myOSystem.console().tia().update();
|
||||||
--frames;
|
--frames;
|
||||||
}
|
}
|
||||||
lockBankswitchState();
|
lockBankswitchState();
|
||||||
|
|
|
@ -734,7 +734,7 @@ void DebuggerParser::executeCheat()
|
||||||
for(int arg = 0; arg < argCount; arg++)
|
for(int arg = 0; arg < argCount; arg++)
|
||||||
{
|
{
|
||||||
const string& cheat = argStrings[arg];
|
const string& cheat = argStrings[arg];
|
||||||
const Cheat* c = debugger.myOSystem->cheat().add("DBG", cheat);
|
const Cheat* c = debugger.myOSystem.cheat().add("DBG", cheat);
|
||||||
if(c && c->enabled())
|
if(c && c->enabled())
|
||||||
commandResult << "Cheat code " << cheat << " enabled" << endl;
|
commandResult << "Cheat code " << cheat << " enabled" << endl;
|
||||||
else
|
else
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
#include "DebuggerDialog.hxx"
|
#include "DebuggerDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
DebuggerDialog::DebuggerDialog(OSystem* osystem, DialogContainer* parent,
|
DebuggerDialog::DebuggerDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: Dialog(osystem, parent, x, y, w, h),
|
: Dialog(osystem, parent, x, y, w, h),
|
||||||
myTab(NULL),
|
myTab(NULL),
|
||||||
|
|
|
@ -49,7 +49,7 @@ class DebuggerDialog : public Dialog
|
||||||
kLargeFontMinW = 1300, kLargeFontMinH = 940
|
kLargeFontMinW = 1300, kLargeFontMinH = 940
|
||||||
};
|
};
|
||||||
|
|
||||||
DebuggerDialog(OSystem* osystem, DialogContainer* parent,
|
DebuggerDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
int x, int y, int w, int h);
|
int x, int y, int w, int h);
|
||||||
~DebuggerDialog();
|
~DebuggerDialog();
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
RomListSettings::RomListSettings(GuiObject* boss, const GUI::Font& font)
|
RomListSettings::RomListSettings(GuiObject* boss, const GUI::Font& font)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 16, 16),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
_xorig(0),
|
_xorig(0),
|
||||||
_yorig(0)
|
_yorig(0)
|
||||||
|
|
|
@ -193,9 +193,9 @@ bool OSystem::create()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Create menu and launcher GUI objects
|
// Create menu and launcher GUI objects
|
||||||
myMenu = new Menu(this);
|
myMenu = new Menu(*this);
|
||||||
myCommandMenu = new CommandMenu(this);
|
myCommandMenu = new CommandMenu(*this);
|
||||||
myLauncher = new Launcher(this);
|
myLauncher = new Launcher(*this);
|
||||||
myStateManager = new StateManager(*this);
|
myStateManager = new StateManager(*this);
|
||||||
|
|
||||||
// Create the sound object; the sound subsystem isn't actually
|
// Create the sound object; the sound subsystem isn't actually
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "AboutDialog.hxx"
|
#include "AboutDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
AboutDialog::AboutDialog(OSystem* osystem, DialogContainer* parent,
|
AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
myPage(1),
|
myPage(1),
|
||||||
|
|
|
@ -32,9 +32,9 @@ class StaticTextWidget;
|
||||||
class AboutDialog : public Dialog
|
class AboutDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AboutDialog(OSystem* osystem, DialogContainer* parent,
|
AboutDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font);
|
const GUI::Font& font);
|
||||||
~AboutDialog();
|
virtual ~AboutDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ButtonWidget* myNextButton;
|
ButtonWidget* myNextButton;
|
||||||
|
@ -49,8 +49,8 @@ class AboutDialog : public Dialog
|
||||||
int myLinesPerPage;
|
int myLinesPerPage;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
virtual void updateStrings(int page, int lines, string& title);
|
void updateStrings(int page, int lines, string& title);
|
||||||
void displayInfo();
|
void displayInfo();
|
||||||
|
|
||||||
void loadConfig() { displayInfo(); }
|
void loadConfig() { displayInfo(); }
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "AudioDialog.hxx"
|
#include "AudioDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent,
|
AudioDialog::AudioDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,8 +34,8 @@ class OSystem;
|
||||||
class AudioDialog : public Dialog
|
class AudioDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudioDialog(OSystem* osystem, DialogContainer* parent, const GUI::Font& font);
|
AudioDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font);
|
||||||
~AudioDialog();
|
virtual ~AudioDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SliderWidget* myVolumeSlider;
|
SliderWidget* myVolumeSlider;
|
||||||
|
@ -50,7 +50,7 @@ class AudioDialog : public Dialog
|
||||||
void setDefaults();
|
void setDefaults();
|
||||||
|
|
||||||
void handleSoundEnableChange(bool active);
|
void handleSoundEnableChange(bool active);
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kVolumeChanged = 'ADvc',
|
kVolumeChanged = 'ADvc',
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
|
BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
int max_w, int max_h)
|
int max_w, int max_h)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 0, 0),
|
||||||
CommandSender(boss)
|
CommandSender(boss)
|
||||||
{
|
{
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
|
|
|
@ -52,7 +52,7 @@ class BrowserDialog : public Dialog, public CommandSender
|
||||||
const FilesystemNode& getResult() const;
|
const FilesystemNode& getResult() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
void updateUI();
|
void updateUI();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
|
ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
const VariantList& combolist)
|
const VariantList& combolist)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 0, 0),
|
||||||
myComboEvent(Event::NoType)
|
myComboEvent(Event::NoType)
|
||||||
{
|
{
|
||||||
#define ADD_EVENT_POPUP(IDX, LABEL) \
|
#define ADD_EVENT_POPUP(IDX, LABEL) \
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ComboDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ComboDialog(GuiObject* boss, const GUI::Font& font, const VariantList& combolist);
|
ComboDialog(GuiObject* boss, const GUI::Font& font, const VariantList& combolist);
|
||||||
~ComboDialog();
|
virtual ~ComboDialog();
|
||||||
|
|
||||||
/** Place the dialog onscreen and center it */
|
/** Place the dialog onscreen and center it */
|
||||||
void show(Event::Type event, const string& name);
|
void show(Event::Type event, const string& name);
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
new ButtonWidget(this, font, xoffset, yoffset, buttonWidth, buttonHeight, label, cmd); xoffset += buttonWidth + 6
|
new ButtonWidget(this, font, xoffset, yoffset, buttonWidth, buttonHeight, label, cmd); xoffset += buttonWidth + 6
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
CommandDialog::CommandDialog(OSystem* osystem, DialogContainer* parent)
|
CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent)
|
||||||
: Dialog(osystem, parent, 0, 0, 16, 16)
|
: Dialog(osystem, parent, 0, 0, 16, 16)
|
||||||
{
|
{
|
||||||
const GUI::Font& font = instance().frameBuffer().font();
|
const GUI::Font& font = instance().frameBuffer().font();
|
||||||
|
|
|
@ -30,11 +30,11 @@ class OSystem;
|
||||||
class CommandDialog : public Dialog
|
class CommandDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CommandDialog(OSystem* osystem, DialogContainer* parent);
|
CommandDialog(OSystem& osystem, DialogContainer& parent);
|
||||||
~CommandDialog();
|
~CommandDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kSelectCmd = 'Csel',
|
kSelectCmd = 'Csel',
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
#include "CommandMenu.hxx"
|
#include "CommandMenu.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
CommandMenu::CommandMenu(OSystem* osystem)
|
CommandMenu::CommandMenu(OSystem& osystem)
|
||||||
: DialogContainer(osystem)
|
: DialogContainer(osystem)
|
||||||
{
|
{
|
||||||
myBaseDialog = new CommandDialog(myOSystem, this);
|
myBaseDialog = new CommandDialog(myOSystem, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -37,7 +37,7 @@ class CommandMenu : public DialogContainer
|
||||||
/**
|
/**
|
||||||
Create a new menu stack
|
Create a new menu stack
|
||||||
*/
|
*/
|
||||||
CommandMenu(OSystem* osystem);
|
CommandMenu(OSystem& osystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ConfigPathDialog::ConfigPathDialog(
|
ConfigPathDialog::ConfigPathDialog(
|
||||||
OSystem* osystem, DialogContainer* parent,
|
OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, GuiObject* boss,
|
const GUI::Font& font, GuiObject* boss,
|
||||||
int max_w, int max_h)
|
int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
|
|
|
@ -36,10 +36,10 @@ class StaticTextWidget;
|
||||||
class ConfigPathDialog : public Dialog, public CommandSender
|
class ConfigPathDialog : public Dialog, public CommandSender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfigPathDialog(OSystem* osystem, DialogContainer* parent,
|
ConfigPathDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, GuiObject* boss,
|
const GUI::Font& font, GuiObject* boss,
|
||||||
int max_w, int max_h);
|
int max_w, int max_h);
|
||||||
~ConfigPathDialog();
|
virtual ~ConfigPathDialog();
|
||||||
|
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font,
|
ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font,
|
||||||
const VariantList& items, int cmd)
|
const VariantList& items, int cmd)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 16, 16),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
_rowHeight(font.getLineHeight()),
|
_rowHeight(font.getLineHeight()),
|
||||||
_firstEntry(0),
|
_firstEntry(0),
|
||||||
|
|
|
@ -36,9 +36,9 @@
|
||||||
* ...
|
* ...
|
||||||
*/
|
*/
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Dialog::Dialog(OSystem* instance, DialogContainer* parent,
|
Dialog::Dialog(OSystem& instance, DialogContainer& parent,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: GuiObject(*instance, *parent, *this, x, y, w, h),
|
: GuiObject(instance, parent, *this, x, y, w, h),
|
||||||
_mouseWidget(0),
|
_mouseWidget(0),
|
||||||
_focusedWidget(0),
|
_focusedWidget(0),
|
||||||
_dragWidget(0),
|
_dragWidget(0),
|
||||||
|
@ -656,7 +656,7 @@ void Dialog::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
||||||
* in the local coordinate system, i.e. relative to the top left of the dialog.
|
* in the local coordinate system, i.e. relative to the top left of the dialog.
|
||||||
*/
|
*/
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Widget* Dialog::findWidget(int x, int y)
|
Widget* Dialog::findWidget(int x, int y) const
|
||||||
{
|
{
|
||||||
return Widget::findWidgetInChain(_firstWidget, x, y);
|
return Widget::findWidgetInChain(_firstWidget, x, y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Dialog : public GuiObject
|
||||||
friend class DialogContainer;
|
friend class DialogContainer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Dialog(OSystem* instance, DialogContainer* parent,
|
Dialog(OSystem& instance, DialogContainer& parent,
|
||||||
int x, int y, int w, int h);
|
int x, int y, int w, int h);
|
||||||
|
|
||||||
virtual ~Dialog();
|
virtual ~Dialog();
|
||||||
|
@ -101,7 +101,7 @@ class Dialog : public GuiObject
|
||||||
virtual bool handleJoyHat(int stick, int hat, int value);
|
virtual bool handleJoyHat(int stick, int hat, int value);
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
Widget* findWidget(int x, int y); // Find the widget at pos x,y if any
|
Widget* findWidget(int x, int y) const; // Find the widget at pos x,y if any
|
||||||
|
|
||||||
void addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
|
void addOKCancelBGroup(WidgetArray& wid, const GUI::Font& font,
|
||||||
const string& okText = "",
|
const string& okText = "",
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "DialogContainer.hxx"
|
#include "DialogContainer.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
DialogContainer::DialogContainer(OSystem* osystem)
|
DialogContainer::DialogContainer(OSystem& osystem)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
myBaseDialog(NULL),
|
myBaseDialog(NULL),
|
||||||
myTime(0)
|
myTime(0)
|
||||||
|
@ -132,7 +132,7 @@ void DialogContainer::reStack()
|
||||||
|
|
||||||
myBaseDialog->open(false); // don't force a refresh
|
myBaseDialog->open(false); // don't force a refresh
|
||||||
|
|
||||||
myOSystem->frameBuffer().refresh();
|
myOSystem.frameBuffer().refresh();
|
||||||
|
|
||||||
// Reset all continuous events
|
// Reset all continuous events
|
||||||
reset();
|
reset();
|
||||||
|
|
|
@ -48,7 +48,7 @@ class DialogContainer
|
||||||
/**
|
/**
|
||||||
Create a new DialogContainer stack
|
Create a new DialogContainer stack
|
||||||
*/
|
*/
|
||||||
DialogContainer(OSystem* osystem);
|
DialogContainer(OSystem& osystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
@ -154,9 +154,9 @@ class DialogContainer
|
||||||
void removeDialog();
|
void removeDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
OSystem* myOSystem;
|
OSystem& myOSystem;
|
||||||
Dialog* myBaseDialog;
|
Dialog* myBaseDialog;
|
||||||
Common::FixedStack<Dialog *> myDialogStack;
|
Common::FixedStack<Dialog*> myDialogStack;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
GameInfoDialog::GameInfoDialog(
|
GameInfoDialog::GameInfoDialog(
|
||||||
OSystem* osystem, DialogContainer* parent, const GUI::Font& font,
|
OSystem& osystem, DialogContainer& parent, const GUI::Font& font,
|
||||||
GuiObject* boss)
|
GuiObject* boss)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
|
|
|
@ -35,7 +35,7 @@ class SliderWidget;
|
||||||
class GameInfoDialog : public Dialog, public CommandSender
|
class GameInfoDialog : public Dialog, public CommandSender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GameInfoDialog(OSystem* osystem, DialogContainer* parent,
|
GameInfoDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, GuiObject* boss);
|
const GUI::Font& font, GuiObject* boss);
|
||||||
virtual ~GameInfoDialog();
|
virtual ~GameInfoDialog();
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
|
GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 0, 0),
|
||||||
CommandSender(boss)
|
CommandSender(boss)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
|
|
|
@ -42,7 +42,7 @@ class GlobalPropsDialog : public Dialog, public CommandSender
|
||||||
void saveConfig();
|
void saveConfig();
|
||||||
void setDefaults();
|
void setDefaults();
|
||||||
|
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -73,9 +73,9 @@ class GuiObject : public CommandReceiver
|
||||||
|
|
||||||
virtual ~GuiObject() {}
|
virtual ~GuiObject() {}
|
||||||
|
|
||||||
OSystem& instance() { return myOSystem; }
|
OSystem& instance() const { return myOSystem; }
|
||||||
DialogContainer& parent() { return myParent; }
|
DialogContainer& parent() const { return myParent; }
|
||||||
Dialog& dialog() { return myDialog; }
|
Dialog& dialog() const { return myDialog; }
|
||||||
|
|
||||||
virtual int getAbsX() const { return _x; }
|
virtual int getAbsX() const { return _x; }
|
||||||
virtual int getAbsY() const { return _y; }
|
virtual int getAbsY() const { return _y; }
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "HelpDialog.hxx"
|
#include "HelpDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
HelpDialog::HelpDialog(OSystem* osystem, DialogContainer* parent,
|
HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
myPage(1),
|
myPage(1),
|
||||||
|
|
|
@ -32,8 +32,8 @@ class OSystem;
|
||||||
class HelpDialog : public Dialog
|
class HelpDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HelpDialog(OSystem* osystem, DialogContainer* parent, const GUI::Font& font);
|
HelpDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font);
|
||||||
~HelpDialog();
|
virtual ~HelpDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum { kLINES_PER_PAGE = 10 };
|
enum { kLINES_PER_PAGE = 10 };
|
||||||
|
@ -50,8 +50,8 @@ class HelpDialog : public Dialog
|
||||||
uInt8 myNumPages;
|
uInt8 myNumPages;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
virtual void updateStrings(uInt8 page, uInt8 lines, string& title);
|
void updateStrings(uInt8 page, uInt8 lines, string& title);
|
||||||
void displayInfo();
|
void displayInfo();
|
||||||
void loadConfig() { displayInfo(); }
|
void loadConfig() { displayInfo(); }
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
InputDialog::InputDialog(OSystem* osystem, DialogContainer* parent,
|
InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h)
|
const GUI::Font& font, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,16 +36,16 @@ class StaticTextWidget;
|
||||||
class InputDialog : public Dialog
|
class InputDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InputDialog(OSystem* osystem, DialogContainer* parent,
|
InputDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h);
|
const GUI::Font& font, int max_w, int max_h);
|
||||||
~InputDialog();
|
virtual ~InputDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void handleKeyDown(StellaKey key, StellaMod mod);
|
void handleKeyDown(StellaKey key, StellaMod mod);
|
||||||
virtual void handleJoyDown(int stick, int button);
|
void handleJoyDown(int stick, int button);
|
||||||
virtual void handleJoyAxis(int stick, int axis, int value);
|
void handleJoyAxis(int stick, int axis, int value);
|
||||||
virtual bool handleJoyHat(int stick, int hat, int value);
|
bool handleJoyHat(int stick, int hat, int value);
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
void saveConfig();
|
void saveConfig();
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
|
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
const StringList& labels)
|
const StringList& labels)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 16, 16),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myEnableCenter(false),
|
myEnableCenter(false),
|
||||||
myErrorFlag(false),
|
myErrorFlag(false),
|
||||||
|
@ -45,7 +45,7 @@ InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& lfont,
|
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& lfont,
|
||||||
const GUI::Font& nfont,
|
const GUI::Font& nfont,
|
||||||
const StringList& labels)
|
const StringList& labels)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 16, 16),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myEnableCenter(false),
|
myEnableCenter(false),
|
||||||
myErrorFlag(false),
|
myErrorFlag(false),
|
||||||
|
|
|
@ -56,7 +56,7 @@ class InputTextDialog : public Dialog, public CommandSender
|
||||||
protected:
|
protected:
|
||||||
void initialize(const GUI::Font& lfont, const GUI::Font& nfont,
|
void initialize(const GUI::Font& lfont, const GUI::Font& nfont,
|
||||||
const StringList& labels);
|
const StringList& labels);
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef Common::Array<EditTextWidget*> InputWidget;
|
typedef Common::Array<EditTextWidget*> InputWidget;
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
#include "Launcher.hxx"
|
#include "Launcher.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Launcher::Launcher(OSystem* osystem)
|
Launcher::Launcher(OSystem& osystem)
|
||||||
: DialogContainer(osystem)
|
: DialogContainer(osystem)
|
||||||
{
|
{
|
||||||
const GUI::Size& s = myOSystem->settings().getSize("launcherres");
|
const GUI::Size& s = myOSystem.settings().getSize("launcherres");
|
||||||
const GUI::Size& d = myOSystem->frameBuffer().desktopSize();
|
const GUI::Size& d = myOSystem.frameBuffer().desktopSize();
|
||||||
myWidth = s.w; myHeight = s.h;
|
myWidth = s.w; myHeight = s.h;
|
||||||
|
|
||||||
// The launcher dialog is resizable, within certain bounds
|
// The launcher dialog is resizable, within certain bounds
|
||||||
|
@ -42,10 +42,10 @@ Launcher::Launcher(OSystem* osystem)
|
||||||
myWidth = BSPF_min(myWidth, (uInt32)d.w);
|
myWidth = BSPF_min(myWidth, (uInt32)d.w);
|
||||||
myHeight = BSPF_min(myHeight, (uInt32)d.h);
|
myHeight = BSPF_min(myHeight, (uInt32)d.h);
|
||||||
|
|
||||||
myOSystem->settings().setValue("launcherres",
|
myOSystem.settings().setValue("launcherres",
|
||||||
GUI::Size(myWidth, myHeight));
|
GUI::Size(myWidth, myHeight));
|
||||||
|
|
||||||
myBaseDialog = new LauncherDialog(myOSystem, this, 0, 0, myWidth, myHeight);
|
myBaseDialog = new LauncherDialog(myOSystem, *this, 0, 0, myWidth, myHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -57,7 +57,7 @@ Launcher::~Launcher()
|
||||||
FBInitStatus Launcher::initializeVideo()
|
FBInitStatus Launcher::initializeVideo()
|
||||||
{
|
{
|
||||||
string title = string("Stella ") + STELLA_VERSION;
|
string title = string("Stella ") + STELLA_VERSION;
|
||||||
return myOSystem->frameBuffer().createDisplay(title, myWidth, myHeight);
|
return myOSystem.frameBuffer().createDisplay(title, myWidth, myHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Launcher : public DialogContainer
|
||||||
/**
|
/**
|
||||||
Create a new menu stack
|
Create a new menu stack
|
||||||
*/
|
*/
|
||||||
Launcher(OSystem* osystem);
|
Launcher(OSystem& osystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: Dialog(osystem, parent, x, y, w, h),
|
: Dialog(osystem, parent, x, y, w, h),
|
||||||
myStartButton(NULL),
|
myStartButton(NULL),
|
||||||
|
@ -183,14 +183,14 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
l.push_back("Power-on options", "override");
|
l.push_back("Power-on options", "override");
|
||||||
l.push_back("Filter listing", "filter");
|
l.push_back("Filter listing", "filter");
|
||||||
l.push_back("Reload listing", "reload");
|
l.push_back("Reload listing", "reload");
|
||||||
myMenu = new ContextMenu(this, osystem->frameBuffer().font(), l);
|
myMenu = new ContextMenu(this, osystem.frameBuffer().font(), l);
|
||||||
|
|
||||||
// Create global props dialog, which is used to temporarily overrride
|
// Create global props dialog, which is used to temporarily overrride
|
||||||
// ROM properties
|
// ROM properties
|
||||||
myGlobalProps = new GlobalPropsDialog(this, osystem->frameBuffer().font());
|
myGlobalProps = new GlobalPropsDialog(this, osystem.frameBuffer().font());
|
||||||
|
|
||||||
// Create dialog whereby the files shown in the ROM listing can be customized
|
// Create dialog whereby the files shown in the ROM listing can be customized
|
||||||
myFilters = new LauncherFilterDialog(this, osystem->frameBuffer().font());
|
myFilters = new LauncherFilterDialog(this, osystem.frameBuffer().font());
|
||||||
|
|
||||||
// Figure out which filters are needed for the ROM listing
|
// Figure out which filters are needed for the ROM listing
|
||||||
setListFilters();
|
setListFilters();
|
||||||
|
|
|
@ -56,9 +56,9 @@ class LauncherDialog : public Dialog
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
LauncherDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
int x, int y, int w, int h);
|
int x, int y, int w, int h);
|
||||||
~LauncherDialog();
|
virtual ~LauncherDialog();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get MD5sum for the currently selected file
|
Get MD5sum for the currently selected file
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
LauncherFilterDialog::LauncherFilterDialog(GuiObject* boss, const GUI::Font& font)
|
LauncherFilterDialog::LauncherFilterDialog(GuiObject* boss, const GUI::Font& font)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 0, 0),
|
||||||
CommandSender(boss)
|
CommandSender(boss)
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
|
|
|
@ -64,7 +64,7 @@ class LauncherFilterDialog : public Dialog, public CommandSender
|
||||||
void setDefaults();
|
void setDefaults();
|
||||||
|
|
||||||
void handleFileTypeChange(const string& type);
|
void handleFileTypeChange(const string& type);
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PopUpWidget* myFileType;
|
PopUpWidget* myFileType;
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "LoggerDialog.hxx"
|
#include "LoggerDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
LoggerDialog::LoggerDialog(OSystem* osystem, DialogContainer* parent,
|
LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h)
|
const GUI::Font& font, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
myLogInfo(NULL)
|
myLogInfo(NULL)
|
||||||
|
|
|
@ -32,7 +32,7 @@ class StringListWidget;
|
||||||
class LoggerDialog : public Dialog
|
class LoggerDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LoggerDialog(OSystem* osystem, DialogContainer* parent,
|
LoggerDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h);
|
const GUI::Font& font, int max_w, int max_h);
|
||||||
virtual ~LoggerDialog();
|
virtual ~LoggerDialog();
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class LoggerDialog : public Dialog
|
||||||
void saveConfig();
|
void saveConfig();
|
||||||
void saveLogFile();
|
void saveLogFile();
|
||||||
|
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StringListWidget* myLogInfo;
|
StringListWidget* myLogInfo;
|
||||||
|
|
|
@ -26,10 +26,10 @@
|
||||||
class Properties;
|
class Properties;
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Menu::Menu(OSystem* osystem)
|
Menu::Menu(OSystem& osystem)
|
||||||
: DialogContainer(osystem)
|
: DialogContainer(osystem)
|
||||||
{
|
{
|
||||||
myBaseDialog = new OptionsDialog(myOSystem, this, 0,
|
myBaseDialog = new OptionsDialog(myOSystem, *this, 0,
|
||||||
FrameBuffer::kFBMinW, FrameBuffer::kFBMinH, false);
|
FrameBuffer::kFBMinW, FrameBuffer::kFBMinH, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Menu : public DialogContainer
|
||||||
/**
|
/**
|
||||||
Create a new menu stack
|
Create a new menu stack
|
||||||
*/
|
*/
|
||||||
Menu(OSystem* osystem);
|
Menu(OSystem& osystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor
|
Destructor
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace GUI {
|
||||||
MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
|
MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
|
||||||
const StringList& text, int max_w, int max_h, int cmd,
|
const StringList& text, int max_w, int max_h, int cmd,
|
||||||
const string& okText, const string& cancelText)
|
const string& okText, const string& cancelText)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, max_w, max_h),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, max_w, max_h),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myCmd(cmd)
|
myCmd(cmd)
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
|
||||||
MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
|
MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
|
||||||
const string& text, int max_w, int max_h, int cmd,
|
const string& text, int max_w, int max_h, int cmd,
|
||||||
const string& okText, const string& cancelText)
|
const string& okText, const string& cancelText)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, max_w, max_h),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, max_w, max_h),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myCmd(cmd)
|
myCmd(cmd)
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
new ButtonWidget(this, font, xoffset, yoffset, buttonWidth, buttonHeight, label, cmd); yoffset += rowHeight
|
new ButtonWidget(this, font, xoffset, yoffset, buttonWidth, buttonHeight, label, cmd); yoffset += rowHeight
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
|
OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
GuiObject* boss, int max_w, int max_h, bool global)
|
GuiObject* boss, int max_w, int max_h, bool global)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
myVideoDialog(NULL),
|
myVideoDialog(NULL),
|
||||||
|
|
|
@ -43,13 +43,13 @@ class OSystem;
|
||||||
class OptionsDialog : public Dialog
|
class OptionsDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OptionsDialog(OSystem* osystem, DialogContainer* parent, GuiObject* boss,
|
OptionsDialog(OSystem& osystem, DialogContainer& parent, GuiObject* boss,
|
||||||
int max_w, int max_h, bool global);
|
int max_w, int max_h, bool global);
|
||||||
virtual ~OptionsDialog();
|
virtual ~OptionsDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VideoDialog* myVideoDialog;
|
VideoDialog* myVideoDialog;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
|
ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
const string& message)
|
const string& message)
|
||||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 16, 16),
|
: Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16),
|
||||||
myMessage(NULL),
|
myMessage(NULL),
|
||||||
mySlider(NULL),
|
mySlider(NULL),
|
||||||
myStart(0),
|
myStart(0),
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "RomAuditDialog.hxx"
|
#include "RomAuditDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
RomAuditDialog::RomAuditDialog(OSystem* osystem, DialogContainer* parent,
|
RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h)
|
const GUI::Font& font, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
myBrowser(NULL),
|
myBrowser(NULL),
|
||||||
|
|
|
@ -35,9 +35,9 @@ class StaticTextWidget;
|
||||||
class RomAuditDialog : public Dialog
|
class RomAuditDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RomAuditDialog(OSystem* osystem, DialogContainer* parent,
|
RomAuditDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h);
|
const GUI::Font& font, int max_w, int max_h);
|
||||||
~RomAuditDialog();
|
virtual ~RomAuditDialog();
|
||||||
|
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SnapshotDialog::SnapshotDialog(
|
SnapshotDialog::SnapshotDialog(
|
||||||
OSystem* osystem, DialogContainer* parent,
|
OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, GuiObject* boss,
|
const GUI::Font& font, GuiObject* boss,
|
||||||
int max_w, int max_h)
|
int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0),
|
: Dialog(osystem, parent, 0, 0, 0, 0),
|
||||||
|
|
|
@ -36,10 +36,10 @@ class StaticTextWidget;
|
||||||
class SnapshotDialog : public Dialog
|
class SnapshotDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SnapshotDialog(OSystem* osystem, DialogContainer* parent,
|
SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, GuiObject* boss,
|
const GUI::Font& font, GuiObject* boss,
|
||||||
int max_w, int max_h);
|
int max_w, int max_h);
|
||||||
~SnapshotDialog();
|
virtual ~SnapshotDialog();
|
||||||
|
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "UIDialog.hxx"
|
#include "UIDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
|
UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,8 +35,8 @@ class OSystem;
|
||||||
class UIDialog : public Dialog
|
class UIDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UIDialog(OSystem* osystem, DialogContainer* parent, const GUI::Font& font);
|
UIDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font);
|
||||||
~UIDialog();
|
virtual ~UIDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TabWidget* myTab;
|
TabWidget* myTab;
|
||||||
|
@ -67,7 +67,7 @@ class UIDialog : public Dialog
|
||||||
void saveConfig();
|
void saveConfig();
|
||||||
void setDefaults();
|
void setDefaults();
|
||||||
|
|
||||||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kLWidthChanged = 'UIlw',
|
kLWidthChanged = 'UIlw',
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "VideoDialog.hxx"
|
#include "VideoDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
|
VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h)
|
const GUI::Font& font, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, 0, 0, 0, 0)
|
: Dialog(osystem, parent, 0, 0, 0, 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,9 +35,9 @@ class OSystem;
|
||||||
class VideoDialog : public Dialog
|
class VideoDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoDialog(OSystem* osystem, DialogContainer* parent, const GUI::Font& font,
|
VideoDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font,
|
||||||
int max_w, int max_h);
|
int max_w, int max_h);
|
||||||
~VideoDialog();
|
virtual ~VideoDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
|
|
Loading…
Reference in New Issue