~vanvugt/unity/fix-865006

« back to all changes in this revision

Viewing changes to hud/HudView.h

  • Committer: Tarmac
  • Author(s): Andrea Azzarone
  • Date: 2012-06-12 14:35:38 UTC
  • mfrom: (2388.1.4 hud-reset)
  • Revision ID: tarmac-20120612143538-igkcxpuc2ly14ghk
Fix HUD flickering when showing up after closing previous search. Included with respective unit test and required changes.. Fixes: https://bugs.launchpad.net/bugs/1011507. Approved by Łukasz Zemczak.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Authored by: Gordon Allott <gord.allott@canonical.com>
17
17
 */
18
18
 
19
 
#ifndef UNITY_HUD_VIEW_H_
20
 
#define UNITY_HUD_VIEW_H_
 
19
#ifndef UNITYSHELL_HUD_VIEW_H
 
20
#define UNITYSHELL_HUD_VIEW_H
21
21
 
22
22
#include <string>
23
23
 
24
24
#include <Nux/Nux.h>
25
 
#include <Nux/View.h>
26
25
#include <Nux/VLayout.h>
27
 
 
28
 
#include <UnityCore/Hud.h>
29
26
#include <UnityCore/GLibSource.h>
30
 
#include "unity-shared/Introspectable.h"
31
27
 
32
 
#include "unity-shared/UBusWrapper.h"
33
28
#include "HudIcon.h"
34
29
#include "HudButton.h"
 
30
#include "HudAbstractView.h"
35
31
#include "unity-shared/SearchBar.h"
36
32
#include "unity-shared/OverlayRenderer.h"
 
33
#include "unity-shared/UBusWrapper.h"
37
34
 
38
35
namespace unity
39
36
{
40
37
namespace hud
41
38
{
42
39
 
43
 
class View : public nux::View, public unity::debug::Introspectable
 
40
class View : public AbstractView
44
41
{
45
 
  NUX_DECLARE_OBJECT_TYPE(HudView, nux::View);
 
42
  NUX_DECLARE_OBJECT_TYPE(View, AbstractView);
 
43
public:
46
44
  typedef nux::ObjectPtr<View> Ptr;
47
 
public:
 
45
 
48
46
  View();
49
47
  ~View();
50
48
 
55
53
  std::list<HudButton::Ptr> const& buttons() const;
56
54
 
57
55
  void SetQueries(Hud::Queries queries);
58
 
  void SetIcon(std::string icon_name, unsigned int tile_size, unsigned int size, unsigned int padding);
 
56
  void SetIcon(std::string const& icon_name, unsigned int tile_size, unsigned int size, unsigned int padding);
59
57
  void ShowEmbeddedIcon(bool show);
60
58
  void SearchFinished();
61
59
 
63
61
  void AboutToHide();
64
62
 
65
63
  void SetWindowGeometry(nux::Geometry const& absolute_geo, nux::Geometry const& geo);
66
 
 
67
 
  sigc::signal<void, std::string> search_changed;
68
 
  sigc::signal<void, std::string> search_activated;
69
 
  sigc::signal<void, Query::Ptr> query_activated;
70
 
  sigc::signal<void, Query::Ptr> query_selected;
71
64
  
72
65
protected:
73
66
  virtual Area* FindKeyFocusArea(unsigned int event_type,
77
70
  void SetupViews();
78
71
  void OnSearchChanged(std::string const& search_string);
79
72
  virtual long PostLayoutManagement(long LayoutResult);
 
73
 
80
74
private:
81
75
  void OnMouseButtonDown(int x, int y, unsigned long button, unsigned long key);
82
76
  void OnKeyDown (unsigned long event_type, unsigned long event_keysym,
123
117
};
124
118
 
125
119
 
126
 
}
127
 
}
128
 
#endif
 
120
} // namespace hud
 
121
} // namespace unity
 
122
 
 
123
#endif // UNITYSHELL_HUD_VIEW_H