- virtual ~wxBitmapRefData();
-
- void Free();
- bool Ok() const { return IsOk(); }
- bool IsOk() const { return m_ok; }
- void SetOk( bool isOk) { m_ok = isOk; }
-
- void SetWidth( int width ) { m_width = width; }
- void SetHeight( int height ) { m_height = height; }
- void SetDepth( int depth ) { m_depth = depth; }
-
- int GetWidth() const { return m_width; }
- int GetHeight() const { return m_height; }
- int GetDepth() const { return m_depth; }
-
- void *GetRawAccess() const;
- void *BeginRawAccess();
- void EndRawAccess();
-
- bool HasAlpha() const { return m_hasAlpha; }
- void UseAlpha( bool useAlpha );
-
-public:
-#if wxUSE_PALETTE
- wxPalette m_bitmapPalette;
-#endif // wxUSE_PALETTE
-
- wxMask * m_bitmapMask; // Optional mask
- CGImageRef CGImageCreate() const;
-
- // returns true if the bitmap has a size that
- // can be natively transferred into a true icon
- // if no is returned GetIconRef will still produce
- // an icon but it will be generated via a PICT and
- // rescaled to 16 x 16
- bool HasNativeSize();
-
- // caller should increase ref count if needed longer
- // than the bitmap exists
- IconRef GetIconRef();
-
- // returns a Pict from the bitmap content
- PicHandle GetPictHandle();
-
- CGContextRef GetBitmapContext() const;
-
- int GetBytesPerRow() const { return m_bytesPerRow; }
-private :
- bool Create(int width , int height , int depth);
- void Init();
-
- int m_width;
- int m_height;
- int m_bytesPerRow;
- int m_depth;
- bool m_hasAlpha;
- wxMemoryBuffer m_memBuf;
- int m_rawAccessCount;
- bool m_ok;
- mutable CGImageRef m_cgImageRef;
-
- IconRef m_iconRef;
- PicHandle m_pictHandle;
-
- CGContextRef m_hBitmap;
-};
-
-class WXDLLEXPORT wxIconRefData : public wxGDIRefData
-{
-public:
- wxIconRefData();
- wxIconRefData( WXHICON );
- virtual ~wxIconRefData() { Free(); }
-
- void Init();
- 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 :
- IconRef m_iconRef;
- int m_width;
- int m_height;
-};