3 This file is part of libmspgltk
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_STATE_H_
9 #define MSP_GLTK_STATE_H_
12 #include <msp/datafile/value.h>
19 NORMAL=0, //< Default state
20 HOVER=1, //< Pointer over the widget
21 ACTIVE=2, //< Widget is active (e.g. pressed button)
22 FOCUS=4, //< Widget has input focus
23 DISABLED=8, //< Widget is unresponsive
24 N_STATES_=16 //< Sentry value
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)
33 inline State operator&(State a, State b)
34 { return static_cast<State>(static_cast<int>(a)&static_cast<int>(b)); }
36 inline State operator&=(State &a, State b)
39 inline State operator~(State a)
40 { return static_cast<State>(~static_cast<int>(a)); }
42 extern std::istream &operator>>(std::istream &, State &);