]> git.saurik.com Git - wxWidgets.git/commitdiff
wxPaletteBase introduction. wxPalette::GetColoursCount() in interface of all platform...
authorWłodzimierz Skiba <abx@abx.art.pl>
Wed, 8 Dec 2004 17:43:18 +0000 (17:43 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Wed, 8 Dec 2004 17:43:18 +0000 (17:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

13 files changed:
docs/latex/wx/palette.tex
include/wx/generic/paletteg.h
include/wx/mac/carbon/palette.h
include/wx/mac/classic/palette.h
include/wx/mgl/palette.h
include/wx/motif/palette.h
include/wx/msw/palette.h
include/wx/os2/palette.h
include/wx/palette.h
include/wx/palmos/palette.h
include/wx/x11/palette.h
src/motif/palette.cpp
src/x11/palette.cpp

index 25c98ec8f231c01404171e0e58261b4cd2026aac..ab37cf331761ab2d325a52b0dceef69b9ba3ef39 100644 (file)
@@ -92,6 +92,12 @@ true if the creation was successful, false otherwise.
 
 \helpref{wxPalette::wxPalette}{wxpalettector}
 
 
 \helpref{wxPalette::wxPalette}{wxpalettector}
 
+\membersection{wxPalette::GetColoursCount}\label{wxpalettegetcolourscount}
+
+\constfunc{int}{GetColoursCount}{\void}
+
+Returns number of entries in palette.
+
 \membersection{wxPalette::GetPixel}\label{wxpalettegetpixel}
 
 \constfunc{int}{GetPixel}{\param{const unsigned char }{red}, \param{const unsigned char }{green},\rtfsp
 \membersection{wxPalette::GetPixel}\label{wxpalettegetpixel}
 
 \constfunc{int}{GetPixel}{\param{const unsigned char }{red}, \param{const unsigned char }{green},\rtfsp
index 3ff00fbf202b8a3ba8fd643ac7141d4943cbc6ef..54a6b51f73eefd35bd19c3ec853aba429936cd0c 100644 (file)
@@ -31,7 +31,7 @@ class wxPalette;
 // wxPalette
 //-----------------------------------------------------------------------------
 
 // wxPalette
 //-----------------------------------------------------------------------------
 
-class wxPalette: public wxGDIObject
+class wxPalette: public wxPaletteBase
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
@@ -44,7 +44,7 @@ class wxPalette: public wxGDIObject
     wxPalette& operator = ( const wxPalette& palette );
     bool operator == ( const wxPalette& palette );
     bool operator != ( const wxPalette& palette );
     wxPalette& operator = ( const wxPalette& palette );
     bool operator == ( const wxPalette& palette );
     bool operator != ( const wxPalette& palette );
-    bool Ok() const;
+    virtual bool Ok() const;
 
     bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     int GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const;
 
     bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     int GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const;
@@ -53,7 +53,4 @@ class wxPalette: public wxGDIObject
     // no data
 };
 
     // no data
 };
 
-#define wxColorMap wxPalette
-#define wxColourMap wxPalette
-
 #endif // __WX_PALETTEG_H__
 #endif // __WX_PALETTEG_H__
index 74f9a4dd301fcc6afe82d0caf2a341a66b60a7be..ed9acb81bc72f8ee4baded4edb4b277ab6dbd14b 100644 (file)
@@ -24,7 +24,7 @@ class WXDLLEXPORT wxPalette;
 class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
 {
     DECLARE_NO_COPY_CLASS(wxPaletteRefData)
 class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
 {
     DECLARE_NO_COPY_CLASS(wxPaletteRefData)
-    
+
     friend class WXDLLEXPORT wxPalette;
 public:
     wxPaletteRefData();
     friend class WXDLLEXPORT wxPalette;
 public:
     wxPaletteRefData();
@@ -36,14 +36,14 @@ protected:
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
-class WXDLLEXPORT wxPalette: public wxGDIObject
+class WXDLLEXPORT wxPalette: public wxPaletteBase
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
 public:
   wxPalette();
   wxPalette(const wxPalette& palette)
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
 public:
   wxPalette();
   wxPalette(const wxPalette& palette)
-      : wxGDIObject()
+      : wxPaletteBase()
   { Ref(palette); }
 
   wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
   { Ref(palette); }
 
   wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
index 74f9a4dd301fcc6afe82d0caf2a341a66b60a7be..ed9acb81bc72f8ee4baded4edb4b277ab6dbd14b 100644 (file)
@@ -24,7 +24,7 @@ class WXDLLEXPORT wxPalette;
 class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
 {
     DECLARE_NO_COPY_CLASS(wxPaletteRefData)
 class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
 {
     DECLARE_NO_COPY_CLASS(wxPaletteRefData)
-    
+
     friend class WXDLLEXPORT wxPalette;
 public:
     wxPaletteRefData();
     friend class WXDLLEXPORT wxPalette;
 public:
     wxPaletteRefData();
@@ -36,14 +36,14 @@ protected:
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
-class WXDLLEXPORT wxPalette: public wxGDIObject
+class WXDLLEXPORT wxPalette: public wxPaletteBase
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
 public:
   wxPalette();
   wxPalette(const wxPalette& palette)
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
 public:
   wxPalette();
   wxPalette(const wxPalette& palette)
-      : wxGDIObject()
+      : wxPaletteBase()
   { Ref(palette); }
 
   wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
   { Ref(palette); }
 
   wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
index a11f8bf9a53880244126fc7da8893412f7e9e046..f134955bc4d67f8d1ef9128c98a8100a431c164c 100644 (file)
@@ -32,7 +32,7 @@ struct palette_t;
 // wxPalette
 //-----------------------------------------------------------------------------
 
 // wxPalette
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxPalette: public wxGDIObject
+class WXDLLEXPORT wxPalette: public wxPaletteBase
 {
     DECLARE_DYNAMIC_CLASS(wxPalette)
 
 {
     DECLARE_DYNAMIC_CLASS(wxPalette)
 
@@ -44,21 +44,16 @@ public:
     wxPalette& operator = (const wxPalette& palette);
     bool operator == (const wxPalette& palette) const;
     bool operator != (const wxPalette& palette) const;
     wxPalette& operator = (const wxPalette& palette);
     bool operator == (const wxPalette& palette) const;
     bool operator != (const wxPalette& palette) const;
-    bool Ok() const;
+    virtual bool Ok() const;
 
     bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
     bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
 
     // implementation
 
     bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
     bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
 
     // implementation
-    int GetColoursCount() const;   
-    // FIXME_MGL -- make this method standard part of wx API
-    // FIXME_MGL -- create wxXXXBase classes for all GDI stuff (Vadim wants that)
-    
+    virtual int GetColoursCount() const;
+
     palette_t *GetMGLpalette_t() const;
 };
 
     palette_t *GetMGLpalette_t() const;
 };
 
-#define wxColorMap wxPalette
-#define wxColourMap wxPalette
-
 #endif // __WX_PALETTE_H__
 #endif // __WX_PALETTE_H__
index bff484a85e5480bd692030267597cf3f1e2fd773..64403fb7ad95aad24dd8eb0017e0bd28e0926b5f 100644 (file)
@@ -25,10 +25,10 @@ class WXDLLEXPORT wxPalette;
 class wxXPalette : public wxObject
 {
     DECLARE_DYNAMIC_CLASS(wxXPalette)
 class wxXPalette : public wxObject
 {
     DECLARE_DYNAMIC_CLASS(wxXPalette)
-        
+
 public:
     wxXPalette();
 public:
     wxXPalette();
-    
+
     WXDisplay*        m_display;
     int               m_pix_array_n;
     unsigned long*    m_pix_array;
     WXDisplay*        m_display;
     int               m_pix_array_n;
     unsigned long*    m_pix_array;
@@ -42,33 +42,33 @@ class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
 public:
     wxPaletteRefData();
     ~wxPaletteRefData();
 public:
     wxPaletteRefData();
     ~wxPaletteRefData();
-    
+
 protected:
     wxList  m_palettes;
 };
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
 protected:
     wxList  m_palettes;
 };
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
-class WXDLLEXPORT wxPalette: public wxGDIObject
+class WXDLLEXPORT wxPalette: public wxPaletteBase
 {
     DECLARE_DYNAMIC_CLASS(wxPalette)
 {
     DECLARE_DYNAMIC_CLASS(wxPalette)
-        
+
 public:
     wxPalette();
     wxPalette(const wxPalette& palette) { Ref(palette); }
 public:
     wxPalette();
     wxPalette(const wxPalette& palette) { Ref(palette); }
-    
+
     wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     ~wxPalette();
     bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
     bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
     wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     ~wxPalette();
     bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
     bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
-    
+
     virtual bool Ok() const { return (m_refData != NULL) ; }
     virtual bool Ok() const { return (m_refData != NULL) ; }
-    
+
     wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
     bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
     bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
     wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
     bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
     bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
-    
+
     // Motif-specific
     WXColormap GetXColormap(WXDisplay* display = NULL) const;
     bool TransferBitmap(void *data, int depth, int size);
     // Motif-specific
     WXColormap GetXColormap(WXDisplay* display = NULL) const;
     bool TransferBitmap(void *data, int depth, int size);
index 6179d35006ee18c71d9bf860ce1a5f9d341a0862..73d5df709e60323ad5cb297ef958ff666cc23bc6 100644 (file)
@@ -32,13 +32,13 @@ protected:
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
-class WXDLLEXPORT wxPalette: public wxGDIObject
+class WXDLLEXPORT wxPalette: public wxPaletteBase
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
 public:
   wxPalette(void);
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
 public:
   wxPalette(void);
-  inline wxPalette(const wxPalette& palette) : wxGDIObject(palette) { Ref(palette); }
+  inline wxPalette(const wxPalette& palette) : wxPaletteBase(palette) { Ref(palette); }
 
   wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
   ~wxPalette(void);
 
   wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
   ~wxPalette(void);
@@ -58,8 +58,5 @@ public:
   void SetHPALETTE(WXHPALETTE pal);
 };
 
   void SetHPALETTE(WXHPALETTE pal);
 };
 
-#define wxColorMap wxPalette
-#define wxColourMap wxPalette
-
 #endif
     // _WX_PALETTE_H_
 #endif
     // _WX_PALETTE_H_
index 9d445157d1412e0c7f584ac91473091d0ed194f1..1926409552aa405b884b92158458559273f57e0f 100644 (file)
@@ -30,7 +30,7 @@ public:
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
-class WXDLLEXPORT wxPalette: public wxGDIObject
+class WXDLLEXPORT wxPalette: public wxPaletteBase
 {
     DECLARE_DYNAMIC_CLASS(wxPalette)
 
 {
     DECLARE_DYNAMIC_CLASS(wxPalette)
 
@@ -68,16 +68,13 @@ public:
     inline bool       operator != (const wxPalette& rPalette) const
         { return m_refData != rPalette.m_refData; }
 
     inline bool       operator != (const wxPalette& rPalette) const
         { return m_refData != rPalette.m_refData; }
 
-    virtual bool FreeResource(bool bForce = FALSE);
+    virtual bool FreeResource(bool bForce = false);
 
     inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
     void              SetHPALETTE(WXHPALETTE hPalette);
     void              SetPS(HPS hPS);
 }; // end of CLASS wxPalette
 
 
     inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
     void              SetHPALETTE(WXHPALETTE hPalette);
     void              SetPS(HPS hPS);
 }; // end of CLASS wxPalette
 
-#define wxColorMap wxPalette
-#define wxColourMap wxPalette
-
 #endif
     // _WX_PALETTE_H_
 
 #endif
     // _WX_PALETTE_H_
 
index 52d2da66a1f194f55b53cb78baf650a8ca4ac6d8..91c1f52945f907df867a3898b1199edc112400fd 100644 (file)
@@ -1,12 +1,26 @@
 #ifndef _WX_PALETTE_H_BASE_
 #define _WX_PALETTE_H_BASE_
 
 #ifndef _WX_PALETTE_H_BASE_
 #define _WX_PALETTE_H_BASE_
 
-// include it to get wxUSE_PALETTE value
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 #if wxUSE_PALETTE
 
 
 #if wxUSE_PALETTE
 
-#if defined(__WXMSW__)
+#include "wx/object.h"
+#include "wx/gdiobj.h"
+
+// wxBrushBase
+class WXDLLEXPORT wxPaletteBase: public wxGDIObject
+{
+public:
+    virtual ~wxPaletteBase() { }
+
+    virtual bool Ok() const = 0;
+    virtual int GetColoursCount() const { wxFAIL_MSG( _T("not implemented") ); return 0; };
+};
+
+#if defined(__PALMOS__)
+    #include "wx/palmos/palette.h"
+#elif defined(__WXMSW__)
     #include "wx/msw/palette.h"
 #elif defined(__WXMOTIF__)
     #include "wx/motif/palette.h"
     #include "wx/msw/palette.h"
 #elif defined(__WXMOTIF__)
     #include "wx/motif/palette.h"
     #include "wx/os2/palette.h"
 #endif
 
     #include "wx/os2/palette.h"
 #endif
 
+#if WXWIN_COMPATIBILITY_2_4
+    #define wxColorMap wxPalette
+    #define wxColourMap wxPalette
+#endif
+
 #endif // wxUSE_PALETTE
 
 #endif
 #endif // wxUSE_PALETTE
 
 #endif
index b0753763e20e9263d4f0d83c4326d1812dd16920..cebc6a2bc58a2dc2a4e8798f8021122dc5a1ee62 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      William Osborne
 // Modified by:
 // Created:     10/13/04
 // Author:      William Osborne
 // Modified by:
 // Created:     10/13/04
-// RCS-ID:      $Id: 
+// RCS-ID:      $Id:
 // Copyright:   (c) William Osborne
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) William Osborne
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -32,7 +32,7 @@ protected:
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
-class WXDLLEXPORT wxPalette: public wxGDIObject
+class WXDLLEXPORT wxPalette: public wxPaletteBase
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
 {
   DECLARE_DYNAMIC_CLASS(wxPalette)
 
@@ -52,14 +52,11 @@ public:
   inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
   inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
 
   inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
   inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
 
-  virtual bool FreeResource(bool force = FALSE);
+  virtual bool FreeResource(bool force = false);
 
   inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
   void SetHPALETTE(WXHPALETTE pal);
 };
 
 
   inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
   void SetHPALETTE(WXHPALETTE pal);
 };
 
-#define wxColorMap wxPalette
-#define wxColourMap wxPalette
-
 #endif
     // _WX_PALETTE_H_
 #endif
     // _WX_PALETTE_H_
index 975ec7584ce3f0bd9f789b43f70158c8223dc209..aaef465ffdaee83421c2de242dd748080179c3d2 100644 (file)
@@ -25,10 +25,10 @@ class WXDLLEXPORT wxPalette;
 class wxXPalette : public wxObject
 {
     DECLARE_DYNAMIC_CLASS(wxXPalette)
 class wxXPalette : public wxObject
 {
     DECLARE_DYNAMIC_CLASS(wxXPalette)
-        
+
 public:
     wxXPalette();
 public:
     wxXPalette();
-    
+
     WXDisplay*        m_display;
     int               m_pix_array_n;
     unsigned long*    m_pix_array;
     WXDisplay*        m_display;
     int               m_pix_array_n;
     unsigned long*    m_pix_array;
@@ -42,33 +42,33 @@ class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
 public:
     wxPaletteRefData();
     ~wxPaletteRefData();
 public:
     wxPaletteRefData();
     ~wxPaletteRefData();
-    
+
 protected:
     wxList  m_palettes;
 };
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
 protected:
     wxList  m_palettes;
 };
 
 #define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
 
-class WXDLLEXPORT wxPalette: public wxGDIObject
+class WXDLLEXPORT wxPalette: public wxPaletteBase
 {
     DECLARE_DYNAMIC_CLASS(wxPalette)
 {
     DECLARE_DYNAMIC_CLASS(wxPalette)
-        
+
 public:
     wxPalette();
     wxPalette(const wxPalette& palette) { Ref(palette); }
 public:
     wxPalette();
     wxPalette(const wxPalette& palette) { Ref(palette); }
-    
+
     wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     ~wxPalette();
     bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
     bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
     wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     ~wxPalette();
     bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
     int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
     bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
-    
+
     virtual bool Ok() const { return (m_refData != NULL) ; }
     virtual bool Ok() const { return (m_refData != NULL) ; }
-    
+
     wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
     bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
     bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
     wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
     bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
     bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
-    
+
     // X-specific
     WXColormap GetXColormap(WXDisplay* display = NULL) const;
     bool TransferBitmap(void *data, int depth, int size);
     // X-specific
     WXColormap GetXColormap(WXDisplay* display = NULL) const;
     bool TransferBitmap(void *data, int depth, int size);
index 2540f1ecdd4294dcc29380c2bc33a746c9e6632a..988cc153c076d2cc2dfc45889486bcc8ab898cfd 100644 (file)
@@ -23,7 +23,7 @@ I have implemented basic colormap support for the X11 versions of
 wxWidgets, notably wxPalette::Create().  The way I did it is to
 allocate additional read-only color cells in the default colormap.  In
 general you will get arbitrary pixel values assigned to these new
 wxWidgets, notably wxPalette::Create().  The way I did it is to
 allocate additional read-only color cells in the default colormap.  In
 general you will get arbitrary pixel values assigned to these new
-cells and therefore I added a method wxColourMap::TransferBitmap()
+cells and therefore I added a method wxPalette::TransferBitmap()
 which maps the pixel values 0..n to the real ones obtained with
 Create().  This is only implemented for the popular case of 8-bit
 depth.
 which maps the pixel values 0..n to the real ones obtained with
 Create().  This is only implemented for the popular case of 8-bit
 depth.
@@ -69,7 +69,7 @@ wxXPalette::wxXPalette()
     m_pix_array_n = 0;
     m_pix_array = (unsigned long*) 0;
     m_display = (WXDisplay*) 0;
     m_pix_array_n = 0;
     m_pix_array = (unsigned long*) 0;
     m_display = (WXDisplay*) 0;
-    m_destroyable = FALSE;
+    m_destroyable = false;
 }
 
 wxPaletteRefData::wxPaletteRefData()
 }
 
 wxPaletteRefData::wxPaletteRefData()
@@ -130,7 +130,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
     UnRef();
 
     if (!n) {
     UnRef();
 
     if (!n) {
-        return FALSE;
+        return false;
     }
 
     m_refData = new wxPaletteRefData;
     }
 
     m_refData = new wxPaletteRefData;
@@ -146,7 +146,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
 
     pix_array = new unsigned long[n];
     if (!pix_array)
 
     pix_array = new unsigned long[n];
     if (!pix_array)
-        return FALSE;
+        return false;
 
     pix_array_n = n;
     xcol.flags = DoRed | DoGreen | DoBlue;
 
     pix_array_n = n;
     xcol.flags = DoRed | DoGreen | DoBlue;
@@ -163,10 +163,10 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
     c->m_pix_array = pix_array;
     c->m_cmap = (WXColormap) cmap;
     c->m_display = (WXDisplay*) display;
     c->m_pix_array = pix_array;
     c->m_cmap = (WXColormap) cmap;
     c->m_display = (WXDisplay*) display;
-    c->m_destroyable = FALSE;
+    c->m_destroyable = false;
     M_PALETTEDATA->m_palettes.Append(c);
 
     M_PALETTEDATA->m_palettes.Append(c);
 
-    return TRUE;
+    return true;
 }
 
 int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
 }
 
 int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
@@ -181,13 +181,13 @@ int wxPalette::GetPixel(const unsigned char red, const unsigned char green, cons
 bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue)) const
 {
     if ( !m_refData )
 bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue)) const
 {
     if ( !m_refData )
-        return FALSE;
+        return false;
 
     if (index < 0 || index > 255)
 
     if (index < 0 || index > 255)
-        return FALSE;
+        return false;
 
     // TODO
 
     // TODO
-    return FALSE;
+    return false;
 }
 
 WXColormap wxPalette::GetXColormap(WXDisplay* display) const
 }
 
 WXColormap wxPalette::GetXColormap(WXDisplay* display) const
