2004-03-23 12:35:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-10-06 10:37:43 -04:00
|
|
|
// Name: wx/mac/carbon/palette.h
|
2004-03-23 12:35:05 -05:00
|
|
|
// Purpose: wxPalette class
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Stefan Csomor
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2004-03-23 12:35:05 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PALETTE_H_
|
|
|
|
#define _WX_PALETTE_H_
|
|
|
|
|
|
|
|
#include "wx/colour.h"
|
|
|
|
#include "wx/gdiobj.h"
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
|
|
|
{
|
|
|
|
DECLARE_NO_COPY_CLASS(wxPaletteRefData)
|
2004-12-08 12:43:18 -05:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
friend class WXDLLIMPEXP_FWD_CORE wxPalette;
|
2004-03-23 12:35:05 -05:00
|
|
|
public:
|
|
|
|
wxPaletteRefData();
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxPaletteRefData();
|
2004-03-23 12:35:05 -05:00
|
|
|
protected:
|
|
|
|
wxColour* m_palette;
|
|
|
|
wxInt32 m_count ;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
|
|
|
|
2004-12-08 12:43:18 -05:00
|
|
|
class WXDLLEXPORT wxPalette: public wxPaletteBase
|
2004-03-23 12:35:05 -05:00
|
|
|
{
|
|
|
|
public:
|
2006-09-24 06:27:12 -04:00
|
|
|
wxPalette();
|
2004-03-23 12:35:05 -05:00
|
|
|
|
2006-09-24 06:27:12 -04:00
|
|
|
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
|
|
|
virtual ~wxPalette();
|
|
|
|
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
|
|
|
|
|
|
|
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
|
|
|
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
2004-03-23 12:35:05 -05:00
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
virtual bool Ok() const { return IsOk(); }
|
|
|
|
virtual bool IsOk() const { return (m_refData != NULL) ; }
|
2004-03-23 12:35:05 -05:00
|
|
|
|
2006-09-24 06:27:12 -04:00
|
|
|
virtual int GetColoursCount() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
2004-03-23 12:35:05 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_PALETTE_H_
|