| 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 ROM_INFO_WIDGET_HXX |
| 19 | #define ROM_INFO_WIDGET_HXX |
| 20 | |
| 21 | class FBSurface; |
| 22 | class Properties; |
| 23 | namespace GUI { |
| 24 | struct Size; |
| 25 | } |
| 26 | |
| 27 | #include "Widget.hxx" |
| 28 | #include "bspf.hxx" |
| 29 | |
| 30 | class RomInfoWidget : public Widget |
| 31 | { |
| 32 | public: |
| 33 | RomInfoWidget(GuiObject *boss, const GUI::Font& font, |
| 34 | int x, int y, int w, int h); |
| 35 | virtual ~RomInfoWidget() = default; |
| 36 | |
| 37 | void setProperties(const Properties& props, const FilesystemNode& node); |
| 38 | void clearProperties(); |
| 39 | void reloadProperties(const FilesystemNode& node); |
| 40 | |
| 41 | protected: |
| 42 | void drawWidget(bool hilite) override; |
| 43 | |
| 44 | private: |
| 45 | void parseProperties(const FilesystemNode& node); |
| 46 | |
| 47 | private: |
| 48 | // Surface pointer holding the PNG image |
| 49 | shared_ptr<FBSurface> mySurface; |
| 50 | |
| 51 | // Whether the surface should be redrawn by drawWidget() |
| 52 | bool mySurfaceIsValid; |
| 53 | |
| 54 | // Some ROM properties info, as well as 'tEXt' chunks from the PNG image |
| 55 | StringList myRomInfo; |
| 56 | |
| 57 | // The properties for the currently selected ROM |
| 58 | Properties myProperties; |
| 59 | |
| 60 | // Indicates if the current properties should actually be used |
| 61 | bool myHaveProperties; |
| 62 | |
| 63 | // Indicates if an error occurred in creating/displaying the surface |
| 64 | string mySurfaceErrorMsg; |
| 65 | |
| 66 | // How much space available for the PNG image |
| 67 | Common::Size myAvail; |
| 68 | |
| 69 | private: |
| 70 | // Following constructors and assignment operators not supported |
| 71 | RomInfoWidget() = delete; |
| 72 | RomInfoWidget(const RomInfoWidget&) = delete; |
| 73 | RomInfoWidget(RomInfoWidget&&) = delete; |
| 74 | RomInfoWidget& operator=(const RomInfoWidget&) = delete; |
| 75 | RomInfoWidget& operator=(RomInfoWidget&&) = delete; |
| 76 | }; |
| 77 | |
| 78 | #endif |
| 79 | |