diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-09-19 18:44:03 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-09-19 18:44:03 +0200 |
| commit | 033814277ad7346e8079b720fd0b3a789319f2f1 (patch) | |
| tree | 9696216dacd64320290664fd2cc19dbdff3da614 /dash | |
| parent | 05edc67a973e990477cb74f37e9a79779d5010a5 (diff) | |
Introspectable: use IntrospectionData class for collecting data from children
Now each introspectable object is called with an IntrospectionData parameter and calling one of its methods it's the only way to fill introspection data into unity. As bonus point, remove all the unneeded UnityCore/Variant.cpp inclusions. (bzr r3506.6.3)
Diffstat (limited to 'dash')
58 files changed, 110 insertions, 132 deletions
diff --git a/dash/CoverflowResultView.cpp b/dash/CoverflowResultView.cpp index 3c9180ef5..c0fe1f27e 100755 --- a/dash/CoverflowResultView.cpp +++ b/dash/CoverflowResultView.cpp @@ -18,7 +18,6 @@ */ #include "CoverflowResultView.h" -#include <UnityCore/Variant.h> #include "unity-shared/IconLoader.h" #include "unity-shared/IconTexture.h" #include "unity-shared/DashStyle.h" diff --git a/dash/DashController.cpp b/dash/DashController.cpp index dab7214e9..4bcc98afa 100644 --- a/dash/DashController.cpp +++ b/dash/DashController.cpp @@ -438,11 +438,11 @@ std::string Controller::GetName() const return "DashController"; } -void Controller::AddProperties(GVariantBuilder* builder) +void Controller::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder).add("visible", visible_) - .add("ideal_monitor", GetIdealMonitor()) - .add("monitor", monitor_); + introspection.add("visible", visible_) + .add("ideal_monitor", GetIdealMonitor()) + .add("monitor", monitor_); } void Controller::ReFocusKeyInput() diff --git a/dash/DashController.h b/dash/DashController.h index da8d064d5..4555caaf4 100644 --- a/dash/DashController.h +++ b/dash/DashController.h @@ -71,7 +71,7 @@ public: protected: std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); private: void EnsureDash(); diff --git a/dash/DashView.cpp b/dash/DashView.cpp index 89ecab3ab..9d22128bc 100644 --- a/dash/DashView.cpp +++ b/dash/DashView.cpp @@ -1438,7 +1438,7 @@ std::string DashView::GetName() const return "DashView"; } -void DashView::AddProperties(GVariantBuilder* builder) +void DashView::AddProperties(debug::IntrospectionData& introspection) { dash::Style& style = dash::Style::Instance(); int num_rows = 1; // The search bar @@ -1455,16 +1455,15 @@ void DashView::AddProperties(GVariantBuilder* builder) else if (Settings::Instance().form_factor() == FormFactor::TV) form_factor = "tv"; - unity::variant::BuilderWrapper wrapper(builder); - wrapper.add(nux::Geometry(GetAbsoluteX(), GetAbsoluteY(), content_geo_.width, content_geo_.height)); - wrapper.add("num_rows", num_rows); - wrapper.add("form_factor", form_factor); - wrapper.add("right-border-width", style.GetDashRightTileWidth()); - wrapper.add("bottom-border-height", style.GetDashBottomTileHeight()); - wrapper.add("preview_displaying", preview_displaying_); - wrapper.add("preview_animation", animate_split_value_ * animate_preview_container_value_ * animate_preview_value_); - wrapper.add("dash_maximized", style.always_maximised()); - wrapper.add("overlay_window_buttons_shown", overlay_window_buttons_->IsVisible()); + introspection.add(nux::Geometry(GetAbsoluteX(), GetAbsoluteY(), content_geo_.width, content_geo_.height)) + .add("num_rows", num_rows) + .add("form_factor", form_factor) + .add("right-border-width", style.GetDashRightTileWidth()) + .add("bottom-border-height", style.GetDashBottomTileHeight()) + .add("preview_displaying", preview_displaying_) + .add("preview_animation", animate_split_value_ * animate_preview_container_value_ * animate_preview_value_) + .add("dash_maximized", style.always_maximised()) + .add("overlay_window_buttons_shown", overlay_window_buttons_->IsVisible()); } nux::Area* DashView::KeyNavIteration(nux::KeyNavDirection direction) diff --git a/dash/DashView.h b/dash/DashView.h index 6abf56b1a..98e19c87d 100644 --- a/dash/DashView.h +++ b/dash/DashView.h @@ -27,13 +27,13 @@ #include <UnityCore/ConnectionManager.h> #include <UnityCore/Scopes.h> #include <UnityCore/GLibSource.h> +#include <UnityCore/Preview.h> #include "ScopeBar.h" #include "ScopeView.h" #include "ApplicationStarter.h" #include "previews/PreviewContainer.h" #include "PreviewStateMachine.h" -#include "UnityCore/Preview.h" #include "unity-shared/BackgroundEffectHelper.h" #include "unity-shared/BGHash.h" @@ -126,7 +126,7 @@ private: bool AcceptKeyNavFocus(); bool InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character); std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); nux::Area* KeyNavIteration(nux::KeyNavDirection direction); diff --git a/dash/FilterBar.cpp b/dash/FilterBar.cpp index 52713c603..165523c3f 100644 --- a/dash/FilterBar.cpp +++ b/dash/FilterBar.cpp @@ -142,9 +142,9 @@ std::string FilterBar::GetName() const return "FilterBar"; } -void FilterBar::AddProperties(GVariantBuilder* builder) +void FilterBar::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder).add(GetAbsoluteGeometry()); + introspection.add(GetAbsoluteGeometry()); } } // namespace dash diff --git a/dash/FilterBar.h b/dash/FilterBar.h index 668065275..e437c43bb 100644 --- a/dash/FilterBar.h +++ b/dash/FilterBar.h @@ -57,7 +57,7 @@ protected: // Introspection virtual std::string GetName() const; - virtual void AddProperties(GVariantBuilder* builder); + virtual void AddProperties(debug::IntrospectionData&); private: void Init(); diff --git a/dash/FilterExpanderLabel.cpp b/dash/FilterExpanderLabel.cpp index b2fda6b34..cd3b11d1f 100644 --- a/dash/FilterExpanderLabel.cpp +++ b/dash/FilterExpanderLabel.cpp @@ -309,7 +309,7 @@ std::string FilterExpanderLabel::GetName() const return "FilterExpanderLabel"; } -void FilterExpanderLabel::AddProperties(GVariantBuilder* builder) +void FilterExpanderLabel::AddProperties(debug::IntrospectionData& introspection) { bool content_has_focus = false; auto focus_area = nux::GetWindowCompositor().GetKeyFocusArea(); @@ -317,12 +317,10 @@ void FilterExpanderLabel::AddProperties(GVariantBuilder* builder) if (focus_area && contents_) content_has_focus = focus_area->IsChildOf(contents_.GetPointer()); - unity::variant::BuilderWrapper wrapper(builder); - - wrapper.add("expander-has-focus", (expander_view_ && expander_view_->HasKeyFocus())) - .add("expanded", expanded()) - .add(GetAbsoluteGeometry()) - .add("content-has-focus", content_has_focus); + introspection.add("expander-has-focus", (expander_view_ && expander_view_->HasKeyFocus())) + .add("expanded", expanded()) + .add(GetAbsoluteGeometry()) + .add("content-has-focus", content_has_focus); } } // namespace dash diff --git a/dash/FilterExpanderLabel.h b/dash/FilterExpanderLabel.h index 3525bdab3..1b15a92aa 100644 --- a/dash/FilterExpanderLabel.h +++ b/dash/FilterExpanderLabel.h @@ -75,7 +75,7 @@ protected: // Introspection virtual std::string GetName() const; - virtual void AddProperties(GVariantBuilder* builder); + virtual void AddProperties(debug::IntrospectionData&); private: void BuildLayout(); diff --git a/dash/PlacesGroup.cpp b/dash/PlacesGroup.cpp index b67229a9c..477bffdbc 100755 --- a/dash/PlacesGroup.cpp +++ b/dash/PlacesGroup.cpp @@ -27,8 +27,6 @@ #include <glib.h> #include "config.h" #include <glib/gi18n-lib.h> - -#include <UnityCore/Variant.h> #include <UnityCore/GLibWrapper.h> #include "unity-shared/StaticCairoText.h" @@ -641,10 +639,8 @@ std::string PlacesGroup::GetName() const return "PlacesGroup"; } -void PlacesGroup::AddProperties(GVariantBuilder* builder) +void PlacesGroup::AddProperties(debug::IntrospectionData& wrapper) { - unity::variant::BuilderWrapper wrapper(builder); - wrapper.add("header-x", _header_view->GetAbsoluteX()); wrapper.add("header-y", _header_view->GetAbsoluteY()); wrapper.add("header-width", _header_view->GetAbsoluteWidth()); diff --git a/dash/PlacesGroup.h b/dash/PlacesGroup.h index c93318689..28cb1f432 100644 --- a/dash/PlacesGroup.h +++ b/dash/PlacesGroup.h @@ -106,7 +106,7 @@ protected: // Introspection virtual std::string GetName() const; - virtual void AddProperties(GVariantBuilder* builder); + virtual void AddProperties(debug::IntrospectionData&); private: void Refresh(); diff --git a/dash/ResultView.cpp b/dash/ResultView.cpp index 9fdd2ad74..e41118925 100644 --- a/dash/ResultView.cpp +++ b/dash/ResultView.cpp @@ -24,7 +24,6 @@ #include "ResultView.h" #include <Nux/Layout.h> -#include <UnityCore/Variant.h> #include "unity-shared/IntrospectableWrappers.h" #include "unity-shared/GraphicsUtils.h" @@ -271,13 +270,13 @@ std::string ResultView::GetName() const void ResultView::GetResultDimensions(int& rows, int& columns) { - columns = results_per_row; + columns = results_per_row; rows = result_model_ ? ceil(static_cast<double>(result_model_->count()) / static_cast<double>(std::max(1, columns))) : 0.0; } -void ResultView::AddProperties(GVariantBuilder* builder) +void ResultView::AddProperties(debug::IntrospectionData& introspection) { - unity::variant::BuilderWrapper(builder) + introspection .add("expanded", expanded); } diff --git a/dash/ResultView.h b/dash/ResultView.h index e5fb8b885..a3a9d1954 100644 --- a/dash/ResultView.h +++ b/dash/ResultView.h @@ -85,7 +85,7 @@ public: std::string GetName() const; ResultIterator GetIteratorAtRow(unsigned row); - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); IntrospectableList GetIntrospectableChildren(); virtual int GetSelectedIndex() const; diff --git a/dash/ResultViewGrid.cpp b/dash/ResultViewGrid.cpp index e1d2a68be..6ed816b49 100644 --- a/dash/ResultViewGrid.cpp +++ b/dash/ResultViewGrid.cpp @@ -28,7 +28,6 @@ #include <gdk/gdk.h> #include <unity-protocol.h> -#include <UnityCore/Variant.h> #include "unity-shared/IntrospectableWrappers.h" #include "unity-shared/Timer.h" #include "unity-shared/UBusWrapper.h" diff --git a/dash/ScopeBar.cpp b/dash/ScopeBar.cpp index d2677bb02..bd97ae9ec 100644 --- a/dash/ScopeBar.cpp +++ b/dash/ScopeBar.cpp @@ -268,19 +268,15 @@ std::string ScopeBar::GetName() const return "ScopeBar"; } -void ScopeBar::AddProperties(GVariantBuilder* builder) +void ScopeBar::AddProperties(debug::IntrospectionData& wrapper) { - unity::variant::BuilderWrapper wrapper(builder); - - wrapper.add("focused-scope-icon", ""); - - for( auto icon : icons_) + for (auto icon : icons_) { if (icon->active) - wrapper.add("active-scope", icon->id.Get()); + wrapper.add("active-scope", icon->id()); if (icon->HasKeyFocus()) - wrapper.add("focused-scope-icon", icon->id.Get()); + wrapper.add("focused-scope-icon", icon->id()); } } diff --git a/dash/ScopeBar.h b/dash/ScopeBar.h index 2dc259968..2e64e0c1b 100644 --- a/dash/ScopeBar.h +++ b/dash/ScopeBar.h @@ -77,7 +77,7 @@ private: bool AcceptKeyNavFocus(); std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); typedef std::unique_ptr<nux::AbstractPaintLayer> LayerPtr; diff --git a/dash/ScopeBarIcon.cpp b/dash/ScopeBarIcon.cpp index ed8519cc8..4d7a50cfb 100644 --- a/dash/ScopeBarIcon.cpp +++ b/dash/ScopeBarIcon.cpp @@ -16,8 +16,6 @@ * Authored by: Neil Jagdish Patel <neil.patel@canonical.com> */ -#include <UnityCore/Variant.h> - #include "unity-shared/DashStyle.h" #include "ScopeBarIcon.h" @@ -120,10 +118,8 @@ std::string ScopeBarIcon::GetName() const return "ScopeBarIcon"; } -void ScopeBarIcon::AddProperties(GVariantBuilder* builder) +void ScopeBarIcon::AddProperties(debug::IntrospectionData& wrapper) { - unity::variant::BuilderWrapper wrapper(builder); - wrapper.add(GetAbsoluteGeometry()); wrapper.add("name", id); } diff --git a/dash/ScopeBarIcon.h b/dash/ScopeBarIcon.h index a07d64e47..c3cba57af 100644 --- a/dash/ScopeBarIcon.h +++ b/dash/ScopeBarIcon.h @@ -49,7 +49,7 @@ private: // Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); private: typedef std::unique_ptr<nux::AbstractPaintLayer> LayerPtr; diff --git a/dash/ScopeView.cpp b/dash/ScopeView.cpp index d087b1335..f8332045a 100755 --- a/dash/ScopeView.cpp +++ b/dash/ScopeView.cpp @@ -1142,9 +1142,9 @@ std::string ScopeView::GetName() const return "ScopeView"; } -void ScopeView::AddProperties(GVariantBuilder* builder) +void ScopeView::AddProperties(debug::IntrospectionData& introspection) { - unity::variant::BuilderWrapper(builder) + introspection .add("name", scope_->id) .add("scope-name", scope_->name) .add("visible", IsVisible()) diff --git a/dash/ScopeView.h b/dash/ScopeView.h index 9eb359a8e..f4c0b8b8c 100644 --- a/dash/ScopeView.h +++ b/dash/ScopeView.h @@ -133,7 +133,7 @@ private: virtual bool AcceptKeyNavFocus(); virtual std::string GetName() const; - virtual void AddProperties(GVariantBuilder* builder); + virtual void AddProperties(debug::IntrospectionData&); void OnCompositorKeyNavFocusChanged(nux::Area*, bool, nux::KeyNavDirection); diff --git a/dash/previews/ActionButton.cpp b/dash/previews/ActionButton.cpp index b76bab00b..508e65974 100644 --- a/dash/previews/ActionButton.cpp +++ b/dash/previews/ActionButton.cpp @@ -25,7 +25,6 @@ #include <Nux/HLayout.h> #include "unity-shared/IconTexture.h" #include "unity-shared/StaticCairoText.h" -#include <UnityCore/Variant.h> namespace { @@ -61,9 +60,9 @@ std::string ActionButton::GetName() const return "ActionButton"; } -void ActionButton::AddProperties(GVariantBuilder* builder) +void ActionButton::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add(GetAbsoluteGeometry()) .add("action", action_hint_) .add("label", label_) diff --git a/dash/previews/ActionButton.h b/dash/previews/ActionButton.h index 0a4e25073..efcfbe37e 100644 --- a/dash/previews/ActionButton.h +++ b/dash/previews/ActionButton.h @@ -74,7 +74,7 @@ protected: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); private: typedef std::unique_ptr<nux::CairoWrapper> NuxCairoPtr; diff --git a/dash/previews/ActionLink.cpp b/dash/previews/ActionLink.cpp index 317800bde..9f1438ee9 100644 --- a/dash/previews/ActionLink.cpp +++ b/dash/previews/ActionLink.cpp @@ -22,7 +22,6 @@ #include "ActionLink.h" #include <NuxCore/Logger.h> #include <Nux/VLayout.h> -#include <UnityCore/Variant.h> #include "unity-shared/DashStyle.h" #include "unity-shared/IconTexture.h" #include "unity-shared/StaticCairoText.h" @@ -54,9 +53,9 @@ std::string ActionLink::GetName() const return "ActionLink"; } -void ActionLink::AddProperties(GVariantBuilder* builder) +void ActionLink::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add(GetAbsoluteGeometry()) .add("action", action_hint_) .add("label", label_) diff --git a/dash/previews/ActionLink.h b/dash/previews/ActionLink.h index 147d6157f..6a7ec5959 100644 --- a/dash/previews/ActionLink.h +++ b/dash/previews/ActionLink.h @@ -71,7 +71,7 @@ protected: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); // this methods/vars could be private but are protected to make testing // easier diff --git a/dash/previews/ApplicationPreview.cpp b/dash/previews/ApplicationPreview.cpp index 7ab91a2d2..076ec8afe 100644 --- a/dash/previews/ApplicationPreview.cpp +++ b/dash/previews/ApplicationPreview.cpp @@ -34,7 +34,7 @@ #include "config.h" #include <glib/gi18n-lib.h> - + #include "ApplicationPreview.h" #include "ActionButton.h" #include "PreviewInfoHintWidget.h" @@ -103,9 +103,9 @@ std::string ApplicationPreview::GetName() const return "ApplicationPreview"; } -void ApplicationPreview::AddProperties(GVariantBuilder* builder) +void ApplicationPreview::AddProperties(debug::IntrospectionData& introspection) { - Preview::AddProperties(builder); + Preview::AddProperties(introspection); } void ApplicationPreview::SetupViews() diff --git a/dash/previews/ApplicationPreview.h b/dash/previews/ApplicationPreview.h index 2da8adba4..25a42d5ff 100644 --- a/dash/previews/ApplicationPreview.h +++ b/dash/previews/ApplicationPreview.h @@ -46,7 +46,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); protected: virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); diff --git a/dash/previews/ErrorPreview.cpp b/dash/previews/ErrorPreview.cpp index bee583176..04fe4557b 100644 --- a/dash/previews/ErrorPreview.cpp +++ b/dash/previews/ErrorPreview.cpp @@ -91,9 +91,9 @@ std::string ErrorPreview::GetName() const return "ErrorPreview"; } -void ErrorPreview::AddProperties(GVariantBuilder* builder) +void ErrorPreview::AddProperties(debug::IntrospectionData& introspection) { - PaymentPreview::AddProperties(builder); + PaymentPreview::AddProperties(introspection); } void ErrorPreview::OnActionActivated(ActionButton* button, std::string const& id) diff --git a/dash/previews/ErrorPreview.h b/dash/previews/ErrorPreview.h index 1c2088ddd..7e60de1fa 100644 --- a/dash/previews/ErrorPreview.h +++ b/dash/previews/ErrorPreview.h @@ -72,7 +72,7 @@ public: unsigned long special_keys_state); // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); nux::Layout* GetTitle(); nux::Layout* GetPrice(); diff --git a/dash/previews/GenericPreview.cpp b/dash/previews/GenericPreview.cpp index b912722dd..ecb1b73da 100644 --- a/dash/previews/GenericPreview.cpp +++ b/dash/previews/GenericPreview.cpp @@ -97,9 +97,9 @@ std::string GenericPreview::GetName() const return "GenericPreview"; } -void GenericPreview::AddProperties(GVariantBuilder* builder) +void GenericPreview::AddProperties(debug::IntrospectionData& introspection) { - Preview::AddProperties(builder); + Preview::AddProperties(introspection); } void GenericPreview::SetupViews() diff --git a/dash/previews/GenericPreview.h b/dash/previews/GenericPreview.h index 1ed175785..95151b0cf 100644 --- a/dash/previews/GenericPreview.h +++ b/dash/previews/GenericPreview.h @@ -44,7 +44,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); protected: virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); diff --git a/dash/previews/MoviePreview.cpp b/dash/previews/MoviePreview.cpp index 5edcb5db3..d17f779ea 100644 --- a/dash/previews/MoviePreview.cpp +++ b/dash/previews/MoviePreview.cpp @@ -71,9 +71,9 @@ std::string MoviePreview::GetName() const return "MoviePreview"; } -void MoviePreview::AddProperties(GVariantBuilder* builder) +void MoviePreview::AddProperties(debug::IntrospectionData& introspection) { - Preview::AddProperties(builder); + Preview::AddProperties(introspection); } void MoviePreview::Draw(nux::GraphicsEngine& gfx_engine, bool force_draw) diff --git a/dash/previews/MoviePreview.h b/dash/previews/MoviePreview.h index 8de20a5a3..c4edf5552 100644 --- a/dash/previews/MoviePreview.h +++ b/dash/previews/MoviePreview.h @@ -44,7 +44,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); protected: virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); diff --git a/dash/previews/MusicPaymentPreview.cpp b/dash/previews/MusicPaymentPreview.cpp index dba1cf2a8..2fb7ed36b 100644 --- a/dash/previews/MusicPaymentPreview.cpp +++ b/dash/previews/MusicPaymentPreview.cpp @@ -84,9 +84,9 @@ std::string MusicPaymentPreview::GetName() const return "MusicPaymentPreview"; } -void MusicPaymentPreview::AddProperties(GVariantBuilder* builder) +void MusicPaymentPreview::AddProperties(debug::IntrospectionData& introspection) { - PaymentPreview::AddProperties(builder); + PaymentPreview::AddProperties(introspection); } void MusicPaymentPreview::OnActionActivated(ActionButton* button, std::string const& id) diff --git a/dash/previews/MusicPaymentPreview.h b/dash/previews/MusicPaymentPreview.h index 2e8e37e8a..7ce7d51d3 100644 --- a/dash/previews/MusicPaymentPreview.h +++ b/dash/previews/MusicPaymentPreview.h @@ -74,7 +74,7 @@ protected: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); nux::Layout* GetTitle(); nux::Layout* GetPrice(); diff --git a/dash/previews/MusicPreview.cpp b/dash/previews/MusicPreview.cpp index d41a7767f..9fe6a1f36 100644 --- a/dash/previews/MusicPreview.cpp +++ b/dash/previews/MusicPreview.cpp @@ -88,9 +88,9 @@ std::string MusicPreview::GetName() const return "MusicPreview"; } -void MusicPreview::AddProperties(GVariantBuilder* builder) +void MusicPreview::AddProperties(debug::IntrospectionData& introspection) { - Preview::AddProperties(builder); + Preview::AddProperties(introspection); } bool MusicPreview::HasUbuntuOneCredentials() diff --git a/dash/previews/MusicPreview.h b/dash/previews/MusicPreview.h index c572fa4f7..a38e7972b 100644 --- a/dash/previews/MusicPreview.h +++ b/dash/previews/MusicPreview.h @@ -45,7 +45,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); protected: virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); diff --git a/dash/previews/PaymentPreview.cpp b/dash/previews/PaymentPreview.cpp index 9c8943e98..ea21b7bc4 100644 --- a/dash/previews/PaymentPreview.cpp +++ b/dash/previews/PaymentPreview.cpp @@ -53,7 +53,7 @@ public: protected: // Introspectable methods std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); // Key navigation virtual bool AcceptKeyNavFocus(); @@ -168,9 +168,9 @@ std::string OverlaySpinner::GetName() const return "OverlaySpinner"; } -void OverlaySpinner::AddProperties(GVariantBuilder* builder) +void OverlaySpinner::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder).add(GetAbsoluteGeometry()); + introspection.add(GetAbsoluteGeometry()); } @@ -191,9 +191,9 @@ std::string PaymentPreview::GetName() const return "PaymentPreview"; } -void PaymentPreview::AddProperties(GVariantBuilder* builder) +void PaymentPreview::AddProperties(debug::IntrospectionData& introspection) { - Preview::AddProperties(builder); + Preview::AddProperties(introspection); } nux::Layout* PaymentPreview::GetHeader() diff --git a/dash/previews/PaymentPreview.h b/dash/previews/PaymentPreview.h index 5db1e8bf9..501cab9bb 100644 --- a/dash/previews/PaymentPreview.h +++ b/dash/previews/PaymentPreview.h @@ -60,7 +60,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); // Create and connect an action link to OnActionLinkActivated nux::ObjectPtr<ActionLink> CreateLink(dash::Preview::ActionPtr action); diff --git a/dash/previews/Preview.cpp b/dash/previews/Preview.cpp index c32038444..f0b95f29e 100644 --- a/dash/previews/Preview.cpp +++ b/dash/previews/Preview.cpp @@ -120,9 +120,9 @@ std::string Preview::GetName() const return "Preview"; } -void Preview::AddProperties(GVariantBuilder* builder) +void Preview::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add(GetAbsoluteGeometry()) .add("uri", preview_model_->preview_result.uri); } diff --git a/dash/previews/Preview.h b/dash/previews/Preview.h index c07fe94a3..c9615b0bb 100644 --- a/dash/previews/Preview.h +++ b/dash/previews/Preview.h @@ -63,7 +63,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); static previews::Preview::Ptr PreviewForModel(dash::Preview::Ptr model); diff --git a/dash/previews/PreviewContainer.cpp b/dash/previews/PreviewContainer.cpp index 644095669..e9564eb71 100644 --- a/dash/previews/PreviewContainer.cpp +++ b/dash/previews/PreviewContainer.cpp @@ -84,9 +84,9 @@ public: return "PreviewContent"; } - void AddProperties(GVariantBuilder* builder) + void AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add("animating", animating_) .add("animation_progress", progress_) .add("waiting_preview", waiting_preview_) @@ -444,9 +444,9 @@ std::string PreviewContainer::GetName() const return "PreviewContainer"; } -void PreviewContainer::AddProperties(GVariantBuilder* builder) +void PreviewContainer::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add(GetAbsoluteGeometry()) .add("navigate-left-enabled", !IsNavigationDisabled(Navigation::LEFT)) .add("navigate-right-enabled", !IsNavigationDisabled(Navigation::RIGHT)); diff --git a/dash/previews/PreviewContainer.h b/dash/previews/PreviewContainer.h index 17d3b2dd7..fd1f68d1c 100644 --- a/dash/previews/PreviewContainer.h +++ b/dash/previews/PreviewContainer.h @@ -66,7 +66,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); // For the nav buttons to the left/right of the previews, call when they are activated diff --git a/dash/previews/PreviewInfoHintWidget.cpp b/dash/previews/PreviewInfoHintWidget.cpp index 46ebfb0e3..a1aa3cd92 100644 --- a/dash/previews/PreviewInfoHintWidget.cpp +++ b/dash/previews/PreviewInfoHintWidget.cpp @@ -86,9 +86,9 @@ std::string PreviewInfoHintWidget::GetName() const return "PreviewInfoHintWidget"; } -void PreviewInfoHintWidget::AddProperties(GVariantBuilder* builder) +void PreviewInfoHintWidget::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add(GetAbsoluteGeometry()); } diff --git a/dash/previews/PreviewInfoHintWidget.h b/dash/previews/PreviewInfoHintWidget.h index 08b44aaa8..80604d6a9 100644 --- a/dash/previews/PreviewInfoHintWidget.h +++ b/dash/previews/PreviewInfoHintWidget.h @@ -52,7 +52,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); void PreLayoutManagement(); diff --git a/dash/previews/PreviewNavigator.cpp b/dash/previews/PreviewNavigator.cpp index d71c2217c..289fd2b8a 100644 --- a/dash/previews/PreviewNavigator.cpp +++ b/dash/previews/PreviewNavigator.cpp @@ -27,7 +27,6 @@ #include <Nux/VLayout.h> #include <unity-shared/IconTexture.h> #include <unity-shared/PreviewStyle.h> -#include <UnityCore/Variant.h> namespace unity { @@ -63,9 +62,9 @@ std::string PreviewNavigator::GetName() const return "PreviewNavigator"; } -void PreviewNavigator::AddProperties(GVariantBuilder* builder) +void PreviewNavigator::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add("button-x", texture_->GetAbsoluteX()) .add("button-y", texture_->GetAbsoluteY()) .add("button-width", texture_->GetGeometry().width) diff --git a/dash/previews/PreviewNavigator.h b/dash/previews/PreviewNavigator.h index 774d4aa7c..32445c803 100644 --- a/dash/previews/PreviewNavigator.h +++ b/dash/previews/PreviewNavigator.h @@ -50,7 +50,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder*); + void AddProperties(debug::IntrospectionData&); sigc::signal<void> activated; diff --git a/dash/previews/PreviewRatingsWidget.cpp b/dash/previews/PreviewRatingsWidget.cpp index 1e4454bc6..53a72ef35 100644 --- a/dash/previews/PreviewRatingsWidget.cpp +++ b/dash/previews/PreviewRatingsWidget.cpp @@ -29,7 +29,6 @@ #include "unity-shared/RatingsButton.h" #include "unity-shared/StaticCairoText.h" #include "unity-shared/PreviewStyle.h" -#include <UnityCore/Variant.h> #include "PreviewRatingsWidget.h" namespace unity @@ -109,9 +108,9 @@ std::string PreviewRatingsWidget::GetName() const return "PreviewRatingsWidget"; } -void PreviewRatingsWidget::AddProperties(GVariantBuilder* builder) +void PreviewRatingsWidget::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add(GetAbsoluteGeometry()); } diff --git a/dash/previews/PreviewRatingsWidget.h b/dash/previews/PreviewRatingsWidget.h index f60e88c9d..3fa4342ef 100644 --- a/dash/previews/PreviewRatingsWidget.h +++ b/dash/previews/PreviewRatingsWidget.h @@ -62,7 +62,7 @@ protected: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder*); + void AddProperties(debug::IntrospectionData&); private: RatingsButton* ratings_; diff --git a/dash/previews/SocialPreview.cpp b/dash/previews/SocialPreview.cpp index a1513c019..1990d6669 100644 --- a/dash/previews/SocialPreview.cpp +++ b/dash/previews/SocialPreview.cpp @@ -34,7 +34,7 @@ #include "config.h" #include <glib/gi18n-lib.h> - + #include "SocialPreview.h" #include "SocialPreviewContent.h" #include "SocialPreviewComments.h" @@ -104,9 +104,9 @@ std::string SocialPreview::GetName() const return "SocialPreview"; } -void SocialPreview::AddProperties(GVariantBuilder* builder) +void SocialPreview::AddProperties(debug::IntrospectionData& introspection) { - Preview::AddProperties(builder); + Preview::AddProperties(introspection); } void SocialPreview::SetupViews() diff --git a/dash/previews/SocialPreview.h b/dash/previews/SocialPreview.h index 54a3fbe17..c83562c67 100644 --- a/dash/previews/SocialPreview.h +++ b/dash/previews/SocialPreview.h @@ -48,7 +48,7 @@ public: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); protected: virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw); diff --git a/dash/previews/SocialPreviewComments.cpp b/dash/previews/SocialPreviewComments.cpp index 653854896..65e6f3e1c 100644 --- a/dash/previews/SocialPreviewComments.cpp +++ b/dash/previews/SocialPreviewComments.cpp @@ -190,8 +190,9 @@ std::string SocialPreviewComments::GetName() const return "SocialPreviewComments"; } -void SocialPreviewComments::AddProperties(GVariantBuilder* builder) +void SocialPreviewComments::AddProperties(debug::IntrospectionData& introspection) { + introspection.add(GetAbsoluteGeometry()); } } diff --git a/dash/previews/SocialPreviewComments.h b/dash/previews/SocialPreviewComments.h index 51a21951e..2f6562585 100644 --- a/dash/previews/SocialPreviewComments.h +++ b/dash/previews/SocialPreviewComments.h @@ -67,7 +67,7 @@ protected: void SetupViews(); virtual std::string GetName() const; - virtual void AddProperties(GVariantBuilder* builder); + virtual void AddProperties(debug::IntrospectionData&); private: diff --git a/dash/previews/SocialPreviewContent.cpp b/dash/previews/SocialPreviewContent.cpp index 7c4b287ce..3b9f37264 100644 --- a/dash/previews/SocialPreviewContent.cpp +++ b/dash/previews/SocialPreviewContent.cpp @@ -309,8 +309,9 @@ std::string SocialPreviewContent::GetName() const return "SocialPreviewContent"; } -void SocialPreviewContent::AddProperties(GVariantBuilder* builder) +void SocialPreviewContent::AddProperties(debug::IntrospectionData& introspection) { + introspection.add(GetAbsoluteGeometry()); } } diff --git a/dash/previews/SocialPreviewContent.h b/dash/previews/SocialPreviewContent.h index 528989a4e..290da9a1f 100644 --- a/dash/previews/SocialPreviewContent.h +++ b/dash/previews/SocialPreviewContent.h @@ -56,7 +56,7 @@ protected: virtual void Draw(nux::GraphicsEngine& gfx_engine, bool force_draw); virtual void DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw); virtual void PreLayoutManagement(); - + virtual bool AcceptKeyNavFocus() { return false; } void SetupViews(); @@ -73,7 +73,7 @@ protected: double tailWidth); virtual std::string GetName() const; - virtual void AddProperties(GVariantBuilder* builder); + virtual void AddProperties(debug::IntrospectionData&); private: nux::ObjectPtr<StaticCairoText> text_; diff --git a/dash/previews/Track.cpp b/dash/previews/Track.cpp index a9898d61f..36d32aa34 100644 --- a/dash/previews/Track.cpp +++ b/dash/previews/Track.cpp @@ -29,7 +29,6 @@ #include <unity-shared/IconTexture.h> #include <unity-shared/DashStyle.h> #include <unity-shared/PreviewStyle.h> -#include <UnityCore/Variant.h> namespace unity { @@ -138,9 +137,9 @@ std::string Track::GetName() const return "Track"; } -void Track::AddProperties(GVariantBuilder* builder) +void Track::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add("uri", uri_) .add("play-state", (int)play_state_) .add("progress", progress_) diff --git a/dash/previews/Track.h b/dash/previews/Track.h index 55ceeb5a0..d9089d092 100644 --- a/dash/previews/Track.h +++ b/dash/previews/Track.h @@ -63,7 +63,7 @@ protected: // From debug::Introspectable std::string GetName() const; - void AddProperties(GVariantBuilder* builder); + void AddProperties(debug::IntrospectionData&); virtual bool AcceptKeyNavFocus() { return false; } diff --git a/dash/previews/Tracks.cpp b/dash/previews/Tracks.cpp index 480bcbf0a..7a884a710 100644 --- a/dash/previews/Tracks.cpp +++ b/dash/previews/Tracks.cpp @@ -27,7 +27,6 @@ #include "unity-shared/PlacesOverlayVScrollBar.h" #include "unity-shared/PreviewStyle.h" #include <UnityCore/Track.h> -#include <UnityCore/Variant.h> namespace unity { @@ -62,9 +61,9 @@ std::string Tracks::GetName() const return "Tracks"; } -void Tracks::AddProperties(GVariantBuilder* builder) +void Tracks::AddProperties(debug::IntrospectionData& introspection) { - variant::BuilderWrapper(builder) + introspection .add("track-count", m_tracks.size()); } diff --git a/dash/previews/Tracks.h b/dash/previews/Tracks.h index 786f608c7..a1f15af54 100644 --- a/dash/previews/Tracks.h +++ b/dash/previews/Tracks.h @@ -52,10 +52,6 @@ public: Tracks(dash::Tracks::Ptr tracks, NUX_FILE_LINE_PROTO); - // From debug::Introspectable - std::string GetName() const; - void AddProperties(GVariantBuilder* builder); - protected: virtual bool AcceptKeyNavFocus() { return false; } @@ -65,6 +61,10 @@ protected: void OnTrackAdded(dash::Track const& track); void OnTrackRemoved(dash::Track const&track); + // From debug::Introspectable + std::string GetName() const; + void AddProperties(debug::IntrospectionData&); + protected: dash::Tracks::Ptr tracks_; |
