git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1435
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
LoadFile( name, type );
}
LoadFile( name, type );
}
wxImage::wxImage( wxInputStream& stream, long type )
{
LoadFile( stream, type );
}
wxImage::wxImage( wxInputStream& stream, long type )
{
LoadFile( stream, type );
}
wxImage::wxImage( const wxImage& image )
{
wxImage::wxImage( const wxImage& image )
{
bool wxImage::LoadFile( const wxString& filename, long type )
{
bool wxImage::LoadFile( const wxString& filename, long type )
{
if (wxFileExists(filename))
{
wxFileInputStream stream(filename);
if (wxFileExists(filename))
{
wxFileInputStream stream(filename);
}
bool wxImage::SaveFile( const wxString& filename, int type )
{
}
bool wxImage::SaveFile( const wxString& filename, int type )
{
wxFileOutputStream stream(filename);
if ( stream.LastError() == wxStream_NOERROR )
return SaveFile(stream, type);
else
wxFileOutputStream stream(filename);
if ( stream.LastError() == wxStream_NOERROR )
return SaveFile(stream, type);
else
bool wxImage::LoadFile( wxInputStream& stream, long type )
{
UnRef();
bool wxImage::LoadFile( wxInputStream& stream, long type )
{
UnRef();
return handler->SaveFile( this, stream );
}
return handler->SaveFile( this, stream );
}
void wxImage::AddHandler( wxImageHandler *handler )
{
void wxImage::AddHandler( wxImageHandler *handler )
{
IMPLEMENT_DYNAMIC_CLASS(wxImageHandler,wxObject)
#endif
IMPLEMENT_DYNAMIC_CLASS(wxImageHandler,wxObject)
#endif
bool wxImageHandler::LoadFile( wxImage *WXUNUSED(image), wxInputStream& WXUNUSED(stream) )
{
return FALSE;
bool wxImageHandler::LoadFile( wxImage *WXUNUSED(image), wxInputStream& WXUNUSED(stream) )
{
return FALSE;
//-----------------------------------------------------------------------------
// wxPNGHandler
//-----------------------------------------------------------------------------
// wxPNGHandler
static void _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length )
{
((wxInputStream*) png_get_io_ptr( png_ptr )) -> Read(data, length);
static void _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length )
{
((wxInputStream*) png_get_io_ptr( png_ptr )) -> Read(data, length);
IMPLEMENT_DYNAMIC_CLASS(wxBMPHandler,wxImageHandler)
#endif
IMPLEMENT_DYNAMIC_CLASS(wxBMPHandler,wxImageHandler)
#endif
bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream )
{
unsigned char *data, *ptr;
bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream )
{
unsigned char *data, *ptr;
virtual bool Read(istream& str);
virtual bool Write(ostream& str) const;
virtual bool Read(istream& str);
virtual bool Write(ostream& str) const;
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
virtual wxString GetType() const { return "long"; };
virtual wxString GetType() const { return "long"; };
bool wxVariantDataLong::Write(wxOutputStream& str) const
{
str << m_value;
bool wxVariantDataLong::Write(wxOutputStream& str) const
{
str << m_value;
str >> m_value;
return TRUE;
}
str >> m_value;
return TRUE;
}
bool wxVariantDataLong::Read(wxString& str)
{
bool wxVariantDataLong::Read(wxString& str)
{
virtual bool Write(ostream& str) const;
virtual bool Write(wxString& str) const;
virtual bool Read(istream& str);
virtual bool Write(ostream& str) const;
virtual bool Write(wxString& str) const;
virtual bool Read(istream& str);
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
virtual wxString GetType() const { return "double"; };
protected:
virtual wxString GetType() const { return "double"; };
protected:
bool wxVariantDataReal::Write(wxOutputStream& str) const
{
str << m_value;
bool wxVariantDataReal::Write(wxOutputStream& str) const
{
str << m_value;
str >> (float&)m_value;
return TRUE;
}
str >> (float&)m_value;
return TRUE;
}
bool wxVariantDataReal::Read(wxString& str)
{
bool wxVariantDataReal::Read(wxString& str)
{
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str);
virtual bool Read(istream& str);
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str);
virtual bool Read(istream& str);
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
virtual wxString GetType() const { return "bool"; };
protected:
virtual wxString GetType() const { return "bool"; };
protected:
bool wxVariantDataBool::Write(wxOutputStream& str) const
{
str << (char)m_value;
bool wxVariantDataBool::Write(wxOutputStream& str) const
{
str << (char)m_value;
str >> (char&)m_value;
return TRUE;
}
str >> (char&)m_value;
return TRUE;
}
bool wxVariantDataBool::Read(wxString& str)
{
bool wxVariantDataBool::Read(wxString& str)
{
virtual bool Write(ostream& str) const;
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Write(ostream& str) const;
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
virtual wxString GetType() const { return "char"; };
protected:
virtual wxString GetType() const { return "char"; };
protected:
bool wxVariantDataChar::Write(wxOutputStream& str) const
{
str << m_value;
bool wxVariantDataChar::Write(wxOutputStream& str) const
{
str << m_value;
str >> m_value;
return TRUE;
}
str >> m_value;
return TRUE;
}
bool wxVariantDataChar::Read(wxString& str)
{
bool wxVariantDataChar::Read(wxString& str)
{
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(istream& str);
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(istream& str);
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
virtual wxString GetType() const { return "string"; };
protected:
virtual wxString GetType() const { return "string"; };
protected:
bool wxVariantDataString::Write(wxOutputStream& str) const
{
str << (const char*) m_value;
bool wxVariantDataString::Write(wxOutputStream& str) const
{
str << (const char*) m_value;
str >> m_value;
return TRUE;
}
str >> m_value;
return TRUE;
}
bool wxVariantDataString::Read(wxString& str)
{
bool wxVariantDataString::Read(wxString& str)
{