-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.hpp
58 lines (48 loc) · 1.34 KB
/
App.hpp
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
#ifndef _____APP_HPP_0
#define _____APP_HPP_0
#include "constants.h"
#include "PropertyMap.hpp"
#include "WXWidgets.hpp"
#include <wx/thread.h>
#include <wx/filename.h>
#include <wx/stdpaths.h>
#include<string>
#include<vector>
#include<unordered_map>
#include<fstream>
#include<functional>
#include "cpprintf.hpp"
struct App;
wxDECLARE_APP(App);
struct App: wxApp {
struct MainWindow* win = nullptr;
wxLocale* wxlocale;
std::string locale;
PropertyMap config, lang;
wxPathList pathList;
wxString appDir, userDir, userLocalDir;
wxString onLoadScript;
std::string fileToOpen, uriToOpen;
std::vector<std::shared_ptr<struct XQillaScript>> xqScripts;
struct WebViewBookHandler* bookFSHandler;
wxSharedPtr<struct wxWebViewHandler> bookFsHandlerSp;
bool initDirs ();
bool initConfig ();
bool initLocale ();
bool initTranslations ();
bool initWebview ();
bool initMisc ();
bool initScriptList ();
bool saveConfig ();
std::string findWritablePath (const std::string& filename);
void changeLocale (const std::string& s);
struct wxWebView* createWebView (wxWindow* parent, int id, const wxString& initialPage);
virtual bool OnInit () override;
virtual void OnInitCmdLine (wxCmdLineParser& cmd) override;
virtual bool OnCmdLineParsed (wxCmdLineParser& cmd) override;
void OnQuit ();
};
template <class F> inline void RunEDT (const F& f) {
wxGetApp().CallAfter(f);
}
#endif