2011-03-20 18:05:19 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gtk/colour.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_GTK_COLOUR_H_
|
|
|
|
#define _WX_GTK_COLOUR_H_
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
#ifdef __WXGTK3__
|
|
|
|
typedef struct _GdkRGBA GdkRGBA;
|
|
|
|
#endif
|
|
|
|
|
2011-03-20 18:05:19 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxColour
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructors
|
|
|
|
// ------------
|
|
|
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
|
|
|
wxColour(const GdkColor& gdkColor);
|
2013-09-22 22:44:55 +00:00
|
|
|
#ifdef __WXGTK3__
|
|
|
|
wxColour(const GdkRGBA& gdkRGBA);
|
|
|
|
#endif
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
virtual ~wxColour();
|
|
|
|
|
|
|
|
bool operator==(const wxColour& col) const;
|
|
|
|
bool operator!=(const wxColour& col) const { return !(*this == col); }
|
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
unsigned char Red() const wxOVERRIDE;
|
|
|
|
unsigned char Green() const wxOVERRIDE;
|
|
|
|
unsigned char Blue() const wxOVERRIDE;
|
|
|
|
unsigned char Alpha() const wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
// Implementation part
|
2013-09-22 22:44:55 +00:00
|
|
|
#ifdef __WXGTK3__
|
|
|
|
operator const GdkRGBA*() const;
|
|
|
|
#else
|
2011-03-20 18:05:19 +00:00
|
|
|
void CalcPixel( GdkColormap *cmap );
|
|
|
|
int GetPixel() const;
|
2013-09-22 22:44:55 +00:00
|
|
|
#endif
|
2011-03-20 18:05:19 +00:00
|
|
|
const GdkColor *GetColor() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void
|
2016-06-26 05:25:29 +00:00
|
|
|
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
virtual bool FromString(const wxString& str) wxOVERRIDE;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxColour);
|
2011-03-20 18:05:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_GTK_COLOUR_H_
|