1 #ifndef MSP_GLTK_STATE_H_
2 #define MSP_GLTK_STATE_H_
5 #include <msp/datafile/value.h>
6 #include "mspgltk_api.h"
13 NORMAL = 0, //< Default state
14 HOVER = 1, //< Pointer over the widget
15 ACTIVE = 2, //< Widget is active (e.g. pressed button)
16 FOCUS = 4, //< Widget has input focus
17 DISABLED = 8, //< Widget is unresponsive
18 N_STATES_ = 16 //< Sentry value
21 inline State operator|(State a, State b)
22 { return static_cast<State>(static_cast<int>(a)|static_cast<int>(b)); }
24 inline State operator|=(State &a, State b)
25 { a = a|b; return a; }
27 inline State operator&(State a, State b)
28 { return static_cast<State>(static_cast<int>(a)&static_cast<int>(b)); }
30 inline State operator&=(State &a, State b)
31 { a = a&b; return a; }
33 inline State operator~(State a)
34 { return static_cast<State>(~static_cast<int>(a)); }
36 MSPGLTK_API std::istream &operator>>(std::istream &, State &);