]> Shamusworld >> Repos - apple2/blob - src/gui/gui.h
ba93a41c8ff625032ecf9712b88eea56a8bceef3
[apple2] / src / gui / gui.h
1 //
2 // GUI.H
3 //
4 // Graphical User Interface support
5 //
6
7 #ifndef __GUI_H__
8 #define __GUI_H__
9
10 #include <SDL2/SDL.h>
11 #include <list>
12
13 class Menu;                                                                             // Now *this* should work, since we've got pointers...
14 class MenuItems;
15 class Element;
16
17
18 class GUI
19 {
20         public:
21                 GUI(SDL_Surface *);
22                 ~GUI();
23                 void AddMenuTitle(const char *);
24                 void AddMenuItem(const char *, Element * (* a)(void) = NULL, SDL_Scancode k = SDL_SCANCODE_UNKNOWN);
25                 void CommitItemsToMenu(void);
26                 void Run(void);
27                 void Stop(void);
28
29         private:
30 //              Menu * mainMenu;
31                 MenuItems * menuItem;
32                 std::list<Element *> windowList;
33                 bool exitGUI;
34                 bool showMouse;
35                 SDL_Rect mouse, oldMouse;
36 };
37
38
39 class GUI2
40 {
41         public:
42                 GUI2();
43                 ~GUI2();
44
45                 // Everything else is a class method...
46                 static void Init(SDL_Renderer *);
47                 static void MouseDown(int32_t, int32_t, uint32_t);
48                 static void MouseUp(int32_t, int32_t, uint32_t);
49                 static void MouseMove(int32_t, int32_t, uint32_t);
50                 static void Render(SDL_Renderer *);
51                 static void HandleGUIState(void);
52
53                 // Class variables...
54                 static SDL_Texture * overlay;
55                 static SDL_Rect olSrc;
56                 static SDL_Rect olDst;
57                 static bool sidebarOut;
58                 static int sidebarState;
59                 static int32_t dx;
60 };
61
62
63 #endif  // __GUI_H__
64