-
- bool SaveFile( const wxString &name, const int type, wxPalette *palette = NULL );
- bool LoadFile( const wxString &name, const int type );
-
- wxPalette *GetPalette(void) const;
- wxPalette *GetColourMap(void) const
- { return GetPalette(); };
-
- public:
-
- GdkPixmap *GetPixmap(void) const;
-
- // no data :-)
+ wxBitmap GetMaskBitmap() const;
+
+ wxBitmap GetSubBitmap( const wxRect& rect ) const;
+
+ bool SaveFile(const wxString &name, wxBitmapType type,
+ const wxPalette *palette = NULL) const;
+ bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
+
+#if wxUSE_PALETTE
+ wxPalette *GetPalette() const;
+ void SetPalette(const wxPalette& palette);
+ wxPalette *GetColourMap() const { return GetPalette(); }
+#endif // wxUSE_PALETTE
+
+ static void InitStandardHandlers();
+
+ // implementation
+ // --------------
+
+ void SetHeight( int height );
+ void SetWidth( int width );
+ void SetDepth( int depth );
+
+#ifdef __WXGTK3__
+ GdkPixbuf* GetPixbufNoMask() const;
+ cairo_t* CairoCreate() const;
+ void Draw(cairo_t* cr, int x, int y, bool useMask = true, const wxColour* fg = NULL, const wxColour* bg = NULL) const;
+ void SetSourceSurface(cairo_t* cr, int x, int y, const wxColour* fg = NULL, const wxColour* bg = NULL) const;
+#else
+ GdkPixmap *GetPixmap() const;
+ bool HasPixmap() const;
+ bool HasPixbuf() const;
+ wxBitmap(GdkPixmap* pixmap);
+#endif
+ GdkPixbuf *GetPixbuf() const;
+
+ // raw bitmap access support functions
+ void *GetRawData(wxPixelDataBase& data, int bpp);
+ void UngetRawData(wxPixelDataBase& data);
+
+ bool HasAlpha() const;
+
+protected:
+#ifndef __WXGTK3__
+#if wxUSE_IMAGE
+ bool CreateFromImage(const wxImage& image, int depth);
+#endif // wxUSE_IMAGE
+#endif
+
+ virtual wxGDIRefData* CreateGDIRefData() const;
+ virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const;
+
+private:
+#ifndef __WXGTK3__
+ void SetPixmap(GdkPixmap* pixmap);
+#if wxUSE_IMAGE
+ // to be called from CreateFromImage only!
+ bool CreateFromImageAsPixmap(const wxImage& image, int depth);
+ bool CreateFromImageAsPixbuf(const wxImage& image);
+#endif // wxUSE_IMAGE
+
+public:
+ // implementation only
+ enum Representation
+ {
+ Pixmap,
+ Pixbuf
+ };
+ // removes other representations from memory, keeping only 'keep'
+ // (wxBitmap may keep same bitmap e.g. as both pixmap and pixbuf):
+ void PurgeOtherRepresentations(Representation keep);
+#endif
+
+ DECLARE_DYNAMIC_CLASS(wxBitmap)