projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exclude contrib from build for as long as there is no makefile.vc there
[wxWidgets.git]
/
src
/
gtk1
/
region.cpp
diff --git
a/src/gtk1/region.cpp
b/src/gtk1/region.cpp
index f0eadcdc005f2881db513439c4206e92867fc055..ea44a6498fbecb726f296b25f8ac5a6631fb5bf9 100644
(file)
--- a/
src/gtk1/region.cpp
+++ b/
src/gtk1/region.cpp
@@
-49,7
+49,7
@@
private:
// wxRegionRefData: private class containing the information about the region
// ----------------------------------------------------------------------------
// wxRegionRefData: private class containing the information about the region
// ----------------------------------------------------------------------------
-class wxRegionRefData : public wx
Object
RefData
+class wxRegionRefData : public wx
GDI
RefData
{
public:
wxRegionRefData()
{
public:
wxRegionRefData()
@@
-58,12
+58,12
@@
public:
}
wxRegionRefData(const wxRegionRefData& refData)
}
wxRegionRefData(const wxRegionRefData& refData)
- : wx
Object
RefData()
+ : wx
GDI
RefData()
{
m_region = gdk_regions_union(wxGdkRegion(), refData.m_region);
}
{
m_region = gdk_regions_union(wxGdkRegion(), refData.m_region);
}
- ~wxRegionRefData()
+
virtual
~wxRegionRefData()
{
if (m_region)
gdk_region_destroy( m_region );
{
if (m_region)
gdk_region_destroy( m_region );
@@
-136,12
+136,12
@@
wxRegion::~wxRegion()
// m_refData unrefed in ~wxObject
}
// m_refData unrefed in ~wxObject
}
-wx
ObjectRefData *wxRegion::Create
RefData() const
+wx
GDIRefData *wxRegion::CreateGDI
RefData() const
{
return new wxRegionRefData;
}
{
return new wxRegionRefData;
}
-wx
ObjectRefData *wxRegion::CloneRefData(const wxObject
RefData *data) const
+wx
GDIRefData *wxRegion::CloneGDIRefData(const wxGDI
RefData *data) const
{
return new wxRegionRefData(*(wxRegionRefData *)data);
}
{
return new wxRegionRefData(*(wxRegionRefData *)data);
}
@@
-150,13
+150,8
@@
wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
// wxRegion comparison
// ----------------------------------------------------------------------------
// wxRegion comparison
// ----------------------------------------------------------------------------
-bool wxRegion::
operator==( const wxRegion& region
) const
+bool wxRegion::
DoIsEqual(const wxRegion& region
) const
{
{
- if (m_refData == region.m_refData) return TRUE;
-
- if (!m_refData || !region.m_refData) return FALSE;
-
- // compare the regions themselves, not the pointers to ref data!
return gdk_region_equal(M_REGIONDATA->m_region,
M_REGIONDATA_OF(region)->m_region);
}
return gdk_region_equal(M_REGIONDATA->m_region,
M_REGIONDATA_OF(region)->m_region);
}
@@
-170,27
+165,27
@@
void wxRegion::Clear()
UnRef();
}
UnRef();
}
-bool wxRegion::
Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height
)
+bool wxRegion::
DoUnionWithRect(const wxRect& r
)
{
// workaround for a strange GTK/X11 bug: taking union with an empty
// rectangle results in an empty region which is definitely not what we
// want
{
// workaround for a strange GTK/X11 bug: taking union with an empty
// rectangle results in an empty region which is definitely not what we
// want
- if (
!width || !height
)
+ if (
r.IsEmpty()
)
return TRUE;
if ( !m_refData )
{
return TRUE;
if ( !m_refData )
{
- InitRect(
x, y, width,
height);
+ InitRect(
r.x, r.y, r.width, r.
height);
}
else
{
AllocExclusive();
GdkRectangle rect;
}
else
{
AllocExclusive();
GdkRectangle rect;
- rect.x = x;
- rect.y = y;
- rect.width = width;
- rect.height = height;
+ rect.x =
r.
x;
+ rect.y =
r.
y;
+ rect.width =
r.
width;
+ rect.height =
r.
height;
GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
gdk_region_destroy( M_REGIONDATA->m_region );
GdkRegion *reg = gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
gdk_region_destroy( M_REGIONDATA->m_region );
@@
-200,12
+195,7
@@
bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
return TRUE;
}
return TRUE;
}
-bool wxRegion::Union( const wxRect& rect )
-{
- return Union( rect.x, rect.y, rect.width, rect.height );
-}
-
-bool wxRegion::Union( const wxRegion& region )
+bool wxRegion::DoUnionWithRegion( const wxRegion& region )
{
if (region.IsNull())
return FALSE;
{
if (region.IsNull())
return FALSE;
@@
-227,24
+217,9
@@
bool wxRegion::Union( const wxRegion& region )
return TRUE;
}
return TRUE;
}
-bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
-{
- wxRegion reg( x, y, width, height );
-
- return Intersect( reg );
-}
-
-bool wxRegion::Intersect( const wxRect& rect )
+bool wxRegion::DoIntersect( const wxRegion& region )
{
{
- wxRegion reg( rect );
-
- return Intersect( reg );
-}
-
-bool wxRegion::Intersect( const wxRegion& region )
-{
- if (region.IsNull())
- return FALSE;
+ wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
if (!m_refData)
{
if (!m_refData)
{
@@
-261,22
+236,9
@@
bool wxRegion::Intersect( const wxRegion& region )
return TRUE;
}
return TRUE;
}
-bool wxRegion::Subtract( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
-{
- wxRegion reg( x, y, width, height );
- return Subtract( reg );
-}
-
-bool wxRegion::Subtract( const wxRect& rect )
+bool wxRegion::DoSubtract( const wxRegion& region )
{
{
- wxRegion reg( rect );
- return Subtract( reg );
-}
-
-bool wxRegion::Subtract( const wxRegion& region )
-{
- if (region.IsNull())
- return FALSE;
+ wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
if (!m_refData)
{
if (!m_refData)
{
@@
-293,22
+255,9
@@
bool wxRegion::Subtract( const wxRegion& region )
return TRUE;
}
return TRUE;
}
-bool wxRegion::
Xor( wxCoord x, wxCoord y, wxCoord width, wxCoord height
)
+bool wxRegion::
DoXor( const wxRegion& region
)
{
{
- wxRegion reg( x, y, width, height );
- return Xor( reg );
-}
-
-bool wxRegion::Xor( const wxRect& rect )
-{
- wxRegion reg( rect );
- return Xor( reg );
-}
-
-bool wxRegion::Xor( const wxRegion& region )
-{
- if (region.IsNull())
- return FALSE;
+ wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
if (!m_refData)
{
if (!m_refData)
{
@@
-324,7
+273,7
@@
bool wxRegion::Xor( const wxRegion& region )
return TRUE;
}
return TRUE;
}
-bool wxRegion::Offset( wxCoord x, wxCoord y )
+bool wxRegion::
Do
Offset( wxCoord x, wxCoord y )
{
if (!m_refData)
return FALSE;
{
if (!m_refData)
return FALSE;
@@
-340,7
+289,7
@@
bool wxRegion::Offset( wxCoord x, wxCoord y )
// wxRegion tests
// ----------------------------------------------------------------------------
// wxRegion tests
// ----------------------------------------------------------------------------
-
void wxRegion::
GetBox( wxCoord &x, wxCoord &y, wxCoord &w, wxCoord &h ) const
+
bool wxRegion::Do
GetBox( wxCoord &x, wxCoord &y, wxCoord &w, wxCoord &h ) const
{
if ( m_refData )
{
{
if ( m_refData )
{
@@
-350,6
+299,8
@@
void wxRegion::GetBox( wxCoord &x, wxCoord &y, wxCoord &w, wxCoord &h ) const
y = rect.y;
w = rect.width;
h = rect.height;
y = rect.y;
w = rect.width;
h = rect.height;
+
+ return true;
}
else
{
}
else
{
@@
-357,17
+308,12
@@
void wxRegion::GetBox( wxCoord &x, wxCoord &y, wxCoord &w, wxCoord &h ) const
y = 0;
w = -1;
h = -1;
y = 0;
w = -1;
h = -1;
- }
-}
-wxRect wxRegion::GetBox() const
-{
- wxCoord x, y, w, h;
- GetBox( x, y, w, h );
- return wxRect( x, y, w, h );
+ return false;
+ }
}
}
-bool wxRegion::Empty() const
+bool wxRegion::
Is
Empty() const
{
if (!m_refData)
return TRUE;
{
if (!m_refData)
return TRUE;
@@
-375,7
+321,7
@@
bool wxRegion::Empty() const
return gdk_region_empty( M_REGIONDATA->m_region );
}
return gdk_region_empty( M_REGIONDATA->m_region );
}
-wxRegionContain wxRegion::
Contains
( wxCoord x, wxCoord y ) const
+wxRegionContain wxRegion::
DoContainsPoint
( wxCoord x, wxCoord y ) const
{
if (!m_refData)
return wxOutRegion;
{
if (!m_refData)
return wxOutRegion;
@@
-386,16
+332,16
@@
wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y ) const
return wxOutRegion;
}
return wxOutRegion;
}
-wxRegionContain wxRegion::
Contains( wxCoord x, wxCoord y, wxCoord w, wxCoord h
) const
+wxRegionContain wxRegion::
DoContainsRect(const wxRect& r
) const
{
if (!m_refData)
return wxOutRegion;
GdkRectangle rect;
{
if (!m_refData)
return wxOutRegion;
GdkRectangle rect;
- rect.x = x;
- rect.y = y;
- rect.width =
w
;
- rect.height =
h
;
+ rect.x =
r.
x;
+ rect.y =
r.
y;
+ rect.width =
r.width
;
+ rect.height =
r.height
;
GdkOverlapType res = gdk_region_rect_in( M_REGIONDATA->m_region, &rect );
switch (res)
{
GdkOverlapType res = gdk_region_rect_in( M_REGIONDATA->m_region, &rect );
switch (res)
{
@@
-406,16
+352,6
@@
wxRegionContain wxRegion::Contains( wxCoord x, wxCoord y, wxCoord w, wxCoord h )
return wxOutRegion;
}
return wxOutRegion;
}
-wxRegionContain wxRegion::Contains(const wxPoint& pt) const
-{
- return Contains( pt.x, pt.y );
-}
-
-wxRegionContain wxRegion::Contains(const wxRect& rect) const
-{
- return Contains( rect.x, rect.y, rect.width, rect.height );
-}
-
GdkRegion *wxRegion::GetRegion() const
{
if (!m_refData)
GdkRegion *wxRegion::GetRegion() const
{
if (!m_refData)
@@
-446,7
+382,7
@@
struct _XRegion {
};
};
-class wxRIRefData
: public wxObject
RefData
+class wxRIRefData
: public wxGDI
RefData
{
public:
wxRIRefData() { Init(); }
{
public:
wxRIRefData() { Init(); }