summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/App.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-26 03:13:49 +0000
committerDavid Robillard <d@drobilla.net>2007-10-26 03:13:49 +0000
commit9e8425f0d5f9e2d8a7db45a29a3bb93b824a11c4 (patch)
treee1b356a54fb54d7258eae8662825aa9098bc95ea /src/libs/gui/App.hpp
parent203d851e116d4590897eceab582f735fb30c4e26 (diff)
downloadingen-9e8425f0d5f9e2d8a7db45a29a3bb93b824a11c4.tar.gz
ingen-9e8425f0d5f9e2d8a7db45a29a3bb93b824a11c4.tar.bz2
ingen-9e8425f0d5f9e2d8a7db45a29a3bb93b824a11c4.zip
Apply module icons patch from larsl (with formatting/visual tweaks).
git-svn-id: http://svn.drobilla.net/lad/ingen@901 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/App.hpp')
-rw-r--r--src/libs/gui/App.hpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp
index a54db98f..9e700ceb 100644
--- a/src/libs/gui/App.hpp
+++ b/src/libs/gui/App.hpp
@@ -100,7 +100,7 @@ public:
Configuration* configuration() const { return _configuration; }
WindowFactory* window_factory() const { return _window_factory; }
- Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const string& path);
+ Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const string& path, int size);
const SharedPtr<EngineInterface>& engine() const { return _engine; }
const SharedPtr<SigClientInterface>& client() const { return _client; }
@@ -120,10 +120,25 @@ public:
Ingen::Shared::World* world() { return _world; }
protected:
+
+ /** This is needed for the icon map. */
+ template <typename A, typename B>
+ struct LexicalCompare {
+ bool operator()(const pair<A, B>& p1, const pair<A, B>& p2) {
+ return (p1.first < p2.first) ||
+ ((p1.first == p2.first) && (p1.second < p2.second));
+ }
+ };
+
+ typedef map<pair<string, int>, Gdk::Pixbuf*, LexicalCompare<string, int> > IconMap;
+ IconMap _icons;
+
App(Ingen::Shared::World* world);
bool animate();
+ static void* icon_destroyed(void* data);
+
static App* _instance;
SharedPtr<Glib::Module> _serialisation_module;
@@ -141,9 +156,7 @@ protected:
PatchTreeWindow* _patch_tree_window;
Gtk::AboutDialog* _about_dialog;
WindowFactory* _window_factory;
-
- map<string, Glib::RefPtr<Gdk::Pixbuf> > _icons;
-
+
Ingen::Shared::World* _world;
/// <Port, whether it has been seen in gtk callback yet>