X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3d1a4878f36ba4b5f66c2ccfd2cb27a9dc528b6f..cc44c7102fbab987280ad2dca7eb1e85ac70a9f6:/src/mac/carbon/cursor.cpp diff --git a/src/mac/carbon/cursor.cpp b/src/mac/carbon/cursor.cpp index eace8c0b5d..8c6d751197 100644 --- a/src/mac/carbon/cursor.cpp +++ b/src/mac/carbon/cursor.cpp @@ -27,6 +27,27 @@ IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap) #endif +class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData +{ + DECLARE_NO_COPY_CLASS(wxCursorRefData) + + friend class WXDLLEXPORT wxBitmap; + friend class WXDLLEXPORT wxCursor; +public: + wxCursorRefData(); + ~wxCursorRefData(); + +protected: + WXHCURSOR m_hCursor; + bool m_disposeHandle; + bool m_releaseHandle; + bool m_isColorCursor ; + long m_themeCursor ; +}; + +#define M_CURSORDATA ((wxCursorRefData *)m_refData) +#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) + const short kwxCursorBullseye = 0 ; const short kwxCursorBlank = 1 ; const short kwxCursorPencil = 2 ; @@ -181,8 +202,8 @@ CursHandle wxGetStockCursor( int number ) wxCursorRefData::wxCursorRefData() { - m_width = 16; - m_height = 16; + SetWidth( 16 ); + SetHeight( 16 ); m_hCursor = NULL ; m_disposeHandle = false ; m_releaseHandle = false ; @@ -242,6 +263,16 @@ bool wxCursor::CreateFromXpm(const char **bits) return TRUE; } +WXHCURSOR wxCursor::GetHCURSOR() const +{ + return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); +} + +bool wxCursor::Ok() const +{ + return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; +} + short GetCTabIndex( CTabHandle colors , RGBColor *col ) { short retval = 0 ; @@ -318,7 +349,7 @@ void wxCursor::CreateFromImage(const wxImage & image) (**ch).crsrHotSpot.h = hotSpotX ; (**ch).crsrHotSpot.v = hotSpotY ; - (**ch).crsrXTable = NULL ; + (**ch).crsrXTable = 0 ; (**ch).crsrID = GetCTSeed() ; memset( (**ch).crsr1Data , 0 , sizeof( Bits16 ) ) ;