1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2013 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
21
//#include <glib/gi18n-lib.h>
24
//#include <Nux/NuxTimerTickSource.h>
25
#include <Nux/WindowThread.h>
26
//#include <NuxCore/AnimationController.h>
28
#include "LockScreenController.h"
29
//#include "unity-shared/UnitySettings.h"
31
class MockSessionManager : public unity::session::Manager
34
std::string RealName() const { return ""; }
35
std::string UserName() const { return ""; }
44
void CancelAction() {}
46
bool CanShutdown() const {return true;}
47
bool CanSuspend() const {return true;}
48
bool CanHibernate() const {return true;}
51
struct LockScreenWindow
54
: wt(nux::CreateGUIThread("Unity LockScreen Controller", 1024, 300, 0, &LockScreenWindow::ThreadWidgetInit, this))
55
//, animation_controller(tick_source)
66
static void ThreadWidgetInit(nux::NThread* thread, void* self)
68
static_cast<LockScreenWindow*>(self)->Init();
71
//unity::Settings settings;
72
std::shared_ptr<nux::WindowThread> wt;
73
//nux::NuxTimerTickSource tick_source;
74
//nux::animation::AnimationController animation_controller;
75
std::shared_ptr<unity::lockscreen::Controller> controller;
78
void LockScreenWindow::Init()
80
auto manager = std::make_shared<MockSessionManager>();
81
controller = std::make_shared<unity::lockscreen::Controller>(manager);
82
manager->lock_requested.emit();
85
int main(int argc, char** argv)
87
gtk_init(&argc, &argv);
89
nux::NuxInitialize(0);
90
LockScreenWindow().Show();