diff -Naur fbdesk-1.1.5.orig/src/Resource.hh fbdesk-1.1.5/src/Resource.hh --- fbdesk-1.1.5.orig/src/Resource.hh 2003-01-14 22:45:53.000000000 +0100 +++ fbdesk-1.1.5/src/Resource.hh 2004-07-17 11:31:57.000000000 +0200 @@ -56,40 +56,8 @@ std::string m_altname; ///< alternative name }; -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 Resource; class ResourceManager { @@ -129,4 +97,37 @@ 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_