mirror of https://github.com/stella-emu/stella.git
Implemented BrowserDialog functionality. That means we can now browse
for the correct ROM folder, and the folders contents will be shown in the listview. Still TODO is modify GameList so that it contains all relevant info for a ROM. Then, the listview will contain the actual names of the ROMS (as specified in stella.pro) instead of their on-disk filenames. And at that point, we can actually start a game directly from that listview. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@417 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
011588bbb1
commit
781f8b8d2e
|
@ -13,7 +13,7 @@
|
|||
## See the file "license" for information on usage and redistribution of
|
||||
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
##
|
||||
## $Id: makefile,v 1.76 2005-05-09 18:58:17 stephena Exp $
|
||||
## $Id: makefile,v 1.77 2005-05-10 19:20:38 stephena Exp $
|
||||
##============================================================================
|
||||
|
||||
##============================================================================
|
||||
|
@ -159,7 +159,7 @@ GUI_OBJS = StellaFont.o Menu.o Launcher.o \
|
|||
Widget.o PopUpWidget.o ScrollBarWidget.o ListWidget.o \
|
||||
Dialog.o DialogContainer.o OptionsDialog.o VideoDialog.o AudioDialog.o \
|
||||
EventMappingDialog.o GameInfoDialog.o HelpDialog.o \
|
||||
LauncherDialog.o BrowserDialog.o
|
||||
LauncherDialog.o BrowserDialog.o GameList.o
|
||||
|
||||
CORE_OBJS = Booster.o Cart.o Cart2K.o Cart3F.o Cart4K.o CartAR.o CartDPC.o \
|
||||
CartE0.o CartE7.o CartF4.o CartF4SC.o CartF6.o CartF6SC.o \
|
||||
|
@ -426,3 +426,6 @@ LauncherDialog.o: $(GUI)/LauncherDialog.cxx $(GUI)/LauncherDialog.hxx
|
|||
|
||||
BrowserDialog.o: $(GUI)/BrowserDialog.cxx $(GUI)/BrowserDialog.hxx
|
||||
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(GUI)/BrowserDialog.cxx
|
||||
|
||||
GameList.o: $(GUI)/GameList.cxx $(GUI)/GameList.hxx
|
||||
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(GUI)/GameList.cxx
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: FSNode.cxx,v 1.1 2005-05-09 18:58:18 stephena Exp $
|
||||
// $Id: FSNode.cxx,v 1.2 2005-05-10 19:20:40 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -64,13 +64,11 @@ FilesystemNode::FilesystemNode(const FilesystemNode &node)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
#ifdef MACOSX
|
||||
FilesystemNode::FilesystemNode(const string& p)
|
||||
{
|
||||
_realNode = getNodeForPath(p);
|
||||
_refCount = new int(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
FilesystemNode::~FilesystemNode()
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: FSNode.hxx,v 1.1 2005-05-09 18:58:18 stephena Exp $
|
||||
// $Id: FSNode.hxx,v 1.2 2005-05-10 19:20:40 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -161,9 +161,7 @@ class FilesystemNode : public AbstractFilesystemNode
|
|||
public:
|
||||
FilesystemNode();
|
||||
FilesystemNode(const FilesystemNode& node);
|
||||
#ifdef MACOSX
|
||||
FilesystemNode(const string& path);
|
||||
#endif
|
||||
~FilesystemNode();
|
||||
|
||||
FilesystemNode &operator =(const FilesystemNode &node);
|
||||
|
@ -195,7 +193,6 @@ class FilesystemNode : public AbstractFilesystemNode
|
|||
*/
|
||||
static AbstractFilesystemNode* getRoot();
|
||||
|
||||
#ifdef MACOSX
|
||||
/*
|
||||
* Construct a node based on a path; the path is in the same format as it
|
||||
* would be for calls to fopen().
|
||||
|
@ -203,7 +200,6 @@ class FilesystemNode : public AbstractFilesystemNode
|
|||
* I.e. getNodeForPath(oldNode.path()) should create a new node identical to oldNode.
|
||||
*/
|
||||
static AbstractFilesystemNode* getNodeForPath(const string& path);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: FrameBuffer.hxx,v 1.30 2005-05-08 17:38:23 stephena Exp $
|
||||
// $Id: FrameBuffer.hxx,v 1.31 2005-05-10 19:20:40 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#ifndef FRAMEBUFFER_HXX
|
||||
|
@ -41,7 +41,7 @@ class OSystem;
|
|||
All GUI elements (ala ScummVM) are drawn here as well.
|
||||
|
||||
@author Stephen Anthony
|
||||
@version $Id: FrameBuffer.hxx,v 1.30 2005-05-08 17:38:23 stephena Exp $
|
||||
@version $Id: FrameBuffer.hxx,v 1.31 2005-05-10 19:20:40 stephena Exp $
|
||||
*/
|
||||
class FrameBuffer
|
||||
{
|
||||
|
@ -135,7 +135,7 @@ class FrameBuffer
|
|||
*/
|
||||
void refresh(bool now = false)
|
||||
{
|
||||
//cerr << "refresh() " << myNumRedraws++ << endl;
|
||||
// cerr << "refresh() " << myNumRedraws++ << endl;
|
||||
theRedrawEntireFrameIndicator = true;
|
||||
myMenuRedraws = 2;
|
||||
if(now) drawMediaSource();
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: Settings.cxx,v 1.38 2005-05-06 18:38:59 stephena Exp $
|
||||
// $Id: Settings.cxx,v 1.39 2005-05-10 19:20:41 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <cassert>
|
||||
|
@ -59,6 +59,7 @@ Settings::Settings(OSystem* osystem)
|
|||
set("ssdir", ".");
|
||||
set("ssname", "romname");
|
||||
set("sssingle", "false");
|
||||
set("romdir", "");
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: AudioDialog.cxx,v 1.3 2005-04-28 19:28:33 stephena Exp $
|
||||
// $Id: AudioDialog.cxx,v 1.4 2005-05-10 19:20:42 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -41,8 +41,9 @@ enum {
|
|||
};
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
AudioDialog::AudioDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, x, y, w, h)
|
||||
AudioDialog::AudioDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, parent, x, y, w, h)
|
||||
{
|
||||
int yoff = 10,
|
||||
xoff = 30,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: AudioDialog.hxx,v 1.1 2005-03-26 19:26:47 stephena Exp $
|
||||
// $Id: AudioDialog.hxx,v 1.2 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -24,6 +24,7 @@
|
|||
|
||||
class CommandSender;
|
||||
class Dialog;
|
||||
class DialogContainer;
|
||||
class PopUpWidget;
|
||||
class SliderWidget;
|
||||
class StaticTextWidget;
|
||||
|
@ -35,7 +36,8 @@ class CheckboxWidget;
|
|||
class AudioDialog : public Dialog
|
||||
{
|
||||
public:
|
||||
AudioDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
AudioDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
~AudioDialog();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: BrowserDialog.cxx,v 1.1 2005-05-06 18:39:00 stephena Exp $
|
||||
// $Id: BrowserDialog.cxx,v 1.2 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -23,31 +23,125 @@
|
|||
#include "Widget.hxx"
|
||||
#include "ListWidget.hxx"
|
||||
#include "Dialog.hxx"
|
||||
#include "FSNode.hxx"
|
||||
#include "GuiUtils.hxx"
|
||||
#include "Event.hxx"
|
||||
#include "EventHandler.hxx"
|
||||
#include "BrowserDialog.hxx"
|
||||
|
||||
#include "bspf.hxx"
|
||||
|
||||
enum {
|
||||
kChooseCmd = 'CHOS',
|
||||
kGoUpCmd = 'GOUP'
|
||||
};
|
||||
|
||||
/* We want to use this as a general directory selector at some point... possible uses
|
||||
* - to select the data dir for a game
|
||||
* - to select the place where save games are stored
|
||||
* - others???
|
||||
*/
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
BrowserDialog::BrowserDialog(OSystem* osystem, uInt16 x, uInt16 y,
|
||||
uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, x, y, w, h)
|
||||
BrowserDialog::BrowserDialog(OSystem* osystem, DialogContainer* parent,
|
||||
const string& title, const string& startpath,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, parent, x, y, w, h),
|
||||
_fileList(NULL),
|
||||
_currentPath(NULL),
|
||||
_startPath(startpath)
|
||||
{
|
||||
// Headline - TODO: should be customizable during creation time
|
||||
new StaticTextWidget(this, 10, 8, _w - 2 * 10, kLineHeight, title, kTextAlignCenter);
|
||||
|
||||
// Current path - TODO: handle long paths ?
|
||||
_currentPath = new StaticTextWidget(this, 10, 20, _w - 2 * 10, kLineHeight,
|
||||
"DUMMY", kTextAlignLeft);
|
||||
|
||||
// Add file list
|
||||
_fileList = new ListWidget(this, 10, 34, _w - 2 * 10, _h - 34 - 24 - 10);
|
||||
_fileList->setNumberingMode(kListNumberingOff);
|
||||
_fileList->setEditable(false);
|
||||
|
||||
// Buttons
|
||||
addButton(10, _h - 24, "Go up", kGoUpCmd, 0);
|
||||
addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0);
|
||||
addButton(_w - (kButtonWidth+10), _h - 24, "Choose", kChooseCmd, 0);
|
||||
|
||||
// If no node has been set, or the last used one is now invalid,
|
||||
// go back to the root/default dir.
|
||||
if (_startPath != "")
|
||||
_choice = FilesystemNode(_startPath);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
BrowserDialog::~BrowserDialog()
|
||||
void BrowserDialog::loadConfig()
|
||||
{
|
||||
}
|
||||
// If no node has been set, or the last used one is now invalid,
|
||||
// go back to the root/default dir.
|
||||
if (_choice.isValid())
|
||||
_node = _choice;
|
||||
else if (!_node.isValid())
|
||||
_node = FilesystemNode();
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void BrowserDialog::handleKeyDown(uInt16 ascii, Int32 keycode, Int32 modifiers)
|
||||
{
|
||||
// Alway refresh file list
|
||||
updateListing();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void BrowserDialog::handleCommand(CommandSender* sender, uInt32 cmd, uInt32 data)
|
||||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case kChooseCmd:
|
||||
{
|
||||
// If nothing is selected in the list widget, choose the current dir.
|
||||
// Else, choose the dir that is selected.
|
||||
Int32 selection = _fileList->getSelected();
|
||||
if (selection >= 0)
|
||||
_choice = _nodeContent[selection];
|
||||
else
|
||||
_choice = _node;
|
||||
|
||||
setResult(1);
|
||||
close();
|
||||
break;
|
||||
}
|
||||
|
||||
case kGoUpCmd:
|
||||
_node = _node.getParent();
|
||||
updateListing();
|
||||
break;
|
||||
|
||||
case kListItemActivatedCmd:
|
||||
case kListItemDoubleClickedCmd:
|
||||
_node = _nodeContent[data];
|
||||
updateListing();
|
||||
break;
|
||||
|
||||
default:
|
||||
Dialog::handleCommand(sender, cmd, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void BrowserDialog::updateListing()
|
||||
{
|
||||
// Update the path display
|
||||
_currentPath->setLabel(_node.path());
|
||||
|
||||
// Read in the data from the file system
|
||||
_nodeContent = _node.listDir();
|
||||
_nodeContent.sort();
|
||||
|
||||
// Populate the ListWidget
|
||||
StringList list;
|
||||
Int32 size = _nodeContent.size();
|
||||
for (Int32 i = 0; i < size; i++)
|
||||
list.push_back(_nodeContent[i].displayName());
|
||||
|
||||
_fileList->setList(list);
|
||||
_fileList->scrollTo(0);
|
||||
|
||||
// Finally, redraw
|
||||
draw();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: BrowserDialog.hxx,v 1.1 2005-05-06 18:39:00 stephena Exp $
|
||||
// $Id: BrowserDialog.hxx,v 1.2 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -22,6 +22,7 @@
|
|||
#ifndef BROWSER_DIALOG_HXX
|
||||
#define BROWSER_DIALOG_HXX
|
||||
|
||||
class DialogContainer;
|
||||
class CommandSender;
|
||||
class ButtonWidget;
|
||||
class StaticTextWidget;
|
||||
|
@ -29,28 +30,30 @@ class ListWidget;
|
|||
|
||||
#include "Dialog.hxx"
|
||||
#include "OSystem.hxx"
|
||||
#include "FSNode.hxx"
|
||||
#include "bspf.hxx"
|
||||
|
||||
class BrowserDialog : public Dialog
|
||||
{
|
||||
public:
|
||||
BrowserDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
~BrowserDialog();
|
||||
|
||||
virtual void handleKeyDown(uInt16 ascii, Int32 keycode, Int32 modifiers);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
enum {
|
||||
kStartMapCmd = 'map ',
|
||||
kEraseCmd = 'eras',
|
||||
kStopMapCmd = 'smap'
|
||||
};
|
||||
BrowserDialog(OSystem* osystem, DialogContainer* parent,
|
||||
const string& title, const string& startpath,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
|
||||
virtual void loadConfig();
|
||||
virtual void handleCommand(CommandSender* sender, uInt32 cmd, uInt32 data);
|
||||
|
||||
private:
|
||||
const FilesystemNode& getResult() { return _choice; }
|
||||
|
||||
protected:
|
||||
ListWidget* _fileList;
|
||||
StaticTextWidget* _currentPath;
|
||||
FilesystemNode _node;
|
||||
FSList _nodeContent;
|
||||
FilesystemNode _choice;
|
||||
string _startPath;
|
||||
|
||||
void updateListing();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: Dialog.cxx,v 1.11 2005-04-24 20:36:36 stephena Exp $
|
||||
// $Id: Dialog.cxx,v 1.12 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -36,8 +36,9 @@
|
|||
* ...
|
||||
*/
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Dialog::Dialog(OSystem* instance, uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: GuiObject(instance, x, y, w, h),
|
||||
Dialog::Dialog(OSystem* instance, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: GuiObject(instance, parent, x, y, w, h),
|
||||
_mouseWidget(0),
|
||||
_focusedWidget(0),
|
||||
_dragWidget(0),
|
||||
|
@ -99,7 +100,7 @@ void Dialog::close()
|
|||
}
|
||||
|
||||
releaseFocus();
|
||||
instance()->menu().removeDialog();
|
||||
parent()->removeDialog();
|
||||
|
||||
_openCount = 0;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: Dialog.hxx,v 1.9 2005-05-04 19:04:46 stephena Exp $
|
||||
// $Id: Dialog.hxx,v 1.10 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -35,14 +35,15 @@ class DialogContainer;
|
|||
This is the base class for all dialog boxes.
|
||||
|
||||
@author Stephen Anthony
|
||||
@version $Id: Dialog.hxx,v 1.9 2005-05-04 19:04:46 stephena Exp $
|
||||
@version $Id: Dialog.hxx,v 1.10 2005-05-10 19:20:43 stephena Exp $
|
||||
*/
|
||||
class Dialog : public GuiObject
|
||||
{
|
||||
friend class DialogContainer;
|
||||
|
||||
public:
|
||||
Dialog(OSystem* instance, uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
Dialog(OSystem* instance, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
|
||||
virtual ~Dialog();
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: EventMappingDialog.cxx,v 1.7 2005-05-06 22:50:15 stephena Exp $
|
||||
// $Id: EventMappingDialog.cxx,v 1.8 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -31,9 +31,9 @@
|
|||
#include "bspf.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
EventMappingDialog::EventMappingDialog(OSystem* osystem, uInt16 x, uInt16 y,
|
||||
uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, x, y, w, h),
|
||||
EventMappingDialog::EventMappingDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, parent, x, y, w, h),
|
||||
myActionSelected(-1),
|
||||
myRemapStatus(false)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: EventMappingDialog.hxx,v 1.4 2005-04-06 23:47:08 stephena Exp $
|
||||
// $Id: EventMappingDialog.hxx,v 1.5 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -22,6 +22,7 @@
|
|||
#ifndef EVENT_MAPPING_DIALOG_HXX
|
||||
#define EVENT_MAPPING_DIALOG_HXX
|
||||
|
||||
class DialogContainer;
|
||||
class CommandSender;
|
||||
class ButtonWidget;
|
||||
class StaticTextWidget;
|
||||
|
@ -33,7 +34,8 @@ class ListWidget;
|
|||
class EventMappingDialog : public Dialog
|
||||
{
|
||||
public:
|
||||
EventMappingDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
EventMappingDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
~EventMappingDialog();
|
||||
|
||||
virtual void handleKeyDown(uInt16 ascii, Int32 keycode, Int32 modifiers);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: GameInfoDialog.cxx,v 1.3 2005-05-02 22:18:13 stephena Exp $
|
||||
// $Id: GameInfoDialog.cxx,v 1.4 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -29,8 +29,9 @@
|
|||
#include "bspf.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
GameInfoDialog::GameInfoDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, x, y, w, h),
|
||||
GameInfoDialog::GameInfoDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, parent, x, y, w, h),
|
||||
myPage(1),
|
||||
myNumPages(2),
|
||||
myGameProperties(NULL)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: GameInfoDialog.hxx,v 1.2 2005-05-02 19:36:05 stephena Exp $
|
||||
// $Id: GameInfoDialog.hxx,v 1.3 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -22,6 +22,7 @@
|
|||
#ifndef GAME_INFO_DIALOG_HXX
|
||||
#define GAME_INFO_DIALOG_HXX
|
||||
|
||||
class DialogContainer;
|
||||
class CommandSender;
|
||||
class ButtonWidget;
|
||||
class StaticTextWidget;
|
||||
|
@ -39,7 +40,8 @@ class StaticTextWidget;
|
|||
class GameInfoDialog : public Dialog
|
||||
{
|
||||
public:
|
||||
GameInfoDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
GameInfoDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
~GameInfoDialog();
|
||||
|
||||
void setGameProfile(Properties& props) { myGameProperties = &props; }
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2005 by Bradford W. Mott
|
||||
//
|
||||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: GameList.cxx,v 1.1 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Copyright (C) 2005 by Stephen Anthony
|
||||
// @author Stephen Anthony
|
||||
//============================================================================
|
||||
|
||||
#include "GameList.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
GameList::GameList()
|
||||
{
|
||||
cerr << "GameList::GameList()\n";
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
GameList::~GameList()
|
||||
{
|
||||
cerr << "GameList::~GameList()\n";
|
||||
myArray.clear();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void GameList::sortByName()
|
||||
{
|
||||
cerr << "GameList::sortByName()\n";
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2005 by Bradford W. Mott
|
||||
//
|
||||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: GameList.hxx,v 1.1 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from KStella - Stella frontend
|
||||
// Copyright (C) 2003-2005 Stephen Anthony
|
||||
//============================================================================
|
||||
|
||||
#ifndef GAME_LIST_HXX
|
||||
#define GAME_LIST_HXX
|
||||
|
||||
#include "Array.hxx"
|
||||
#include "bspf.hxx"
|
||||
|
||||
/**
|
||||
Holds the list of game info for the ROM launcher.
|
||||
*/
|
||||
class GameList
|
||||
{
|
||||
struct Entry {
|
||||
string _rom;
|
||||
string _md5;
|
||||
string _name;
|
||||
string _note;
|
||||
};
|
||||
|
||||
typedef Array<Entry> GameArray;
|
||||
|
||||
public:
|
||||
GameList();
|
||||
~GameList();
|
||||
|
||||
void sortByName();
|
||||
GameArray& getList() { return myArray; }
|
||||
|
||||
private:
|
||||
GameArray myArray;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: GuiObject.hxx,v 1.4 2005-03-14 04:08:15 stephena Exp $
|
||||
// $Id: GuiObject.hxx,v 1.5 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -23,6 +23,7 @@
|
|||
#define GUI_OBJECT_HXX
|
||||
|
||||
class OSystem;
|
||||
class DialogContainer;
|
||||
class Widget;
|
||||
class Menu;
|
||||
|
||||
|
@ -33,7 +34,7 @@ class Menu;
|
|||
This is the base class for all GUI objects/widgets.
|
||||
|
||||
@author Stephen Anthony
|
||||
@version $Id: GuiObject.hxx,v 1.4 2005-03-14 04:08:15 stephena Exp $
|
||||
@version $Id: GuiObject.hxx,v 1.5 2005-05-10 19:20:43 stephena Exp $
|
||||
*/
|
||||
class GuiObject : public CommandReceiver
|
||||
{
|
||||
|
@ -41,8 +42,9 @@ class GuiObject : public CommandReceiver
|
|||
friend class Menu;
|
||||
|
||||
public:
|
||||
GuiObject(OSystem* osystem, int x, int y, int w, int h)
|
||||
GuiObject(OSystem* osystem, DialogContainer* parent, int x, int y, int w, int h)
|
||||
: myOSystem(osystem),
|
||||
myParent(parent),
|
||||
_x(x),
|
||||
_y(y),
|
||||
_w(w),
|
||||
|
@ -50,6 +52,7 @@ class GuiObject : public CommandReceiver
|
|||
_firstWidget(0) { }
|
||||
|
||||
OSystem* instance() { return myOSystem; }
|
||||
DialogContainer* parent() { return myParent; }
|
||||
|
||||
virtual Int16 getAbsX() const { return _x; }
|
||||
virtual Int16 getAbsY() const { return _y; }
|
||||
|
@ -63,6 +66,7 @@ class GuiObject : public CommandReceiver
|
|||
|
||||
protected:
|
||||
OSystem* myOSystem;
|
||||
DialogContainer* myParent;
|
||||
|
||||
Int16 _x, _y;
|
||||
uInt16 _w, _h;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: HelpDialog.cxx,v 1.3 2005-05-02 22:18:14 stephena Exp $
|
||||
// $Id: HelpDialog.cxx,v 1.4 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -28,8 +28,9 @@
|
|||
#include "bspf.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
HelpDialog::HelpDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, x, y, w, h),
|
||||
HelpDialog::HelpDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, parent, x, y, w, h),
|
||||
myPage(1),
|
||||
myNumPages(4)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: HelpDialog.hxx,v 1.1 2005-03-27 03:07:34 stephena Exp $
|
||||
// $Id: HelpDialog.hxx,v 1.2 2005-05-10 19:20:43 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -22,6 +22,7 @@
|
|||
#ifndef HELP_DIALOG_HXX
|
||||
#define HELP_DIALOG_HXX
|
||||
|
||||
class DialogContainer;
|
||||
class CommandSender;
|
||||
class ButtonWidget;
|
||||
class StaticTextWidget;
|
||||
|
@ -39,7 +40,8 @@ class StaticTextWidget;
|
|||
class HelpDialog : public Dialog
|
||||
{
|
||||
public:
|
||||
HelpDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
HelpDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
~HelpDialog();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: Launcher.cxx,v 1.3 2005-05-09 18:58:19 stephena Exp $
|
||||
// $Id: Launcher.cxx,v 1.4 2005-05-10 19:20:43 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include "OSystem.hxx"
|
||||
|
@ -39,7 +39,8 @@ void Launcher::initialize()
|
|||
// We only create one instance of this dialog, since each time we do so,
|
||||
// the ROM listing is read from disk. This can be very expensive.
|
||||
if(myBaseDialog == NULL)
|
||||
myBaseDialog = new LauncherDialog(myOSystem, 0, 0, kLauncherWidth, kLauncherHeight);
|
||||
myBaseDialog = new LauncherDialog(myOSystem, this,
|
||||
0, 0, kLauncherWidth, kLauncherHeight);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -13,20 +13,20 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: LauncherDialog.cxx,v 1.5 2005-05-10 01:12:59 stephena Exp $
|
||||
// $Id: LauncherDialog.cxx,v 1.6 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
//============================================================================
|
||||
|
||||
#include "OSystem.hxx"
|
||||
#include "Settings.hxx"
|
||||
#include "FSNode.hxx"
|
||||
#include "Widget.hxx"
|
||||
#include "ListWidget.hxx"
|
||||
#include "Dialog.hxx"
|
||||
#include "DialogContainer.hxx"
|
||||
#include "GuiUtils.hxx"
|
||||
#include "Event.hxx"
|
||||
#include "EventHandler.hxx"
|
||||
#include "BrowserDialog.hxx"
|
||||
#include "LauncherDialog.hxx"
|
||||
|
||||
|
@ -48,11 +48,12 @@ enum {
|
|||
};
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
LauncherDialog::LauncherDialog(OSystem* osystem, uInt16 x, uInt16 y,
|
||||
uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, x, y, w, h),
|
||||
LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, parent, x, y, w, h),
|
||||
myList(NULL),
|
||||
myBrowser(NULL)
|
||||
myBrowser(NULL),
|
||||
myGameList(NULL)
|
||||
{
|
||||
// Show game name
|
||||
new StaticTextWidget(this, 10, 8, _w - 20, kLineHeight,
|
||||
|
@ -100,17 +101,22 @@ LauncherDialog::LauncherDialog(OSystem* osystem, uInt16 x, uInt16 y,
|
|||
}
|
||||
}
|
||||
*/
|
||||
// En-/Disable the buttons depending on the list selection
|
||||
updateButtons();
|
||||
|
||||
// Create file browser dialog
|
||||
//FIXME myBrowser = new BrowserDialog("Select directory with game data");
|
||||
string romdir = instance()->settings().getString("romdir");
|
||||
myBrowser = new BrowserDialog(osystem, parent, "Select ROM directory", romdir,
|
||||
20, 20, _w - 40, _h - 40);
|
||||
|
||||
// Create a game list, which contains all the information about a ROM that
|
||||
// the launcher needs
|
||||
myGameList = new GameList();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
LauncherDialog::~LauncherDialog()
|
||||
{
|
||||
delete myBrowser;
|
||||
delete myGameList;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -125,6 +131,9 @@ void LauncherDialog::loadConfig()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void LauncherDialog::close()
|
||||
{
|
||||
// Save romdir specified by the browser
|
||||
FilesystemNode dir(myBrowser->getResult());
|
||||
instance()->settings().setString("romdir", dir.path());
|
||||
/*
|
||||
// Save last selection
|
||||
const int sel = _list->getSelected();
|
||||
|
@ -139,7 +148,7 @@ void LauncherDialog::close()
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void LauncherDialog::updateListing()
|
||||
void LauncherDialog::updateListing(bool full_reload)
|
||||
{
|
||||
cerr << "LauncherDialog::updateListing()\n";
|
||||
|
||||
|
@ -147,19 +156,18 @@ cerr << "LauncherDialog::updateListing()\n";
|
|||
// If so, we do a full reload from disk (takes quite some time).
|
||||
// Otherwise, we can use the cache file (which is much faster).
|
||||
// FIXME - actually implement the following code
|
||||
/*
|
||||
if(... ROM_DIR_CHANGED ...)
|
||||
bool ROM_DIR_CHANGED = true;
|
||||
|
||||
if(ROM_DIR_CHANGED)
|
||||
loadListFromDisk();
|
||||
else if( ... CACHE_FILE_EXISTS)
|
||||
loadListFromCache();
|
||||
// else if( ... CACHE_FILE_EXISTS)
|
||||
// loadListFromCache();
|
||||
else // we have no other choice
|
||||
loadListFromDisk();
|
||||
*/
|
||||
|
||||
StringList l;
|
||||
|
||||
FilesystemNode t;
|
||||
FilesystemNode dir(t);//"/local/emulators/atari/roms"); // FIXME
|
||||
FilesystemNode dir(myBrowser->getResult());
|
||||
FSList files = dir.listDir(FilesystemNode::kListAll);
|
||||
files.sort();
|
||||
|
||||
|
@ -199,14 +207,6 @@ cerr << "LauncherDialog::updateListing()\n";
|
|||
}
|
||||
*/
|
||||
myList->setList(l);
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void LauncherDialog::reloadListing()
|
||||
{
|
||||
// FIXME - add bulk of KStella code here wrt loading from disk
|
||||
cerr << "LauncherDialog::reloadListing()\n";
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -331,7 +331,6 @@ void LauncherDialog::handleCommand(CommandSender* sender, uInt32 cmd, uInt32 dat
|
|||
if(myList->getSelected() >= 0)
|
||||
{
|
||||
string item = myList->getSelectedString();
|
||||
cerr << "Game selected: " << item << endl;
|
||||
instance()->createConsole(item);
|
||||
close();
|
||||
}
|
||||
|
@ -339,16 +338,15 @@ void LauncherDialog::handleCommand(CommandSender* sender, uInt32 cmd, uInt32 dat
|
|||
}
|
||||
|
||||
case kLocationCmd:
|
||||
cerr << "kLocationCmd from LauncherDialog\n";
|
||||
// instance()->launcher().addDialog(myLocationDialog);
|
||||
parent()->addDialog(myBrowser);
|
||||
break;
|
||||
|
||||
case kReloadCmd:
|
||||
reloadListing();
|
||||
updateListing(true); // force a reload from disk
|
||||
break;
|
||||
|
||||
case kListSelectionChangedCmd:
|
||||
cerr << "change note\n";
|
||||
// cerr << "change note\n";
|
||||
break;
|
||||
|
||||
case kQuitCmd:
|
||||
|
@ -362,13 +360,11 @@ void LauncherDialog::handleCommand(CommandSender* sender, uInt32 cmd, uInt32 dat
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void LauncherDialog::updateButtons()
|
||||
void LauncherDialog::loadListFromDisk()
|
||||
{
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void LauncherDialog::loadListFromCache()
|
||||
{
|
||||
/*
|
||||
bool enable = (myList->getSelected() >= 0);
|
||||
if (enable != _startButton->isEnabled()) {
|
||||
_startButton->setEnabled(enable);
|
||||
_startButton->draw();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: LauncherDialog.hxx,v 1.2 2005-05-10 01:12:59 stephena Exp $
|
||||
// $Id: LauncherDialog.hxx,v 1.3 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -22,12 +22,14 @@
|
|||
#ifndef LAUNCHER_DIALOG_HXX
|
||||
#define LAUNCHER_DIALOG_HXX
|
||||
|
||||
class DialogContainer;
|
||||
class CommandSender;
|
||||
class ButtonWidget;
|
||||
class StaticTextWidget;
|
||||
class ListWidget;
|
||||
class BrowserDialog;
|
||||
|
||||
#include "GameList.hxx"
|
||||
#include "Dialog.hxx"
|
||||
#include "Launcher.hxx"
|
||||
#include "OSystem.hxx"
|
||||
|
@ -36,15 +38,14 @@ class BrowserDialog;
|
|||
class LauncherDialog : public Dialog
|
||||
{
|
||||
public:
|
||||
LauncherDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
~LauncherDialog();
|
||||
|
||||
virtual void handleCommand(CommandSender* sender, uInt32 cmd, uInt32 data);
|
||||
|
||||
protected:
|
||||
void updateListing();
|
||||
void reloadListing();
|
||||
void updateButtons();
|
||||
void updateListing(bool full_reload = false);
|
||||
|
||||
void close();
|
||||
virtual void addGame();
|
||||
|
@ -56,6 +57,11 @@ class LauncherDialog : public Dialog
|
|||
ListWidget* myList;
|
||||
BrowserDialog* myBrowser;
|
||||
StaticTextWidget* myNote;
|
||||
GameList* myGameList;
|
||||
|
||||
private:
|
||||
void loadListFromDisk();
|
||||
void loadListFromCache();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: ListWidget.cxx,v 1.5 2005-05-04 19:04:46 stephena Exp $
|
||||
// $Id: ListWidget.cxx,v 1.6 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -165,9 +165,9 @@ void ListWidget::handleMouseDown(Int32 x, Int32 y, Int32 button, Int32 clickCoun
|
|||
drawCaret(true);
|
||||
}
|
||||
sendCommand(kListSelectionChangedCmd, _selectedItem);
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
draw();
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,6 @@ void ListWidget::handleMouseUp(Int32 x, Int32 y, Int32 button, Int32 clickCount)
|
|||
void ListWidget::handleMouseWheel(Int32 x, Int32 y, Int32 direction)
|
||||
{
|
||||
_scrollBar->handleMouseWheel(x, y, direction);
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -336,6 +335,8 @@ bool ListWidget::handleKeyDown(uInt16 ascii, Int32 keycode, Int32 modifiers)
|
|||
sendCommand(kListSelectionChangedCmd, _selectedItem);
|
||||
// also draw scrollbar
|
||||
_scrollBar->draw();
|
||||
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
|
||||
return handled;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: ListWidget.hxx,v 1.1 2005-04-04 02:19:22 stephena Exp $
|
||||
// $Id: ListWidget.hxx,v 1.2 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -64,8 +64,8 @@ class ListWidget : public Widget, public CommandSender
|
|||
virtual void handleMouseDown(Int32 x, Int32 y, Int32 button, Int32 clickCount);
|
||||
virtual void handleMouseUp(Int32 x, Int32 y, Int32 button, Int32 clickCount);
|
||||
virtual void handleMouseWheel(Int32 x, Int32 y, Int32 direction);
|
||||
virtual void handleMouseEntered(Int32 button) { _scrollBar->handleMouseLeft(button); }
|
||||
virtual void handleMouseLeft(Int32 button) { _scrollBar->handleMouseLeft(button); }
|
||||
virtual void handleMouseEntered(Int32 button) {};
|
||||
virtual void handleMouseLeft(Int32 button) {};
|
||||
virtual bool handleKeyDown(uInt16 ascii, Int32 keycode, Int32 modifiers);
|
||||
virtual bool handleKeyUp(uInt16 ascii, Int32 keycode, Int32 modifiers);
|
||||
virtual void handleCommand(CommandSender* sender, uInt32 cmd, uInt32 data);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: Menu.cxx,v 1.8 2005-05-04 21:32:25 stephena Exp $
|
||||
// $Id: Menu.cxx,v 1.9 2005-05-10 19:20:44 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include "Dialog.hxx"
|
||||
|
@ -38,7 +38,7 @@ Menu::~Menu()
|
|||
void Menu::initialize()
|
||||
{
|
||||
delete myBaseDialog;
|
||||
myBaseDialog = new OptionsDialog(myOSystem);
|
||||
myBaseDialog = new OptionsDialog(myOSystem, this);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -13,15 +13,15 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: OptionsDialog.cxx,v 1.13 2005-05-01 18:57:21 stephena Exp $
|
||||
// $Id: OptionsDialog.cxx,v 1.14 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
//============================================================================
|
||||
|
||||
#include "OSystem.hxx"
|
||||
#include "Menu.hxx"
|
||||
#include "Dialog.hxx"
|
||||
#include "DialogContainer.hxx"
|
||||
#include "Widget.hxx"
|
||||
#include "Control.hxx"
|
||||
#include "VideoDialog.hxx"
|
||||
|
@ -53,11 +53,12 @@ enum {
|
|||
new ButtonWidget(this, xoffset, yoffset, kBigButtonWidth, 18, label, cmd, hotkey); yoffset += kRowHeight
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
OptionsDialog::OptionsDialog(OSystem* osystem)
|
||||
OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent)
|
||||
// FIXME - we have to initialize the video system at least once *before*
|
||||
// creating a new console. For now, just use predefined values.
|
||||
// Eventually, this subsystem will have to take into account screen size changes
|
||||
: Dialog(osystem, (osystem->frameBuffer().baseWidth() - kMainMenuWidth) / 2,
|
||||
: Dialog(osystem, parent,
|
||||
(osystem->frameBuffer().baseWidth() - kMainMenuWidth) / 2,
|
||||
(osystem->frameBuffer().baseHeight() - kMainMenuHeight)/2,
|
||||
kMainMenuWidth, kMainMenuHeight),
|
||||
myVideoDialog(NULL)
|
||||
|
@ -85,27 +86,27 @@ OptionsDialog::OptionsDialog(OSystem* osystem)
|
|||
// Now create all the dialogs attached to each menu button
|
||||
w = 230; h = 130;
|
||||
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
|
||||
myVideoDialog = new VideoDialog(myOSystem, x, y, w, h);
|
||||
myVideoDialog = new VideoDialog(myOSystem, parent, x, y, w, h);
|
||||
|
||||
w = 200; h = 100;
|
||||
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
|
||||
myAudioDialog = new AudioDialog(myOSystem, x, y, w, h);
|
||||
myAudioDialog = new AudioDialog(myOSystem, parent, x, y, w, h);
|
||||
|
||||
w = 280; h = 170;
|
||||
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
|
||||
myEventMappingDialog = new EventMappingDialog(myOSystem, x, y, w, h);
|
||||
myEventMappingDialog = new EventMappingDialog(myOSystem, parent, x, y, w, h);
|
||||
|
||||
// w = 250; h = 150;
|
||||
// checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
|
||||
// myMiscDialog = new MiscDialog(myOSystem, x, y, w, h);
|
||||
// myMiscDialog = new MiscDialog(myOSystem, parent, x, y, w, h);
|
||||
|
||||
w = 255; h = 150;
|
||||
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
|
||||
myGameInfoDialog = new GameInfoDialog(myOSystem, x, y, w, h);
|
||||
myGameInfoDialog = new GameInfoDialog(myOSystem, parent, x, y, w, h);
|
||||
|
||||
w = 255; h = 150;
|
||||
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
|
||||
myHelpDialog = new HelpDialog(myOSystem, x, y, w, h);
|
||||
myHelpDialog = new HelpDialog(myOSystem, parent, x, y, w, h);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -135,28 +136,28 @@ void OptionsDialog::handleCommand(CommandSender* sender, uInt32 cmd, uInt32 data
|
|||
switch(cmd)
|
||||
{
|
||||
case kVidCmd:
|
||||
instance()->menu().addDialog(myVideoDialog);
|
||||
parent()->addDialog(myVideoDialog);
|
||||
break;
|
||||
|
||||
case kAudCmd:
|
||||
instance()->menu().addDialog(myAudioDialog);
|
||||
parent()->addDialog(myAudioDialog);
|
||||
break;
|
||||
|
||||
case kEMapCmd:
|
||||
instance()->menu().addDialog(myEventMappingDialog);
|
||||
parent()->addDialog(myEventMappingDialog);
|
||||
break;
|
||||
|
||||
case kMiscCmd:
|
||||
// instance()->menu().addDialog(myMiscDialog);
|
||||
// parent()->addDialog(myMiscDialog);
|
||||
cerr << "push MiscDialog to top of stack\n";
|
||||
break;
|
||||
|
||||
case kInfoCmd:
|
||||
instance()->menu().addDialog(myGameInfoDialog);
|
||||
parent()->addDialog(myGameInfoDialog);
|
||||
break;
|
||||
|
||||
case kHelpCmd:
|
||||
instance()->menu().addDialog(myHelpDialog);
|
||||
parent()->addDialog(myHelpDialog);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: OptionsDialog.hxx,v 1.4 2005-03-28 00:04:54 stephena Exp $
|
||||
// $Id: OptionsDialog.hxx,v 1.5 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -25,6 +25,7 @@
|
|||
class Properties;
|
||||
class CommandSender;
|
||||
class Dialog;
|
||||
class DialogContainer;
|
||||
class VideoDialog;
|
||||
class AudioDialog;
|
||||
class EventMappingDialog;
|
||||
|
@ -38,7 +39,7 @@ class HelpDialog;
|
|||
class OptionsDialog : public Dialog
|
||||
{
|
||||
public:
|
||||
OptionsDialog(OSystem* osystem);
|
||||
OptionsDialog(OSystem* osystem, DialogContainer* parent);
|
||||
~OptionsDialog();
|
||||
|
||||
virtual void handleCommand(CommandSender* sender, uInt32 cmd, uInt32 data);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: PopUpWidget.cxx,v 1.4 2005-04-04 02:19:22 stephena Exp $
|
||||
// $Id: PopUpWidget.cxx,v 1.5 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -44,7 +44,7 @@ static uInt32 up_down_arrows[8] = {
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
PopUpDialog::PopUpDialog(PopUpWidget* boss, Int32 clickX, Int32 clickY)
|
||||
: Dialog(boss->instance(), 0, 0, 16, 16),
|
||||
: Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16),
|
||||
_popUpBoss(boss)
|
||||
{
|
||||
// Copy the selection index
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: ScrollBarWidget.cxx,v 1.2 2005-04-24 20:36:36 stephena Exp $
|
||||
// $Id: ScrollBarWidget.cxx,v 1.3 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -118,8 +118,6 @@ void ScrollBarWidget::handleMouseDown(Int32 x, Int32 y, Int32 button,
|
|||
|
||||
// Make sure that _currentPos is still inside the bounds
|
||||
checkBounds(old_pos);
|
||||
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -127,7 +125,6 @@ void ScrollBarWidget::handleMouseUp(Int32 x, Int32 y, Int32 button,
|
|||
Int32 clickCount)
|
||||
{
|
||||
_draggingPart = kNoPart;
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -145,7 +142,6 @@ void ScrollBarWidget::handleMouseWheel(Int32 x, Int32 y, Int32 direction)
|
|||
|
||||
// Make sure that _currentPos is still inside the bounds
|
||||
checkBounds(old_pos);
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -186,9 +182,13 @@ void ScrollBarWidget::handleMouseMoved(Int32 x, Int32 y, Int32 button)
|
|||
_part = kSliderPart;
|
||||
|
||||
if (old_part != _part)
|
||||
{
|
||||
draw();
|
||||
}
|
||||
|
||||
// Refresh the FB, since the selected part has changed
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -222,7 +222,7 @@ void ScrollBarWidget::checkBounds(Int32 old_pos)
|
|||
|
||||
if (old_pos != _currentPos)
|
||||
{
|
||||
recalc();
|
||||
recalc(); // This takes care of the required refresh
|
||||
draw();
|
||||
sendCommand(kSetPositionCmd, _currentPos);
|
||||
}
|
||||
|
@ -247,6 +247,8 @@ void ScrollBarWidget::recalc()
|
|||
_sliderHeight = _h - 2 * UP_DOWN_BOX_HEIGHT;
|
||||
_sliderPos = UP_DOWN_BOX_HEIGHT;
|
||||
}
|
||||
|
||||
_boss->instance()->frameBuffer().refresh();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: VideoDialog.cxx,v 1.9 2005-05-05 00:10:49 stephena Exp $
|
||||
// $Id: VideoDialog.cxx,v 1.10 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -40,8 +40,9 @@ enum {
|
|||
};
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
VideoDialog::VideoDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, x, y, w, h)
|
||||
VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h)
|
||||
: Dialog(osystem, parent, x, y, w, h)
|
||||
{
|
||||
int yoff = 10,
|
||||
xoff = 2,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: VideoDialog.hxx,v 1.3 2005-03-26 19:26:48 stephena Exp $
|
||||
// $Id: VideoDialog.hxx,v 1.4 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -24,6 +24,7 @@
|
|||
|
||||
class CommandSender;
|
||||
class Dialog;
|
||||
class DialogContainer;
|
||||
class PopUpWidget;
|
||||
class SliderWidget;
|
||||
class StaticTextWidget;
|
||||
|
@ -35,7 +36,8 @@ class CheckboxWidget;
|
|||
class VideoDialog : public Dialog
|
||||
{
|
||||
public:
|
||||
VideoDialog(OSystem* osystem, uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
VideoDialog(OSystem* osystem, DialogContainer* parent,
|
||||
uInt16 x, uInt16 y, uInt16 w, uInt16 h);
|
||||
~VideoDialog();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: Widget.cxx,v 1.7 2005-04-04 02:19:22 stephena Exp $
|
||||
// $Id: Widget.cxx,v 1.8 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Widget::Widget(GuiObject* boss, Int32 x, Int32 y, Int32 w, Int32 h)
|
||||
: GuiObject(boss->instance(), x, y, w, h),
|
||||
: GuiObject(boss->instance(), boss->parent(), x, y, w, h),
|
||||
_type(0),
|
||||
_boss(boss),
|
||||
_id(0),
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: FSNodePOSIX.cxx,v 1.1 2005-05-09 18:58:19 stephena Exp $
|
||||
// $Id: FSNodePOSIX.cxx,v 1.2 2005-05-10 19:20:44 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -78,12 +78,10 @@ AbstractFilesystemNode* FilesystemNode::getRoot()
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
#ifdef MACOSX
|
||||
AbstractFilesystemNode* FilesystemNode::getNodeForPath(const string& path)
|
||||
{
|
||||
return new POSIXFilesystemNode(path);
|
||||
}
|
||||
#endif
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
POSIXFilesystemNode::POSIXFilesystemNode()
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: SettingsUNIX.cxx,v 1.11 2005-05-02 19:36:05 stephena Exp $
|
||||
// $Id: SettingsUNIX.cxx,v 1.12 2005-05-10 19:20:45 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <cstdlib>
|
||||
|
@ -48,8 +48,7 @@ SettingsUNIX::SettingsUNIX(OSystem* osystem)
|
|||
string systemConfigFile = "/etc/stellarc";
|
||||
myOSystem->setConfigFiles(userConfigFile, systemConfigFile);
|
||||
|
||||
// This argument is only valid for Linux/UNIX, and will eventually
|
||||
// be removed
|
||||
// This argument is only valid for Linux/UNIX, and will eventually be removed
|
||||
set("accurate", "false");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue