]> git.saurik.com Git - wxWidgets.git/commitdiff
Make wxBitmap inherit from wxBitmapBase
authorRobert Roebling <robert@roebling.de>
Sat, 5 Feb 2005 13:08:44 +0000 (13:08 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 5 Feb 2005 13:08:44 +0000 (13:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/bitmap.h
include/wx/gtk/bitmap.h
include/wx/gtk/icon.h
include/wx/gtk1/bitmap.h
include/wx/gtk1/icon.h
src/gtk/bitmap.cpp
src/gtk1/bitmap.cpp

index 357c5636856495ca2a371742f1fa576affd67bdc..f5f6b51ceb96258385415090ba51d8108ebc24d6 100644 (file)
@@ -34,6 +34,7 @@ class WXDLLEXPORT wxPalette;
 
 #if defined(__WXMGL__) || \
     defined(__WXMAC__) || \
+    defined(__WXGTK__) || \
     defined(__WXCOCOA__) || \
     defined(__WXMOTIF__) || \
     defined(__WXX11__)
index 23f5b94e764ecb699a736f71bc385da69866a6f4..6ad8ede7d6e56528fb57d28bbada6c42594bdbe5 100644 (file)
@@ -63,7 +63,7 @@ private:
 // wxBitmap
 //-----------------------------------------------------------------------------
 
-class wxBitmap: public wxGDIObject
+class wxBitmap: public wxBitmapBase
 {
 public:
     wxBitmap();
@@ -72,7 +72,7 @@ public:
     wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); }
     wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
     wxBitmap( const wxBitmap& bmp );
-    wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
+    wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
     wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
     ~wxBitmap();
     wxBitmap& operator = ( const wxBitmap& bmp );
@@ -96,14 +96,17 @@ public:
     
     wxBitmap GetSubBitmap( const wxRect& rect ) const;
 
-    bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
-    bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
+    bool SaveFile(const wxString &name, wxBitmapType type,
+                          const wxPalette *palette = (wxPalette *)NULL) const;
+    bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_XPM );
 
+#if wxUSE_PALETTE
     wxPalette *GetPalette() const;
+    void SetPalette(const wxPalette& palette);
     wxPalette *GetColourMap() const { return GetPalette(); };
+#endif // wxUSE_PALETTE
 
     static void InitStandardHandlers() { }
-    static void CleanUpHandlers() { }
 
     // implementation
     // --------------
index c784b646e4ee345ab9c7059e134743b929e57469..0bcbf462c0cf84116b01e2740ebd16ebde72316b 100644 (file)
@@ -38,7 +38,7 @@ public:
 
     // For compatibility with wxMSW where desired size is sometimes required to
     // distinguish between multiple icons in a resource.
