aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Resource.hh
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-12 13:17:47 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-16 23:51:49 (GMT)
commit946bc2edb60836bb0d939d850543d1c9ab683dc9 (patch)
tree1011ab3f5e572998bd60408aef7618f9cc809e48 /src/FbTk/Resource.hh
parent62aac4851aed94bc198c09aff4d764967542b8e4 (diff)
downloadfluxbox_pavel-946bc2edb60836bb0d939d850543d1c9ab683dc9.zip
fluxbox_pavel-946bc2edb60836bb0d939d850543d1c9ab683dc9.tar.bz2
Factor out "session." from resource names
this reduces typing and it makes more sense in lua, since there the resources are implemented as hierarchical tables and the topmost table has to be handled a bit specially.
Diffstat (limited to 'src/FbTk/Resource.hh')
-rw-r--r--src/FbTk/Resource.hh7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/FbTk/Resource.hh b/src/FbTk/Resource.hh
index 33a6bb2..744178b 100644
--- a/src/FbTk/Resource.hh
+++ b/src/FbTk/Resource.hh
@@ -87,6 +87,8 @@ class ResourceManager_base
87public: 87public:
88 typedef std::list<Resource_base *> ResourceList; 88 typedef std::list<Resource_base *> ResourceList;
89 89
90 ResourceManager_base(const std::string &root) : m_root(root) {}
91
90 virtual ~ResourceManager_base() {} 92 virtual ~ResourceManager_base() {}
91 93
92 /// Save all resouces registered to this class 94 /// Save all resouces registered to this class
@@ -123,6 +125,7 @@ public:
123 125
124protected: 126protected:
125 ResourceList m_resourcelist; 127 ResourceList m_resourcelist;
128 const std::string m_root;
126}; 129};
127 130
128class ResourceManager: public ResourceManager_base 131class ResourceManager: public ResourceManager_base
@@ -130,7 +133,8 @@ class ResourceManager: public ResourceManager_base
130public: 133public:
131 // lock specifies if the database should be opened with one level locked 134 // lock specifies if the database should be opened with one level locked
132 // (useful for constructing inside initial set of constructors) 135 // (useful for constructing inside initial set of constructors)
133 ResourceManager(const char *filename, bool lock_db); 136 ResourceManager(const std::string &root, const std::string &alt_root,
137 const char *filename, bool lock_db);
134 virtual ~ResourceManager(); 138 virtual ~ResourceManager();
135 139
136 /// Load all resources registered to this class 140 /// Load all resources registered to this class
@@ -169,6 +173,7 @@ private:
169 XrmDatabaseHelper *m_database; 173 XrmDatabaseHelper *m_database;
170 174
171 std::string m_filename; 175 std::string m_filename;
176 std::string m_alt_root;
172}; 177};
173 178
174 179