16#include <wx/busyinfo.h>
19#define MAINWIN ((MainWindow *)wxGetApp().GetTopWindow())
21#define SHOW_DIALOG_ERROR(message) \
23 wxMessageDialog *dial = new wxMessageDialog( \
24 NULL, wxT(message), wxT("Error"), wxOK | wxICON_ERROR); \
27#define SHOW_DIALOG_INFO(message) {wxMessageBox( wxT(message) );}
28#define SHOW_DIALOG_BUSY(message) {wxBusyInfo wait(message);}
29#define REQUIRE_FILE(file) \
31 if (!wxFileExists(file)) { \
32 Abort(std::string("File ") + file + std::string(" not found")); \
36#define CONFIG_OPEN(name) wxConfig *name = new wxConfig("ochess")
37#define CONFIG_CLOSE(name) delete name
38#define CONFIG_VERSION "1.0"
39#define UNUSED(symbol) (void)(symbol);
52 typedef enum Type { GAME, BASE, ENGINE, NONE }
Type;
64 virtual void Refresh(){};
69 virtual std::shared_ptr<Game> GetGame() = 0;
70 virtual std::shared_ptr<GameBase> GetBase() = 0;
71 virtual std::uint32_t GetEngineId() {
return 0; };
91 void NewGame(std::shared_ptr<Game> g);
99void Abort(std::string msg);
Binary resources functions.
Represent the interface that each database type (such as PGNGameBase) must follow to be accessible in...
Definition: GameBase.hpp:10
Hold an entire chess game. Used in many places in the projects.
Definition: Game.hpp:12
Main application.
Definition: ochess.hpp:79
Openings & GetBook()
Singleton to get the opening book (see Openings)
Definition: ochess.cpp:62
void NewGame(TabInfos *tabsrc, std::shared_ptr< Game > g)
Open a new game tab linked to tabsrc that uses game g.
Definition: ochess.cpp:64
virtual bool OnInit()
Entry point of the application.
Definition: ochess.cpp:5
std::vector< TabInfos * > ListTabInfos()
Get a list of all the tabs opened in OChess.
Definition: ochess.cpp:45
void FocusOnTab(TabInfos *)
Trigger a wxWidget focus event on a specific tab.
Definition: ochess.cpp:54
Guess the opening using the Lichess Opening Database See: https://github.com/lichess-org/chess-openin...
Definition: Openings.hpp:10
Used by each tab of the GUI to attach additional informations and features.
Definition: ochess.hpp:47
long id
Each tab has an associated unique id.
Definition: ochess.hpp:55
bool is_linked
Set to true if this tab is attach to another one (c.f linked_id)
Definition: ochess.hpp:59
static long tab_count
Keep track of the number of opened tabs.
Definition: ochess.hpp:49
bool is_dirty
True if current tab is dirty.
Definition: ochess.hpp:61
long linked_id
Specify to which tab id this tab is linked (e.g: database to linked to on of its opened game tab)
Definition: ochess.hpp:57
virtual void ApplyPreferences()
Can be called to load preferences that have been modify in the application settings.
Definition: ochess.hpp:68
virtual void OnLink()
Callback that is called when the current tab is linked to another one.
Definition: ochess.hpp:66
Type
Which type of tab is it?
Definition: ochess.hpp:52