improvments in widgets initialization

This commit is contained in:
Eduardo Bart
2011-11-17 15:43:41 -02:00
parent b736e52b29
commit 63cbe11f7e
23 changed files with 65 additions and 97 deletions

View File

@@ -30,7 +30,7 @@
class Color
{
public:
Color() : m_rgba(0) { }
Color() : m_rgba(0xFFFFFFFF) { }
Color(uint8 r, uint8 g, uint8 b, uint8 a = 0xFF) : m_r(r), m_g(g), m_b(b), m_a(a) { }
Color(const Color& other) : m_rgba(other.m_rgba) { }
Color(uint32 rgba) : m_rgba(rgba) { }

View File

@@ -42,8 +42,15 @@ typedef int8_t int8;
typedef std::function<void()> SimpleCallback;
typedef std::function<bool()> BooleanCallback;
#ifndef nullptr
#define nullptr NULL
#endif
// boolean with default value initializer
template<bool def>
struct boolean {
boolean() : v(def) { }
operator bool &() { return v; }
operator bool const &() const { return v; }
bool& operator=(const bool& o) { v = o; return v; }
private:
bool v;
};
#endif