colour.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/colour.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKCOLOURH__
  9. #define __GTKCOLOURH__
  10. #include "wx/defs.h"
  11. #include "wx/object.h"
  12. #include "wx/string.h"
  13. #include "wx/gdiobj.h"
  14. #include "wx/palette.h"
  15. //-----------------------------------------------------------------------------
  16. // classes
  17. //-----------------------------------------------------------------------------
  18. class WXDLLIMPEXP_FWD_CORE wxDC;
  19. class WXDLLIMPEXP_FWD_CORE wxPaintDC;
  20. class WXDLLIMPEXP_FWD_CORE wxBitmap;
  21. class WXDLLIMPEXP_FWD_CORE wxWindow;
  22. class WXDLLIMPEXP_FWD_CORE wxColour;
  23. //-----------------------------------------------------------------------------
  24. // wxColour
  25. //-----------------------------------------------------------------------------
  26. class WXDLLIMPEXP_CORE wxColour : public wxColourBase
  27. {
  28. public:
  29. // constructors
  30. // ------------
  31. DEFINE_STD_WXCOLOUR_CONSTRUCTORS
  32. virtual ~wxColour();
  33. virtual bool FromString(const wxString& str);
  34. bool operator==(const wxColour& col) const;
  35. bool operator!=(const wxColour& col) const { return !(*this == col); }
  36. unsigned char Red() const;
  37. unsigned char Green() const;
  38. unsigned char Blue() const;
  39. // Implementation part
  40. void CalcPixel( GdkColormap *cmap );
  41. int GetPixel() const;
  42. GdkColor *GetColor() const;
  43. protected:
  44. // ref counting code
  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. private:
  50. DECLARE_DYNAMIC_CLASS(wxColour)
  51. };
  52. #endif // __GTKCOLOURH__