]> Shamusworld >> Repos - apple2/blob - src/gui/gui.h
Added initial emulator configuration window, cleanup of settings code.
[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
12 enum { SBS_SHOWING, SBS_HIDING, SBS_SHOWN, SBS_HIDDEN };
13
14 class GUI
15 {
16         public:
17                 GUI();
18                 ~GUI();
19
20                 // Everything else is a class method...
21                 static void Init(SDL_Renderer *);
22                 static SDL_Texture * CreateTexture(SDL_Renderer *, const void *);
23                 static void MouseDown(int32_t, int32_t, uint32_t);
24                 static void MouseUp(int32_t, int32_t, uint32_t);
25                 static void MouseMove(int32_t, int32_t, uint32_t);
26                 static bool KeyDown(uint32_t);
27                 static void HandleIconSelection(SDL_Renderer *);
28                 static void AssembleDriveIcon(SDL_Renderer *, int);
29                 static void DrawEjectButton(SDL_Renderer *, int);
30                 static void DrawNewDiskButton(SDL_Renderer *, int);
31                 static void DrawDriveLight(SDL_Renderer *, int);
32                 static void DrawCharArray(SDL_Renderer *, const char *, int x,
33                         int y, int w, int h, int r, int g, int b);
34                 static void DrawCharacter(SDL_Renderer *, int, int, uint8_t, bool inv = false);
35                 static void DrawCharacterVert(SDL_Renderer *, int, int, uint8_t, bool inv = false);
36                 static void DrawString(SDL_Renderer *, int, int, const char *, bool inv = false);
37                 static void DrawStringVert(SDL_Renderer *, int, int, const char *, bool inv = false);
38                 static void DrawBox(SDL_Renderer *, int, int, int, int, int r = 0x00, int g = 0xAA, int b = 0x00);
39                 static void HandleGUIState(void);
40                 static void DrawSidebarIcons(SDL_Renderer *);
41                 static void Render(SDL_Renderer *);
42
43                 // Class variables...
44                 static SDL_Texture * overlay;
45                 static SDL_Rect olDst;
46                 static int sidebarState;
47                 static int32_t dx;
48                 static int32_t iconSelected;
49                 static bool hasKeyboardFocus;
50                 static bool powerOnState;
51
52         private:
53                 static SDL_Texture * charStamp;
54                 static uint32_t stamp[];
55 };
56
57 #endif  // __GUI_H__
58