]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/classic/colour.h
availability does not include any other headers, but it provides the necessary macros...
[wxWidgets.git] / include / wx / mac / classic / colour.h
CommitLineData
52479aef 1/////////////////////////////////////////////////////////////////////////////
edc536d3 2// Name: wx/mac/classic/colour.h
52479aef
SC
3// Purpose: wxColour class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
7// RCS-ID: $Id$
8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
52479aef
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_COLOUR_H_
13#define _WX_COLOUR_H_
14
52479aef
SC
15#include "wx/object.h"
16#include "wx/string.h"
17
18// Colour
ee19674c 19class WXDLLEXPORT wxColour: public wxColourBase
52479aef
SC
20{
21public:
edc536d3
WS
22 // constructors
23 // ------------
24
52479aef 25 // default
edc536d3 26 wxColour() { Init(); }
ee19674c 27 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
52479aef
SC
28
29 // copy ctors and assignment operators
edc536d3
WS
30 wxColour( const wxColour& col );
31 wxColour( const wxColour* col );
32 wxColour& operator = ( const wxColour& col );
52479aef
SC
33
34 // dtor
d3c7fc99 35 virtual ~wxColour();
edc536d3 36
edc536d3 37 // accessors
b7cacb43
VZ
38 bool Ok() const { return IsOk(); }
39 bool IsOk() const {return m_isInit; }
edc536d3
WS
40
41 unsigned char Red() const { return m_red; }
42 unsigned char Green() const { return m_green; }
43 unsigned char Blue() const { return m_blue; }
44
45 // comparison
46 bool operator == (const wxColour& colour) const
47 {
48 return (m_isInit == colour.m_isInit
49 && m_red == colour.m_red
50 && m_green == colour.m_green
51 && m_blue == colour.m_blue);
52 }
53 bool operator != (const wxColour& colour) const { return !(*this == colour); }
54
55 const WXCOLORREF& GetPixel() const { return m_pixel; };
52479aef 56
ee19674c 57protected:
52479aef
SC
58
59 // Helper function
60 void Init();
61
ee19674c
WS
62 void InitWith( unsigned char red, unsigned char green, unsigned char blue );
63
52479aef 64private:
edc536d3
WS
65 bool m_isInit;
66 unsigned char m_red;
67 unsigned char m_blue;
68 unsigned char m_green;
52479aef
SC
69
70public:
edc536d3
WS
71 WXCOLORREF m_pixel ;
72 void Set( const WXCOLORREF* color ) ;
52479aef
SC
73
74private:
edc536d3 75 DECLARE_DYNAMIC_CLASS(wxColour)
52479aef
SC
76};
77
78#endif
79 // _WX_COLOUR_H_