Make wxBitmap inherit from wxBitmapBase
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
58b907f6e1
commit
4611dd06a1
@ -34,6 +34,7 @@ class WXDLLEXPORT wxPalette;
|
||||
|
||||
#if defined(__WXMGL__) || \
|
||||
defined(__WXMAC__) || \
|
||||
defined(__WXGTK__) || \
|
||||
defined(__WXCOCOA__) || \
|
||||
defined(__WXMOTIF__) || \
|
||||
defined(__WXX11__)
|
||||
|
@ -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
|
||||
// --------------
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
// --------------
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user