~unity-team/unity/match-designed-sizings

« back to all changes in this revision

Viewing changes to src/PlacesGroup.h

  • Committer: Neil Jagdish Patel
  • Date: 2011-02-28 17:44:02 UTC
  • mfrom: (894.1.29 dash-fixes-2011-02-28)
  • Revision ID: neil.patel@canonical.com-20110228174402-3l0w8tg4cc2j8hc5
[merge] dash fixes part deux

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef PLACES_GROUP_H
21
21
#define PLACES_GROUP_H
22
22
 
23
 
#include <sigc++/sigc++.h>
24
 
 
25
23
#include <Nux/Nux.h>
26
24
#include <Nux/VLayout.h>
27
 
#include <Nux/BaseWindow.h>
28
 
#include <NuxCore/Math/MathInc.h>
29
 
 
 
25
#include <Nux/HLayout.h>
 
26
#include <Nux/TextureArea.h>
 
27
 
 
28
#include <sigc++/sigc++.h>
 
29
 
 
30
#include "IconTexture.h"
 
31
#include "Introspectable.h"
30
32
#include "StaticCairoText.h"
31
33
 
32
 
#include "Introspectable.h"
33
 
 
34
 
#include <sigc++/trackable.h>
35
 
#include <sigc++/signal.h>
36
 
#include <sigc++/functors/ptr_fun.h>
37
 
#include <sigc++/functors/mem_fun.h>
38
 
 
39
 
#include "IconTexture.h"
40
 
 
41
34
class PlacesGroup : public nux::View
42
35
{
43
36
public:
44
 
 
 
37
  
45
38
  PlacesGroup (NUX_FILE_LINE_PROTO);
46
39
  ~PlacesGroup ();
47
40
 
48
 
  void SetEmblem (const char *path_to_emblem);
49
 
  void SetTitle  (const char *title);
50
 
 
 
41
  void SetIcon (const char *icon);
 
42
  void SetName (const char *name);
 
43
 
51
44
  void          SetChildLayout (nux::Layout *layout);
52
45
  nux::Layout * GetChildLayout ();
53
46
 
54
47
  void Relayout ();
55
48
 
56
 
private:
57
 
  nux::StaticCairoText *_label;
58
 
  nux::StaticCairoText *_title;
59
 
 
60
 
  guint32 _idle_id;
61
 
 
62
 
  char *_title_string;
63
 
 
64
 
  nux::Layout *_content;
65
 
  IconTexture  *_icon_texture;
 
49
  void SetCounts (guint n_visible_items_in_unexpand_mode, guint n_total_items);
 
50
 
 
51
  void SetChildUnexpandHeight (guint height);
 
52
 
 
53
  void SetExpanded (bool is_expanded);
 
54
  bool GetExpanded ();
 
55
 
 
56
  sigc::signal<void> expanded;
 
57
 
 
58
private:
 
59
  void Refresh ();
 
60
 
 
61
  long ProcessEvent (nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
 
62
  void Draw (nux::GraphicsEngine &GfxContext, bool force_draw);
 
63
  void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw);
 
64
 
 
65
  static gboolean OnIdleRelayout (PlacesGroup *self);
 
66
 
 
67
  void RecvMouseClick (int x, int y, unsigned long button_flags, unsigned long key_flags);
 
68
  void RecvMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags);
 
69
  void RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags);
 
70
 
 
71
private:
66
72
  nux::VLayout *_group_layout;
67
73
  nux::HLayout *_header_layout;
68
 
 
69
 
  static gboolean OnIdleRelayout (PlacesGroup *self);
70
 
 
71
 
  void UpdateTitle ();
72
 
  void UpdateLabel ();
73
 
 
74
 
  virtual long ProcessEvent (nux::IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
75
 
  virtual void Draw (nux::GraphicsEngine &GfxContext, bool force_draw);
76
 
  virtual void DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw);
77
 
  virtual void PostDraw (nux::GraphicsEngine &GfxContext, bool force_draw);
78
 
private:
 
74
  nux::Layout  *_content_layout;
 
75
  
 
76
  IconTexture          *_icon;
 
77
  nux::StaticCairoText *_name;
 
78
  nux::StaticCairoText *_expand_label;
 
79
  nux::TextureArea     *_expand_icon;
 
80
 
 
81
  guint32 _idle_id;
 
82
 
 
83
  bool  _is_expanded;
 
84
  guint _n_visible_items_in_unexpand_mode;
 
85
  guint _n_total_items;
 
86
  guint _child_unexpand_height;
79
87
};
80
88
 
81
89
#endif