1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/x11/palette.h
3 // Purpose: wxPalette class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_PALETTE_H_
12 #define _WX_PALETTE_H_
16 class WXDLLIMPEXP_FWD_CORE wxPalette
;
18 // Palette for one display
19 class wxXPalette
: public wxObject
21 DECLARE_DYNAMIC_CLASS(wxXPalette
)
28 unsigned long* m_pix_array
;
33 class WXDLLIMPEXP_CORE wxPaletteRefData
: public wxGDIRefData
35 friend class WXDLLIMPEXP_FWD_CORE wxPalette
;
38 virtual ~wxPaletteRefData();
44 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
46 class WXDLLIMPEXP_CORE wxPalette
: public wxPaletteBase
48 DECLARE_DYNAMIC_CLASS(wxPalette
)
53 wxPalette(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
55 bool Create(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
56 int GetPixel(unsigned char red
, unsigned char green
, unsigned char blue
) const;
57 bool GetRGB(int pixel
, unsigned char *red
, unsigned char *green
, unsigned char *blue
) const;
60 WXColormap
GetXColormap(WXDisplay
* display
= NULL
) const;
61 bool TransferBitmap(void *data
, int depth
, int size
);
62 bool TransferBitmap8(unsigned char *data
, unsigned long size
, void *dest
, unsigned int bpp
);
63 unsigned long *GetXPixArray(WXDisplay
* display
, int *pix_array_n
);
64 void PutXColormap(WXDisplay
* display
, WXColormap cmap
, bool destroyable
);
67 virtual wxGDIRefData
*CreateGDIRefData() const;
68 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
71 #endif // _WX_PALETTE_H_