]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/palette.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / os2 / palette.h
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
88ef3a57 2// Name: wx/os2/palette.h
0e320a79 3// Purpose: wxPalette class
cdf1e714 4// Author: David Webster
0e320a79 5// Modified by:
cdf1e714 6// Created: 10/12/99
cdf1e714 7// Copyright: (c) David Webster
65571936 8// Licence: wxWindows licence
0e320a79
DW
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_PALETTE_H_
12#define _WX_PALETTE_H_
13
0e320a79 14#include "wx/gdiobj.h"
48c82007 15#include "wx/os2/private.h"
0e320a79 16
b5dbe15d 17class WXDLLIMPEXP_FWD_CORE wxPalette;
0e320a79 18
53a2db12 19class WXDLLIMPEXP_CORE wxPaletteRefData: public wxGDIRefData
0e320a79 20{
b5dbe15d 21 friend class WXDLLIMPEXP_FWD_CORE wxPalette;
0e320a79
DW
22public:
23 wxPaletteRefData();
d3c7fc99 24 virtual ~wxPaletteRefData();
65029152 25// protected:
deb63b95
DW
26 WXHPALETTE m_hPalette;
27 HPS m_hPS;
28}; // end of CLASS wxPaletteRefData
0e320a79
DW
29
30#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
31
53a2db12 32class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase
0e320a79 33{
0e320a79 34public:
deb63b95 35 wxPalette();
0e320a79 36
deb63b95
DW
37 wxPalette( int n
38 ,const unsigned char* pRed
39 ,const unsigned char* pGreen
40 ,const unsigned char* pBlue
41 );
d3c7fc99 42 virtual ~wxPalette();
0e320a79 43
deb63b95
DW
44 bool Create( int n
45 ,const unsigned char* pRed
46 ,const unsigned char* pGreen
47 ,const unsigned char* pBlue
48 );
88ef3a57
WS
49 int GetPixel( unsigned char cRed
50 ,unsigned char cGreen
51 ,unsigned char cBlue
deb63b95
DW
52 ) const;
53 bool GetRGB( int nPixel
54 ,unsigned char* pRed
55 ,unsigned char* pGreen
56 ,unsigned char* pBlue
57 ) const;
0e320a79 58
917be7ed 59 virtual bool FreeResource(bool bForce = false);
deb63b95
DW
60
61 inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
62 void SetHPALETTE(WXHPALETTE hPalette);
63 void SetPS(HPS hPS);
4b3f61d1
SN
64
65protected:
66 virtual wxGDIRefData *CreateGDIRefData() const;
67 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
68
69private:
70 DECLARE_DYNAMIC_CLASS(wxPalette)
deb63b95 71}; // end of CLASS wxPalette
0e320a79
DW
72
73#endif
74 // _WX_PALETTE_H_