From d30907023903bc7b4a2de16d3fe5d7674861e394 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 7 Jan 2014 03:25:15 +0000 Subject: Remove unused plugin icon stuff. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5295 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/App.cpp | 51 ------------------------------------------------- src/gui/App.hpp | 19 ------------------ src/gui/GraphCanvas.cpp | 3 --- 3 files changed, 73 deletions(-) (limited to 'src/gui') diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 5a04ebf6..357f4a4a 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -363,57 +363,6 @@ App::quit(Gtk::Window* dialog_parent) return quit; } -struct IconDestroyNotification { - IconDestroyNotification(App& a, pair k) - : app(a) - , key(k) - {} - - App& app; - pair key; -}; - -Glib::RefPtr -App::icon_from_path(const string& path, int size) -{ - Glib::RefPtr buf; - if (path.length() == 0) - return buf; - - Icons::iterator iter = _icons.find(make_pair(path, size)); - - if (iter != _icons.end()) { - // we need to reference manually since the RefPtr constructor doesn't do it - iter->second->reference(); - return Glib::RefPtr(iter->second); - } - - try { - buf = Gdk::Pixbuf::create_from_file(path, size, size); - _icons.insert(make_pair(make_pair(path, size), buf.operator->())); - buf->add_destroy_notify_callback( - new IconDestroyNotification(*this, make_pair(path, size)), - &App::icon_destroyed); - } catch (const Glib::Error& e) { - log().warn(fmt("Error loading icon %1%: %2%\n") - % path % e.what()); - } - return buf; -} - -void* -App::icon_destroyed(void* data) -{ - IconDestroyNotification* note = (IconDestroyNotification*)data; - Icons::iterator iter = note->app._icons.find(note->key); - if (iter != note->app._icons.end()) - note->app._icons.erase(iter); - - delete note; // allocated in App::icon_from_path - - return NULL; -} - bool App::can_control(const Client::PortModel* port) const { diff --git a/src/gui/App.hpp b/src/gui/App.hpp index 11915949..dbb0465c 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -106,8 +106,6 @@ public: Style* style() const { return _style; } WindowFactory* window_factory() const { return _window_factory; } - Glib::RefPtr icon_from_path(const std::string& path, int size); - Ingen::Forge& forge() const { return _world->forge(); } SPtr interface() const { return _world->interface(); } SPtr client() const { return _client; } @@ -124,21 +122,6 @@ public: inline Ingen::Log& log() const { return _world->log(); } protected: - - /** This is needed for the icon map. */ - template - struct LexicalCompare { - bool operator()(const std::pair& p1, const std::pair& p2) { - return (p1.first < p2.first) || - ((p1.first == p2.first) && (p1.second < p2.second)); - } - }; - - typedef std::map< std::pair, - Gdk::Pixbuf*, - LexicalCompare > Icons; - Icons _icons; - explicit App(Ingen::World* world); bool animate(); @@ -148,8 +131,6 @@ protected: const Raul::URI& key, const Atom& value); - static void* icon_destroyed(void* data); - static Gtk::Main* _main; SPtr _client; diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index 503f9dd5..2ecbec80 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -418,9 +418,6 @@ GraphCanvas::add_block(SPtr bm) module = SubgraphModule::create(*this, pm, _human_names); } else { module = NodeModule::create(*this, bm, _human_names); - //const PluginModel* plugm = dynamic_cast(nm->plugin()); - //if (plugm && !plugm->icon_path().empty()) - // module->set_icon(_app.icon_from_path(plugm->icon_path(), 100).operator->()); } module->show(); -- cgit v1.2.1