2009-11-28 09:22:19 +01:00
|
|
|
#ifndef __GUI_HH__
|
|
|
|
#define __GUI_HH__
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
|
|
|
|
#include "menu.hh"
|
|
|
|
#include "font.hh"
|
|
|
|
|
|
|
|
enum GuiView
|
|
|
|
{
|
2009-11-28 09:43:37 +01:00
|
|
|
main_menu,
|
2009-11-28 09:22:19 +01:00
|
|
|
insert_disc,
|
|
|
|
select_state,
|
|
|
|
virtual_keyboard,
|
|
|
|
networking,
|
|
|
|
options,
|
|
|
|
help,
|
|
|
|
};
|
|
|
|
|
|
|
|
class Gui
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Gui();
|
|
|
|
|
|
|
|
~Gui();
|
|
|
|
|
|
|
|
bool setTheme(const char *path);
|
|
|
|
|
2009-11-28 09:43:37 +01:00
|
|
|
void activate();
|
2009-11-28 09:22:19 +01:00
|
|
|
|
2009-11-28 09:43:37 +01:00
|
|
|
void deActivate();
|
2009-11-28 09:22:19 +01:00
|
|
|
|
|
|
|
void runLogic(void);
|
|
|
|
|
|
|
|
void setView(GuiView view);
|
|
|
|
|
|
|
|
void pushEvent(SDL_Event *ev);
|
|
|
|
|
|
|
|
void draw(SDL_Surface *where);
|
|
|
|
|
|
|
|
private:
|
|
|
|
const char *getThemePath(const char *dir, const char *what);
|
|
|
|
|
|
|
|
SDL_Surface *loadThemeImage(const char *dir, const char *what);
|
|
|
|
|
|
|
|
Font *loadThemeFont(const char *dir, const char *what);
|
|
|
|
|
|
|
|
bool is_active;
|
|
|
|
Menu *focus; /* Where the focus goes */
|
|
|
|
Menu *main_menu;
|
|
|
|
|
2009-11-28 09:59:42 +01:00
|
|
|
SDL_Surface *background;
|
|
|
|
SDL_Surface *main_menu_bg;
|
2009-11-28 09:22:19 +01:00
|
|
|
SDL_Surface *bg_left, *bg_right, *bg_middle,
|
|
|
|
*bg_submenu_left, *bg_submenu_right, *bg_submenu_middle;
|
|
|
|
|
|
|
|
Font *main_font;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GUI_HH */
|