~3v1n0/unity/overlay-border-scale

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/SwitcherView.h

  • Committer: Daniel van Vugt
  • Date: 2012-03-14 06:24:18 UTC
  • mfrom: (2108 unity)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: daniel.van.vugt@canonical.com-20120314062418-nprucpbr0m7qky5e
MergedĀ latestĀ lp:unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "StaticCairoText.h"
26
26
#include "LayoutSystem.h"
27
27
#include "BackgroundEffectHelper.h"
 
28
#include "UnityWindowView.h"
28
29
 
29
30
#include "Introspectable.h"
30
31
 
36
37
#include <NuxCore/Property.h>
37
38
 
38
39
 
 
40
 
 
41
 
39
42
namespace unity
40
43
{
41
44
namespace launcher
45
48
namespace switcher
46
49
{
47
50
 
48
 
class SwitcherView : public debug::Introspectable, public nux::View
 
51
class SwitcherView : public debug::Introspectable, public ui::UnityWindowView
49
52
{
50
 
  NUX_DECLARE_OBJECT_TYPE(SwitcherView, nux::View);
 
53
  NUX_DECLARE_OBJECT_TYPE(SwitcherView, ui::UnityWindowView);
51
54
public:
52
55
  typedef nux::ObjectPtr<SwitcherView> Ptr;
53
56
 
54
 
  SwitcherView(NUX_FILE_LINE_PROTO);
 
57
  SwitcherView();
55
58
  virtual ~SwitcherView();
56
59
 
57
60
  ui::LayoutWindowList ExternalTargets ();
59
62
  void SetModel(SwitcherModel::Ptr model);
60
63
  SwitcherModel::Ptr GetModel();
61
64
 
62
 
  void SetupBackground ();
63
 
 
64
65
  nux::Property<bool> render_boxes;
65
66
  nux::Property<int> border_size;
66
67
  nux::Property<int> flat_spacing;
70
71
  nux::Property<int> vertical_size;
71
72
  nux::Property<int> text_size;
72
73
  nux::Property<int> animation_length;
 
74
  nux::Property<int> monitor;
73
75
  nux::Property<double> spread_size;
74
 
  nux::Property<nux::Color> background_color;
75
76
 
76
77
protected:
77
78
  // Introspectable methods
78
79
  std::string GetName() const;
79
80
  void AddProperties(GVariantBuilder* builder);
80
81
 
81
 
  void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
82
 
  void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
 
82
  void PreDraw(nux::GraphicsEngine& GfxContext, bool force_draw);
 
83
  void DrawOverlay(nux::GraphicsEngine& GfxContext, bool force_draw, nux::Geometry clip);
 
84
  nux::Geometry GetBackgroundGeometry();
83
85
 
84
86
  ui::RenderArg InterpolateRenderArgs(ui::RenderArg const& start, ui::RenderArg const& end, float progress);
85
87
  nux::Geometry InterpolateBackground (nux::Geometry const& start, nux::Geometry const& end, float progress);
86
88
 
87
89
  std::list<ui::RenderArg> RenderArgsFlat(nux::Geometry& background_geo, int selection, timespec const& current);
88
90
 
89
 
  ui::RenderArg CreateBaseArgForIcon(launcher::AbstractLauncherIcon* icon);
 
91
  ui::RenderArg CreateBaseArgForIcon(launcher::AbstractLauncherIcon::Ptr icon);
90
92
private:
91
 
  void DrawBackground(nux::GraphicsEngine& GfxContext, nux::Geometry const& geo);
92
 
 
93
 
  void OnSelectionChanged(launcher::AbstractLauncherIcon* selection);
 
93
  void OnSelectionChanged(launcher::AbstractLauncherIcon::Ptr selection);
94
94
  void OnDetailSelectionChanged (bool detail);
95
95
  void OnDetailSelectionIndexChanged (unsigned int index);
96
96
 
121
121
 
122
122
  guint redraw_handle_;
123
123
 
124
 
  nux::BaseTexture* background_top_;
125
 
  nux::BaseTexture* background_left_;
126
 
  nux::BaseTexture* background_corner_;
127
124
  nux::BaseTexture* rounding_texture_;
128
125
 
129
126
  nux::StaticCairoText* text_view_;
136
133
 
137
134
  ui::LayoutWindowList render_targets_;
138
135
 
 
136
  timespec current_;
139
137
  timespec save_time_;
140
138
 
141
139
  bool animation_draw_;
142
 
 
143
 
  BackgroundEffectHelper bg_effect_helper_;
144
140
};
145
141
 
146
142
}