]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/x11/colour.h
mac cleanup, pure cgcolor
[wxWidgets.git] / include / wx / x11 / colour.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/x11/colour.h
3// Purpose: wxColour class
4// Author: Julian Smart, Robert Roebling
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart, Robert Roebling
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_COLOUR_H_
13#define _WX_COLOUR_H_
14
15#include "wx/defs.h"
16#include "wx/object.h"
17#include "wx/string.h"
18#include "wx/gdiobj.h"
19#include "wx/palette.h"
20
21//-----------------------------------------------------------------------------
22// classes
23//-----------------------------------------------------------------------------
24
25class WXDLLIMPEXP_FWD_CORE wxDC;
26class WXDLLIMPEXP_FWD_CORE wxPaintDC;
27class WXDLLIMPEXP_FWD_CORE wxBitmap;
28class WXDLLIMPEXP_FWD_CORE wxWindow;
29
30class WXDLLIMPEXP_FWD_CORE wxColour;
31
32//-----------------------------------------------------------------------------
33// wxColour
34//-----------------------------------------------------------------------------
35
36class WXDLLEXPORT wxColour : public wxColourBase
37{
38public:
39 // constructors
40 // ------------
41
42 wxColour() {}
43 DEFINE_STD_WXCOLOUR_CONSTRUCTORS
44
45 virtual ~wxColour();
46
47 bool Ok() const { return IsOk(); }
48 bool IsOk() const { return m_refData != NULL; }
49
50 bool operator == ( const wxColour& col ) const;
51 bool operator != ( const wxColour& col ) const { return !(*this == col); }
52
53 unsigned char Red() const;
54 unsigned char Green() const;
55 unsigned char Blue() const;
56
57 // Implementation part
58
59 void CalcPixel( WXColormap cmap );
60 unsigned long GetPixel() const;
61 WXColor *GetColor() const;
62
63protected:
64 // ref counting code
65 virtual wxObjectRefData *CreateRefData() const;
66 virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
67
68 virtual void
69 InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
70
71 virtual bool FromString(const wxString& str);
72
73private:
74 DECLARE_DYNAMIC_CLASS(wxColour)
75};
76
77#endif
78
79// _WX_COLOUR_H_