1//============================================================================
2//
3// SSSS tt lll lll
4// SS SS tt ll ll
5// SS tttttt eeee ll ll aaaa
6// SSSS tt ee ee ll ll aa
7// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
8// SS SS tt ee ll ll aa aa
9// SSSS ttt eeeee llll llll aaaaa
10//
11// Copyright (c) 1995-2019 by Bradford W. Mott, Stephen Anthony
12// and the Stella Team
13//
14// See the file "License.txt" for information on usage and redistribution of
15// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16//============================================================================
17
18#ifndef RIOT_WIDGET_HXX
19#define RIOT_WIDGET_HXX
20
21class GuiObject;
22class ButtonWidget;
23class DataGridWidget;
24class PopUpWidget;
25class ToggleBitWidget;
26class ControllerWidget;
27class Controller;
28
29#include "Widget.hxx"
30#include "Command.hxx"
31
32class RiotWidget : public Widget, public CommandSender
33{
34 public:
35 RiotWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
36 int x, int y, int w, int h);
37 virtual ~RiotWidget() = default;
38
39 private:
40 ControllerWidget* addControlWidget(GuiObject* boss, const GUI::Font& font,
41 int x, int y, Controller& controller);
42
43 void handleConsole();
44 void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
45 void loadConfig() override;
46
47 private:
48 ToggleBitWidget* mySWCHAReadBits;
49 ToggleBitWidget* mySWCHAWriteBits;
50 ToggleBitWidget* mySWACNTBits;
51 ToggleBitWidget* mySWCHBReadBits;
52 ToggleBitWidget* mySWCHBWriteBits;
53 ToggleBitWidget* mySWBCNTBits;
54
55 DataGridWidget* myLeftINPT;
56 DataGridWidget* myRightINPT;
57 CheckboxWidget* myINPTLatch;
58 CheckboxWidget* myINPTDump;
59
60 DataGridWidget* myTimWrite;
61 DataGridWidget* myTimRead;
62 DataGridWidget* myTimDivider;
63
64 ControllerWidget *myLeftControl, *myRightControl;
65 PopUpWidget *myP0Diff, *myP1Diff;
66 PopUpWidget *myTVType;
67 CheckboxWidget* mySelect;
68 CheckboxWidget* myReset;
69 CheckboxWidget* myPause;
70
71 EditTextWidget* myConsole;
72
73 // ID's for the various widgets
74 // We need ID's, since there are more than one of several types of widgets
75 enum {
76 kTim1TID, kTim8TID, kTim64TID, kTim1024TID, kTimWriteID,
77 kSWCHABitsID, kSWACNTBitsID, kSWCHBBitsID, kSWBCNTBitsID,
78 kP0DiffChanged, kP1DiffChanged, kTVTypeChanged, kSelectID, kResetID,
79 kSWCHARBitsID, kPauseID
80 };
81
82 private:
83 // Following constructors and assignment operators not supported
84 RiotWidget() = delete;
85 RiotWidget(const RiotWidget&) = delete;
86 RiotWidget(RiotWidget&&) = delete;
87 RiotWidget& operator=(const RiotWidget&) = delete;
88 RiotWidget& operator=(RiotWidget&&) = delete;
89};
90
91#endif
92