+class WXDLLEXPORT wxIconRefData : public wxGDIRefData
+{
+public:
+ wxIconRefData() { Init(); }
+ wxIconRefData( WXHICON iconref, int desiredWidth, int desiredHeight );
+ virtual ~wxIconRefData() { Free(); }
+
+ virtual bool IsOk() const { return m_iconRef != NULL; }
+
+ virtual void Free();
+
+ void SetWidth( int width ) { m_width = width; }
+ void SetHeight( int height ) { m_height = height; }
+
+ int GetWidth() const { return m_width; }
+ int GetHeight() const { return m_height; }
+
+ WXHICON GetHICON() const { return (WXHICON) m_iconRef; }
+
+private:
+ void Init();
+
+ IconRef m_iconRef;
+ int m_width;
+ int m_height;
+};
+
+
+wxIconRefData::wxIconRefData( WXHICON icon, int desiredWidth, int desiredHeight )
+{
+ m_iconRef = MAC_WXHICON( icon ) ;
+
+ // Standard sizes
+ SetWidth( desiredWidth == -1 ? 32 : desiredWidth ) ;
+ SetHeight( desiredHeight == -1 ? 32 : desiredHeight ) ;
+}
+
+void wxIconRefData::Init()
+{
+ m_iconRef = NULL ;
+ m_width =
+ m_height = 0;
+}
+
+void wxIconRefData::Free()
+{
+ if ( m_iconRef )
+ {
+ ReleaseIconRef( m_iconRef ) ;
+ m_iconRef = NULL ;
+ }
+}