X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/519cb848a8f4c91c73421bb75314754284e593a4..947ea04d016852aa293291069d5c91ce4c6dde60:/src/mac/carbon/icon.cpp?ds=sidebyside diff --git a/src/mac/carbon/icon.cpp b/src/mac/carbon/icon.cpp index 537165343e..7f666da534 100644 --- a/src/mac/carbon/icon.cpp +++ b/src/mac/carbon/icon.cpp @@ -60,6 +60,14 @@ wxIcon::wxIcon(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(he { } +wxIcon::wxIcon( const char **bits, int width, int height ) +{ +} + +wxIcon::wxIcon( char **bits, int width, int height ) +{ +} + wxIcon::wxIcon(const wxString& icon_file, long flags, int desiredWidth, int desiredHeight) @@ -94,24 +102,32 @@ bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo Str255 theName ; short theId ; OSType theType ; - strcpy( (char*) theName , name ) ; - c2pstr( (char*) theName ) ; + +#if TARGET_CARBON + c2pstrcpy( (StringPtr) theName , name ) ; +#else + strcpy( (char *) theName , name ) ; + c2pstr( (char *) theName ) ; +#endif Handle resHandle = GetNamedResource( 'cicn' , theName ) ; - GetResInfo( resHandle , &theId , &theType , theName ) ; - ReleaseResource( resHandle ) ; - - CIconHandle theIcon = (CIconHandle ) GetCIcon( theId ) ; - if ( theIcon ) + if ( resHandle != 0L ) { - M_ICONHANDLERDATA->m_hIcon = theIcon ; - M_ICONHANDLERDATA->m_width = 32 ; - M_ICONHANDLERDATA->m_height = 32 ; + GetResInfo( resHandle , &theId , &theType , theName ) ; + ReleaseResource( resHandle ) ; - M_ICONHANDLERDATA->m_depth = 8 ; - M_ICONHANDLERDATA->m_ok = true ; - M_ICONHANDLERDATA->m_numColors = 256 ; - return TRUE ; + CIconHandle theIcon = (CIconHandle ) GetCIcon( theId ) ; + if ( theIcon ) + { + M_ICONHANDLERDATA->m_hIcon = theIcon ; + M_ICONHANDLERDATA->m_width = 32 ; + M_ICONHANDLERDATA->m_height = 32 ; + + M_ICONHANDLERDATA->m_depth = 8 ; + M_ICONHANDLERDATA->m_ok = true ; + M_ICONHANDLERDATA->m_numColors = 256 ; + return TRUE ; + } } return FALSE ; -} \ No newline at end of file +}