me empecine con el makefile.... make stats :)
[seni.git] / engine / menu.hpp
blob7d2b24e0fc178dff93d7fbff755e8ea4bd5fd200
1 /*SENI, Search for Extra Nibiru Intelligence*/
3 /*
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 Copyright SSW Team 2010
22 #ifndef __MENU_ENGINE__H_SENI
23 #define __MENU_ENGINE__H_SENI
25 #define WITHOUT_OPTION (0)
27 #define MAX_OPTIONS (20)
29 #define MENU_NO_ERROR (0)
30 #define MENU_ERROR (MENU_NO_ERROR + 1)
31 #define OPTIONS_FULL (MENU_NO_ERROR + 2)
32 #define NO_OPTION (MENU_NO_ERROR + 3)
33 #define MENU_NO_ENGINE (MENU_NO_ERROR + 4)
34 #define OPTION_RETURN (0)
35 #define OPTION_STAY (OPTION_RETURN + 1)
37 class Option;
38 class Menu;
40 #include "engine.hpp"
42 typedef int (*option_event)(SDL_Event *, Engine *, Menu *, Option *);
44 class Option{
45 public:
46 Option(void);
47 Option(Engine *);
48 Option(char *, Engine *);
49 Option(char *, int, Engine *);
50 int getId(void);
51 void setId(int);
52 int setImage(char *);
53 void setEvent(option_event);
54 int execEvent(SDL_Event *, Engine *, Menu *, Option *);
55 int show(void);
56 int update(void);
57 void setEngine(Engine *);
58 void setXY(int, int);
59 int getH(void);
60 int getW(void);
61 int getX(void);
62 int getY(void);
63 private:
64 int id;
65 char image[255];
66 int x;
67 int y;
68 SDL_Surface *Simage;
69 option_event event;
70 Engine *engine;
73 class Menu{
74 public:
75 Menu(void);
76 Menu(Engine *);
77 Menu(char *, Engine *);
78 Menu(char *, Option **, int, Engine *);
79 int setWallpaper(char *);
80 int addOption(Option *);
81 Option *getOption(int);
82 Option *getOptionById(int);
83 int removeOption(int);
84 int show(void);
85 int update(void);
86 void setEngine(Engine *);
87 private:
88 Option *options[MAX_OPTIONS];
89 char wallpaper[255];
90 SDL_Surface *Swallpaper;
91 SDL_Surface *Smenu;
92 Engine *engine;
95 #endif