diff options
| author | Christopher Lee <chris.lee@canonical.com> | 2012-06-26 23:36:10 -0400 |
|---|---|---|
| committer | Tarmac <> | 2012-06-26 23:36:10 -0400 |
| commit | b3c06003409e340d2b8cf2a6175f81dc1de55182 (patch) | |
| tree | b899ec201847d99c101f6112ac574b9bd34e4e69 /hud | |
| parent | 210aeafa0374fe85b6ac18ec7527d93356d92358 (diff) | |
| parent | bb023c2f6aeb6960bb64d87d40955ee7cb1b16cb (diff) | |
Added introspection for HudButtons (hud query results). Fixes: . Approved by jenkins, Thomi Richards.
(bzr r2444)
Diffstat (limited to 'hud')
| -rw-r--r-- | hud/HudButton.cpp | 5 | ||||
| -rw-r--r-- | hud/HudView.cpp | 13 | ||||
| -rw-r--r-- | hud/HudView.h | 5 |
3 files changed, 20 insertions, 3 deletions
diff --git a/hud/HudButton.cpp b/hud/HudButton.cpp index 138407f30..64ae06dfa 100644 --- a/hud/HudButton.cpp +++ b/hud/HudButton.cpp @@ -105,7 +105,7 @@ void HudButton::RedrawTheme(nux::Geometry const& geom, cairo_t* cr, nux::ButtonV bool HudButton::AcceptKeyNavFocus() { - // The button will not receive the keyboard focus. The keyboard focus is always to remain with the + // The button will not receive the keyboard focus. The keyboard focus is always to remain with the // text entry in the hud. return false; } @@ -209,7 +209,8 @@ std::string HudButton::GetName() const void HudButton::AddProperties(GVariantBuilder* builder) { variant::BuilderWrapper(builder) - .add("label", label()); + .add("label", label()) + .add("focused", fake_focused()); } } // namespace hud diff --git a/hud/HudView.cpp b/hud/HudView.cpp index f2d425c4b..921c7713c 100644 --- a/hud/HudView.cpp +++ b/hud/HudView.cpp @@ -27,6 +27,8 @@ #include <Nux/HLayout.h> #include <Nux/VLayout.h> +#include "unity-shared/Introspectable.h" + #include "unity-shared/UBusMessages.h" #include "unity-shared/DashStyle.h" @@ -502,6 +504,17 @@ void View::AddProperties(GVariantBuilder* builder) .add("num_buttons", num_buttons); } +debug::Introspectable::IntrospectableList const& View::GetIntrospectableChildren() +{ + introspectable_children_.clear(); + for (auto button: buttons_) + { + introspectable_children_.push_front(button.GetPointer()); + } + + return introspectable_children_; +} + bool View::InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character) diff --git a/hud/HudView.h b/hud/HudView.h index ca1e1a6f4..32a35a818 100644 --- a/hud/HudView.h +++ b/hud/HudView.h @@ -61,7 +61,7 @@ public: void AboutToHide(); void SetWindowGeometry(nux::Geometry const& absolute_geo, nux::Geometry const& geo); - + protected: virtual Area* FindKeyFocusArea(unsigned int event_type, unsigned long x11_key_code, @@ -71,6 +71,8 @@ protected: void OnSearchChanged(std::string const& search_string); virtual long PostLayoutManagement(long LayoutResult); + IntrospectableList introspectable_children_; + private: void OnMouseButtonDown(int x, int y, unsigned long button, unsigned long key); void OnKeyDown (unsigned long event_type, unsigned long event_keysym, @@ -87,6 +89,7 @@ private: std::string GetName() const; void AddProperties(GVariantBuilder* builder); + IntrospectableList const& GetIntrospectableChildren(); private: UBusManager ubus; |
