X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f884a0dccd6b642f35c441ac9bfc87a6d5b4d35..b0607dd221a6110cbd2a4a42e379b93e5f2d5334:/include/wx/cocoa/bitmap.h diff --git a/include/wx/cocoa/bitmap.h b/include/wx/cocoa/bitmap.h index 79d0c6279d..94d7eb3140 100644 --- a/include/wx/cocoa/bitmap.h +++ b/include/wx/cocoa/bitmap.h @@ -26,7 +26,7 @@ class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; // ======================================================================== // A mask is a 1-bit alpha bitmap used for drawing bitmaps transparently. -class WXDLLEXPORT wxMask: public wxObject +class WXDLLIMPEXP_CORE wxMask: public wxObject { DECLARE_DYNAMIC_CLASS(wxMask) public: @@ -59,10 +59,12 @@ protected: WX_NSBitmapImageRep m_cocoaNSBitmapImageRep; }; + // ======================================================================== // wxBitmap // ======================================================================== -class WXDLLEXPORT wxBitmap: public wxGDIObject + +class WXDLLIMPEXP_CORE wxBitmap: public wxGDIObject { // ------------------------------------------------------------------------ // initialization @@ -75,7 +77,7 @@ public: // Initialize with XPM data wxBitmap(const char* const* bits); // Load a file or resource - wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); + wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); // Construct from Cocoa's NSImage wxBitmap(NSImage* cocoaNSImage); // Construct from Cocoa's NSBitmapImageRep @@ -83,10 +85,13 @@ public: // Constructor for generalised creation from data wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1); // If depth is omitted, will create a bitmap compatible with the display - wxBitmap(int width, int height, int depth = -1); + wxBitmap(int width, int height, int depth = -1) + { (void)Create(width, height, depth); } + wxBitmap(const wxSize& sz, int depth = -1) + { (void)Create(sz, depth); } // Convert from wxImage: wxBitmap(const wxImage& image, int depth = -1) - { CreateFromImage(image, depth); } + { CreateFromImage(image, depth); } // Convert from wxIcon wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); } @@ -100,11 +105,14 @@ public: // Initialize from wxImage bool CreateFromImage(const wxImage& image, int depth=-1); - virtual bool Create(int width, int height, int depth = -1); + virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); + virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) + { return Create(sz.GetWidth(), sz.GetHeight(), depth); } + bool Create(NSImage* cocoaNSImage); bool Create(NSBitmapImageRep* cocoaNSBitmapImageRep); virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1); - virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); + virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; // copies the contents and mask of the given (colour) icon to the bitmap @@ -135,7 +143,7 @@ public: wxMask *GetMask() const; void SetMask(wxMask *mask) ; - int GetBitmapType() const; + wxBitmapType GetBitmapType() const; // wxCocoa WX_NSBitmapImageRep GetNSBitmapImageRep(); @@ -152,9 +160,5 @@ protected: DECLARE_DYNAMIC_CLASS(wxBitmap) }; -class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase -{ - DECLARE_ABSTRACT_CLASS(wxBitmapHandler) -}; #endif // __WX_COCOA_BITMAP_H__