diff options
author | Mathias Agopian <mathias@google.com> | 2009-05-27 17:01:58 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-05-27 17:01:58 -0700 |
commit | bed9dd128dfbdc7d9dbca005078536dadc0b9359 (patch) | |
tree | eabfee52c02276a81d270595d4d436e35a5da7fa /include/ui/Region.h | |
parent | 4b8160fdfd3281d1d66c0cae9bb9c647b4333491 (diff) | |
download | frameworks_native-bed9dd128dfbdc7d9dbca005078536dadc0b9359.zip frameworks_native-bed9dd128dfbdc7d9dbca005078536dadc0b9359.tar.gz frameworks_native-bed9dd128dfbdc7d9dbca005078536dadc0b9359.tar.bz2 |
make sure the Region code disallows constructs like "(a+b)=c;", which is somewhat meaningless.
Diffstat (limited to 'include/ui/Region.h')
-rw-r--r-- | include/ui/Region.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/include/ui/Region.h b/include/ui/Region.h index e36dcb4..4299ea5 100644 --- a/include/ui/Region.h +++ b/include/ui/Region.h @@ -65,14 +65,14 @@ public: Region& subtractSelf(const Region& rhs); // boolean operators - Region merge(const Rect& rhs) const; - Region intersect(const Rect& rhs) const; - Region subtract(const Rect& rhs) const; + const Region merge(const Rect& rhs) const; + const Region intersect(const Rect& rhs) const; + const Region subtract(const Rect& rhs) const; // boolean operators - Region merge(const Region& rhs) const; - Region intersect(const Region& rhs) const; - Region subtract(const Region& rhs) const; + const Region merge(const Region& rhs) const; + const Region intersect(const Region& rhs) const; + const Region subtract(const Region& rhs) const; // these translate rhs first Region& translateSelf(int dx, int dy); @@ -81,16 +81,16 @@ public: Region& subtractSelf(const Region& rhs, int dx, int dy); // these translate rhs first - Region translate(int dx, int dy) const; - Region merge(const Region& rhs, int dx, int dy) const; - Region intersect(const Region& rhs, int dx, int dy) const; - Region subtract(const Region& rhs, int dx, int dy) const; + const Region translate(int dx, int dy) const; + const Region merge(const Region& rhs, int dx, int dy) const; + const Region intersect(const Region& rhs, int dx, int dy) const; + const Region subtract(const Region& rhs, int dx, int dy) const; // convenience operators overloads - inline Region operator | (const Region& rhs) const; - inline Region operator & (const Region& rhs) const; - inline Region operator - (const Region& rhs) const; - inline Region operator + (const Point& pt) const; + inline const Region operator | (const Region& rhs) const; + inline const Region operator & (const Region& rhs) const; + inline const Region operator - (const Region& rhs) const; + inline const Region operator + (const Point& pt) const; inline Region& operator |= (const Region& rhs); inline Region& operator &= (const Region& rhs); @@ -136,9 +136,9 @@ private: Region& operationSelf(const Rect& r, int op); Region& operationSelf(const Region& r, int op); Region& operationSelf(const Region& r, int dx, int dy, int op); - Region operation(const Rect& rhs, int op) const; - Region operation(const Region& rhs, int op) const; - Region operation(const Region& rhs, int dx, int dy, int op) const; + const Region operation(const Rect& rhs, int op) const; + const Region operation(const Region& rhs, int op) const; + const Region operation(const Region& rhs, int dx, int dy, int op) const; static void boolean_operation(int op, Region& dst, const Region& lhs, const Region& rhs, int dx, int dy); @@ -160,16 +160,16 @@ private: }; -Region Region::operator | (const Region& rhs) const { +const Region Region::operator | (const Region& rhs) const { return merge(rhs); } -Region Region::operator & (const Region& rhs) const { +const Region Region::operator & (const Region& rhs) const { return intersect(rhs); } -Region Region::operator - (const Region& rhs) const { +const Region Region::operator - (const Region& rhs) const { return subtract(rhs); } -Region Region::operator + (const Point& pt) const { +const Region Region::operator + (const Point& pt) const { return translate(pt.x, pt.y); } |