@@ -221,7 +221,7 @@ WXColormap wxPalette::GetXColormap(WXDisplay* display) const
     c->m_pix_array = new unsigned long[pix_array_n];
     c->m_display = display;
     c->m_cmap = wxTheApp->GetMainColormap(display);
     c->m_pix_array = new unsigned long[pix_array_n];
     c->m_display = display;
     c->m_cmap = wxTheApp->GetMainColormap(display);
-    c->m_destroyable = FALSE;
+    c->m_destroyable = false;
 
     xcol.flags = DoRed | DoGreen | DoBlue;
     int i;
 
     xcol.flags = DoRed | DoGreen | DoBlue;
     int i;
@@ -257,10 +257,10 @@ bool wxPalette::TransferBitmap(void *data, int depth, int size)
                 uptr++;
             }
 
                 uptr++;
             }
 
-            return TRUE;
+            return true;
         }
     default:
         }
     default:
-        return FALSE;
+        return false;
     }
 }
 
     }
 }
 
@@ -314,9 +314,9 @@ bool wxPalette::TransferBitmap8(unsigned char *data, unsigned long sz,
         break;
              }
     default:
         break;
              }
     default:
-        return FALSE;
+        return false;
     }
     }
-    return TRUE;
+    return true;
 }
 
 unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
 }
 
 unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
