]> git.tdb.fi Git - libs/gltk.git/blob - source/state.cpp
Support loading Buttons from datafiles
[libs/gltk.git] / source / state.cpp
1 #include "state.h"
2
3 using namespace std;
4
5 namespace Msp {
6 namespace GLtk {
7
8 istream &operator>>(istream &is, State &state)
9 {
10         string str;
11         is>>str;
12         if(str=="NORMAL")
13                 state=NORMAL;
14         else if(str=="HOVER")
15                 state=HOVER;
16         else if(str=="ACTIVE")
17                 state=ACTIVE;
18         else if(str=="DISABLED")
19                 state=DISABLED;
20         else
21                 is.setstate(ios_base::failbit);
22
23         return is;
24 }
25
26 } // namespace GLtk
27 } // namespace Msp