1 #ifndef MSP_GLTK_STATE_H_
2 #define MSP_GLTK_STATE_H_
5 #include <msp/datafile/value.h>
12 NORMAL = 0, //< Default state
13 HOVER = 1, //< Pointer over the widget
14 ACTIVE = 2, //< Widget is active (e.g. pressed button)
15 FOCUS = 4, //< Widget has input focus
16 DISABLED = 8, //< Widget is unresponsive
17 N_STATES_ = 16 //< Sentry value
20 inline State operator|(State a, State b)
21 { return static_cast<State>(static_cast<int>(a)|static_cast<int>(b)); }
23 inline State operator|=(State &a, State b)
24 { a = a|b; return a; }
26 inline State operator&(State a, State b)
27 { return static_cast<State>(static_cast<int>(a)&static_cast<int>(b)); }
29 inline State operator&=(State &a, State b)
30 { a = a&b; return a; }
32 inline State operator~(State a)
33 { return static_cast<State>(~static_cast<int>(a)); }
35 extern std::istream &operator>>(std::istream &, State &);