1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: palette.h
|
|
|
|
// Purpose: wxPalette class
|
1999-10-12 18:49:24 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-12 18:49:24 -04:00
|
|
|
// Created: 10/12/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-12 18:49:24 -04:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PALETTE_H_
|
|
|
|
#define _WX_PALETTE_H_
|
|
|
|
|
|
|
|
#include "wx/gdiobj.h"
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxPalette;
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
|
|
|
{
|
|
|
|
friend class WXDLLEXPORT wxPalette;
|
|
|
|
public:
|
|
|
|
wxPaletteRefData();
|
|
|
|
~wxPaletteRefData();
|
|
|
|
protected:
|
2000-12-18 22:10:11 -05:00
|
|
|
WXHPALETTE m_hPalette;
|
|
|
|
HPS m_hPS;
|
|
|
|
}; // end of CLASS wxPaletteRefData
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxPalette: public wxGDIObject
|
|
|
|
{
|
2000-12-18 22:10:11 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
public:
|
2000-12-18 22:10:11 -05:00
|
|
|
wxPalette();
|
|
|
|
inline wxPalette(const wxPalette& rPalette) { Ref(rPalette); }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 22:10:11 -05:00
|
|
|
wxPalette( int n
|
|
|
|
,const unsigned char* pRed
|
|
|
|
,const unsigned char* pGreen
|
|
|
|
,const unsigned char* pBlue
|
|
|
|
);
|
|
|
|
~wxPalette();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 22:10:11 -05:00
|
|
|
bool Create( int n
|
|
|
|
,const unsigned char* pRed
|
|
|
|
,const unsigned char* pGreen
|
|
|
|
,const unsigned char* pBlue
|
|
|
|
);
|
|
|
|
int GetPixel( const unsigned char cRed
|
|
|
|
,const unsigned char cGreen
|
|
|
|
,const unsigned char cBlue
|
|
|
|
) const;
|
|
|
|
bool GetRGB( int nPixel
|
|
|
|
,unsigned char* pRed
|
|
|
|
,unsigned char* pGreen
|
|
|
|
,unsigned char* pBlue
|
|
|
|
) const;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 22:10:11 -05:00
|
|
|
virtual bool Ok(void) const { return (m_refData != NULL) ; }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2000-12-18 22:10:11 -05:00
|
|
|
inline wxPalette& operator = (const wxPalette& rPalette) { if (*this == rPalette) return (*this); Ref(rPalette); return *this; }
|
|
|
|
inline bool operator == (const wxPalette& rPalette) { return m_refData == rPalette.m_refData; }
|
|
|
|
inline bool operator != (const wxPalette& rPalette) { return m_refData != rPalette.m_refData; }
|
1999-10-12 18:49:24 -04:00
|
|
|
|
2000-12-18 22:10:11 -05:00
|
|
|
virtual bool FreeResource(bool bForce = FALSE);
|
|
|
|
|
|
|
|
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
|
|
|
void SetHPALETTE(WXHPALETTE hPalette);
|
|
|
|
void SetPS(HPS hPS);
|
|
|
|
}; // end of CLASS wxPalette
|
1999-07-29 01:11:30 -04:00
|
|
|
|
1999-10-12 18:49:24 -04:00
|
|
|
#define wxColorMap wxPalette
|
|
|
|
#define wxColourMap wxPalette
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
#endif
|
|
|
|
// _WX_PALETTE_H_
|
1999-10-12 18:49:24 -04:00
|
|
|
|