1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-10-06 14:37:43 +00:00
|
|
|
// Name: wx/os2/palette.h
|
1999-07-29 05:11:30 +00:00
|
|
|
// Purpose: wxPalette class
|
1999-10-12 22:49:24 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-12 22:49:24 +00:00
|
|
|
// Created: 10/12/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-12 22:49:24 +00:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PALETTE_H_
|
|
|
|
#define _WX_PALETTE_H_
|
|
|
|
|
|
|
|
#include "wx/gdiobj.h"
|
2003-08-31 22:35:24 +00:00
|
|
|
#include "wx/os2/private.h"
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
|
|
|
{
|
2007-07-09 10:09:52 +00:00
|
|
|
friend class WXDLLIMPEXP_FWD_CORE wxPalette;
|
1999-07-29 05:11:30 +00:00
|
|
|
public:
|
|
|
|
wxPaletteRefData();
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxPaletteRefData();
|
2002-08-25 18:24:18 +00:00
|
|
|
// protected:
|
2000-12-19 03:10:11 +00:00
|
|
|
WXHPALETTE m_hPalette;
|
|
|
|
HPS m_hPS;
|
|
|
|
}; // end of CLASS wxPaletteRefData
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
|
|
|
|
2004-12-08 17:43:18 +00:00
|
|
|
class WXDLLEXPORT wxPalette: public wxPaletteBase
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
2000-12-19 03:10:11 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
public:
|
2000-12-19 03:10:11 +00:00
|
|
|
wxPalette();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2000-12-19 03:10:11 +00:00
|
|
|
wxPalette( int n
|
|
|
|
,const unsigned char* pRed
|
|
|
|
,const unsigned char* pGreen
|
|
|
|
,const unsigned char* pBlue
|
|
|
|
);
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxPalette();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2000-12-19 03:10:11 +00:00
|
|
|
bool Create( int n
|
|
|
|
,const unsigned char* pRed
|
|
|
|
,const unsigned char* pGreen
|
|
|
|
,const unsigned char* pBlue
|
|
|
|
);
|
2005-10-06 14:37:43 +00:00
|
|
|
int GetPixel( unsigned char cRed
|
|
|
|
,unsigned char cGreen
|
|
|
|
,unsigned char cBlue
|
2000-12-19 03:10:11 +00:00
|
|
|
) const;
|
|
|
|
bool GetRGB( int nPixel
|
|
|
|
,unsigned char* pRed
|
|
|
|
,unsigned char* pGreen
|
|
|
|
,unsigned char* pBlue
|
|
|
|
) const;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2006-10-08 21:56:55 +00:00
|
|
|
virtual bool Ok() const { return IsOk(); }
|
|
|
|
virtual bool IsOk(void) const { return (m_refData != NULL) ; }
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2004-12-08 17:43:18 +00:00
|
|
|
virtual bool FreeResource(bool bForce = false);
|
2000-12-19 03:10:11 +00: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 05:11:30 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_PALETTE_H_
|