]> git.saurik.com Git - wxWidgets.git/blob - include/wx/x11/palette.h
add assertEquals(int,unsigned short) overload to resolve the ambiguity resulting...
[wxWidgets.git] / include / wx / x11 / palette.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/x11/palette.h
3 // Purpose: wxPalette class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_PALETTE_H_
13 #define _WX_PALETTE_H_
14
15 #include "wx/list.h"
16
17 class WXDLLIMPEXP_FWD_CORE wxPalette;
18
19 // Palette for one display
20 class wxXPalette : public wxObject
21 {
22 DECLARE_DYNAMIC_CLASS(wxXPalette)
23
24 public:
25 wxXPalette();
26
27 WXDisplay* m_display;
28 int m_pix_array_n;
29 unsigned long* m_pix_array;
30 WXColormap m_cmap;
31 bool m_destroyable;
32 };
33
34 class WXDLLIMPEXP_CORE wxPaletteRefData: public wxGDIRefData
35 {
36 friend class WXDLLIMPEXP_FWD_CORE wxPalette;
37 public:
38 wxPaletteRefData();
39 virtual ~wxPaletteRefData();
40
41 protected:
42 wxList m_palettes;
43 };
44
45 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
46
47 class WXDLLIMPEXP_CORE wxPalette : public wxPaletteBase
48 {
49 DECLARE_DYNAMIC_CLASS(wxPalette)
50
51 public:
52 wxPalette();
53
54 wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
55 virtual ~wxPalette();
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;
59
60 // X-specific
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);
66
67 protected:
68 virtual wxGDIRefData *CreateGDIRefData() const;
69 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
70 };
71
72 #endif // _WX_PALETTE_H_