~sethj/ubuntu/wily/unity/fix-for-1445595

« back to all changes in this revision

Viewing changes to shutdown/SessionController.h

  • Committer: Marco Trevisan (Treviño)
  • Date: 2013-02-11 22:41:12 UTC
  • mto: This revision was merged to the branch mainline in revision 3200.
  • Revision ID: mail@3v1n0.net-20130211224112-k1nxtougs7xgdjj5
ShutdownView: first draft implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
 
2
/*
 
3
* Copyright (C) 2013 Canonical Ltd
 
4
*
 
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.
 
8
*
 
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.
 
13
*
 
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/>.
 
16
*
 
17
* Authored by: Marco Trevisan (Treviño) <marco@ubuntu.com>
 
18
*/
 
19
 
 
20
#ifndef UNITYSHELL_SESSION_CONTROLLER_H
 
21
#define UNITYSHELL_SESSION_CONTROLLER_H
 
22
 
 
23
#include <memory>
 
24
 
 
25
#include <Nux/Nux.h>
 
26
#include <Nux/BaseWindow.h>
 
27
#include <Nux/HLayout.h>
 
28
#include <NuxCore/Color.h>
 
29
#include <NuxCore/Animation.h>
 
30
#include <UnityCore/SessionManager.h>
 
31
 
 
32
#include "SessionView.h"
 
33
#include "unity-shared/Introspectable.h"
 
34
#include "unity-shared/UBusWrapper.h"
 
35
 
 
36
namespace unity
 
37
{
 
38
namespace session
 
39
{
 
40
 
 
41
class Controller : public debug::Introspectable
 
42
{
 
43
public:
 
44
  typedef std::shared_ptr<Controller> Ptr;
 
45
 
 
46
  Controller(session::Manager::Ptr const& manager);
 
47
  virtual ~Controller() = default;
 
48
 
 
49
  void Show();
 
50
  void Hide();
 
51
 
 
52
  bool Visible() const;
 
53
 
 
54
protected:
 
55
  // Introspectable
 
56
  std::string GetName() const;
 
57
  void AddProperties(GVariantBuilder* builder);
 
58
 
 
59
  virtual nux::Point GetOffsetPerMonitor(int monitor);
 
60
 
 
61
private:
 
62
  void ConstructView();
 
63
  void EnsureView();
 
64
  void CloseWindow();
 
65
  void OnBackgroundUpdate(GVariant* data);
 
66
 
 
67
  View::Ptr view_;
 
68
  nux::ObjectPtr<nux::BaseWindow> view_window_;
 
69
  nux::Point adjustment_;
 
70
  session::Manager::Ptr manager_;
 
71
 
 
72
  nux::Color bg_color_;
 
73
 
 
74
  nux::animation::AnimateValue<double> fade_animator_;
 
75
  UBusManager ubus_manager_;
 
76
};
 
77
 
 
78
}
 
79
}
 
80
 
 
81
#endif