aboutsummaryrefslogtreecommitdiff
path: root/src/ScreenPlacement.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-05 12:39:40 (GMT)
committerPaul Tagliamonte <paultag@fluxbox.org>2012-04-07 02:10:40 (GMT)
commit5f91d3183a1407222bb6929de0eb2bdc314a0bad (patch)
treeabc545f1492cee09d8c675c03abbeb7e6902becf /src/ScreenPlacement.cc
parent964fa5e114b4bdde158578c10c821ae5613d4b41 (diff)
downloadfluxbox_paul-5f91d3183a1407222bb6929de0eb2bdc314a0bad.zip
fluxbox_paul-5f91d3183a1407222bb6929de0eb2bdc314a0bad.tar.bz2
Specializations of FbTk::Resource<X>::{setFromLua,pushToLua}
for various values of X.
Diffstat (limited to 'src/ScreenPlacement.cc')
-rw-r--r--src/ScreenPlacement.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
index 29c8b5f..1029343 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
222template<>
223void 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
232template<>
233void FbTk::Resource<ScreenPlacement::PlacementPolicy>::pushToLua(lua::state &l) const {
234 l.pushstring(getString());
235}
236
221 237
222template <> 238template <>
223std::string FbTk::Resource<ScreenPlacement::RowDirection>::getString() const { 239std::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
261template<>
262void 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
271template<>
272void FbTk::Resource<ScreenPlacement::RowDirection>::pushToLua(lua::state &l) const {
273 l.pushstring(getString());
274}
275
245template <> 276template <>
246std::string FbTk::Resource<ScreenPlacement::ColumnDirection>::getString() const { 277std::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
299template<>
300void 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
309template<>
310void FbTk::Resource<ScreenPlacement::ColumnDirection>::pushToLua(lua::state &l) const {
311 l.pushstring(getString());
312}
313
268} // end namespace FbTk 314} // end namespace FbTk