2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
34 VRegion(int x, int y, int w, int h);
35 VRegion(const VRect &r);
36 VRegion(const VRegion ®ion);
37 VRegion(VRegion &&other);
39 VRegion & operator=(const VRegion &);
40 VRegion & operator=(VRegion &&);
42 bool contains(const VRect &r) const;
43 VRegion united(const VRect &r) const;
44 VRegion united(const VRegion &r) const;
45 VRegion intersected(const VRect &r) const;
46 VRegion intersected(const VRegion &r) const;
47 VRegion subtracted(const VRegion &r) const;
48 void translate(const VPoint &p);
49 inline void translate(int dx, int dy);
50 VRegion translated(const VPoint &p) const;
51 inline VRegion translated(int dx, int dy) const;
52 int rectCount() const;
53 VRect rectAt(int index) const;
55 VRegion operator+(const VRect &r) const;
56 VRegion operator+(const VRegion &r) const;
57 VRegion operator-(const VRegion &r) const;
58 VRegion &operator+=(const VRect &r);
59 VRegion &operator+=(const VRegion &r);
60 VRegion &operator-=(const VRegion &r);
62 VRect boundingRect() const noexcept;
63 bool intersects(const VRegion ®ion) const;
65 bool operator==(const VRegion &r) const;
66 inline bool operator!=(const VRegion &r) const { return !(operator==(r)); }
67 friend VDebug &operator<<(VDebug &os, const VRegion &o);
70 bool within(const VRect &r) const;
73 void cleanUp(VRegionData *x);
75 struct VRegionData *d;
77 inline void VRegion::translate(int dx, int dy)
79 translate(VPoint(dx, dy));
82 inline VRegion VRegion::translated(int dx, int dy) const
84 return translated(VPoint(dx, dy));