aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-16 19:09:37 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-16 23:54:31 (GMT)
commit9f2c3883b7cf08a5f9d311fd8f7fc317574b605b (patch)
tree55461e357b95ddaa582b73c840f4c5e6846b0f69 /src/FbTk
parent590efd07bb2ed1ce78ce6e5e6750b57311904f1f (diff)
downloadfluxbox_pavel-9f2c3883b7cf08a5f9d311fd8f7fc317574b605b.zip
fluxbox_pavel-9f2c3883b7cf08a5f9d311fd8f7fc317574b605b.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 }