| 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 TIA_OUTPUT_WIDGET_HXX | 
|---|
| 19 | #define TIA_OUTPUT_WIDGET_HXX | 
|---|
| 20 |  | 
|---|
| 21 | class GuiObject; | 
|---|
| 22 | class ; | 
|---|
| 23 | class TiaZoomWidget; | 
|---|
| 24 | class FBSurface; | 
|---|
| 25 |  | 
|---|
| 26 | #include "Widget.hxx" | 
|---|
| 27 | #include "Command.hxx" | 
|---|
| 28 |  | 
|---|
| 29 | class TiaOutputWidget : public Widget, public CommandSender | 
|---|
| 30 | { | 
|---|
| 31 | public: | 
|---|
| 32 | TiaOutputWidget(GuiObject *boss, const GUI::Font& font, | 
|---|
| 33 | int x, int y, int w, int h); | 
|---|
| 34 | virtual ~TiaOutputWidget() = default; | 
|---|
| 35 |  | 
|---|
| 36 | void loadConfig() override; | 
|---|
| 37 | void setZoomWidget(TiaZoomWidget* w) { myZoom = w; } | 
|---|
| 38 |  | 
|---|
| 39 | void saveSnapshot(int execDepth = 0, const string& execPrefix = ""); | 
|---|
| 40 |  | 
|---|
| 41 | // Eventually, these methods will enable access to the onscreen TIA image | 
|---|
| 42 | // For example, clicking an area may cause an action | 
|---|
| 43 | // (fill to this scanline, etc). | 
|---|
| 44 | /* | 
|---|
| 45 | void handleMouseUp(int x, int y, MouseButton b, int clickCount) override; | 
|---|
| 46 | void handleMouseWheel(int x, int y, int direction) override; | 
|---|
| 47 | bool handleKeyDown(StellaKey key, StellaMod mod) override; | 
|---|
| 48 | bool handleKeyUp(StellaKey key, StellaMod mod) override; | 
|---|
| 49 | */ | 
|---|
| 50 | private: | 
|---|
| 51 | unique_ptr<ContextMenu> ; | 
|---|
| 52 | TiaZoomWidget* myZoom; | 
|---|
| 53 |  | 
|---|
| 54 | int myClickX, myClickY; | 
|---|
| 55 |  | 
|---|
| 56 | // Create this buffer once, instead of allocating it each time the | 
|---|
| 57 | // TIA image is redrawn | 
|---|
| 58 | uInt32 myLineBuffer[320]; | 
|---|
| 59 |  | 
|---|
| 60 | private: | 
|---|
| 61 | void handleMouseDown(int x, int y, MouseButton b, int clickCount) override; | 
|---|
| 62 | void handleCommand(CommandSender* sender, int cmd, int data, int id) override; | 
|---|
| 63 |  | 
|---|
| 64 | void drawWidget(bool hilite) override; | 
|---|
| 65 | bool wantsFocus() const override { return false; } | 
|---|
| 66 |  | 
|---|
| 67 | // Following constructors and assignment operators not supported | 
|---|
| 68 | TiaOutputWidget() = delete; | 
|---|
| 69 | TiaOutputWidget(const TiaOutputWidget&) = delete; | 
|---|
| 70 | TiaOutputWidget(TiaOutputWidget&&) = delete; | 
|---|
| 71 | TiaOutputWidget& operator=(const TiaOutputWidget&) = delete; | 
|---|
| 72 | TiaOutputWidget& operator=(TiaOutputWidget&&) = delete; | 
|---|
| 73 | }; | 
|---|
| 74 |  | 
|---|
| 75 | #endif | 
|---|
| 76 |  | 
|---|