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
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxDC;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPaintDC;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
2002-02-11 15:41:24 -05:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_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
|
|
|
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxColour();
|
2002-02-11 15:41:24 -05:00
|
|
|
|
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-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-09-09 22:00:24 -04:00
|
|
|
virtual void
|
|
|
|
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
|
|
|
|
2007-05-30 06:29:12 -04:00
|
|
|
virtual bool FromString(const wxString& str);
|
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_
|