/* * Copyright (C) 2010-2012 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Authored by: Neil Jagdish Patel * Marco Trevisan (TreviƱo) <3v1n0@ubuntu.com> */ #ifndef PANEL_TRAY_H #define PANEL_TRAY_H #include #include #include #include #include "unity-shared/Introspectable.h" #include #include #include #include #include #include namespace unity { class PanelTray : public nux::View, public unity::debug::Introspectable { public: PanelTray(int monitor); ~PanelTray(); void Sync(); Window xid(); static bool FilterTray(std::string const& title, std::string const& res_name, std::string const& res_class); protected: void Draw(nux::GraphicsEngine& gfx_content, bool force_draw); std::string GetName() const; void AddProperties(debug::IntrospectionData&); private: bool IdleSync(); static gboolean FilterTrayCallback(NaTray* tray, NaTrayChild* child, PanelTray* self); void OnTrayIconRemoved(NaTrayManager* manager, NaTrayChild* child); gboolean OnTrayDraw(GtkWidget* widget, cairo_t* cr); int WidthOfTray(); glib::Object window_; glib::Object tray_; glib::Signal whitelist_changed_; glib::Signal draw_signal_; glib::Signal icon_removed_signal_; glib::Source::UniquePtr sync_idle_; std::list children_; nux::Geometry last_geo_; int monitor_; }; } #endif