]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/colour.h
Patch from Bo for recent API changes
[wxWidgets.git] / include / wx / generic / colour.h
CommitLineData
32b8ec41 1/////////////////////////////////////////////////////////////////////////////
3da12c22 2// Name: wx/generic/colour.h
32b8ec41
VZ
3// Purpose: wxColour class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
32b8ec41
VZ
10/////////////////////////////////////////////////////////////////////////////
11
3da12c22
VS
12#ifndef _WX_GENERIC_COLOUR_H_
13#define _WX_GENERIC_COLOUR_H_
32b8ec41 14
32b8ec41
VZ
15#include "wx/object.h"
16
17// Colour
40989e46 18class WXDLLEXPORT wxColour: public wxColourBase
32b8ec41
VZ
19{
20public:
edc536d3
WS
21 // constructors
22 // ------------
23
24 // default
daebb84b 25 wxColour();
40989e46 26 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
32b8ec41 27
edc536d3 28 // copy ctors and assignment operators
32b8ec41 29 wxColour(const wxColour& col);
7f5426f0 30 wxColour& operator=(const wxColour& col);
32b8ec41 31
edc536d3 32 // dtor
d3c7fc99 33 virtual ~wxColour();
32b8ec41 34
32b8ec41 35 // accessors
b7cacb43
VZ
36 bool Ok() const { return IsOk(); }
37 bool IsOk() const { return m_isInit; }
32b8ec41 38
32b8ec41
VZ
39 unsigned char Red() const { return m_red; }
40 unsigned char Green() const { return m_green; }
41 unsigned char Blue() const { return m_blue; }
7f5426f0 42 unsigned char Alpha() const { return m_alpha; }
32b8ec41
VZ
43
44 // comparison
7f5426f0 45 bool operator==(const wxColour& colour) const
32b8ec41 46 {
edc536d3
WS
47 return (m_red == colour.m_red &&
48 m_green == colour.m_green &&
49 m_blue == colour.m_blue &&
7f5426f0 50 m_alpha == colour.m_alpha &&
edc536d3 51 m_isInit == colour.m_isInit);
32b8ec41 52 }
32b8ec41 53
7f5426f0 54 bool operator!=(const wxColour& colour) const { return !(*this == colour); }
aad6765c
JS
55
56protected:
57
58 // Helper function
59 void Init();
60
aea95b1c
VZ
61 virtual void
62 InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
40989e46 63
32b8ec41
VZ
64private:
65 bool m_isInit;
66 unsigned char m_red;
67 unsigned char m_blue;
68 unsigned char m_green;
7f5426f0 69 unsigned char m_alpha;
32b8ec41 70
32b8ec41
VZ
71private:
72 DECLARE_DYNAMIC_CLASS(wxColour)
73};
74
3da12c22 75#endif // _WX_GENERIC_COLOUR_H_