colour.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. // Copyright: (c) Julian Smart, Robert Roebling
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_COLOUR_H_
  11. #define _WX_COLOUR_H_
  12. #include "wx/defs.h"
  13. #include "wx/object.h"
  14. #include "wx/string.h"
  15. #include "wx/gdiobj.h"
  16. #include "wx/palette.h"
  17. //-----------------------------------------------------------------------------
  18. // classes
  19. //-----------------------------------------------------------------------------
  20. class WXDLLIMPEXP_FWD_CORE wxDC;
  21. class WXDLLIMPEXP_FWD_CORE wxPaintDC;
  22. class WXDLLIMPEXP_FWD_CORE wxBitmap;
  23. class WXDLLIMPEXP_FWD_CORE wxWindow;
  24. class WXDLLIMPEXP_FWD_CORE wxColour;
  25. //-----------------------------------------------------------------------------
  26. // wxColour
  27. //-----------------------------------------------------------------------------
  28. class WXDLLIMPEXP_CORE wxColour : public wxColourBase
  29. {
  30. public:
  31. // constructors
  32. // ------------
  33. DEFINE_STD_WXCOLOUR_CONSTRUCTORS
  34. virtual ~wxColour();
  35. bool operator==(const wxColour& col) const;
  36. bool operator!=(const wxColour& col) const { return !(*this == col); }
  37. unsigned char Red() const;
  38. unsigned char Green() const;
  39. unsigned char Blue() const;
  40. // Implementation part
  41. void CalcPixel( WXColormap cmap );
  42. unsigned long GetPixel() const;
  43. WXColor *GetColor() const;
  44. protected:
  45. virtual wxGDIRefData *CreateGDIRefData() const;
  46. virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
  47. virtual void
  48. InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
  49. virtual bool FromString(const wxString& str);
  50. private:
  51. DECLARE_DYNAMIC_CLASS(wxColour)
  52. };
  53. #endif // _WX_COLOUR_H_