index c81b1fa113f0237e4242a5be2a49ec3ce93bc2a6..9da4df9aa4f2f128c0165053a024031a6f000e5c 100644 (file)
@@ -23,7 +23,7 @@ I have implemented basic colormap support for the X11 versions of
 wxWidgets, notably wxPalette::Create().  The way I did it is to
 allocate additional read-only color cells in the default colormap.  In
 general you will get arbitrary pixel values assigned to these new
 wxWidgets, notably wxPalette::Create().  The way I did it is to
 allocate additional read-only color cells in the default colormap.  In
 general you will get arbitrary pixel values assigned to these new
-cells and therefore I added a method wxColourMap::TransferBitmap()
+cells and therefore I added a method wxPalette::TransferBitmap()
 which maps the pixel values 0..n to the real ones obtained with
 Create().  This is only implemented for the popular case of 8-bit
 depth.
 which maps the pixel values 0..n to the real ones obtained with
 Create().  This is only implemented for the popular case of 8-bit
 depth.
@@ -66,7 +66,7 @@ wxXPalette::wxXPalette()
     m_pix_array_n = 0;
     m_pix_array = (unsigned long*) 0;
     m_display = (WXDisplay*) 0;
     m_pix_array_n = 0;
     m_pix_array = (unsigned long*) 0;
     m_display = (WXDisplay*) 0;
