diff options
author | fluxgen <fluxgen> | 2003-07-01 12:39:49 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-07-01 12:39:49 (GMT) |
commit | c34e820240e514b983adfc07f632f463a9022356 (patch) | |
tree | 4228436ee4d106463e23696bcf1d2b122de7f4f9 | |
parent | 6fce27ea136416be45d2b9d1eeed6d6f8585d601 (diff) | |
download | fluxbox-c34e820240e514b983adfc07f632f463a9022356.zip fluxbox-c34e820240e514b983adfc07f632f463a9022356.tar.bz2 |
added default themeitem handlers for integer and string
-rw-r--r-- | src/FbTk/Theme.cc | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc index 82bda06..2037431 100644 --- a/src/FbTk/Theme.cc +++ b/src/FbTk/Theme.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Theme.cc,v 1.7 2003/06/15 21:02:41 fluxgen Exp $ | 22 | // $Id: Theme.cc,v 1.8 2003/07/01 12:39:49 fluxgen Exp $ |
23 | 23 | ||
24 | #include "Theme.hh" | 24 | #include "Theme.hh" |
25 | 25 | ||
@@ -43,7 +43,34 @@ | |||
43 | using namespace std; | 43 | using namespace std; |
44 | namespace FbTk { | 44 | namespace FbTk { |
45 | 45 | ||
46 | // create default handlers for Color, Font, and Texture | 46 | // create default handlers for Color, Font, Texture, int and string |
47 | template <> | ||
48 | void FbTk::ThemeItem<std::string>::load() { } | ||
49 | |||
50 | template <> | ||
51 | void FbTk::ThemeItem<std::string>::setDefaultValue() { | ||
52 | *(*this) = ""; | ||
53 | } | ||
54 | |||
55 | template <> | ||
56 | void FbTk::ThemeItem<std::string>::setFromString(const char *str) { | ||
57 | *(*this) = (str ? str : ""); | ||
58 | } | ||
59 | |||
60 | template <> | ||
61 | void FbTk::ThemeItem<int>::load() { } | ||
62 | |||
63 | template <> | ||
64 | void FbTk::ThemeItem<int>::setDefaultValue() { | ||
65 | *(*this) = 0; | ||
66 | } | ||
67 | |||
68 | template <> | ||
69 | void FbTk::ThemeItem<int>::setFromString(const char *str) { | ||
70 | if (str == 0) | ||
71 | return; | ||
72 | sscanf(str, "%d", &m_value); | ||
73 | } | ||
47 | 74 | ||
48 | template <> | 75 | template <> |
49 | void ThemeItem<FbTk::Font>::setDefaultValue() { | 76 | void ThemeItem<FbTk::Font>::setDefaultValue() { |