2004-10-19 09:40:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-01-18 16:14:27 -05:00
|
|
|
// Name: wx/palmos/palette.h
|
2004-10-19 09:40:30 -04:00
|
|
|
// Purpose: wxPalette class
|
2005-01-18 16:14:27 -05:00
|
|
|
// Author: William Osborne - minimal working wxPalmOS port
|
2004-10-19 09:40:30 -04:00
|
|
|
// Modified by:
|
|
|
|
// Created: 10/13/04
|
2005-01-18 16:14:27 -05:00
|
|
|
// RCS-ID: $Id$
|
2004-10-19 09:40:30 -04:00
|
|
|
// Copyright: (c) William Osborne
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PALETTE_H_
|
|
|
|
#define _WX_PALETTE_H_
|
|
|
|
|
|
|
|
#include "wx/gdiobj.h"
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
2004-10-19 09:40:30 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPaletteRefData: public wxGDIRefData
|
2004-10-19 09:40:30 -04:00
|
|
|
{
|
2007-07-09 06:09:52 -04:00
|
|
|
friend class WXDLLIMPEXP_FWD_CORE wxPalette;
|
2004-10-19 09:40:30 -04:00
|
|
|
public:
|
|
|
|
wxPaletteRefData(void);
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxPaletteRefData(void);
|
2004-10-19 09:40:30 -04:00
|
|
|
protected:
|
|
|
|
WXHPALETTE m_hPalette;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase
|
2004-10-19 09:40:30 -04:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxPalette(void);
|
|
|
|
|
|
|
|
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxPalette(void);
|
2004-10-19 09:40:30 -04:00
|
|
|
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
2005-10-06 10:37:43 -04:00
|
|
|
int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
2004-10-19 09:40:30 -04:00
|
|
|
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
|
|
|
|
2004-12-08 12:43:18 -05:00
|
|
|
virtual bool FreeResource(bool force = false);
|
2004-10-19 09:40:30 -04:00
|
|
|
|
|
|
|
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
|
|
|
void SetHPALETTE(WXHPALETTE pal);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_PALETTE_H_
|