-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parbat.cpp
66 lines (52 loc) · 1.68 KB
/
Parbat.cpp
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
62
63
64
65
66
/****************************************************************************\
| Copyright 2009 Rowan James
\****************************************************************************/
#include "PchApp.h"
#include "Parbat.h"
#include "OverviewWindow.h"
//----------------------------------------------------------------------------
ParbatApp* ParbatApp::s_pInstance(NULL);
namespace {
// We use Glade to load the user interface from XML
glade_ref_t g_refGlade;
}
//----------------------------------------------------------------------------
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
g_refGlade = Gtk::Builder::create_from_file("Parbat.glade");
GetApp();
return 0;
}
//----------------------------------------------------------------------------
glade_ref_t GetGladeRef()
{
return g_refGlade;
}
//----------------------------------------------------------------------------
ParbatApp& GetApp()
{
return ParbatApp::GetInstance();
}
//----------------------------------------------------------------------------
ParbatApp& ParbatApp::GetInstance()
{
if (s_pInstance == NULL) {
s_pInstance = new ParbatApp();
}
return *s_pInstance;
}
//----------------------------------------------------------------------------
// Actual class implementation for ParbatApp
//----------------------------------------------------------------------------
ParbatApp::ParbatApp() :
m_pOverviewWindow(NULL)
{
GetGladeRef()->get_widget_derived("OverviewWindow", m_pOverviewWindow);
Gtk::Main::run(*m_pOverviewWindow);
}
//----------------------------------------------------------------------------
OverviewWindow& ParbatApp::GetOverviewWindow()
{
return *m_pOverviewWindow;
}