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