diff options
Diffstat (limited to 'src/ScreenPlacement.cc')
-rw-r--r-- | src/ScreenPlacement.cc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc index 73ddfa2..cd7ce15 100644 --- a/src/ScreenPlacement.cc +++ b/src/ScreenPlacement.cc | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "Window.hh" | 31 | #include "Window.hh" |
32 | 32 | ||
33 | #include "FbTk/Menu.hh" | 33 | #include "FbTk/Menu.hh" |
34 | #include "FbTk/Luamm.hh" | ||
34 | 35 | ||
35 | #include <iostream> | 36 | #include <iostream> |
36 | #include <exception> | 37 | #include <exception> |
@@ -218,6 +219,21 @@ void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromString(const char | |||
218 | setDefaultValue(); | 219 | setDefaultValue(); |
219 | } | 220 | } |
220 | 221 | ||
222 | template<> | ||
223 | void FbTk::Resource<ScreenPlacement::PlacementPolicy>::setFromLua(lua::state &l) { | ||
224 | lua::stack_sentry s(l, -1); | ||
225 | if(l.isstring(-1)) | ||
226 | setFromString(l.tostring(-1).c_str()); | ||
227 | else | ||
228 | setDefaultValue(); | ||
229 | l.pop(); | ||
230 | } | ||
231 | |||
232 | template<> | ||
233 | void FbTk::Resource<ScreenPlacement::PlacementPolicy>::pushToLua(lua::state &l) const { | ||
234 | l.pushstring(getString()); | ||
235 | } | ||
236 | |||
221 | 237 | ||
222 | template <> | 238 | template <> |
223 | std::string FbTk::Resource<ScreenPlacement::RowDirection>::getString() const { | 239 | std::string FbTk::Resource<ScreenPlacement::RowDirection>::getString() const { |
@@ -242,6 +258,21 @@ void FbTk::Resource<ScreenPlacement::RowDirection>::setFromString(const char *st | |||
242 | setDefaultValue(); | 258 | setDefaultValue(); |
243 | } | 259 | } |
244 | 260 | ||
261 | template<> | ||
262 | void FbTk::Resource<ScreenPlacement::RowDirection>::setFromLua(lua::state &l) { | ||
263 | lua::stack_sentry s(l, -1); | ||
264 | if(l.isstring(-1)) | ||
265 | setFromString(l.tostring(-1).c_str()); | ||
266 | else | ||
267 | setDefaultValue(); | ||
268 | l.pop(); | ||
269 | } | ||
270 | |||
271 | template<> | ||
272 | void FbTk::Resource<ScreenPlacement::RowDirection>::pushToLua(lua::state &l) const { | ||
273 | l.pushstring(getString()); | ||
274 | } | ||
275 | |||
245 | template <> | 276 | template <> |
246 | std::string FbTk::Resource<ScreenPlacement::ColumnDirection>::getString() const { | 277 | std::string FbTk::Resource<ScreenPlacement::ColumnDirection>::getString() const { |
247 | switch (*(*this)) { | 278 | switch (*(*this)) { |
@@ -265,4 +296,19 @@ void FbTk::Resource<ScreenPlacement::ColumnDirection>::setFromString(const char | |||
265 | setDefaultValue(); | 296 | setDefaultValue(); |
266 | } | 297 | } |
267 | 298 | ||
299 | template<> | ||
300 | void FbTk::Resource<ScreenPlacement::ColumnDirection>::setFromLua(lua::state &l) { | ||
301 | lua::stack_sentry s(l, -1); | ||
302 | if(l.isstring(-1)) | ||
303 | setFromString(l.tostring(-1).c_str()); | ||
304 | else | ||
305 | setDefaultValue(); | ||
306 | l.pop(); | ||
307 | } | ||
308 | |||
309 | template<> | ||
310 | void FbTk::Resource<ScreenPlacement::ColumnDirection>::pushToLua(lua::state &l) const { | ||
311 | l.pushstring(getString()); | ||
312 | } | ||
313 | |||
268 | } // end namespace FbTk | 314 | } // end namespace FbTk |