build fix for older gtk2, second attempt

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2006-06-18 03:37:24 +00:00
parent 086b047624
commit 4f558e23ff
3 changed files with 11 additions and 10 deletions

View File

@@ -56,7 +56,13 @@ public:
// Implementation part // Implementation part
void CalcPixel( GdkColormap *cmap ); void CalcPixel( GdkColormap *cmap );
int GetPixel() const; int GetPixel() const;
#ifdef __WXGTK24__
const GdkColor *GetColor() const; 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: protected:
virtual bool FromString(const wxChar *str); virtual bool FromString(const wxChar *str);

View File

@@ -154,7 +154,11 @@ int wxColour::GetPixel() const
return M_COLDATA->m_color.pixel; return M_COLDATA->m_color.pixel;
} }
#ifdef __WXGTK24__
const GdkColor *wxColour::GetColor() const const GdkColor *wxColour::GetColor() const
#else
GdkColor *wxColour::GetColor() const
#endif
{ {
wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") ); wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") );

View File

@@ -144,12 +144,7 @@ wxCursor::wxCursor(const char bits[], int width, int height,
m_refData = new wxCursorRefData; m_refData = new wxCursorRefData;
M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap( M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap(
data, mask, data, mask, fg->GetColor(), bg->GetColor(),
#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 ); hotSpotX, hotSpotY );
g_object_unref (data); g_object_unref (data);
@@ -300,11 +295,7 @@ wxCursor::wxCursor( const wxImage & image )
( (
data, data,
mask, mask,
#if GTK_CHECK_VERSION(2, 6, 0)
fg.GetColor(), bg.GetColor(), fg.GetColor(), bg.GetColor(),
#else
wx_const_cast(GdkColor*, fg.GetColor()), wx_const_cast(GdkColor*, bg.GetColor()),
#endif
hotSpotX, hotSpotY hotSpotX, hotSpotY
); );