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
|
|
|
|
|
|
|
class WXDLLEXPORT wxPalette;
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
|
|
|
{
|
|
|
|
friend class WXDLLEXPORT wxPalette;
|
|
|
|
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)
|
|
|
|
|
2004-12-08 12:43:18 -05:00
|
|
|
class WXDLLEXPORT wxPalette: public wxPaletteBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
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();
|
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
|
|
|
|
2006-10-08 17:56:55 -04:00
|
|
|
virtual bool Ok() const { return IsOk(); }
|
|
|
|
virtual bool IsOk(void) const { return (m_refData != NULL) ; }
|
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);
|
|
|
|
}; // end of CLASS wxPalette
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_PALETTE_H_
|