Ticket #15699: Allow-creating-wxBitmap-from-wxCursor.patch

File Allow-creating-wxBitmap-from-wxCursor.patch, 974 bytes (added by awi, 6 years ago)

Patch allowing assignment wxCursor to wxBitmap.

  • include/wx/gtk/bitmap.h

    a b typedef struct _cairo_surface cairo_surface_t; 
    1515#endif
    1616typedef struct _GdkPixbuf GdkPixbuf;
    1717class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
     18class WXDLLIMPEXP_FWD_CORE wxCursor;
    1819
    1920//-----------------------------------------------------------------------------
    2021// wxMask
    public: 
    8182    wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH);
    8283#endif // wxUSE_IMAGE
    8384    wxBitmap(GdkPixbuf* pixbuf, int depth = 0);
     85    wxBitmap(const wxCursor& cursor);
    8486    virtual ~wxBitmap();
    8587
    8688    bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE;
  • src/gtk/bitmap.cpp

    a b wxBitmap::wxBitmap(GdkPixmap* pixmap) 
    515515}
    516516#endif
    517517
     518wxBitmap::wxBitmap(const wxCursor& cursor)
     519{
     520    GdkPixbuf *pixbuf = gdk_cursor_get_image(cursor.GetCursor());
     521    *this = wxBitmap(pixbuf);
     522}
     523
    518524wxBitmap::~wxBitmap()
    519525{
    520526}