2007-05-29 02:37:11 +00:00
|
|
|
//
|
|
|
|
// GUI.H
|
|
|
|
//
|
|
|
|
// Graphical User Interface support
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef __GUI_H__
|
|
|
|
#define __GUI_H__
|
|
|
|
|
2013-09-09 02:18:23 +00:00
|
|
|
#include <SDL2/SDL.h>
|
2007-05-29 05:16:51 +00:00
|
|
|
#include <list>
|
2007-05-29 02:37:11 +00:00
|
|
|
|
|
|
|
class Menu; // Now *this* should work, since we've got pointers...
|
|
|
|
class MenuItems;
|
|
|
|
class Element;
|
|
|
|
|
2013-09-09 02:18:23 +00:00
|
|
|
|
2007-05-29 02:37:11 +00:00
|
|
|
class GUI
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GUI(SDL_Surface *);
|
|
|
|
~GUI();
|
|
|
|
void AddMenuTitle(const char *);
|
2013-09-09 02:18:23 +00:00
|
|
|
void AddMenuItem(const char *, Element * (* a)(void) = NULL, SDL_Scancode k = SDL_SCANCODE_UNKNOWN);
|
2007-05-29 02:37:11 +00:00
|
|
|
void CommitItemsToMenu(void);
|
|
|
|
void Run(void);
|
|
|
|
void Stop(void);
|
|
|
|
|
|
|
|
private:
|
2007-05-29 05:16:51 +00:00
|
|
|
// Menu * mainMenu;
|
2007-05-29 02:37:11 +00:00
|
|
|
MenuItems * menuItem;
|
2007-05-29 05:16:51 +00:00
|
|
|
std::list<Element *> windowList;
|
2007-05-29 02:37:11 +00:00
|
|
|
bool exitGUI;
|
2007-05-29 05:16:51 +00:00
|
|
|
bool showMouse;
|
|
|
|
SDL_Rect mouse, oldMouse;
|
2007-05-29 02:37:11 +00:00
|
|
|
};
|
|
|
|
|
2013-10-08 21:55:07 +00:00
|
|
|
|
|
|
|
class GUI2
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GUI2();
|
|
|
|
~GUI2();
|
|
|
|
|
|
|
|
// Everything else is a class method...
|
|
|
|
static void Init(SDL_Renderer *);
|
2013-10-11 20:10:47 +00:00
|
|
|
static SDL_Texture * CreateTexture(SDL_Renderer *, const void *);
|
2013-10-08 21:55:07 +00:00
|
|
|
static void MouseDown(int32_t, int32_t, uint32_t);
|
|
|
|
static void MouseUp(int32_t, int32_t, uint32_t);
|
|
|
|
static void MouseMove(int32_t, int32_t, uint32_t);
|
2013-10-10 03:21:44 +00:00
|
|
|
static void HandleIconSelection(SDL_Renderer *);
|
2013-10-08 21:55:07 +00:00
|
|
|
static void HandleGUIState(void);
|
2013-10-10 03:21:44 +00:00
|
|
|
static void DrawSidebarIcons(SDL_Renderer *);
|
|
|
|
static void Render(SDL_Renderer *);
|
2013-10-08 21:55:07 +00:00
|
|
|
|
|
|
|
// Class variables...
|
|
|
|
static SDL_Texture * overlay;
|
2013-10-10 03:21:44 +00:00
|
|
|
// static SDL_Rect olSrc;
|
2013-10-08 21:55:07 +00:00
|
|
|
static SDL_Rect olDst;
|
2013-10-10 03:21:44 +00:00
|
|
|
// static bool sidebarOut;
|
2013-10-08 21:55:07 +00:00
|
|
|
static int sidebarState;
|
|
|
|
static int32_t dx;
|
2013-10-10 03:21:44 +00:00
|
|
|
static int32_t iconSelected;
|
2013-10-08 21:55:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-05-29 02:37:11 +00:00
|
|
|
#endif // __GUI_H__
|
2013-09-09 02:18:23 +00:00
|
|
|
|