diff -Nur fluxbox-0.1.14/src/Resource.hh fluxbox-0.1.14-gcc34/src/Resource.hh --- fluxbox-0.1.14/src/Resource.hh 2002-12-07 15:15:25.000000000 +0100 +++ fluxbox-0.1.14-gcc34/src/Resource.hh 2005-05-10 20:42:22.883959376 +0200 @@ -56,41 +56,9 @@ std::string m_altname; ///< alternative name }; +template class Resource; class ResourceManager; -/** - Real resource class -*/ -template -class Resource:public Resource_base -{ -public: - Resource(ResourceManager &rm, T val, - const std::string &name, const std::string &altname): - Resource_base(name, altname), - m_value(val), m_defaultval(val), - m_rm(rm) - { - m_rm.addResource(*this); // add this to resource handler - } - virtual ~Resource() { - m_rm.removeResource(*this); // remove this from resource handler - } - - inline void setDefaultValue() { m_value = m_defaultval; } - void setFromString(const char *strval); - inline Resource& operator = (const T& newvalue) { m_value = newvalue; return *this;} - - std::string getString(); - inline T& operator*() { return m_value; } - inline const T& operator*() const { return m_value; } - inline T *operator->() { return &m_value; } - inline const T *operator->() const { return &m_value; } -private: - T m_value, m_defaultval; - ResourceManager &m_rm; -}; - class ResourceManager { public: @@ -129,4 +97,36 @@ ResourceList m_resourcelist; }; +/** + Real resource class +*/ +template +class Resource:public Resource_base +{ +public: + Resource(ResourceManager &rm, T val, + const std::string &name, const std::string &altname): + Resource_base(name, altname), + m_value(val), m_defaultval(val), + m_rm(rm) + { + m_rm.addResource(*this); // add this to resource handler + } + virtual ~Resource() { + m_rm.removeResource(*this); // remove this from resource handler + } + + inline void setDefaultValue() { m_value = m_defaultval; } + void setFromString(const char *strval); + inline Resource& operator = (const T& newvalue) { m_value = newvalue; return *this;} + + std::string getString(); + inline T& operator*() { return m_value; } + inline const T& operator*() const { return m_value; } + inline T *operator->() { return &m_value; } + inline const T *operator->() const { return &m_value; } +private: + T m_value, m_defaultval; + ResourceManager &m_rm; +}; #endif //_RESOURCE_HH_