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
|
|
|
|
|
|
|
class WXDLLEXPORT wxPalette;
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
|
|
|
{
|
|
|
|
friend class WXDLLEXPORT wxPalette;
|
|
|
|
public:
|
|
|
|
wxPaletteRefData();
|
|
|
|
~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();
|
|
|
|
inline wxPalette(const wxPalette& rPalette) { Ref(rPalette); }
|
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
|
|
|
|
);
|
|
|
|
~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
|
|
|
|
2000-12-19 03:10:11 +00:00
|
|
|
virtual bool Ok(void) const { return (m_refData != NULL) ; }
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2000-12-19 03:10:11 +00:00
|
|
|
inline wxPalette& operator = (const wxPalette& rPalette) { if (*this == rPalette) return (*this); Ref(rPalette); return *this; }
|
2004-05-09 17:30:57 +00:00
|
|
|
inline bool operator == (const wxPalette& rPalette) const
|
|
|
|
{ return m_refData == rPalette.m_refData; }
|
|
|
|
inline bool operator != (const wxPalette& rPalette) const
|
|
|
|
{ return m_refData != rPalette.m_refData; }
|
1999-10-12 22:49:24 +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_
|