aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-16 19:09:37 (GMT)
committerPaul Tagliamonte <paultag@fluxbox.org>2012-04-07 02:10:41 (GMT)
commit3b1abf8f8f812a9e97cc1b7f6fe95a1bf07d3246 (patch)
tree9e498bb21445968481fc71ab6059df6aa3877f65 /src/FbTk
parent75ad307a404e4e259a028f2dab73e1b370642318 (diff)
downloadfluxbox_paul-3b1abf8f8f812a9e97cc1b7f6fe95a1bf07d3246.zip
fluxbox_paul-3b1abf8f8f812a9e97cc1b7f6fe95a1bf07d3246.tar.bz2
Replace ResourceManager with the lua version
Loading of an init file with the new manager works ok. Saving and restarting is still not completed. This touches many files because i removed the alternative name of resources. Unlike Xrm, lua does not have native support for alt names. It should be fairly easy to add them, but I think that is unnecessary and would be confusing.
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Resource.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/FbTk/Resource.hh b/src/FbTk/Resource.hh
index 00f8769..518d0aa 100644
--- a/src/FbTk/Resource.hh
+++ b/src/FbTk/Resource.hh
@@ -190,10 +190,18 @@ template <typename T, typename Traits>
190class Resource:public Resource_base, public Accessor<T> { 190class Resource:public Resource_base, public Accessor<T> {
191public: 191public:
192 typedef T Type; 192 typedef T Type;
193
193 Resource(ResourceManager_base &rm, T val, const std::string &name, const std::string &altname): 194 Resource(ResourceManager_base &rm, T val, const std::string &name, const std::string &altname):
194 Resource_base(name, altname), m_value(val), m_defaultval(val), m_rm(rm) { 195 Resource_base(name, altname), m_value(val), m_defaultval(val), m_rm(rm) {
195 m_rm.addResource(*this); // add this to resource handler 196 m_rm.addResource(*this); // add this to resource handler
196 } 197 }
198
199 // LResourceManager does not use altname, so we provide a constructor which initializes
200 // altname to name
201 Resource(ResourceManager_base &rm, T val, const std::string &name):
202 Resource_base(name, name), m_value(val), m_defaultval(val), m_rm(rm) {
203 m_rm.addResource(*this); // add this to resource handler
204 }
197 virtual ~Resource() { 205 virtual ~Resource() {
198 m_rm.removeResource(*this); // remove this from resource handler 206 m_rm.removeResource(*this); // remove this from resource handler
199 } 207 }