fix compile against newer giflib
[rofl0r-obeditor.git] / src / ob_editor.h
blob9a520fd78c3123158241a6d114616bc3b3ade7c9
1 #ifndef OB_EDITOR_H_
2 #define OB_EDITOR_H_
4 #include <wx/notebook.h>
5 #include <vector>
6 #include <map>
8 #include "common__tools.h"
9 #include "common__modalsFrames.h"
10 #include "CHistory.h"
12 /**
13 * The Application.
15 * The application central start and end of the program
20 class MyApp: public wxApp
22 public:
23 bool auto_load;
24 wxString autoLoadFrame;
27 private:
28 virtual bool OnInit();
29 virtual int OnExit();
32 extern MyApp* theApp;
34 /**
35 * Main Window.
36 * The main Window for the Application
39 class StartFrame: public wxFrame
41 public:
42 StartFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
43 void ShowEntityFrame();
44 void ShowleFrame();
46 void OnEditEntities(wxCommandEvent& event);
47 void OnLoadStages(wxCommandEvent& event);
48 void OnCheckAutoLoad(wxCommandEvent& event);
50 void evtClose( wxCloseEvent& );
51 void EvtActivate( wxActivateEvent& );
53 void OnQuit(wxCommandEvent& event);
54 void OnAbout(wxCommandEvent& event);
55 void OnAddProject(wxCommandEvent& event);
56 void OnDelProject(wxCommandEvent& event);
57 void OnRenameProject(wxCommandEvent& event);
58 void OnChgDirProject(wxCommandEvent& event);
59 void OnRepairWindaubePath(wxCommandEvent& WXUNUSED(event));
60 void OnSetEditor(wxCommandEvent& event);
62 bool LoadCurrentProject_Models();
63 bool LoadCurrentProject_Levels();
65 wxListBox *lstBx_projects;
66 wxCheckBox *chckbx_autoLoad;
67 bool b_init;
68 bool b_reset_entityFrame;
69 bool b_reset_leFrame;
70 wxString frame_launched;
71 DECLARE_EVENT_TABLE()
73 extern StartFrame *startFrame;
75 /**
76 * Edit Entity window.
77 * The Window where to edit entity properties and animations.
79 class Panel_withAnims;
81 class EntityFrame: public wxFrame
83 public:
84 EntityFrame(wxWindow *_parent, const wxString& title );
85 ~EntityFrame();
87 void OnEditEntities(wxCommandEvent& event);
88 void OnLoadStages(wxCommandEvent& event);
90 void OnQuit(wxCommandEvent& event);
91 void OnAbout(wxCommandEvent& event);
93 void EvtUndo(wxCommandEvent& event);
94 void EvtRedo(wxCommandEvent& event);
96 void EvtResize( wxSizeEvent& event );
97 void EvtClose( wxCloseEvent& event );
98 void EvtActivate( wxActivateEvent& );
99 void EvtMenu(wxCommandEvent& event);
100 void EvtCharPress(wxKeyEvent& event);
102 void Reload_Frames();
103 void Reload_Anims();
104 void PanelPageChanging(wxNotebookEvent& event );
105 void SetPanelErrorsIntitule( const wxString& new_intitule );
107 Panel_withAnims* GetCurrentPanel();
109 wxMenu *menuHistory;
110 wxMenu *menuUnRedo;
111 wxNotebook *onglets;
112 bool b_NoAnimPage;
113 int entitySelection_time; //Keep a trace of change of selected entity
114 int entityLastSelection_time;
116 wxMenuBar *menuBar;
118 std::map<wxString,wxString> map_ent_animHistory;
119 void EntityAnimsHistory__Append(const wxString& _ent_name);
120 void EntityAnimsHistory__Clear();
122 // Undo/Redo stuffs
123 void Menu_DoRedos__Update_Labels(std::list<History_Group*>::iterator it_group);
124 void Restore_ControlsState( void* pStates );
125 bool May_Register_ControlsState();
126 void Register_ControlsState_inHistory( const wxString& f_caller );
127 void Set_ControlsState_In( void* elt_datas );
129 int m_flag;
131 private:
132 std::vector<wxString> vect_ent_history;
134 bool b_started;
135 DECLARE_EVENT_TABLE()
137 extern EntityFrame *entityFrame;
142 * Level Editor window.
145 class LevelEditorFrame;
146 extern LevelEditorFrame *leFrame;
150 * Enumeration of ID for StartFrame
154 enum
156 ID_Quit = 101,
157 ID_About = 102,
159 ID_AUTO_LOAD = 103,
161 ID_LOAD_STAGES = 104,
162 ID_EDIT_ENTITIES = 105,
164 ID_LIST_PROJECTS = 106,
165 ID_ADD_PROJECT = 107,
166 ID_DEL_PROJECT = 108,
167 ID_RENAME_PROJECT = 109,
168 ID_CHGDIR_PROJECT = 110,
170 ID_WND_CHG_PJCT_NAME = 111,
171 ID_REPAIR_FILEPATHS = 112,
173 ID_ENTITIES_CURR_SAVE = 234,
174 ID_ENTITIES_CURR_RELOAD = 235,
175 ID_ENTITIES_SAVEALL = 236,
176 ID_ENTITIES_RELOADALL = 237,
177 ID_ENTITIES_RELOAD_MODELSTXT = 238,
179 ID_ENTITIES_RELOAD_GIFS = 239,
180 ID_HELP_PLEASE = 240,
181 ID_SET_EDITOR = 241,
182 ID_OPEN_IN_EDITOR = 242,
183 ID_BACK_TO_STARTFRAME = 243,
185 ID_LEVEL_FIRST_ID = 244,
187 * RESERVED To Stages ID in menu
188 * 244
189 * TO
190 * 300
193 ID_STAGE_NEW = 301,
194 ID_STAGE_EDIT_SETTINGS = 302,
196 ID_STAGE_RELOAD = 303,
197 ID_STAGE_RELOAD_ALL = 304,
199 ID_STAGE_SAVE = 3003,
200 ID_STAGE_SAVE_ALL = 3004,
202 ID_OBJECT_COPY = 3005,
203 ID_OBJECT_SUPP = 3006,
204 ID_OBJECT_PROPERTIES = 3007,
205 ID_OBJECT_SORT_AT_OBJECTS = 3008,
207 ID_STAGE_LOADED_ENTITIES = 308,
209 ID_BACKGROUND = 310,
210 ID_SCENE_BG_LIST_START = 311,
211 /* RESERVED TO 349 */
212 ID_SCENE_BG_EDIT_ORDER = 350,
214 ID_SCENE_PANELS_LIST_START = 360,
215 /* RESERVED TO 399 */
216 ID_SCENE_PANELS_EDIT_ORDER = 400,
218 ID_SCENE_WATER = 401,
219 ID_SCENE_FRONTPANEL = 402,
220 ID_SCENE_TEST = 403,
221 ID_SCENE_MENU_BG = 404,
222 ID_SCENE_MENU_PANELS = 405,
224 ID_STAGE_LIST = 409,
225 ID_STAGE_LIST_START = 410,
226 /* RESERVED TO 499 */
228 ID_SET_LIST = 500,
229 ID_SET_LIST_START = 501,
230 /* RESERVED TO 549 */
231 ID_SET_NEW = 550,
232 ID_SET_EDIT_SETTINGS = 551,
234 ID_LEVELSTXT_SAVE = 552,
235 ID_OPEN_LEVELSTXT_IN_EDITOR = 553,
237 ID_SET_EDIT_EXTENDED_PROPS = 554,
238 ID_STAGE_EDIT_EXTENDED_PROPS = 555,
239 ID_OBJECT_EDIT_EXTENDED_PROPS = 556,
240 ID_STAGE_EDIT_DECLARE_SETTINGS = 557,
242 ID_SCENE_FRONTPANEL_ORDER = 559,
243 ID_SCENE_FRONTPANEL_LIST_START = 560,
244 /* RESERVED TO 599 */
246 ID_SCENE_BG_ADD = 600,
247 ID_SCENE_PANELS_ADD = 601,
250 ID_ENTITIES_HISTORY_CLEAR = 610,
251 ID_ENTITIES_HISTORY_START = 620,
252 /* RESERVED TO 640 */
254 ID_UNDO = 641,
255 ID_REDO = 642,
262 #endif /*OB_EDITOR_H_*/