1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/x11/palette.h
3 // Purpose: wxPalette class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PALETTE_H_
13 #define _WX_PALETTE_H_
17 class WXDLLIMPEXP_FWD_CORE wxPalette
;
19 // Palette for one display
20 class wxXPalette
: public wxObject
22 DECLARE_DYNAMIC_CLASS(wxXPalette
)
29 unsigned long* m_pix_array
;
34 class WXDLLEXPORT wxPaletteRefData
: public wxGDIRefData
36 friend class WXDLLIMPEXP_FWD_CORE wxPalette
;
39 virtual ~wxPaletteRefData();
45 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
47 class WXDLLEXPORT wxPalette
: public wxPaletteBase
49 DECLARE_DYNAMIC_CLASS(wxPalette
)
54 wxPalette(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
56 bool Create(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
57 int GetPixel(unsigned char red
, unsigned char green
, unsigned char blue
) const;
58 bool GetRGB(int pixel
, unsigned char *red
, unsigned char *green
, unsigned char *blue
) const;
61 WXColormap
GetXColormap(WXDisplay
* display
= NULL
) const;
62 bool TransferBitmap(void *data
, int depth
, int size
);
63 bool TransferBitmap8(unsigned char *data
, unsigned long size
, void *dest
, unsigned int bpp
);
64 unsigned long *GetXPixArray(WXDisplay
* display
, int *pix_array_n
);
65 void PutXColormap(WXDisplay
* display
, WXColormap cmap
, bool destroyable
);
68 virtual wxGDIRefData
*CreateGDIRefData() const;
69 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
72 #endif // _WX_PALETTE_H_