X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/489468feaa08b8f504735eecca522fb8d0f825d2..bd235295fb3b35fdb29326084b87893cf5432eb5:/src/osx/carbon/icon.cpp?ds=sidebyside diff --git a/src/osx/carbon/icon.cpp b/src/osx/carbon/icon.cpp index c90a0b37c7..37c815e24d 100644 --- a/src/osx/carbon/icon.cpp +++ b/src/osx/carbon/icon.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/icon.cpp +// Name: src/osx/carbon/icon.cpp // Purpose: wxIcon class // Author: Stefan Csomor // Modified by: @@ -17,7 +17,7 @@ #include "wx/image.h" #endif -#include "wx/mac/private.h" +#include "wx/osx/private.h" IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxGDIObject) @@ -53,7 +53,7 @@ private: wxIconRefData::wxIconRefData( WXHICON icon, int desiredWidth, int desiredHeight ) { - m_iconRef = MAC_WXHICON( icon ) ; + m_iconRef = (IconRef)( icon ) ; // Standard sizes SetWidth( desiredWidth == -1 ? 32 : desiredWidth ) ; @@ -97,10 +97,10 @@ wxIcon::wxIcon(const char* const* bits) } wxIcon::wxIcon( - const wxString& icon_file, int flags, + const wxString& icon_file, wxBitmapType flags, int desiredWidth, int desiredHeight ) { - LoadFile( icon_file, (wxBitmapType) flags, desiredWidth, desiredHeight ); + LoadFile( icon_file, flags, desiredWidth, desiredHeight ); } wxIcon::wxIcon(WXHICON icon, const wxSize& size) @@ -124,7 +124,7 @@ wxGDIRefData *wxIcon::CreateGDIRefData() const wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxIconRefData(*wx_static_cast(const wxIconRefData *, data)); + return new wxIconRefData(*static_cast(data)); } WXHICON wxIcon::GetHICON() const @@ -203,6 +203,50 @@ bool wxIcon::LoadFile( { theId = kGenericDocumentIcon ; } + else if ( filename == wxT("wxICON_EXECUTABLE_FILE") ) + { + theId = kGenericApplicationIcon ; + } + else if ( filename == wxT("wxICON_CDROM") ) + { + theId = kGenericCDROMIcon ; + } + else if ( filename == wxT("wxICON_FLOPPY") ) + { + theId = kGenericFloppyIcon ; + } + else if ( filename == wxT("wxICON_HARDDISK") ) + { + theId = kGenericHardDiskIcon ; + } + else if ( filename == wxT("wxICON_REMOVABLE") ) + { + theId = kGenericRemovableMediaIcon ; + } + else if ( filename == wxT("wxICON_DELETE") ) + { + theId = kToolbarDeleteIcon ; + } + else if ( filename == wxT("wxICON_GO_BACK") ) + { + theId = kBackwardArrowIcon ; + } + else if ( filename == wxT("wxICON_GO_FORWARD") ) + { + theId = kForwardArrowIcon ; + } + else if ( filename == wxT("wxICON_GO_HOME") ) + { + theId = kToolbarHomeIcon ; + } + else if ( filename == wxT("wxICON_HELP_SETTINGS") ) + { + theId = kGenericFontIcon ; + } + else if ( filename == wxT("wxICON_HELP_PAGE") ) + { + theId = kGenericDocumentIcon ; + } else { IconRef iconRef = NULL ; @@ -290,7 +334,7 @@ bool wxIcon::LoadFile( #endif } } - return true ; + return false; } void wxIcon::CopyFromBitmap( const wxBitmap& bmp ) @@ -305,13 +349,15 @@ void wxIcon::CopyFromBitmap( const wxBitmap& bmp ) IMPLEMENT_DYNAMIC_CLASS(wxICONResourceHandler, wxBitmapHandler) bool wxICONResourceHandler::LoadFile( - wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags), + wxBitmap *bitmap, const wxString& name, wxBitmapType WXUNUSED(flags), int desiredWidth, int desiredHeight ) { wxIcon icon ; - icon.LoadFile( name , wxBITMAP_TYPE_ICON_RESOURCE , desiredWidth , desiredHeight ) ; - bitmap->CopyFromIcon( icon ) ; - - return bitmap->Ok() ; + if ( icon.LoadFile( name , wxBITMAP_TYPE_ICON_RESOURCE , desiredWidth , desiredHeight ) ) + { + bitmap->CopyFromIcon( icon ) ; + return bitmap->Ok() ; + } + return false; }