X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b7cacb43db1e69b87b257a67912b4d52995b070a..28dd9a9d035b5435897d626d1b57b4308daa0371:/include/wx/os2/gdiimage.h diff --git a/include/wx/os2/gdiimage.h b/include/wx/os2/gdiimage.h index b2f68d5ff0..98422387cd 100644 --- a/include/wx/os2/gdiimage.h +++ b/include/wx/os2/gdiimage.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: include/wx/os2/gdiimage.h +// Name: wx/os2/gdiimage.h // Purpose: wxGDIImage class: base class for wxBitmap, wxIcon, wxCursor // under OS/2 // Author: David Webster (adapted from msw version by Vadim Zeitlin) @@ -20,9 +20,9 @@ #include "wx/gdicmn.h" // wxBITMAP_TYPE_INVALID #include "wx/list.h" -class WXDLLEXPORT wxGDIImageRefData; -class WXDLLEXPORT wxGDIImageHandler; -class WXDLLEXPORT wxGDIImage; +class WXDLLIMPEXP_FWD_CORE wxGDIImageRefData; +class WXDLLIMPEXP_FWD_CORE wxGDIImageHandler; +class WXDLLIMPEXP_FWD_CORE wxGDIImage; WX_DECLARE_EXPORTED_LIST(wxGDIImageHandler, wxGDIImageHandlerList); @@ -41,11 +41,11 @@ public: } // accessors - bool IsOk() const + virtual bool IsOk() const { if (m_hHandle == 0) - return FALSE; - return TRUE; + return false; + return true; } void SetSize( int nW @@ -74,7 +74,7 @@ public: WXHCURSOR m_hCursor; }; - UINT m_uId; + unsigned int m_uId; }; // ---------------------------------------------------------------------------- @@ -107,7 +107,7 @@ public: // real handler operations: to implement in derived classes virtual bool Create( wxGDIImage* pImage - ,void* pData + ,const void* pData ,long lFlags ,int nWidth ,int nHeight @@ -187,9 +187,6 @@ public: pData->m_hHandle = hHandle; } - bool Ok() const { return IsOk(); } - bool IsOk() const { return GetHandle() != 0; } - int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_nWidth; } int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_nHeight; } int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_nDepth; } @@ -207,7 +204,7 @@ public: } void SetSize(const wxSize& rSize) { SetSize(rSize.x, rSize.y); } - UINT GetId(void) const + unsigned int GetId(void) const { wxGDIImageRefData* pData; @@ -217,7 +214,7 @@ public: else return pData->m_uId; } // end of WxWinGdi_CGDIImage::GetId - void SetId(UINT uId) + void SetId(unsigned int uId) { wxGDIImageRefData* pData; @@ -226,12 +223,22 @@ public: pData->m_uId = uId; } // forward some of base class virtuals to wxGDIImageRefData - bool FreeResource(bool bForce = FALSE); - virtual WXHANDLE GetResourceHandle(); + bool FreeResource(bool bForce = false); + virtual WXHANDLE GetResourceHandle() const; protected: // create the data for the derived class here virtual wxGDIImageRefData* CreateData() const = 0; + virtual wxGDIRefData *CreateGDIRefData() const { return CreateData(); } + + // we can't [efficiently] clone objects of this class + virtual wxGDIRefData * + CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const + { + wxFAIL_MSG( _T("must be implemented if used") ); + + return NULL; + } static wxGDIImageHandlerList ms_handlers; };