]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/palette.h
use 6px as the default wxSizer border in wxGTK to be a little bit closer to GNOME HIG
[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
0e320a79 7// RCS-ID: $Id$
cdf1e714 8// Copyright: (c) David Webster
65571936 9// Licence: wxWindows licence
0e320a79
DW
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_PALETTE_H_
13#define _WX_PALETTE_H_
14
0e320a79 15#include "wx/gdiobj.h"
48c82007 16#include "wx/os2/private.h"
0e320a79 17
b5dbe15d 18class WXDLLIMPEXP_FWD_CORE wxPalette;
0e320a79
DW
19
20class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
21{
b5dbe15d 22 friend class WXDLLIMPEXP_FWD_CORE wxPalette;
0e320a79
DW
23public:
24 wxPaletteRefData();
d3c7fc99 25 virtual ~wxPaletteRefData();
65029152 26// protected:
deb63b95
DW
27 WXHPALETTE m_hPalette;
28 HPS m_hPS;
29}; // end of CLASS wxPaletteRefData
0e320a79
DW
30
31#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
32
917be7ed 33class WXDLLEXPORT wxPalette: public wxPaletteBase
0e320a79 34{
0e320a79 35public:
deb63b95 36 wxPalette();
0e320a79 37
deb63b95
DW
38 wxPalette( int n
39 ,const unsigned char* pRed
40 ,const unsigned char* pGreen
41 ,const unsigned char* pBlue
42 );
d3c7fc99 43 virtual ~wxPalette();
0e320a79 44
deb63b95
DW
45 bool Create( int n
46 ,const unsigned char* pRed
47 ,const unsigned char* pGreen
48 ,const unsigned char* pBlue
49 );
88ef3a57
WS
50 int GetPixel( unsigned char cRed
51 ,unsigned char cGreen
52 ,unsigned char cBlue
deb63b95
DW
53 ) const;
54 bool GetRGB( int nPixel
55 ,unsigned char* pRed
56 ,unsigned char* pGreen
57 ,unsigned char* pBlue
58 ) const;
0e320a79 59
917be7ed 60 virtual bool FreeResource(bool bForce = false);
deb63b95
DW
61
62 inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
63 void SetHPALETTE(WXHPALETTE hPalette);
64 void SetPS(HPS hPS);
4b3f61d1
SN
65
66protected:
67 virtual wxGDIRefData *CreateGDIRefData() const;
68 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
69
70private:
71 DECLARE_DYNAMIC_CLASS(wxPalette)
deb63b95 72}; // end of CLASS wxPalette
0e320a79
DW
73
74#endif
75 // _WX_PALETTE_H_