#pragma once #include #ifndef WX_PRECOMP #include #endif #include "binres/binres.hpp" #include #include #include // Check file exists etc #include #define MAINWIN ((MainWindow *)wxGetApp().GetTopWindow()) #define SHOW_DIALOG_ERROR(message) \ { \ wxMessageDialog *dial = new wxMessageDialog( \ NULL, wxT(message), wxT("Error"), wxOK | wxICON_ERROR); \ dial->ShowModal(); \ } #define REQUIRE_FILE(file) \ { \ if (!wxFileExists(file)) { \ Abort(std::string("File ") + file + std::string(" not found")); \ } \ } #define CONFIG_OPEN(name) wxConfig *name = new wxConfig("ochess") #define CONFIG_CLOSE(name) delete name /** * @brief Main application * */ class MyApp : public wxApp { public: virtual bool OnInit(); }; wxDECLARE_APP(MyApp); ///@brief Abort ochess with a message void Abort(std::string msg); /** * @brief Attach informations to the application tabs * */ class TabInfos { public: typedef enum Type { GAME, NONE } Type; Type type; TabInfos(Type type_) : type(type_) {} virtual void ApplyPreferences() = 0; };