2001-06-26 17:05:06 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-08-10 07:16:30 -04:00
|
|
|
// Name: wx/generic/colour.h
|
2001-06-26 17:05:06 -04:00
|
|
|
// Purpose: wxColour class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 17:05:06 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-10 07:16:30 -04:00
|
|
|
#ifndef _WX_GENERIC_COLOUR_H_
|
|
|
|
#define _WX_GENERIC_COLOUR_H_
|
2001-06-26 17:05:06 -04:00
|
|
|
|
|
|
|
#include "wx/object.h"
|
|
|
|
|
|
|
|
// Colour
|
2006-04-24 10:52:23 -04:00
|
|
|
class WXDLLEXPORT wxColour: public wxColourBase
|
2001-06-26 17:05:06 -04:00
|
|
|
{
|
|
|
|
public:
|
2005-10-05 12:22:44 -04:00
|
|
|
// constructors
|
|
|
|
// ------------
|
|
|
|
|
|
|
|
// default
|
2006-04-24 17:05:04 -04:00
|
|
|
wxColour();
|
2006-04-24 10:52:23 -04:00
|
|
|
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2005-10-05 12:22:44 -04:00
|
|
|
// copy ctors and assignment operators
|
2001-06-26 17:05:06 -04:00
|
|
|
wxColour(const wxColour& col);
|
2006-09-04 07:14:29 -04:00
|
|
|
wxColour& operator=(const wxColour& col);
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2005-10-05 12:22:44 -04:00
|
|
|
// dtor
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxColour();
|
2001-06-26 17:05:06 -04:00
|
|
|
|
|
|
|
// accessors
|
2007-12-15 12:54:20 -05:00
|
|
|
virtual bool IsOk() const { return m_isInit; }
|
2001-06-26 17:05:06 -04:00
|
|
|
|
|
|
|
unsigned char Red() const { return m_red; }
|
|
|
|
unsigned char Green() const { return m_green; }
|
|
|
|
unsigned char Blue() const { return m_blue; }
|
2006-09-04 07:14:29 -04:00
|
|
|
unsigned char Alpha() const { return m_alpha; }
|
2001-06-26 17:05:06 -04:00
|
|
|
|
|
|
|
// comparison
|
2006-09-04 07:14:29 -04:00
|
|
|
bool operator==(const wxColour& colour) const
|
2001-06-26 17:05:06 -04:00
|
|
|
{
|
2005-10-05 12:22:44 -04:00
|
|
|
return (m_red == colour.m_red &&
|
|
|
|
m_green == colour.m_green &&
|
|
|
|
m_blue == colour.m_blue &&
|
2006-09-04 07:14:29 -04:00
|
|
|
m_alpha == colour.m_alpha &&
|
2005-10-05 12:22:44 -04:00
|
|
|
m_isInit == colour.m_isInit);
|
2001-06-26 17:05:06 -04:00
|
|
|
}
|
|
|
|
|
2006-09-04 07:14:29 -04:00
|
|
|
bool operator!=(const wxColour& colour) const { return !(*this == colour); }
|
2003-12-11 05:10:40 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// Helper function
|
|
|
|
void Init();
|
|
|
|
|
2006-09-09 22:00:24 -04:00
|
|
|
virtual void
|
|
|
|
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
2006-04-24 10:52:23 -04:00
|
|
|
|
2001-06-26 17:05:06 -04:00
|
|
|
private:
|
|
|
|
bool m_isInit;
|
|
|
|
unsigned char m_red;
|
|
|
|
unsigned char m_blue;
|
|
|
|
unsigned char m_green;
|
2006-09-04 07:14:29 -04:00
|
|
|
unsigned char m_alpha;
|
2001-06-26 17:05:06 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxColour)
|
|
|
|
};
|
|
|
|
|
2006-08-10 07:16:30 -04:00
|
|
|
#endif // _WX_GENERIC_COLOUR_H_
|