1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-10-06 10:37:43 -04:00
|
|
|
// Name: wx/os2/palette.h
|
1999-07-29 01:11:30 -04:00
|
|
|
// 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
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PALETTE_H_
|
|
|
|
#define _WX_PALETTE_H_
|
|
|
|
|
|
|
|
#include "wx/gdiobj.h"
|
2003-08-31 18:35:24 -04:00
|
|
|
#include "wx/os2/private.h"
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPaletteRefData: public wxGDIRefData
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
2007-07-09 06:09:52 -04:00
|
|
|
friend class WXDLLIMPEXP_FWD_CORE wxPalette;
|
1999-07-29 01:11:30 -04:00
|
|
|
public:
|
|
|
|
wxPaletteRefData();
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxPaletteRefData();
|
2002-08-25 14:24:18 -04:00
|
|
|
// 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)
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2000-12-18 22:10:11 -05:00
|
|
|
wxPalette();
|
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
|
|
|
|
);
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~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
|
|
|
|
);
|
2005-10-06 10:37:43 -04:00
|
|
|
int GetPixel( unsigned char cRed
|
|
|
|
,unsigned char cGreen
|
|
|
|
,unsigned char cBlue
|
2000-12-18 22:10:11 -05:00
|
|
|
) const;
|
|
|
|
bool GetRGB( int nPixel
|
|
|
|
,unsigned char* pRed
|
|
|
|
,unsigned char* pGreen
|
|
|
|
,unsigned char* pBlue
|
|
|
|
) const;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2004-12-08 12:43:18 -05:00
|
|
|
virtual bool FreeResource(bool bForce = false);
|
2000-12-18 22:10:11 -05:00
|
|
|
|
|
|
|
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
|
|
|
void SetHPALETTE(WXHPALETTE hPalette);
|
|
|
|
void SetPS(HPS hPS);
|
2008-01-12 10:05:15 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual wxGDIRefData *CreateGDIRefData() const;
|
|
|
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
2000-12-18 22:10:11 -05:00
|
|
|
}; // end of CLASS wxPalette
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_PALETTE_H_
|