fixed (and slightly cleant up) wxGTK compilation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,6 +26,26 @@
|
||||
|
||||
#include "wx/gtk/private.h"
|
||||
|
||||
#ifndef __WXGTK20__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGdkRegion: creates a new region in ctor and destroys in dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxGdkRegion
|
||||
{
|
||||
public:
|
||||
wxGdkRegion() { m_region = gdk_region_new(); }
|
||||
~wxGdkRegion() { gdk_region_destroy(m_region); }
|
||||
|
||||
operator GdkRegion *() const { return m_region; }
|
||||
|
||||
private:
|
||||
GdkRegion *m_region;
|
||||
};
|
||||
|
||||
#endif // __WXGTK20__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionRefData: private class containing the information about the region
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -44,10 +64,7 @@ public:
|
||||
#ifdef __WXGTK20__
|
||||
m_region = gdk_region_copy(refData.m_region);
|
||||
#else
|
||||
m_region = gdk_region_new();
|
||||
GdkRegion *regCopy = gdk_regions_union(m_region, refData.m_region);
|
||||
gdk_region_destroy(m_region);
|
||||
m_region = regCopy;
|
||||
m_region = gdk_regions_union(wxGdkRegion(), refData.m_region);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -89,16 +106,18 @@ void wxRegion::InitRect(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
|
||||
#ifdef __WXGTK20__
|
||||
M_REGIONDATA->m_region = gdk_region_rectangle( &rect );
|
||||
#else
|
||||
GdkRegion *reg = gdk_region_new();
|
||||
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
|
||||
gdk_region_destroy( reg );
|
||||
M_REGIONDATA->m_region = gdk_region_union_with_rect( wxGdkRegion(), &rect );
|
||||
#endif
|
||||
}
|
||||
|
||||
wxRegion::wxRegion( GdkRegion *region )
|
||||
{
|
||||
m_refData = new wxRegionRefData();
|
||||
#ifdef __WXGTK20__
|
||||
M_REGIONDATA->m_region = gdk_region_copy( region );
|
||||
#else
|
||||
M_REGIONDATA->m_region = gdk_regions_union(wxGdkRegion(), region);
|
||||
#endif
|
||||
}
|
||||
|
||||
wxRegion::wxRegion( size_t n, const wxPoint *points, int fillStyle )
|
||||
@@ -178,9 +197,7 @@ bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||
#ifdef __WXGTK20__
|
||||
M_REGIONDATA->m_region = gdk_region_rectangle( &rect );
|
||||
#else
|
||||
GdkRegion *reg = gdk_region_new();
|
||||
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
|
||||
gdk_region_destroy( reg );
|
||||
M_REGIONDATA->m_region = gdk_region_union_with_rect(wxGdkRegion(), &rect);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@@ -26,6 +26,26 @@
|
||||
|
||||
#include "wx/gtk/private.h"
|
||||
|
||||
#ifndef __WXGTK20__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGdkRegion: creates a new region in ctor and destroys in dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxGdkRegion
|
||||
{
|
||||
public:
|
||||
wxGdkRegion() { m_region = gdk_region_new(); }
|
||||
~wxGdkRegion() { gdk_region_destroy(m_region); }
|
||||
|
||||
operator GdkRegion *() const { return m_region; }
|
||||
|
||||
private:
|
||||
GdkRegion *m_region;
|
||||
};
|
||||
|
||||
#endif // __WXGTK20__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionRefData: private class containing the information about the region
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -44,10 +64,7 @@ public:
|
||||
#ifdef __WXGTK20__
|
||||
m_region = gdk_region_copy(refData.m_region);
|
||||
#else
|
||||
m_region = gdk_region_new();
|
||||
GdkRegion *regCopy = gdk_regions_union(m_region, refData.m_region);
|
||||
gdk_region_destroy(m_region);
|
||||
m_region = regCopy;
|
||||
m_region = gdk_regions_union(wxGdkRegion(), refData.m_region);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -89,16 +106,18 @@ void wxRegion::InitRect(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
|
||||
#ifdef __WXGTK20__
|
||||
M_REGIONDATA->m_region = gdk_region_rectangle( &rect );
|
||||
#else
|
||||
GdkRegion *reg = gdk_region_new();
|
||||
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
|
||||
gdk_region_destroy( reg );
|
||||
M_REGIONDATA->m_region = gdk_region_union_with_rect( wxGdkRegion(), &rect );
|
||||
#endif
|
||||
}
|
||||
|
||||
wxRegion::wxRegion( GdkRegion *region )
|
||||
{
|
||||
m_refData = new wxRegionRefData();
|
||||
#ifdef __WXGTK20__
|
||||
M_REGIONDATA->m_region = gdk_region_copy( region );
|
||||
#else
|
||||
M_REGIONDATA->m_region = gdk_regions_union(wxGdkRegion(), region);
|
||||
#endif
|
||||
}
|
||||
|
||||
wxRegion::wxRegion( size_t n, const wxPoint *points, int fillStyle )
|
||||
@@ -178,9 +197,7 @@ bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||
#ifdef __WXGTK20__
|
||||
M_REGIONDATA->m_region = gdk_region_rectangle( &rect );
|
||||
#else
|
||||
GdkRegion *reg = gdk_region_new();
|
||||
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
|
||||
gdk_region_destroy( reg );
|
||||
M_REGIONDATA->m_region = gdk_region_union_with_rect(wxGdkRegion(), &rect);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user