]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/state.cpp
Initial revision
[libs/gltk.git] / source / state.cpp
diff --git a/source/state.cpp b/source/state.cpp
new file mode 100644 (file)
index 0000000..bbff03d
--- /dev/null
@@ -0,0 +1,27 @@
+#include "state.h"
+
+using namespace std;
+
+namespace Msp {
+namespace GLtk {
+
+istream &operator>>(istream &is, State &state)
+{
+       string str;
+       is>>str;
+       if(str=="normal")
+               state=NORMAL;
+       else if(str=="hover")
+               state=HOVER;
+       else if(str=="active")
+               state=ACTIVE;
+       else if(str=="disabled")
+               state=DISABLED;
+       else
+               is.setstate(ios_base::failbit);
+
+       return is;
+}
+
+} // namespace GLtk
+} // namespace Msp