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