From 374b5544a99303dbcb9aba3c9a70c597107bab43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 11 Jan 2008 13:42:21 +0000 Subject: [PATCH] * expose the XOR function for BRegions (for now called "ExclusiveInclude") which already existed in the region backend ported from XOrg git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23394 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/Region.h | 2 ++ src/kits/interface/Region.cpp | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/headers/os/interface/Region.h b/headers/os/interface/Region.h index 668c107c0a..37821451c1 100644 --- a/headers/os/interface/Region.h +++ b/headers/os/interface/Region.h @@ -66,6 +66,8 @@ class BRegion { void IntersectWith(const BRegion* region); + void ExclusiveInclude(const BRegion* region); + private: friend class BDirectWindow; friend class BPrivate::ServerLink; diff --git a/src/kits/interface/Region.cpp b/src/kits/interface/Region.cpp index ff996dbc11..cd30c08e33 100644 --- a/src/kits/interface/Region.cpp +++ b/src/kits/interface/Region.cpp @@ -414,7 +414,7 @@ BRegion::Exclude(const BRegion* region) /*! \brief Modifies the region, so that it will contain just the area in common with the given BRegion. - \param region the BRegion to intersect to. + \param region the BRegion to intersect with. */ void BRegion::IntersectWith(const BRegion* region) @@ -429,6 +429,23 @@ BRegion::IntersectWith(const BRegion* region) // #pragma mark - +/*! \brief Modifies the region, so that it will contain just the area + which both regions do not have in common. + \param region the BRegion to exclusively include. +*/ +void +BRegion::ExclusiveInclude(const BRegion* region) +{ + BRegion result; + Support::XXorRegion(this, region, &result); + + _AdoptRegionData(result); +} + + +// #pragma mark - + + /*! \brief Takes over the data of a region and marks that region empty. \param region The region to adopt the data from. */ @@ -501,6 +518,7 @@ BRegion::_SetSize(long newSize) return true; } + clipping_rect BRegion::_Convert(const BRect& rect) const {