class WXDLLIMPEXP_FWD_CORE wxCursor;
class WXDLLIMPEXP_FWD_CORE wxControl;
class WXDLLIMPEXP_FWD_CORE wxImage;
+class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
// ----------------------------------------------------------------------------
// Bitmap data
// Load a resource
wxBitmap( int nId
- ,long lType = wxBITMAP_TYPE_BMP_RESOURCE
+ ,wxBitmapType lType = wxBITMAP_TYPE_BMP_RESOURCE
);
// For compatiability with other ports, under OS/2 does same as default ctor
inline wxBitmap( const wxString& WXUNUSED(rFilename)
- ,long WXUNUSED(lType)
+ ,wxBitmapType WXUNUSED(lType)
)
{ Init(); }
// New constructor for generalised creation from data
wxBitmap( const void* pData
- ,long lType
+ ,wxBitmapType lType
,int nWidth
,int nHeight
,int nDepth = 1
,int nDepth = -1
);
virtual bool Create( const void* pData
- ,long lType
+ ,wxBitmapType lType
,int nWidth
,int nHeight
,int nDepth = 1
);
virtual bool LoadFile( int nId
- ,long lType = wxBITMAP_TYPE_BMP_RESOURCE
+ ,wxBitmapType lType = wxBITMAP_TYPE_BMP_RESOURCE
);
virtual bool LoadFile( const wxString& rName
- ,long lType = wxBITMAP_TYPE_XPM
+ ,wxBitmapType lType = wxBITMAP_TYPE_XPM
);
virtual bool SaveFile( const wxString& rName
- ,int lType
+ ,wxBitmapType lType
,const wxPalette* pCmap = NULL
);
inline wxBitmapRefData* GetBitmapData() const
{ return (wxBitmapRefData *)m_refData; }
+ // raw bitmap access support functions
+ void *GetRawData(wxPixelDataBase& data, int bpp);
+ void UngetRawData(wxPixelDataBase& data);
+
inline int GetQuality() const
{ return (GetBitmapData() ? GetBitmapData()->m_nQuality : 0); }
virtual bool Create( wxGDIImage* pImage
,const void* pData
- ,long lFlags
+ ,wxBitmapType lFlags
,int nWidth
,int nHeight
,int nDepth = 1
);
virtual bool Load( wxGDIImage* pImage
,int nId
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth
,int nDesiredHeight
);
- virtual bool Save( wxGDIImage* pImage
- ,const wxString& rName
- ,int lType
+ virtual bool Save( const wxGDIImage* pImage
+ ,const wxString& rName
+ ,wxBitmapType lType
) const;
private:
inline virtual bool Load( wxGDIImage* WXUNUSED(pImage)
,const wxString& WXUNUSED(rName)
,WXHANDLE WXUNUSED(hPs)
- ,long WXUNUSED(lFlags)
+ ,wxBitmapType WXUNUSED(lFlags)
,int WXUNUSED(nDesiredWidth)
,int WXUNUSED(nDesiredHeight)
)
wxGDIImageHandler() { m_lType = wxBITMAP_TYPE_INVALID; }
wxGDIImageHandler( const wxString& rName
,const wxString& rExt
- ,long lType
+ ,wxBitmapType lType
)
: m_sName(rName)
, m_sExtension(rExt)
// accessors
void SetName(const wxString& rName) { m_sName = rName; }
void SetExtension(const wxString& rExt) { m_sExtension = rExt; }
- void SetType(long lType) { m_lType = lType; }
+ void SetType(wxBitmapType lType) { m_lType = lType; }
wxString GetName() const { return m_sName; }
wxString GetExtension() const { return m_sExtension; }
- long GetType() const { return m_lType; }
+ wxBitmapType GetType() const { return m_lType; }
// real handler operations: to implement in derived classes
virtual bool Create( wxGDIImage* pImage
,const void* pData
- ,long lFlags
+ ,wxBitmapType lFlags
,int nWidth
,int nHeight
,int nDepth = 1
virtual bool Load( wxGDIImage* pImage
,const wxString& rName
,HPS hPs
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth
,int nDesiredHeight
) = 0;
virtual bool Load( wxGDIImage* pImage
,int nId
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth
,int nDesiredHeight
) = 0;
- virtual bool Save( wxGDIImage* pImage
- ,const wxString& rName
- ,int lType
- ) = 0;
+ virtual bool Save( const wxGDIImage* pImage
+ ,const wxString& rName
+ ,wxBitmapType lType
+ ) const = 0;
protected:
wxString m_sName;
wxString m_sExtension;
- long m_lType;
+ wxBitmapType m_lType;
}; // end of wxGDIImageHandler
// ----------------------------------------------------------------------------
static bool RemoveHandler(const wxString& rName);
static wxGDIImageHandler* FindHandler(const wxString& rName);
- static wxGDIImageHandler* FindHandler(const wxString& rExtension, long lType);
- static wxGDIImageHandler* FindHandler(long lType);
+ static wxGDIImageHandler* FindHandler(const wxString& rExtension, wxBitmapType lType);
+ static wxGDIImageHandler* FindHandler(wxBitmapType lType);
static void InitStandardHandlers();
static void CleanUpHandlers();
wxIcon(char** ppData) { CreateIconFromXpm(wx_const_cast(const char* const*, ppData)); }
#endif
wxIcon( const wxString& rName
- ,long lFlags = wxBITMAP_TYPE_ICO_RESOURCE
+ ,wxBitmapType lFlags = wxBITMAP_TYPE_ICO_RESOURCE
,int nDesiredWidth = -1
,int nDesiredHeight = -1
);
virtual ~wxIcon();
bool LoadFile( const wxString& rName
- ,long lFlags = wxBITMAP_TYPE_ICO_RESOURCE
+ ,wxBitmapType lFlags = wxBITMAP_TYPE_ICO_RESOURCE
,int nDesiredWidth = -1
,int nDesiredHeight = -1
);
wxBitmap::wxBitmap(
const void* pData
-, long lType
+, wxBitmapType lType
, int nWidth
, int nHeight
, int nDepth
wxBitmap::wxBitmap(
int nId
-, long lType
+, wxBitmapType lType
)
{
Init();
LoadFile( nId
- ,(int)lType
+ ,lType
);
SetId(nId);
} // end of wxBitmap::wxBitmap
return Ok();
} // end of wxBitmap::Create
-bool wxBitmap::LoadFile(const wxString& filename, long type)
+bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type)
{
UnRef();
bool wxBitmap::LoadFile(
int nId
-, long lType
+, wxBitmapType lType
)
{
UnRef();
bool wxBitmap::Create(
const void* pData
-, long lType
+, wxBitmapType lType
, int nWidth
, int nHeight
, int nDepth
bool wxBitmap::SaveFile(
const wxString& rFilename
-, int lType
+, wxBitmapType lType
, const wxPalette* pPalette
)
{
bool wxBitmapHandler::Create( wxGDIImage* pImage,
const void* pData,
- wxBitmapType WXUNUSED(lFlags),
+ wxBitmapType lType,
int nWidth,
int nHeight,
int nDepth)
return(pBitmap ? Create( pBitmap
,pData
+ ,lType
,nWidth
,nHeight
,nDepth
}
bool wxBitmapHandler::Save(
- wxGDIImage* pImage
+ const wxGDIImage* pImage
, const wxString& rName
-, int lType
+, wxBitmapType lType
) const
{
wxBitmap* pBitmap = wxDynamicCast( pImage
virtual bool LoadFile( wxBitmap* pBitmap
,const wxString& rName
,HPS hPs
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth
,int nDesiredHeight
);
virtual bool SaveFile( wxBitmap* pBitmap
,const wxString& rName
- ,int lType
+ ,wxBitmapType lType
,const wxPalette* pPalette = NULL
);
private:
inline virtual bool LoadFile( wxBitmap* pBitmap
,int nId
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth
,int nDesiredHeight
)
virtual bool LoadFile( wxBitmap* pBitmap
,int nId
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth
,int nDesiredHeight
);
public:
wxIconHandler( const wxString& rName
,const wxString& rExt
- ,long lType
+ ,wxBitmapType lType
) : wxGDIImageHandler( rName
,rExt
,lType
// creating and saving icons is not supported
virtual bool Create( wxGDIImage* WXUNUSED(pImage)
,const void* WXUNUSED(pData)
- ,long WXUNUSED(lFlags)
+ ,wxBitmapType WXUNUSED(lFlags)
,int WXUNUSED(nWidth)
,int WXUNUSED(nHeight)
,int WXUNUSED(nDepth) = 1
return false;
}
- virtual bool Save( wxGDIImage* WXUNUSED(pImage)
- ,const wxString& WXUNUSED(rName)
- ,int WXUNUSED(nType)
- )
+ virtual bool Save( const wxGDIImage* WXUNUSED(pImage)
+ ,const wxString& WXUNUSED(rName)
+ ,wxBitmapType WXUNUSED(nType)
+ ) const
{
return false;
}
virtual bool Load( wxGDIImage* pImage
,const wxString& rName
,HPS hPs
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth
,int nDesiredHeight
)
virtual bool LoadIcon( wxIcon* pIcon
,const wxString& rName
,HPS hPs
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth = -1
,int nDesiredHeight = -1
) = 0;
private:
inline virtual bool Load( wxGDIImage* WXUNUSED(pImage),
int WXUNUSED(nId),
- long WXUNUSED(lFlags),
+ wxBitmapType WXUNUSED(lFlags),
int WXUNUSED(nDesiredWidth),
int WXUNUSED(nDesiredHeight) )
{
virtual bool LoadIcon( wxIcon * pIcon
,const wxString& rName
,HPS hPs
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth = -1
,int nDesiredHeight = -1
);
virtual bool LoadIcon( wxIcon* pIcon
,const wxString& rName
,HPS hPs
- ,long lFlags
+ ,wxBitmapType lFlags
,int nDesiredWidth = -1
,int nDesiredHeight = -1
);
wxGDIImageHandler* wxGDIImage::FindHandler(
const wxString& rExtension
-, long lType
+, wxBitmapType lType
)
{
wxGDIImageHandlerList::compatibility_iterator pNode = ms_handlers.GetFirst();
}
wxGDIImageHandler* wxGDIImage::FindHandler(
- long lType
+ wxBitmapType lType
)
{
wxGDIImageHandlerList::compatibility_iterator pNode = ms_handlers.GetFirst();
bool wxBMPResourceHandler::LoadFile( wxBitmap* pBitmap,
int nId,
- long WXUNUSED(lFlags),
+ wxBitmapType WXUNUSED(lFlags),
int WXUNUSED(nDesiredWidth),
int WXUNUSED(nDesiredHeight) )
{
bool wxBMPFileHandler::LoadFile( wxBitmap* pBitmap,
const wxString& WXUNUSED(rName),
HPS WXUNUSED(hPs),
- long WXUNUSED(lFlags),
+ wxBitmapType WXUNUSED(lFlags),
int WXUNUSED(nDesiredWidth),
int WXUNUSED(nDesiredHeight) )
{
bool wxBMPFileHandler::SaveFile( wxBitmap* pBitmap,
const wxString& WXUNUSED(rName),
- int WXUNUSED(nType),
+ wxBitmapType WXUNUSED(nType),
const wxPalette* pPal )
{
#if defined(wxUSE_IMAGE_LOADING_IN_OS2) && wxUSE_IMAGE_LOADING_IN_OS2
bool wxICOFileHandler::LoadIcon( wxIcon* pIcon,
const wxString& WXUNUSED(rName),
HPS WXUNUSED(hPs),
- long WXUNUSED(lFlags),
+ wxBitmapType WXUNUSED(lFlags),
int WXUNUSED(nDesiredWidth),
int WXUNUSED(nDesiredHeight) )
{
bool wxICOResourceHandler::LoadIcon( wxIcon* pIcon,
const wxString& rName,
HPS WXUNUSED(hPs),
- long WXUNUSED(lFlags),
+ wxBitmapType WXUNUSED(lFlags),
int WXUNUSED(nDesiredWidth),
int WXUNUSED(nDesiredHeight) )
{
}
wxIcon::wxIcon( const wxString& rIconFile,
- long lFlags,
+ wxBitmapType lFlags,
int nDesiredWidth,
int nDesiredHeight )
:m_bIsXpm(false)
} // end of wxIcon::CopyFromBitmap
bool wxIcon::LoadFile( const wxString& rFilename,
- long lType,
+ wxBitmapType lType,
int nDesiredWidth,
int nDesiredHeight )
{