diff --git a/src/debugger/gui/CartDebugWidget.cxx b/src/debugger/gui/CartDebugWidget.cxx index 5727487dd..8f50090a7 100644 --- a/src/debugger/gui/CartDebugWidget.cxx +++ b/src/debugger/gui/CartDebugWidget.cxx @@ -19,6 +19,7 @@ #include "RomWidget.hxx" #include "EditTextWidget.hxx" #include "StringListWidget.hxx" +#include "ScrollBarWidget.hxx" #include "StringParser.hxx" #include "CartDebugWidget.hxx" diff --git a/src/debugger/gui/CartRamWidget.cxx b/src/debugger/gui/CartRamWidget.cxx index de113c6ec..62cb60103 100644 --- a/src/debugger/gui/CartRamWidget.cxx +++ b/src/debugger/gui/CartRamWidget.cxx @@ -23,6 +23,7 @@ #include "Widget.hxx" #include "Font.hxx" #include "StringListWidget.hxx" +#include "ScrollBarWidget.hxx" #include "CartDebugWidget.hxx" #include "CartRamWidget.hxx" diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 03548845e..62fd60e8d 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -27,41 +27,12 @@ class DialogContainer; class EventMappingWidget; #include "Event.hxx" +#include "EventHandlerConstants.hxx" #include "Control.hxx" #include "StellaKeys.hxx" #include "Variant.hxx" #include "bspf.hxx" -enum MouseButton { - EVENT_LBUTTONDOWN, - EVENT_LBUTTONUP, - EVENT_RBUTTONDOWN, - EVENT_RBUTTONUP, - EVENT_WHEELDOWN, - EVENT_WHEELUP -}; - -enum JoyHat { - EVENT_HATUP = 0, // make sure these are set correctly, - EVENT_HATDOWN = 1, // since they'll be used as array indices - EVENT_HATLEFT = 2, - EVENT_HATRIGHT = 3, - EVENT_HATCENTER = 4 -}; -enum JoyHatMask { - EVENT_HATUP_M = 1<<0, - EVENT_HATDOWN_M = 1<<1, - EVENT_HATLEFT_M = 1<<2, - EVENT_HATRIGHT_M = 1<<3, - EVENT_HATCENTER_M = 1<<4 -}; - -enum EventMode { - kEmulationMode = 0, // make sure these are set correctly, - kMenuMode = 1, // since they'll be used as array indices - kNumModes = 2 -}; - /** This class takes care of event remapping and dispatching for the Stella core, as well as keeping track of the current 'mode'. diff --git a/src/emucore/EventHandlerConstants.hxx b/src/emucore/EventHandlerConstants.hxx new file mode 100644 index 000000000..8a66b88e8 --- /dev/null +++ b/src/emucore/EventHandlerConstants.hxx @@ -0,0 +1,54 @@ +//============================================================================ +// +// 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-2017 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +//============================================================================ + +// FIXME - perhaps add to namespace or something + +#ifndef EVENTHANDLER_CONSTANTS_HXX +#define EVENTHANDLER_CONSTANTS_HXX + +enum MouseButton { + EVENT_LBUTTONDOWN, + EVENT_LBUTTONUP, + EVENT_RBUTTONDOWN, + EVENT_RBUTTONUP, + EVENT_WHEELDOWN, + EVENT_WHEELUP +}; + +enum JoyHat { + EVENT_HATUP = 0, // make sure these are set correctly, + EVENT_HATDOWN = 1, // since they'll be used as array indices + EVENT_HATLEFT = 2, + EVENT_HATRIGHT = 3, + EVENT_HATCENTER = 4 +}; + +enum JoyHatMask { + EVENT_HATUP_M = 1<<0, + EVENT_HATDOWN_M = 1<<1, + EVENT_HATLEFT_M = 1<<2, + EVENT_HATRIGHT_M = 1<<3, + EVENT_HATCENTER_M = 1<<4 +}; + +enum EventMode { + kEmulationMode = 0, // make sure these are set correctly, + kMenuMode = 1, // since they'll be used as array indices + kNumModes = 2 +}; + +#endif // EVENTHANDLER_CONSTANTS_HXX diff --git a/src/gui/BrowserDialog.hxx b/src/gui/BrowserDialog.hxx index 7a540b927..a0fee851c 100644 --- a/src/gui/BrowserDialog.hxx +++ b/src/gui/BrowserDialog.hxx @@ -23,10 +23,10 @@ class ButtonWidget; class EditTextWidget; class FileListWidget; class StaticTextWidget; +class FilesystemNode; #include "Dialog.hxx" #include "Command.hxx" -#include "FSNode.hxx" #include "bspf.hxx" class BrowserDialog : public Dialog, public CommandSender diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx index 4ccc04b8a..73322c1dc 100644 --- a/src/gui/CheckListWidget.cxx +++ b/src/gui/CheckListWidget.cxx @@ -17,6 +17,7 @@ #include "Dialog.hxx" #include "FBSurface.hxx" +#include "ScrollBarWidget.hxx" #include "CheckListWidget.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/ConfigPathDialog.hxx b/src/gui/ConfigPathDialog.hxx index c706961c0..9744a1077 100644 --- a/src/gui/ConfigPathDialog.hxx +++ b/src/gui/ConfigPathDialog.hxx @@ -21,6 +21,7 @@ class OSystem; class GuiObject; class DialogContainer; +class BrowserDialog; class CheckboxWidget; class PopUpWidget; class EditTextWidget; @@ -29,7 +30,6 @@ class StaticTextWidget; #include "Dialog.hxx" #include "Command.hxx" -#include "BrowserDialog.hxx" class ConfigPathDialog : public Dialog, public CommandSender { diff --git a/src/gui/Dialog.hxx b/src/gui/Dialog.hxx index 8c8185bbf..39558fc9d 100644 --- a/src/gui/Dialog.hxx +++ b/src/gui/Dialog.hxx @@ -25,13 +25,12 @@ class FBSurface; class OSystem; class DialogContainer; class TabWidget; +class CommandSender; -#include "Command.hxx" #include "Stack.hxx" #include "Widget.hxx" #include "GuiObject.hxx" #include "StellaKeys.hxx" - #include "bspf.hxx" /** diff --git a/src/gui/DialogContainer.hxx b/src/gui/DialogContainer.hxx index 86f8f0f5f..a228d3d33 100644 --- a/src/gui/DialogContainer.hxx +++ b/src/gui/DialogContainer.hxx @@ -20,12 +20,13 @@ class Dialog; class OSystem; +class EventHandler; -#include "EventHandler.hxx" +#include "EventHandlerConstants.hxx" +#include "StellaKeys.hxx" #include "Stack.hxx" #include "bspf.hxx" - /** The base class for groups of dialog boxes. Each dialog box has a parent. In most cases, the parent is itself a dialog box, but in the diff --git a/src/gui/FileListWidget.hxx b/src/gui/FileListWidget.hxx index 34c5b313e..9f1790924 100644 --- a/src/gui/FileListWidget.hxx +++ b/src/gui/FileListWidget.hxx @@ -18,7 +18,8 @@ #ifndef FILE_LIST_WIDGET_HXX #define FILE_LIST_WIDGET_HXX -#include "Command.hxx" +class CommandSender; + #include "FSNode.hxx" #include "GameList.hxx" #include "StringListWidget.hxx" diff --git a/src/gui/GuiObject.hxx b/src/gui/GuiObject.hxx index eddd13b19..4df6eb26c 100644 --- a/src/gui/GuiObject.hxx +++ b/src/gui/GuiObject.hxx @@ -24,6 +24,7 @@ class Dialog; class DialogContainer; class Widget; +class OSystem; #include "Command.hxx" #include "OSystem.hxx" diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index c87a4d012..7728a3eb1 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -26,10 +26,12 @@ #include "Settings.hxx" #include "EventMappingWidget.hxx" #include "EditTextWidget.hxx" +#include "JoystickDialog.hxx" #include "PopUpWidget.hxx" #include "TabWidget.hxx" #include "Widget.hxx" #include "Font.hxx" +#include "MessageBox.hxx" #include "InputDialog.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -95,6 +97,11 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent, addBGroupToFocusList(wid); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +InputDialog::~InputDialog() +{ +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void InputDialog::addDevicePortTab(const GUI::Font& font) { diff --git a/src/gui/InputDialog.hxx b/src/gui/InputDialog.hxx index 921eda0d4..b11a3ca1a 100644 --- a/src/gui/InputDialog.hxx +++ b/src/gui/InputDialog.hxx @@ -24,13 +24,15 @@ class TabWidget; class EventMappingWidget; class CheckboxWidget; class EditTextWidget; +class JoystickDialog; class PopUpWidget; class SliderWidget; class StaticTextWidget; +namespace GUI { + class MessageBox; +} #include "Dialog.hxx" -#include "JoystickDialog.hxx" -#include "MessageBox.hxx" #include "bspf.hxx" class InputDialog : public Dialog @@ -38,7 +40,7 @@ class InputDialog : public Dialog public: InputDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h); - virtual ~InputDialog() = default; + virtual ~InputDialog(); private: void handleKeyDown(StellaKey key, StellaMod mod) override; diff --git a/src/gui/JoystickDialog.hxx b/src/gui/JoystickDialog.hxx index ed40dd172..490e116c4 100644 --- a/src/gui/JoystickDialog.hxx +++ b/src/gui/JoystickDialog.hxx @@ -18,14 +18,13 @@ #ifndef JOYSTICK_DIALOG_HXX #define JOYSTICK_DIALOG_HXX +class CommandSender; class GuiObject; class ButtonWidget; class EditTextWidgetWidget; class StringListWidget; #include "Dialog.hxx" -#include "Command.hxx" -#include "DialogContainer.hxx" /** * Show a listing of joysticks currently stored in the eventhandler database, diff --git a/src/gui/Launcher.hxx b/src/gui/Launcher.hxx index 4d2f11bd0..129477f56 100644 --- a/src/gui/Launcher.hxx +++ b/src/gui/Launcher.hxx @@ -22,8 +22,8 @@ class Properties; class OSystem; class FilesystemNode; +#include "FrameBufferConstants.hxx" #include "DialogContainer.hxx" -#include "FrameBuffer.hxx" /** The base dialog for the ROM launcher in Stella. diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx index a12cd819e..9abc6a364 100644 --- a/src/gui/LauncherDialog.hxx +++ b/src/gui/LauncherDialog.hxx @@ -33,12 +33,14 @@ class EditTextWidget; class RomInfoWidget; class StaticTextWidget; class StringListWidget; +namespace GUI { + class MessageBox; +} #include "bspf.hxx" #include "Dialog.hxx" #include "FSNode.hxx" #include "Stack.hxx" -#include "MessageBox.hxx" class LauncherDialog : public Dialog { diff --git a/src/gui/LauncherFilterDialog.cxx b/src/gui/LauncherFilterDialog.cxx index 0c801eb25..4841082d9 100644 --- a/src/gui/LauncherFilterDialog.cxx +++ b/src/gui/LauncherFilterDialog.cxx @@ -18,6 +18,7 @@ #include "bspf.hxx" #include "Dialog.hxx" #include "OSystem.hxx" +#include "FSNode.hxx" #include "PopUpWidget.hxx" #include "Settings.hxx" #include "Widget.hxx" diff --git a/src/gui/LauncherFilterDialog.hxx b/src/gui/LauncherFilterDialog.hxx index eacc87654..76e60f89c 100644 --- a/src/gui/LauncherFilterDialog.hxx +++ b/src/gui/LauncherFilterDialog.hxx @@ -20,14 +20,14 @@ class CommandSender; class DialogContainer; +class FilesystemNode; class CheckboxWidget; class PopUpWidget; class OSystem; -#include "Dialog.hxx" -#include "FSNode.hxx" -#include "Settings.hxx" #include "bspf.hxx" +#include "Dialog.hxx" +#include "Settings.hxx" class LauncherFilterDialog : public Dialog, public CommandSender { diff --git a/src/gui/ListWidget.cxx b/src/gui/ListWidget.cxx index e5afbeb4b..5dc01d43e 100644 --- a/src/gui/ListWidget.cxx +++ b/src/gui/ListWidget.cxx @@ -153,6 +153,12 @@ void ListWidget::scrollTo(int item) } } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +int ListWidget::getWidth() const +{ + return _w + kScrollBarWidth; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void ListWidget::recalc() { diff --git a/src/gui/ListWidget.hxx b/src/gui/ListWidget.hxx index aefba04fb..1f7de9b8e 100644 --- a/src/gui/ListWidget.hxx +++ b/src/gui/ListWidget.hxx @@ -19,12 +19,11 @@ #define LIST_WIDGET_HXX class GuiObject; +class ScrollBarWidget; -#include "Widget.hxx" +#include "Rect.hxx" #include "Command.hxx" #include "EditableWidget.hxx" -#include "ScrollBarWidget.hxx" -#include "Rect.hxx" /** ListWidget */ class ListWidget : public EditableWidget @@ -61,7 +60,7 @@ class ListWidget : public EditableWidget void scrollTo(int item); // Account for the extra width of embedded scrollbar - int getWidth() const override { return _w + kScrollBarWidth; } + int getWidth() const override; static void setQuickSelectDelay(uInt64 time) { _QUICK_SELECT_DELAY = time; } diff --git a/src/gui/LoggerDialog.hxx b/src/gui/LoggerDialog.hxx index d84d3bd3d..6980c9e27 100644 --- a/src/gui/LoggerDialog.hxx +++ b/src/gui/LoggerDialog.hxx @@ -26,7 +26,6 @@ class StringListWidget; #include "Dialog.hxx" #include "bspf.hxx" - class LoggerDialog : public Dialog { public: diff --git a/src/gui/MessageBox.hxx b/src/gui/MessageBox.hxx index 4e860659e..edc511456 100644 --- a/src/gui/MessageBox.hxx +++ b/src/gui/MessageBox.hxx @@ -23,7 +23,6 @@ class StaticTextWidget; #include "Dialog.hxx" #include "Command.hxx" -#include "DialogContainer.hxx" namespace GUI { diff --git a/src/gui/OptionsDialog.cxx b/src/gui/OptionsDialog.cxx index 833b990bd..a1000e3db 100644 --- a/src/gui/OptionsDialog.cxx +++ b/src/gui/OptionsDialog.cxx @@ -16,6 +16,7 @@ //============================================================================ #include "OSystem.hxx" +#include "FrameBuffer.hxx" #include "Dialog.hxx" #include "DialogContainer.hxx" #include "Widget.hxx" diff --git a/src/gui/RomAuditDialog.cxx b/src/gui/RomAuditDialog.cxx index 1cb84ea87..e6cbc33fe 100644 --- a/src/gui/RomAuditDialog.cxx +++ b/src/gui/RomAuditDialog.cxx @@ -25,6 +25,7 @@ #include "FSNode.hxx" #include "Font.hxx" #include "MessageBox.hxx" +#include "FrameBuffer.hxx" #include "MD5.hxx" #include "Props.hxx" #include "PropsSet.hxx"