-    m_destroyable = FALSE;
+    m_destroyable = false;
 }
 
 wxPaletteRefData::wxPaletteRefData()
 }
 
 wxPaletteRefData::wxPaletteRefData()
@@ -101,7 +101,7 @@ wxPaletteRefData::~wxPaletteRefData()
 #endif
             delete [] pix_array;
         }
 #endif
             delete [] pix_array;
         }
-        
+
         if (destroyable)
             XFreeColormap(display, cmap);
 
         if (destroyable)
             XFreeColormap(display, cmap);
 
@@ -129,7 +129,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
     UnRef();
 
     if (!n) {
     UnRef();
 
     if (!n) {
-        return FALSE;
+        return false;
     }
 
     m_refData = new wxPaletteRefData;
     }
 
     m_refData = new wxPaletteRefData;
@@ -145,7 +145,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
 
     pix_array = new unsigned long[n];
     if (!pix_array)
 
     pix_array = new unsigned long[n];
     if (!pix_array)
-        return FALSE;
+        return false;
 
     pix_array_n = n;
     xcol.flags = DoRed | DoGreen | DoBlue;
 
     pix_array_n = n;
     xcol.flags = DoRed | DoGreen | DoBlue;
@@ -162,10 +162,10 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
     c->m_pix_array = pix_array;
     c->m_cmap = (WXColormap) cmap;
     c->m_display = (WXDisplay*) display;
     c->m_pix_array = pix_array;
     c->m_cmap = (WXColormap) cmap;
     c->m_display = (WXDisplay*) display;
