X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b6dbb09746f8f5ee0549a2ff39ae0ac4c725898..29f538cea2cfcbb272ca724f8dbf778207530033:/include/wx/motif/bitmap.h diff --git a/include/wx/motif/bitmap.h b/include/wx/motif/bitmap.h index 104ec5beb3..644039ef0a 100644 --- a/include/wx/motif/bitmap.h +++ b/include/wx/motif/bitmap.h @@ -54,13 +54,11 @@ public: bool Create(const wxBitmap& bitmap, int paletteIndex); bool Create(const wxBitmap& bitmap); -/* TODO: platform-specific data access - // Implementation - inline WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; } - inline void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; } + inline WXPixmap GetPixmap() const { return m_pixmap; } + inline void SetPixmap(WXPixmap pixmap) { m_pixmap = pixmap; } + protected: - WXHBITMAP m_maskBitmap; -*/ + WXPixmap m_pixmap; }; class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData @@ -73,16 +71,30 @@ public: ~wxBitmapRefData(); public: - int m_width; - int m_height; - int m_depth; - bool m_ok; - int m_numColors; - wxPalette m_bitmapPalette; - int m_quality; - -/* WXHBITMAP m_hBitmap; TODO: platform-specific handle */ - wxMask * m_bitmapMask; // Optional mask + int m_width; + int m_height; + int m_depth; + bool m_ok; + int m_numColors; + wxPalette m_bitmapPalette; + int m_quality; + + wxMask * m_bitmapMask; // Optional mask + + // Motif implementation +public: + WXPixmap m_pixmap; + WXDisplay* m_display; + bool m_freePixmap; + unsigned long* m_freeColors; + long m_freeColorsCount; + + // These 5 variables are for wxControl + WXPixmap m_insensPixmap ; + WXPixmap m_labelPixmap ; + WXPixmap m_armPixmap ; + WXImage* m_image ; + WXImage* m_insensImage ; }; #define M_BITMAPDATA ((wxBitmapRefData *)m_refData) @@ -124,19 +136,15 @@ public: // Copy constructors inline wxBitmap(const wxBitmap& bitmap) { Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); } - inline wxBitmap(const wxBitmap* bitmap) { if (bitmap) Ref(*bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); } - // Initialize with raw data. + // Initialize with raw XBM data wxBitmap(const char bits[], int width, int height, int depth = 1); -/* TODO: maybe implement XPM reading // Initialize with XPM data - wxBitmap(const char **data); -*/ + wxBitmap(char **data, wxControl* control = NULL); // Load a file or resource - // TODO: make default type whatever's appropriate for the platform. - wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE); + wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XPM); // Constructor for generalised creation from data wxBitmap(void *data, long type, int width, int height, int depth = 1); @@ -147,7 +155,7 @@ public: virtual bool Create(int width, int height, int depth = -1); virtual bool Create(void *data, long type, int width, int height, int depth = 1); - virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE); + virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM); virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); inline bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); } @@ -182,17 +190,22 @@ public: static void InitStandardHandlers(); static void CleanUpHandlers(); -protected: - static wxList sm_handlers; -/* - // TODO: Implementation + // Motif implementation public: - void SetHBITMAP(WXHBITMAP bmp); - inline WXHBITMAP GetHBITMAP() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); } - bool FreeResource(bool force = FALSE); -*/ + inline WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; } + inline WXDisplay* GetPixmap() const { return M_BITMAPDATA->m_pixmap; } + virtual WXPixmap GetLabelPixmap(WXWidget w) ; + virtual WXPixmap GetArmPixmap(WXWidget w) ; + virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ; +protected: + static wxList sm_handlers; }; + +// Creates a bitmap with transparent areas drawn in +// the given colour. +wxBitmap wxCreateMaskedBitmap(wxBitmap& bitmap, wxColour& colour); + #endif // _WX_BITMAP_H_