1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-10-05 12:22:44 -04:00
|
|
|
// Name: wx/gtk/colour.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-26 05:56:58 -05:00
|
|
|
// Id: $Id$
|
1998-10-24 13:12:05 -04:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-30 01:55:56 -04:00
|
|
|
#ifndef _WX_GTK_COLOUR_H_
|
|
|
|
#define _WX_GTK_COLOUR_H_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxColour
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2006-04-24 10:52:23 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1998-10-20 10:35:22 -04:00
|
|
|
public:
|
2005-10-05 12:22:44 -04:00
|
|
|
// constructors
|
|
|
|
// ------------
|
|
|
|
|
|
|
|
// default
|
2006-04-24 10:52:23 -04:00
|
|
|
wxColour() {}
|
|
|
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
2006-06-15 15:29:08 -04:00
|
|
|
wxColour(const GdkColor& gdkColor);
|
2002-08-05 14:04:08 -04:00
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxColour();
|
2002-02-04 13:01:21 -05:00
|
|
|
|
|
|
|
bool Ok() const { return m_refData != NULL; }
|
2003-12-11 05:10:40 -05:00
|
|
|
|
2002-02-04 13:01:21 -05:00
|
|
|
bool operator == ( const wxColour& col ) const;
|
|
|
|
bool operator != ( const wxColour& col ) const { return !(*this == col); }
|
|
|
|
|
|
|
|
unsigned char Red() const;
|
|
|
|
unsigned char Green() const;
|
|
|
|
unsigned char Blue() const;
|
|
|
|
|
|
|
|
// Implementation part
|
|
|
|
void CalcPixel( GdkColormap *cmap );
|
|
|
|
int GetPixel() const;
|
2006-06-17 23:37:24 -04:00
|
|
|
#ifdef __WXGTK24__
|
2006-06-15 15:29:08 -04:00
|
|
|
const GdkColor *GetColor() const;
|
2006-06-17 23:37:24 -04:00
|
|
|
#else
|
|
|
|
// GDK functions from old gtk2 versions take non-const color parameters,
|
|
|
|
// too many uses to deal with individually
|
|
|
|
GdkColor *GetColor() const;
|
|
|
|
#endif
|
1998-10-19 22:10:29 -04:00
|
|
|
|
1998-10-19 10:18:56 -04:00
|
|
|
protected:
|
2006-09-09 22:00:24 -04:00
|
|
|
virtual void
|
|
|
|
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
|
|
|
|
2006-05-05 13:04:48 -04:00
|
|
|
virtual bool FromString(const wxChar *str);
|
1998-10-19 10:18:56 -04:00
|
|
|
|
|
|
|
private:
|
2002-02-04 13:01:21 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxColour)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
1998-10-19 22:10:29 -04:00
|
|
|
|
2006-08-30 01:55:56 -04:00
|
|
|
#endif // _WX_GTK_COLOUR_H_
|