+ return true ;
+}
+
+void wxIcon::CopyFromBitmap( const wxBitmap& bmp )
+{
+ UnRef() ;
+
+ // as the bitmap owns that ref, we have to acquire it as well
+ IconRef iconRef = bmp.GetBitmapData()->GetIconRef() ;
+ AcquireIconRef( iconRef ) ;
+
+ m_refData = new wxIconRefData( (WXHICON) iconRef ) ;
+ M_ICONDATA->SetWidth( bmp.GetWidth() ) ;
+ M_ICONDATA->SetHeight( bmp.GetHeight() ) ;
+}
+
+wxIconRefData::wxIconRefData( WXHICON icon )
+{
+ m_iconRef = MAC_WXHICON( icon ) ;
+
+ // Standard sizes
+ SetWidth( 32 ) ;
+ SetHeight( 32 ) ;
+}
+
+void wxIconRefData::Init()
+{
+ m_iconRef = NULL ;
+}
+
+void wxIconRefData::Free()
+{
+ if ( m_iconRef )
+ {
+ ReleaseIconRef( m_iconRef ) ;
+ m_iconRef = NULL ;
+ }
+}
+
+IMPLEMENT_DYNAMIC_CLASS(wxICONResourceHandler, wxBitmapHandler)
+
+bool wxICONResourceHandler::LoadFile(
+ wxBitmap *bitmap, const wxString& name, long flags,
+ int desiredWidth, int desiredHeight )
+{
+ wxIcon icon ;
+ icon.LoadFile( name , wxBITMAP_TYPE_ICON_RESOURCE , desiredWidth , desiredHeight ) ;
+ bitmap->CopyFromIcon( icon ) ;
+
+ return bitmap->Ok() ;