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