2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-10-05 12:22:44 -04:00
|
|
|
// Name: wx/x11/colour.h
|
2002-02-05 11:34:33 -05:00
|
|
|
// Purpose: wxColour class
|
2002-02-11 15:41:24 -05:00
|
|
|
// Author: Julian Smart, Robert Roebling
|
2002-02-05 11:34:33 -05:00
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
2002-02-11 15:41:24 -05:00
|
|
|
// Copyright: (c) Julian Smart, Robert Roebling
|
2005-10-05 12:22:44 -04:00
|
|
|
// Licence: wxWindows licence
|
2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_COLOUR_H_
|
|
|
|
#define _WX_COLOUR_H_
|
|
|
|
|
2002-02-11 15:41:24 -05:00
|
|
|
#include "wx/defs.h"
|
2002-02-05 11:34:33 -05:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/string.h"
|
2002-02-11 15:41:24 -05:00
|
|
|
#include "wx/gdiobj.h"
|
|
|
|
#include "wx/palette.h"
|
2002-02-05 11:34:33 -05:00
|
|
|
|
2002-02-11 15:41:24 -05:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 14:16:51 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDC;
|
|
|
|
class WXDLLIMPEXP_CORE wxPaintDC;
|
|
|
|
class WXDLLIMPEXP_CORE wxBitmap;
|
|
|
|
class WXDLLIMPEXP_CORE wxWindow;
|
2002-02-11 15:41:24 -05:00
|
|
|
|
2005-08-02 14:16:51 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxColour;
|
2002-02-11 15:41:24 -05:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxColour
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2006-04-24 10:52:23 -04:00
|
|
|
class WXDLLEXPORT wxColour : public wxColourBase
|
2002-02-05 11:34:33 -05:00
|
|
|
{
|
|
|
|
public:
|
2005-10-05 12:22:44 -04:00
|
|
|
// constructors
|
|
|
|
// ------------
|
|
|
|
|
2006-04-24 10:52:23 -04:00
|
|
|
wxColour() {}
|
|
|
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
2003-10-18 19:51:01 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
~wxColour();
|
2002-02-11 15:41:24 -05:00
|
|
|
|
|
|
|
bool Ok() const { return m_refData != NULL; }
|
2003-12-11 05:10:40 -05:00
|
|
|
|
2002-02-11 15:41:24 -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
|
2003-12-11 05:10:40 -05:00
|
|
|
|
2002-02-11 15:41:24 -05:00
|
|
|
void CalcPixel( WXColormap cmap );
|
|
|
|
unsigned long GetPixel() const;
|
|
|
|
WXColor *GetColor() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// ref counting code
|
|
|
|
virtual wxObjectRefData *CreateRefData() const;
|
|
|
|
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
2003-12-11 05:10:40 -05:00
|
|
|
|
2006-05-05 13:04:48 -04:00
|
|
|
virtual bool FromString(const wxChar *str);
|
2006-04-24 10:52:23 -04:00
|
|
|
virtual void InitWith( unsigned char red, unsigned char green, unsigned char blue );
|
2002-02-11 15:41:24 -05:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
private:
|
2002-02-11 15:41:24 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxColour)
|
2002-02-05 11:34:33 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-02-11 15:41:24 -05:00
|
|
|
|
2002-02-12 07:59:14 -05:00
|
|
|
// _WX_COLOUR_H_
|