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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
/*
* Copyright 2010 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
* <http://www.gnu.org/licenses/>
*
* Authored by: Gordon Allott <gord.allott@canonical.com>
* Neil Jagdish Patel <neil.patel@canonical.com>
*
*/
#include <gtk/gtk.h>
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include <NuxCore/Logger.h>
#include "unity-shared/BGHash.h"
#include "unity-shared/FontSettings.h"
#include "DashView.h"
#include "unity-shared/UnitySettings.h"
#include "unity-shared/DashStyle.h"
#include "unity-shared/ThumbnailGenerator.h"
#define WIDTH 1024
#define HEIGHT 768
using namespace unity::dash;
class TestRunner
{
public:
TestRunner ();
~TestRunner ();
static void InitWindowThread (nux::NThread* thread, void* InitData);
void Init ();
nux::Layout *layout;
};
TestRunner::TestRunner ()
{
}
TestRunner::~TestRunner ()
{
}
void TestRunner::Init ()
{
layout = new nux::HLayout(NUX_TRACKER_LOCATION);
DashView* view = new DashView();
view->DisableBlur();
view->SetMinMaxSize(WIDTH, HEIGHT);
layout->AddView (view, 1, nux::MINOR_POSITION_CENTER);
layout->SetMinMaxSize(WIDTH, HEIGHT);
view->AboutToShow();
nux::GetWindowThread()->SetLayout (layout);
}
void TestRunner::InitWindowThread(nux::NThread* thread, void* InitData)
{
TestRunner *self = (TestRunner *) InitData;
self->Init ();
}
int main(int argc, char **argv)
{
nux::WindowThread* wt = NULL;
gtk_init (&argc, &argv);
unity::BGHash bghash;
unity::FontSettings font_settings;
nux::NuxInitialize(0);
nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY"));
// The instances for the pseudo-singletons.
unity::ThumbnailGenerator thumb_generator;
unity::Settings settings;
unity::dash::Style dash_style;
TestRunner *test_runner = new TestRunner ();
wt = nux::CreateGUIThread(TEXT("Unity Dash"),
WIDTH, HEIGHT,
0,
&TestRunner::InitWindowThread,
test_runner);
wt->Run (NULL);
delete wt;
return 0;
}
|