colour.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/colour.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_GTK_COLOUR_H_
  9. #define _WX_GTK_COLOUR_H_
  10. #ifdef __WXGTK3__
  11. typedef struct _GdkRGBA GdkRGBA;
  12. #endif
  13. //-----------------------------------------------------------------------------
  14. // wxColour
  15. //-----------------------------------------------------------------------------
  16. class WXDLLIMPEXP_CORE wxColour : public wxColourBase
  17. {
  18. public:
  19. // constructors
  20. // ------------
  21. DEFINE_STD_WXCOLOUR_CONSTRUCTORS
  22. wxColour(const GdkColor& gdkColor);
  23. #ifdef __WXGTK3__
  24. wxColour(const GdkRGBA& gdkRGBA);
  25. #endif
  26. virtual ~wxColour();
  27. bool operator==(const wxColour& col) const;
  28. bool operator!=(const wxColour& col) const { return !(*this == col); }
  29. unsigned char Red() const;
  30. unsigned char Green() const;
  31. unsigned char Blue() const;
  32. unsigned char Alpha() const;
  33. // Implementation part
  34. #ifdef __WXGTK3__
  35. operator const GdkRGBA*() const;
  36. #else
  37. void CalcPixel( GdkColormap *cmap );
  38. int GetPixel() const;
  39. #endif
  40. const GdkColor *GetColor() const;
  41. protected:
  42. virtual void
  43. InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
  44. virtual bool FromString(const wxString& str);
  45. DECLARE_DYNAMIC_CLASS(wxColour)
  46. };
  47. #endif // _WX_GTK_COLOUR_H_