diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-06-16 19:09:37 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-11-01 09:57:19 (GMT) |
commit | e3feca08ce0f6753f7e71ccb9088cf9003d41fc2 (patch) | |
tree | abf0dafc53405d67fdf5ccc285961a37603092d3 /src/FbTk | |
parent | 0e8a7bfb12e6d03ec288cd1fdd0a1453d5e814e1 (diff) | |
download | fluxbox_paul-e3feca08ce0f6753f7e71ccb9088cf9003d41fc2.zip fluxbox_paul-e3feca08ce0f6753f7e71ccb9088cf9003d41fc2.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.hh | 8 |
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> | |||
190 | class Resource:public Resource_base, public Accessor<T> { | 190 | class Resource:public Resource_base, public Accessor<T> { |
191 | public: | 191 | public: |
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 | } |