-    c->m_destroyable = FALSE;
+    c->m_destroyable = false;
     M_PALETTEDATA->m_palettes.Append(c);
 
     M_PALETTEDATA->m_palettes.Append(c);
 
-    return TRUE;
+    return true;
 }
 
 int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
 }
 
 int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
@@ -180,13 +180,13 @@ int wxPalette::GetPixel(const unsigned char red, const unsigned char green, cons
 bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue)) const
 {
     if ( !m_refData )
 bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue)) const
 {
     if ( !m_refData )
-        return FALSE;
+        return false;
 
     if (index < 0 || index > 255)
 
     if (index < 0 || index > 255)
-        return FALSE;
+        return false;
 
     // TODO
 
     // TODO
-    return FALSE;
+    return false;
 }
 
 WXColormap wxPalette::GetXColormap(WXDisplay* display) const
 }
 
 WXColormap wxPalette::GetXColormap(WXDisplay* display) const
@@ -219,7 +219,7 @@ WXColormap wxPalette::GetXColormap(WXDisplay* display) const
     c->m_pix_array = new unsigned long[pix_array_n];
     c->m_display = display;
     c->m_cmap = wxTheApp->GetMainColormap(display);
     c->m_pix_array = new unsigned long[pix_array_n];
     c->m_display = display;
     c->m_cmap = wxTheApp->GetMainColormap(display);
-    c->m_destroyable = FALSE;
+    c->m_destroyable = false;
 
     xcol.flags = DoRed | DoGreen | DoBlue;
     int i;
 
     xcol.flags = DoRed | DoGreen | DoBlue;
     int i;
@@ -253,10 +253,10 @@ bool wxPalette::TransferBitmap(void *data, int depth, int size)
                 uptr++;
             }
 
                 uptr++;
             }
 
-            return TRUE;
+            return true;
         }
     default:
         }
     default:
-        return FALSE;
+        return false;
     }
 }
 
     }
 }
 
@@ -310,9 +310,9 @@ bool wxPalette::TransferBitmap8(unsigned char *data, unsigned long sz,
         break;
              }
     default:
         break;
              }
     default:
-        return FALSE;
+        return false;
     }
     }
-    return TRUE;
+    return true;
 }
 
 unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
 }
 
 unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)