From: Paul Cornett Date: Sun, 18 Jun 2006 03:37:24 +0000 (+0000) Subject: build fix for older gtk2, second attempt X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4f558e23ff5721fafa7d0a5a8d11150093d7d994 build fix for older gtk2, second attempt git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/colour.h b/include/wx/gtk/colour.h index 81c00fad7d..26f002d077 100644 --- a/include/wx/gtk/colour.h +++ b/include/wx/gtk/colour.h @@ -56,7 +56,13 @@ public: // Implementation part void CalcPixel( GdkColormap *cmap ); int GetPixel() const; +#ifdef __WXGTK24__ const GdkColor *GetColor() const; +#else + // GDK functions from old gtk2 versions take non-const color parameters, + // too many uses to deal with individually + GdkColor *GetColor() const; +#endif protected: virtual bool FromString(const wxChar *str); diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index afb1cdc00e..594b081506 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -154,7 +154,11 @@ int wxColour::GetPixel() const return M_COLDATA->m_color.pixel; } +#ifdef __WXGTK24__ const GdkColor *wxColour::GetColor() const +#else + GdkColor *wxColour::GetColor() const +#endif { wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") ); diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 90d718db89..d02105ec8b 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -144,12 +144,7 @@ wxCursor::wxCursor(const char bits[], int width, int height, m_refData = new wxCursorRefData; M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap( - data, mask, -#if GTK_CHECK_VERSION(2, 6, 0) - fg->GetColor(), bg->GetColor(), -#else - wx_const_cast(GdkColor*, fg->GetColor()), wx_const_cast(GdkColor*, bg->GetColor()), -#endif + data, mask, fg->GetColor(), bg->GetColor(), hotSpotX, hotSpotY ); g_object_unref (data); @@ -300,11 +295,7 @@ wxCursor::wxCursor( const wxImage & image ) ( data, mask, -#if GTK_CHECK_VERSION(2, 6, 0) fg.GetColor(), bg.GetColor(), -#else - wx_const_cast(GdkColor*, fg.GetColor()), wx_const_cast(GdkColor*, bg.GetColor()), -#endif hotSpotX, hotSpotY );