frodo-wii/frodo_menu.hh

82 lines
1.2 KiB
C++
Raw Normal View History

2009-11-28 08:22:19 +00:00
#ifndef __GUI_HH__
#define __GUI_HH__
#include <SDL.h>
#include "menu.hh"
#include "font.hh"
class Gui;
class GuiView
2009-11-28 08:22:19 +00:00
{
public:
GuiView(Gui *parent)
{
this->parent = parent;
}
virtual void pushEvent(SDL_Event *ev) = 0;
virtual void runLogic() = 0;
virtual void updateTheme() = 0;
virtual void draw(SDL_Surface *where) = 0;
Gui *parent;
2009-11-28 08:22:19 +00:00
};
class Gui
{
public:
Gui();
~Gui();
bool setTheme(const char *path);
2009-11-28 08:43:37 +00:00
void activate();
2009-11-28 08:22:19 +00:00
2009-11-28 08:43:37 +00:00
void deActivate();
2009-11-28 08:22:19 +00:00
void runLogic(void);
void pushEvent(SDL_Event *ev);
void draw(SDL_Surface *where);
2009-12-04 20:45:17 +00:00
void pushView(GuiView *view);
GuiView *popView();
void resetViewStack();
/* These are private, keep off! */
2009-11-28 08:22:19 +00:00
const char *getThemePath(const char *dir, const char *what);
SDL_Surface *loadThemeImage(const char *dir, const char *what);
2009-12-04 20:06:52 +00:00
Font *loadThemeFont(const char *dir, const char *what, int size);
2009-11-28 08:22:19 +00:00
bool is_active;
Menu *focus; /* Where the focus goes */
Menu *main_menu;
2009-11-28 08:59:42 +00:00
SDL_Surface *background;
SDL_Surface *main_menu_bg;
2009-12-04 17:55:25 +00:00
SDL_Surface *infobox;
SDL_Surface *textbox;
2009-11-28 08:22:19 +00:00
SDL_Surface *bg_left, *bg_right, *bg_middle,
*bg_submenu_left, *bg_submenu_right, *bg_submenu_middle;
Font *default_font;
2009-12-04 20:06:52 +00:00
Font *small_font;
GuiView **views;
GuiView *cur_view;
int n_views;
2009-11-28 08:22:19 +00:00
};
#endif /* GUI_HH */