1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-01-22 21:28:01 -05:00
|
|
|
// Name: wx/gtk1/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
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __GTKCOLOURH__
|
|
|
|
#define __GTKCOLOURH__
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/string.h"
|
|
|
|
#include "wx/gdiobj.h"
|
1998-07-11 05:53:58 -04:00
|
|
|
#include "wx/palette.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDC;
|
|
|
|
class WXDLLIMPEXP_CORE wxPaintDC;
|
|
|
|
class WXDLLIMPEXP_CORE wxBitmap;
|
|
|
|
class WXDLLIMPEXP_CORE wxWindow;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxColour;
|
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 14:02:27 -04:00
|
|
|
wxColour() { }
|
2006-04-24 10:52:23 -04:00
|
|
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
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
|
|
|
|
2006-04-24 10:52:23 -04:00
|
|
|
virtual bool FromString(const wxChar *str);
|
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
bool Ok() const { return IsOk(); }
|
|
|
|
bool IsOk() 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;
|
|
|
|
GdkColor *GetColor() const;
|
1998-10-19 22:10:29 -04:00
|
|
|
|
1998-10-19 10:18:56 -04:00
|
|
|
protected:
|
2002-02-04 13:01:21 -05:00
|
|
|
// ref counting code
|
|
|
|
virtual wxObjectRefData *CreateRefData() const;
|
|
|
|
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
2003-12-11 05:10:40 -05:00
|
|
|
|
2006-09-09 22:00:24 -04:00
|
|
|
virtual void
|
|
|
|
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
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
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif // __GTKCOLOURH__
|