aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r--src/FocusControl.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 5bf113f..abedcf2 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -31,6 +31,7 @@
31#include "Debug.hh" 31#include "Debug.hh"
32 32
33#include "FbTk/EventManager.hh" 33#include "FbTk/EventManager.hh"
34#include "FbTk/Luamm.hh"
34 35
35#include <string> 36#include <string>
36#include <iostream> 37#include <iostream>
@@ -625,6 +626,22 @@ setFromString(char const *strval) {
625} 626}
626 627
627template<> 628template<>
629void FbTk::Resource<FocusControl::FocusModel>::setFromLua(lua::state &l) {
630 lua::stack_sentry s(l, -1);
631 if(l.isstring(-1))
632 setFromString(l.tostring(-1).c_str());
633 else
634 setDefaultValue();
635 l.pop();
636}
637
638template<>
639void FbTk::Resource<FocusControl::FocusModel>::pushToLua(lua::state &l) const {
640 l.pushstring(getString());
641}
642
643
644template<>
628std::string FbTk::Resource<FocusControl::TabFocusModel>::getString() const { 645std::string FbTk::Resource<FocusControl::TabFocusModel>::getString() const {
629 switch (m_value) { 646 switch (m_value) {
630 case FocusControl::MOUSETABFOCUS: 647 case FocusControl::MOUSETABFOCUS:
@@ -648,5 +665,20 @@ setFromString(char const *strval) {
648 setDefaultValue(); 665 setDefaultValue();
649} 666}
650 667
668template<>
669void FbTk::Resource<FocusControl::TabFocusModel>::setFromLua(lua::state &l) {
670 lua::stack_sentry s(l, -1);
671 if(l.isstring(-1))
672 setFromString(l.tostring(-1).c_str());
673 else
674 setDefaultValue();
675 l.pop();
676}
677
678template<>
679void FbTk::Resource<FocusControl::TabFocusModel>::pushToLua(lua::state &l) const {
680 l.pushstring(getString());
681}
682
651} // end namespace FbTk 683} // end namespace FbTk
652 684