aboutsummaryrefslogtreecommitdiff
path: root/src/ScreenPlacement.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-05 12:39:40 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-06-15 23:07:49 (GMT)
commit787c7a994d4328a9c90a037dd464f8007351b0c0 (patch)
treef33943fe5b3e0a4baff6419760775acf769fbfa5 /src/ScreenPlacement.cc
parentde1e05cec6b26f6a7f398a9ea64f38fa0943f9c0 (diff)
downloadfluxbox_pavel-787c7a994d4328a9c90a037dd464f8007351b0c0.zip
fluxbox_pavel-787c7a994d4328a9c90a037dd464f8007351b0c0.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 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
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