1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/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_
15 #include "wx/gdiobj.h"
18 class WXDLLEXPORT wxPalette
;
20 // Palette for one display
21 class wxXPalette
: public wxObject
23 DECLARE_DYNAMIC_CLASS(wxXPalette
)
30 unsigned long* m_pix_array
;
35 class WXDLLEXPORT wxPaletteRefData
: public wxGDIRefData
37 friend class WXDLLEXPORT wxPalette
;
46 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
48 class WXDLLEXPORT wxPalette
: public wxPaletteBase
50 DECLARE_DYNAMIC_CLASS(wxPalette
)
55 wxPalette(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
57 bool Create(int n
, const unsigned char *red
, const unsigned char *green
, const unsigned char *blue
);
58 int GetPixel(unsigned char red
, unsigned char green
, unsigned char blue
) const;
59 bool GetRGB(int pixel
, unsigned char *red
, unsigned char *green
, unsigned char *blue
) const;
61 virtual bool Ok() const { return (m_refData
!= NULL
) ; }
63 bool operator == (const wxPalette
& palette
) const { return m_refData
== palette
.m_refData
; }
64 bool operator != (const wxPalette
& palette
) const { return m_refData
!= palette
.m_refData
; }
67 WXColormap
GetXColormap(WXDisplay
* display
= NULL
) const;
68 bool TransferBitmap(void *data
, int depth
, int size
);
69 bool TransferBitmap8(unsigned char *data
, unsigned long size
, void *dest
, unsigned int bpp
);
70 unsigned long *GetXPixArray(WXDisplay
* display
, int *pix_array_n
);
71 void PutXColormap(WXDisplay
* display
, WXColormap cmap
, bool destroyable
);