http://gobby.0x539.de/trac/ticket/600 --- code/util/config.hpp.orig 2012-10-01 19:01:55.000000000 -0400 +++ code/util/config.hpp 2012-10-01 19:09:37.000000000 -0400 @@ -34,6 +34,52 @@ namespace Gobby { +namespace serialize +{ + +/** @brief Used to convert Gdk::Color to a string. + */ +template<> +class default_context_to<Gdk::Color>: public context_base_to<Gdk::Color> +{ +public: + typedef Gdk::Color data_type; + + virtual std::string to_string(const data_type& from) const; +}; + +/** @brief Used to convert a string to Gdk::Color. + */ +template<> +class default_context_from<Gdk::Color>: public context_base_from<Gdk::Color> +{ +public: + typedef Gdk::Color data_type; + + virtual data_type from_string(const std::string& from) const; +}; + +template<> +class default_context_to<Glib::ustring>: public context_base_to<Glib::ustring> +{ +public: + typedef Glib::ustring data_type; + + virtual std::string to_string(const data_type& from) const; +}; + +template<> +class default_context_from<Glib::ustring>: + public context_base_from<Glib::ustring> +{ +public: + typedef Glib::ustring data_type; + + virtual data_type from_string(const std::string& from) const; +}; + +} // namespace serialize + class Config { public: @@ -426,52 +472,6 @@ m_map[name] = new TypedValueEntry<DataType>(name, value, ctx); } -namespace serialize -{ - -/** @brief Used to convert Gdk::Color to a string. - */ -template<> -class default_context_to<Gdk::Color>: public context_base_to<Gdk::Color> -{ -public: - typedef Gdk::Color data_type; - - virtual std::string to_string(const data_type& from) const; -}; - -/** @brief Used to convert a string to Gdk::Color. - */ -template<> -class default_context_from<Gdk::Color>: public context_base_from<Gdk::Color> -{ -public: - typedef Gdk::Color data_type; - - virtual data_type from_string(const std::string& from) const; -}; - -template<> -class default_context_to<Glib::ustring>: public context_base_to<Glib::ustring> -{ -public: - typedef Glib::ustring data_type; - - virtual std::string to_string(const data_type& from) const; -}; - -template<> -class default_context_from<Glib::ustring>: - public context_base_from<Glib::ustring> -{ -public: - typedef Glib::ustring data_type; - - virtual data_type from_string(const std::string& from) const; -}; - -} // namespace serialize - } // namespace Gobby #endif // _GOBBY_CONFIG_HPP_