2
* Copyright 2010 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3, as published
6
* by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* version 3 along with this program. If not, see
15
* <http://www.gnu.org/licenses/>
17
* Authored by: Gordon Allott <gord.allott@canonical.com>
22
#include "Nux/VLayout.h"
23
#include "Nux/HLayout.h"
24
#include "Nux/Button.h"
25
#include "IconTexture.h"
26
#include "StaticCairoText.h"
27
#include "Nux/TextureArea.h"
28
#include "Nux/WindowThread.h"
29
#include "NuxGraphics/GraphicsEngine.h"
32
#include "PlacesSimpleTile.h"
40
static void InitWindowThread(nux::NThread* thread, void* InitData);
43
PlacesSimpleTile* simple_tile;
49
TestRunner::TestRunner()
53
TestRunner::~TestRunner()
57
void TestRunner::Init()
59
PlacesSimpleTile* tile1 = new PlacesSimpleTile("/usr/share/icons/scalable/apps/deluge.svg", "Der schnelle braune Fuchs sprang über den faulen Hund. Der schnelle braune Fuchs sprang über den faulen Hund. Der schnelle braune Fuchs sprang über den faulen Hund.");
60
PlacesSimpleTile* tile2 = new PlacesSimpleTile("firefox", "FooBar Fox");
61
PlacesSimpleTile* tile3 = new PlacesSimpleTile("THISISNOTAVALIDTEXTURE.NOTREAL", "this icon is not valid");
62
layout = new nux::HLayout(NUX_TRACKER_LOCATION);
64
layout->AddView(tile1, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
65
layout->AddView(tile2, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
66
layout->AddView(tile3, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
68
layout->SetFocused(true);
70
nux::GetGraphicsThread()->SetLayout(layout);
73
void TestRunner::InitWindowThread(nux::NThread* thread, void* InitData)
75
TestRunner* self = (TestRunner*) InitData;
80
ControlThread(nux::NThread* thread,
83
// sleep for 3 seconds
84
nux::SleepForMilliseconds(3000);
85
printf("ControlThread successfully started\n");
89
int main(int argc, char** argv)
91
nux::SystemThread* st = NULL;
92
nux::WindowThread* wt = NULL;
94
// no real tests right now, just make sure we don't get any criticals and such
95
// waiting on nice perceptual diff support before we can build real tests
100
gtk_init(&argc, &argv);
102
nux::NuxInitialize(0);
104
g_setenv("UNITY_ENABLE_PLACES", "1", FALSE);
106
TestRunner* test_runner = new TestRunner();
107
wt = nux::CreateGUIThread(TEXT("Unity Places Tile Test"),
110
&TestRunner::InitWindowThread,
113
st = nux::CreateSystemThread(NULL, ControlThread, wt);