-    wxIcon( const wxString& filename, int type = wxBITMAP_TYPE_XPM,
+    wxIcon( const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_XPM,
             int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
         wxBitmap(filename, type)
     {
index 23f5b94e764ecb699a736f71bc385da69866a6f4..6ad8ede7d6e56528fb57d28bbada6c42594bdbe5 100644 (file)
@@ -63,7 +63,7 @@ private:
 // wxBitmap
 //-----------------------------------------------------------------------------
 
-class wxBitmap: public wxGDIObject
+class wxBitmap: public wxBitmapBase
 {
 public:
     wxBitmap();
@@ -72,7 +72,7 @@ public:
     wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); }
     wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
     wxBitmap( const wxBitmap& bmp );
-    wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
+    wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
     wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
     ~wxBitmap();
     wxBitmap& operator = ( const wxBitmap& bmp );
@@ -96,14 +96,17 @@ public:
     
     wxBitmap GetSubBitmap( const wxRect& rect ) const;
 
-    bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
-    bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
+    bool SaveFile(const wxString &name, wxBitmapType type,
+                          const wxPalette *palette = (wxPalette *)NULL) const;
+    bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_XPM );
 
+#if wxUSE_PALETTE
     wxPalette *GetPalette() const;
+    void SetPalette(const wxPalette& palette);
     wxPalette *GetColourMap() const { return GetPalette(); };
+#endif // wxUSE_PALETTE
 
     static void InitStandardHandlers() { }
-    static void CleanUpHandlers() { }
 
     // implementation
     // --------------
index c784b646e4ee345ab9c7059e134743b929e57469..0bcbf462c0cf84116b01e2740ebd16ebde72316b 100644 (file)
@@ -38,7 +38,7 @@ public:
 
     // For compatibility with wxMSW where desired size is sometimes required to
     // distinguish between multiple icons in a resource.
-    wxIcon( const wxString& filename, int type = wxBITMAP_TYPE_XPM,
+    wxIcon( const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_XPM,
             int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
         wxBitmap(filename, type)
     {
index 8a73768b7d3a68e103d219be76e93b5d4d6158e3..adf047670cacd77418f1a5b122678e138a012ee1 100644 (file)
@@ -1153,12 +1153,12 @@ wxImage wxBitmap::ConvertToImage() const
 }
 
 wxBitmap::wxBitmap( const wxBitmap& bmp )
-        : wxGDIObject()
+        : wxBitmapBase()
 {
     Ref( bmp );
 }
 
-wxBitmap::wxBitmap( const wxString &filename, int type )
+wxBitmap::wxBitmap( const wxString &filename, wxBitmapType type )
 {
     LoadFile( filename, type );
 }
@@ -1324,7 +1324,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
     return ret;
 }
 
-bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) )
+bool wxBitmap::SaveFile( const wxString &name, wxBitmapType type, const wxPalette *WXUNUSED(palette) ) const
 {
     wxCHECK_MSG( Ok(), FALSE, wxT("invalid bitmap") );
 
@@ -1337,7 +1337,7 @@ bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(pal
     return FALSE;
 }
 
-bool wxBitmap::LoadFile( const wxString &name, int type )
+bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type )
 {
     UnRef();
 
@@ -1390,6 +1390,11 @@ wxPalette *wxBitmap::GetPalette() const
     return M_BMPDATA->m_palette;
 }
 
+void wxBitmap::SetPalette(const wxPalette& WXUNUSED(palette))
+{
+    // TODO
+}
+
 void wxBitmap::SetHeight( int height )
 {
     if (!m_refData)
index 8a73768b7d3a68e103d219be76e93b5d4d6158e3..adf047670cacd77418f1a5b122678e138a012ee1 100644 (file)
@@ -1153,12 +1153,12 @@ wxImage wxBitmap::ConvertToImage() const
 }
 
 wxBitmap::wxBitmap( const wxBitmap& bmp )
-        : wxGDIObject()
+        : wxBitmapBase()
 {
     Ref( bmp );
 }
 
-wxBitmap::wxBitmap( const wxString &filename, int type )
+wxBitmap::wxBitmap( const wxString &filename, wxBitmapType type )
 {
     LoadFile( filename, type );
 }
@@ -1324,7 +1324,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
     return ret;
 }
 
-bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) )
+bool wxBitmap::SaveFile( const wxString &name, wxBitmapType type, const wxPalette *WXUNUSED(palette) ) const
 {
     wxCHECK_MSG( Ok(), FALSE, wxT("invalid bitmap") );
 
@@ -1337,7 +1337,7 @@ bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(pal
     return FALSE;
 }
 
-bool wxBitmap::LoadFile( const wxString &name, int type )
+bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type )
 {
     UnRef();
 
@@ -1390,6 +1390,11 @@ wxPalette *wxBitmap::GetPalette() const
     return M_BMPDATA->m_palette;
 }
 
+void wxBitmap::SetPalette(const wxPalette& WXUNUSED(palette))
+{
+    // TODO
+}
+
 void wxBitmap::SetHeight( int height )
 {
     if (!m_refData)