]> Shamusworld >> Repos - apple2/blob - src/gui/gui.h
5f1a82f2f3efa23ff55b1f35c5172001627fbb44
[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 #if 0
14 class Menu;                                                                             // Now *this* should work, since we've got pointers...
15 class MenuItems;
16 class Element;
17
18
19 class GUI
20 {
21         public:
22                 GUI(SDL_Surface *);
23                 ~GUI();
24                 void AddMenuTitle(const char *);
25                 void AddMenuItem(const char *, Element * (* a)(void) = NULL, SDL_Scancode k = SDL_SCANCODE_UNKNOWN);
26                 void CommitItemsToMenu(void);
27                 void Run(void);
28                 void Stop(void);
29
30         private:
31 //              Menu * mainMenu;
32                 MenuItems * menuItem;
33                 std::list<Element *> windowList;
34                 bool exitGUI;
35                 bool showMouse;
36                 SDL_Rect mouse, oldMouse;
37 };
38 #endif
39
40 class GUI2
41 {
42         public:
43                 GUI2();
44                 ~GUI2();
45
46                 // Everything else is a class method...
47                 static void Init(SDL_Renderer *);
48                 static SDL_Texture * CreateTexture(SDL_Renderer *, const void *);
49                 static void MouseDown(int32_t, int32_t, uint32_t);
50                 static void MouseUp(int32_t, int32_t, uint32_t);
51                 static void MouseMove(int32_t, int32_t, uint32_t);
52                 static void HandleIconSelection(SDL_Renderer *);
53                 static void AssembleDriveIcon(SDL_Renderer *, int);
54                 static void DrawEjectButton(SDL_Renderer *, int);
55                 static void DrawDriveLight(SDL_Renderer *, int);
56                 static void DrawCharArray(SDL_Renderer *, const char *, int x,
57                         int y, int w, int h, int r, int g, int b);
58                 static void HandleGUIState(void);
59                 static void DrawSidebarIcons(SDL_Renderer *);
60                 static void Render(SDL_Renderer *);
61
62                 // Class variables...
63                 static SDL_Texture * overlay;
64                 static SDL_Rect olDst;
65                 static int sidebarState;
66                 static int32_t dx;
67                 static int32_t iconSelected;
68                 static bool hasKeyboardFocus;
69 };
70
71
72 #endif  // __GUI_H__
73