Root/
| 1 | // Various authors. |
| 2 | // License: GPL version 2 or later. |
| 3 | |
| 4 | #ifndef __CONTEXTMENU_H__ |
| 5 | #define __CONTEXTMENU_H__ |
| 6 | |
| 7 | #include "layer.h" |
| 8 | |
| 9 | #include <SDL.h> |
| 10 | #include <memory> |
| 11 | |
| 12 | class GMenu2X; |
| 13 | class Menu; |
| 14 | |
| 15 | |
| 16 | /** |
| 17 | * A popup dialog containing action on the current section or link. |
| 18 | */ |
| 19 | class ContextMenu : public Layer { |
| 20 | public: |
| 21 | ContextMenu(GMenu2X &gmenu2x, Menu &menu); |
| 22 | |
| 23 | // Layer implementation: |
| 24 | virtual bool runAnimations(); |
| 25 | virtual void paint(Surface &s); |
| 26 | virtual bool handleButtonPress(InputManager::Button button); |
| 27 | virtual bool handleTouchscreen(Touchscreen &ts); |
| 28 | |
| 29 | private: |
| 30 | struct MenuOption; |
| 31 | |
| 32 | GMenu2X &gmenu2x; |
| 33 | Menu &menu; |
| 34 | std::vector<std::shared_ptr<MenuOption>> options; |
| 35 | SDL_Rect box; |
| 36 | |
| 37 | int fadeAlpha; |
| 38 | int selected; |
| 39 | long tickStart; |
| 40 | }; |
| 41 | |
| 42 | #endif // __CONTEXTMENU_H__ |
| 43 |
Branches:
install_locations
master
opkrun
packages
