bin/pc: Mark non-returning function as void
[haiku.git] / docs / user / interface / Region.dox
blob738fb8a04c8a1538427b4a043a84dcf02f9a7016
1 /*
2  * Copyright 2014 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *              Stephan Aßmus, superstippi@gmx.de
7  *              Stefano Ceccherini, burton666@libero.it
8  *              John Scipione, jscipione@gmail.com
9  *
10  * Corresponds to:
11  *              headers/os/interface/Region.h    hrev47312
12  *              src/kits/interface/Region.cpp    hrev47312
13  */
16 /*!
17         \file Region.h
18         \ingroup interface
19         \ingroup libbe
20         \brief BRegion class definition.
24 /*!
25         \class BRegion
26         \ingroup interface
27         \ingroup libbe
28         \brief An area composed of rectangles.
30         The rectangles do not need to overlap. This class is useful for creating
31         clipping masks.
33         \warning BRegion is designed to be used with integral coordinates only.
35         \since BeOS R3
39 /*!
40         \fn BRegion::BRegion()
41         \brief Initializes an empty region. The region contains no rectangles,
42                and its bounds are invalid.
44         \since BeOS R3
48 /*!
49         \fn BRegion::BRegion(const BRegion& other)
50         \brief Initializes a region as a copy of \a other.
52         \param other The region to copy.
54         \since BeOS R3
58 /*!
59         \fn BRegion::BRegion(const BRect rect)
60         \brief Initializes a region to contain a \a rect.
62         \param rect The BRect to add to the region.
64         \since BeOS R5
68 /*!
69         \fn BRegion::BRegion(const clipping_rect& clipping)
70         \brief Initializes a region to contain a clipping_rect.
72         \param clipping The clipping_rect to set the region to, already in
73                internal rect format.
75         \since Haiku R1
79 /*!
80         \fn BRegion::~BRegion()
81         \brief Destroys the BRegion freeing any memory allocated by it.
83         \since BeOS R3
87 /*!
88         \name Operators
92 //! @{
95 /*!
96         \fn BRegion& BRegion::operator=(const BRegion& other)
97         \brief Modifies the BRegion to be a copy of \a other.
99         \param other the BRegion to copy.
101         \return This method always returns \c *this.
103         \since BeOS R3
108         \fn bool BRegion::operator==(const BRegion& other) const
109         \brief Compares this region to \a other by value.
111         \param other the BRegion to compare to.
113         \return \c true if the regions are the same, \c false otherwise.
115         \since BeOS R3
119 //! @}
123         \fn void BRegion::Set(BRect rect)
124         \brief Set the region to bounds of \a newBounds.
126         \param rect The BRect to set the bounds to.
128         \since BeOS R3
133         \fn void BRegion::Set(clipping_rect clipping)
134         \brief Set the region to the bounds of \a clipping_rect.
136         \param clipping The clipping_rect to set the bounds to.
138         \since Haiku R1
143         \fn BRect BRegion::Frame() const
144         \brief Returns a rectangle that encloses the BRegion.
146         \return A BRect that encloses the BRegion.
148         \since BeOS R3
153         \fn clipping_rect BRegion::FrameInt() const
154         \brief Returns the bounds of the region as a clipping_rect
155                (which has integer coordinates).
157         \return The clipping_rect which represents the region's bounds.
159         \since Haiku R1
164         \fn BRect BRegion::RectAt(int32 index)
165         \brief Returns the rectangle contained in the region at the given \a index.
167         \param index The index of the BRect to retreive.
169         \return If the given index is valid, it returns the BRect at that index,
170                 otherwise, it returns an invalid BRect.
172         \since BeOS R3
177         \fn BRect BRegion::RectAt(int32 index) const
178         \brief Returns the rectangle contained in the region at the given \a index.
180         \param index The index of the BRect to retreive. (zero based)
182         \return If the given index is valid, it returns the BRect at that index,
183                 otherwise, it returns an invalid BRect.
185         \since Haiku R1
190         fn clipping_rect BRegion::RectAtInt(int32 index)
191         \brief Returns the clipping_rect contained in the region at the given
192                \a index.
194         \param index The index of the clipping_rect to retrieve. (zero based)
196         \return If the given index is valid, it returns the clipping_rect at that
197                 index, otherwise, it returns an invalid clipping_rect.
199         \since Haiku R1
204         \fn clipping_rect BRegion::RectAtInt(int32 index) const
205         \brief Returns the clipping_rect contained in the region at the given
206                \a index.
208         \param index The index of the clipping_rect to retrieve. (zero based)
210         \return If the given index is valid, it returns the clipping_rect at that
211                 index, otherwise, it returns an invalid clipping_rect.
213         \since Haiku R1
218         \fn int32 BRegion::CountRects()
219         \brief Returns the number of rectangles contained in the region.
221         \return The number of rectangles in the region as an int32.
223         \since BeOS R3
228         \fn int32 BRegion::CountRects() const
229         \brief Returns the number of rectangles contained in the region.
231         \return The number of rectangles in the region as an int32.
233         \since Haiku R1
238         \fn bool BRegion::Intersects(BRect rect) const
239         \brief Returns whether or not the region has any area in common with
240                \a rect.
242         \param rect The BRect to check the region against.
244         \return \c true if the region has any area in common with the BRect,
245                 \c false if not.
247         \since BeOS R3
252         \fn bool BRegion::Intersects(clipping_rect clipping) const
253         \brief Returns whether or not the region has any area in common with
254                \a clipping.
256         \param clipping The clipping_rect to check the region against.
258         \return \c true if the region has any area in common with the
259                 clipping_rect, \c false if not.
261         \since Haiku R1
266         \fn bool BRegion::Contains(BPoint point) const
267         \brief Returns whether or not if the region contains the given \a point.
269         \param point The \a point to check.
271         \return \c true if the region contains the \a point, \c false if not.
273         \since BeOS R3
278         \fn bool BRegion::Contains(int32 x, int32 y)
279         \brief Returns whether or not the region contains the given coordinates.
281         \param x The \c x coordinate of the point to check.
282         \param y The \c y coordinate of the point to check.
284         \return \c true if the region contains the point, \c false if not.
286         \since Haiku R1
291         \fn bool BRegion::Contains(int32 x, int32 y) const
292         \brief Return whether or not the region contains the given coordinates.
294         \param x The \c x coordinate of the point to check.
295         \param y The \c y coordinate of the point to check.
297         \return \c true if the region contains the point, \c false if not.
299         \since Haiku R1
304         \fn void BRegion::PrintToStream() const
305         \brief Prints each rect in the the BRegion to standard output.
307         \since BeOS R3
312         \fn void BRegion::OffsetBy(const BPoint& point)
313         \brief Applies the given offsets given by the x and y coordinates of
314                \a point to each rectangle contained in the region and recalculates
315                the region's bounds.
317         \param point The point to get the coordinates to offset by.
319         \since Haiku R1
324         \fn void BRegion::OffsetBy(int32 x, int32 y)
325         \brief Applies the given \a x and \a y offsets to each rectangle contained
326                in the region and recalculates the region's bounds.
328         \param x The horizontal offset.
329         \param y The vertical offset.
331         \since BeOS R3
336         \fn void BRegion::ScaleBy(BSize scale)
337         \brief Resize each of the contained rectangles by the given factor
338                and recalculates the region's bounds.
340         \param scale The scale factor
342         \since Haiku R1
347         \fn void BRegion::ScaleBy(float x, float y)
348         \brief Resize each of the contained rectangles by the given factors
349                and recalculates the region's bounds.
351         \param x The horizontal scale.
352         \param y The vertical scale.
354         \since Haiku R1
359         \fn void BRegion::MakeEmpty()
360         \brief Empties the region so that it doesn't containt any rects, and
361                invalidates its bounds.
363         \since BeOS R3
368         \fn void BRegion::Include(BRect rect)
369         \brief Modifies the region so that it includes the given \a rect.
371         \param rect The BRect to include in the region.
373         \since BeOS R3
378         \fn void BRegion::Include(clipping_rect clipping)
379         \brief Modifies the region so that it includes the given \a clipping
380                rectangle.
382         \param clipping The clipping_rect to include in the region.
384         \since Haiku R1
389         \fn void BRegion::Include(const BRegion* region)
390         \brief Modifies the region to include the area of the given \a region.
392         \param region The \a region to be included.
394         \since BeOS R3
399         \fn void BRegion::Exclude(BRect rect)
400         \brief Modifies the region excluding the area of the given \a rect.
402         \param rect The BRect to be excluded.
404         \since BeOS R3
409         \fn void BRegion::Exclude(clipping_rect clipping)
410         \brief Modifies the region excluding the area of the given \a clipping
411                rectangle.
413         \param clipping The clipping_rect to be excluded.
415         \since Haiku R1
420         \fn void BRegion::Exclude(const BRegion* region)
421         \brief Modifies the region excluding the area contained by the given
422               \a region.
424         \param region The BRegion to be excluded.
426         \since BeOS R3
431         \fn void BRegion::IntersectWith(const BRegion* region)
432         \brief Modifies the region, so that it will contain only the area
433                    in common with \a region.
435         \param region the BRegion to intersect with.
437         \since BeOS R3
442         \fn void BRegion::ExclusiveInclude(const BRegion* region)
443         \brief Modifies the region so that it contains only the area
444                which the BRegion and \a region do NOT have in common.
446         \param region the BRegion to exclusively include.
448         \since Haiku R1