From 88493962ebb65a6b58c80b496521d7c1753bb610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 5 Jun 2015 15:27:09 +0100 Subject: Indicators: add a method to get the active entry (bzr r3964.6.1) --- UnityCore/Indicators.cpp | 9 ++++++--- UnityCore/Indicators.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'UnityCore') diff --git a/UnityCore/Indicators.cpp b/UnityCore/Indicators.cpp index b66b271c0..6b929dcbf 100644 --- a/UnityCore/Indicators.cpp +++ b/UnityCore/Indicators.cpp @@ -27,9 +27,8 @@ namespace unity namespace indicator { -class Indicators::Impl +struct Indicators::Impl { -public: typedef std::unordered_map IndicatorMap; Impl(Indicators* owner) @@ -49,7 +48,6 @@ public: Entry::Ptr GetEntry(std::string const& entry_id); -private: Indicators* owner_; IndicatorMap indicators_; Entry::Ptr active_entry_; @@ -93,6 +91,11 @@ void Indicators::RemoveIndicator(std::string const& name) return pimpl->RemoveIndicator(name); } +Entry::Ptr const& Indicators::GetActiveEntry() const +{ + return pimpl->active_entry_; +} + void Indicators::Impl::ActivateEntry(std::string const& panel, std::string const& entry_id, nux::Rect const& geometry) { if (active_entry_) diff --git a/UnityCore/Indicators.h b/UnityCore/Indicators.h index 3351f9462..cb35450ab 100644 --- a/UnityCore/Indicators.h +++ b/UnityCore/Indicators.h @@ -40,6 +40,7 @@ public: virtual ~Indicators(); IndicatorsList GetIndicators() const; + Entry::Ptr const& GetActiveEntry() const; virtual std::vector const& IconPaths() const = 0; virtual void SyncGeometries(std::string const& panel, EntryLocationMap const&) = 0; -- cgit v1.2.3