blob: 6303e3133d99f2be834c1150e8ec65a87eba5883 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#pragma once
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "binres/binres.hpp"
#include <wx/app.h>
#include <wx/config.h>
#include <wx/filefn.h> // Check file exists etc
#include <wx/log.h>
#include "gui.h"
#include <memory>
#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, BASE, ENGINE, NONE } Type;
Type type;
TabInfos(Type type_) : type(type_) {}
virtual void ApplyPreferences() = 0;
virtual void *GetGame() = 0;
virtual void *GetBase() = 0;
};
|