From: Stefan Csomor Date: Fri, 23 Nov 2007 19:18:38 +0000 (+0000) Subject: mac cleanup X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e06b0afba5b1acf36241d33982d5d88cccefa2e8?ds=inline mac cleanup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/mac/carbon/apptbase.h b/include/wx/mac/carbon/apptbase.h index 8d3e444e6d..d053f94d93 100644 --- a/include/wx/mac/carbon/apptbase.h +++ b/include/wx/mac/carbon/apptbase.h @@ -9,31 +9,4 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#ifndef _WX_MAC_APPTBASE_H_ -#define _WX_MAC_APPTBASE_H_ - -// ---------------------------------------------------------------------------- -// wxAppTraits: the Mac version adds extra hooks needed by Mac code -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAppTraits : public wxAppTraitsBase -{ -public: - // wxExecute() support methods - // --------------------------- - - // TODO - - // wxThread helpers - // ---------------- - - - // TODO - - // other miscellaneous helpers - // --------------------------- - -}; - -#endif // _WX_MAC_APPTBASE_H_ - +// TODO REMOVE \ No newline at end of file diff --git a/include/wx/mac/carbon/bitmap.h b/include/wx/mac/carbon/bitmap.h index b14f3436ea..588cf8285b 100644 --- a/include/wx/mac/carbon/bitmap.h +++ b/include/wx/mac/carbon/bitmap.h @@ -167,8 +167,12 @@ public: WXHBITMAP GetHBITMAP( WXHBITMAP * mask = NULL ) const; // returns a CGImageRef which must released after usage with CGImageRelease - WXCGIMAGEREF CGImageCreate() const ; + CGImageRef CreateCGImage() const ; + // returns a IconRef which must be retained before and released after usage + IconRef GetIconRef() const; + // returns a IconRef which must be released after usage + IconRef CreateIconRef() const; // get read only access to the underlying buffer void *GetRawAccess() const ; // brackets to the underlying OS structure for read/write access diff --git a/include/wx/mac/carbon/cursor.h b/include/wx/mac/carbon/cursor.h index 0cc9a6800a..7cbe319bc6 100644 --- a/include/wx/mac/carbon/cursor.h +++ b/include/wx/mac/carbon/cursor.h @@ -15,7 +15,7 @@ #include "wx/bitmap.h" // Cursor -class WXDLLEXPORT wxCursor: public wxBitmap +class WXDLLEXPORT wxCursor: public wxGDIObject { DECLARE_DYNAMIC_CLASS(wxCursor) diff --git a/include/wx/mac/carbon/private.h b/include/wx/mac/carbon/private.h index ad010e8b0b..aa78392df7 100644 --- a/include/wx/mac/carbon/private.h +++ b/include/wx/mac/carbon/private.h @@ -1085,105 +1085,6 @@ CGColorSpaceRef wxMacGetGenericRGBColorSpace(void); void wxMacMemoryBufferReleaseProc(void *info, const void *data, size_t size); -class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData -{ - friend class WXDLLIMPEXP_FWD_CORE wxIcon; - friend class WXDLLIMPEXP_FWD_CORE wxCursor; -public: - wxBitmapRefData(int width , int height , int depth); - wxBitmapRefData(); - wxBitmapRefData(const wxBitmapRefData &tocopy); - - 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; -}; - // toplevel.cpp class wxMacDeferredWindowDeleter : public wxObject