diff options
author | David Robillard <d@drobilla.net> | 2014-01-07 03:25:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-01-07 03:25:15 +0000 |
commit | d30907023903bc7b4a2de16d3fe5d7674861e394 (patch) | |
tree | 8395666227b585b7988361e541e689237b57bb97 /src | |
parent | 9a030ad5599aa88c3034d44b63359c7469785eda (diff) | |
download | ingen-d30907023903bc7b4a2de16d3fe5d7674861e394.tar.gz ingen-d30907023903bc7b4a2de16d3fe5d7674861e394.tar.bz2 ingen-d30907023903bc7b4a2de16d3fe5d7674861e394.zip |
Remove unused plugin icon stuff.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5295 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/client/PluginModel.cpp | 32 | ||||
-rw-r--r-- | src/gui/App.cpp | 51 | ||||
-rw-r--r-- | src/gui/App.hpp | 19 | ||||
-rw-r--r-- | src/gui/GraphCanvas.cpp | 3 |
4 files changed, 0 insertions, 105 deletions
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index a85a9968..179e935b 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -155,7 +155,6 @@ PluginModel::set(SPtr<PluginModel> p) { _type = p->_type; - _icon_path = p->_icon_path; if (p->_lilv_plugin) _lilv_plugin = p->_lilv_plugin; @@ -240,37 +239,6 @@ PluginModel::ui(Ingen::World* world, return PluginUI::create(world, block, _lilv_plugin); } -const string& -PluginModel::icon_path() const -{ - if (_icon_path.empty() && _type == LV2) { - _icon_path = get_lv2_icon_path(_lilv_plugin); - } - - return _icon_path; -} - -/** RDF world mutex must be held by the caller */ -string -PluginModel::get_lv2_icon_path(const LilvPlugin* plugin) -{ - string result; - LilvNode* svg_icon_pred = lilv_new_uri(_lilv_world, - "http://ll-plugins.nongnu.org/lv2/namespace#svgIcon"); - - LilvNodes* paths = lilv_plugin_get_value(plugin, svg_icon_pred); - - if (lilv_nodes_size(paths) > 0) { - const LilvNode* value = lilv_nodes_get_first(paths); - if (lilv_node_is_uri(value)) - result = lilv_uri_to_path(lilv_node_as_string(value)); - lilv_nodes_free(paths); - } - - lilv_node_free(svg_icon_pred); - return result; -} - static std::string heading(const std::string& text, bool html, unsigned level) { 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<string, int> k) - : app(a) - , key(k) - {} - - App& app; - pair<string, int> key; -}; - -Glib::RefPtr<Gdk::Pixbuf> -App::icon_from_path(const string& path, int size) -{ - Glib::RefPtr<Gdk::Pixbuf> 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<Gdk::Pixbuf>(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<Gdk::Pixbuf> icon_from_path(const std::string& path, int size); - Ingen::Forge& forge() const { return _world->forge(); } SPtr<Ingen::Interface> interface() const { return _world->interface(); } SPtr<Client::SigClientInterface> 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 <typename A, typename B> - struct LexicalCompare { - bool operator()(const std::pair<A, B>& p1, const std::pair<A, B>& p2) { - return (p1.first < p2.first) || - ((p1.first == p2.first) && (p1.second < p2.second)); - } - }; - - typedef std::map< std::pair<std::string, int>, - Gdk::Pixbuf*, - LexicalCompare<std::string, int> > 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::SigClientInterface> _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<const BlockModel> bm) module = SubgraphModule::create(*this, pm, _human_names); } else { module = NodeModule::create(*this, bm, _human_names); - //const PluginModel* plugm = dynamic_cast<const PluginModel*>(nm->plugin()); - //if (plugm && !plugm->icon_path().empty()) - // module->set_icon(_app.icon_from_path(plugm->icon_path(), 100).operator->()); } module->show(); |