diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-06-05 12:39:40 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2013-02-16 23:36:35 (GMT) |
commit | 3b7c1a3c220b7ccec0dee7804d36dabfe81449c4 (patch) | |
tree | e8b8aaf22411231fbfee9f16a8c91f8ed3c3f3f3 /src/Toolbar.cc | |
parent | e27268fc69b776f533a2082d2ca9c13fe863cd80 (diff) | |
download | fluxbox_pavel-3b7c1a3c220b7ccec0dee7804d36dabfe81449c4.zip fluxbox_pavel-3b7c1a3c220b7ccec0dee7804d36dabfe81449c4.tar.bz2 |
Specializations of FbTk::Resource<X>::{setFromLua,pushToLua}
for various values of X.
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r-- | src/Toolbar.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 5f4cc80..4839f64 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -54,6 +54,7 @@ | |||
54 | #include "FbTk/MemFun.hh" | 54 | #include "FbTk/MemFun.hh" |
55 | #include "FbTk/STLUtil.hh" | 55 | #include "FbTk/STLUtil.hh" |
56 | #include "FbTk/Util.hh" | 56 | #include "FbTk/Util.hh" |
57 | #include "FbTk/Luamm.hh" | ||
57 | 58 | ||
58 | // use GNU extensions | 59 | // use GNU extensions |
59 | #ifndef _GNU_SOURCE | 60 | #ifndef _GNU_SOURCE |
@@ -132,6 +133,21 @@ setFromString(const char *strval) { | |||
132 | setDefaultValue(); | 133 | setDefaultValue(); |
133 | } | 134 | } |
134 | 135 | ||
136 | template<> | ||
137 | void FbTk::Resource<Toolbar::Placement>::setFromLua(lua::state &l) { | ||
138 | lua::stack_sentry s(l, -1); | ||
139 | if(l.isstring(-1)) | ||
140 | setFromString(l.tostring(-1).c_str()); | ||
141 | else | ||
142 | setDefaultValue(); | ||
143 | l.pop(); | ||
144 | } | ||
145 | |||
146 | template<> | ||
147 | void FbTk::Resource<Toolbar::Placement>::pushToLua(lua::state &l) const { | ||
148 | l.pushstring(getString()); | ||
149 | } | ||
150 | |||
135 | } // end namespace FbTk | 151 | } // end namespace FbTk |
136 | 152 | ||
137 | namespace { | 153 | namespace { |