| 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 | |
| 25 | class WXDLLIMPEXP_FWD_CORE wxDC; |
| 26 | class WXDLLIMPEXP_FWD_CORE wxPaintDC; |
| 27 | class WXDLLIMPEXP_FWD_CORE wxBitmap; |
| 28 | class WXDLLIMPEXP_FWD_CORE wxWindow; |
| 29 | |
| 30 | class WXDLLIMPEXP_FWD_CORE wxColour; |
| 31 | |
| 32 | //----------------------------------------------------------------------------- |
| 33 | // wxColour |
| 34 | //----------------------------------------------------------------------------- |
| 35 | |
| 36 | class WXDLLIMPEXP_CORE wxColour : public wxColourBase |
| 37 | { |
| 38 | public: |
| 39 | // constructors |
| 40 | // ------------ |
| 41 | DEFINE_STD_WXCOLOUR_CONSTRUCTORS |
| 42 | |
| 43 | virtual ~wxColour(); |
| 44 | |
| 45 | bool operator==(const wxColour& col) const; |
| 46 | bool operator!=(const wxColour& col) const { return !(*this == col); } |
| 47 | |
| 48 | unsigned char Red() const; |
| 49 | unsigned char Green() const; |
| 50 | unsigned char Blue() const; |
| 51 | |
| 52 | // Implementation part |
| 53 | |
| 54 | void CalcPixel( WXColormap cmap ); |
| 55 | unsigned long GetPixel() const; |
| 56 | WXColor *GetColor() const; |
| 57 | |
| 58 | protected: |
| 59 | virtual wxGDIRefData *CreateGDIRefData() const; |
| 60 | virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; |
| 61 | |
| 62 | virtual void |
| 63 | InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); |
| 64 | |
| 65 | virtual bool FromString(const wxString& str); |
| 66 | |
| 67 | private: |
| 68 | DECLARE_DYNAMIC_CLASS(wxColour) |
| 69 | }; |
| 70 | |
| 71 | #endif // _WX_COLOUR_H_ |