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-2021 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 
21 class GuiObject;
22 class ButtonWidget;
23 class DataGridWidget;
24 class PopUpWidget;
25 class ToggleBitWidget;
26 class ControllerWidget;
27 class Controller;
28 
29 #include "Widget.hxx"
30 #include "Command.hxx"
31 
32 class 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     ~RiotWidget() override = 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{nullptr};
49     ToggleBitWidget* mySWCHAWriteBits{nullptr};
50     ToggleBitWidget* mySWACNTBits{nullptr};
51     ToggleBitWidget* mySWCHBReadBits{nullptr};
52     ToggleBitWidget* mySWCHBWriteBits{nullptr};
53     ToggleBitWidget* mySWBCNTBits{nullptr};
54 
55     DataGridWidget* myLeftINPT{nullptr};
56     DataGridWidget* myRightINPT{nullptr};
57     CheckboxWidget* myINPTLatch{nullptr};
58     CheckboxWidget* myINPTDump{nullptr};
59 
60     DataGridWidget* myTimWrite{nullptr};
61     DataGridWidget* myTimClocks{nullptr};
62     DataGridWidget* myTimRead{nullptr};
63     DataGridWidget* myTimDivider{nullptr};
64 
65     ControllerWidget *myLeftControl{nullptr}, *myRightControl{nullptr};
66     PopUpWidget *myP0Diff{nullptr}, *myP1Diff{nullptr};
67     PopUpWidget *myTVType{nullptr};
68     CheckboxWidget* mySelect{nullptr};
69     CheckboxWidget* myReset{nullptr};
70     CheckboxWidget* myPause{nullptr};
71 
72     EditTextWidget* myConsole{nullptr};
73 
74     // ID's for the various widgets
75     // We need ID's, since there are more than one of several types of widgets
76     enum {
77       kTim1TID, kTim8TID, kTim64TID, kTim1024TID, kTimWriteID,
78       kSWCHABitsID, kSWACNTBitsID, kSWCHBBitsID, kSWBCNTBitsID,
79       kP0DiffChanged, kP1DiffChanged, kTVTypeChanged, kSelectID, kResetID,
80       kSWCHARBitsID, kSWCHBRBitsID, kPauseID
81     };
82 
83   private:
84     // Following constructors and assignment operators not supported
85     RiotWidget() = delete;
86     RiotWidget(const RiotWidget&) = delete;
87     RiotWidget(RiotWidget&&) = delete;
88     RiotWidget& operator=(const RiotWidget&) = delete;
89     RiotWidget& operator=(RiotWidget&&) = delete;
90 };
91 
92 #endif
93