OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_CPP_RECT_H_ | 5 #ifndef PPAPI_CPP_RECT_H_ |
6 #define PPAPI_CPP_RECT_H_ | 6 #define PPAPI_CPP_RECT_H_ |
7 | 7 |
8 #include "ppapi/c/pp_rect.h" | 8 #include "ppapi/c/pp_rect.h" |
9 #include "ppapi/cpp/point.h" | 9 #include "ppapi/cpp/point.h" |
10 #include "ppapi/cpp/size.h" | 10 #include "ppapi/cpp/size.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 /// @param[in] top An int32_t value representing a top | 275 /// @param[in] top An int32_t value representing a top |
276 /// shrinking distance. | 276 /// shrinking distance. |
277 /// @param[in] right An int32_t value representing a right | 277 /// @param[in] right An int32_t value representing a right |
278 /// shrinking distance. | 278 /// shrinking distance. |
279 /// @param[in] bottom An int32_t value representing a bottom | 279 /// @param[in] bottom An int32_t value representing a bottom |
280 /// shrinking distance. | 280 /// shrinking distance. |
281 void Inset(int32_t left, int32_t top, int32_t right, int32_t bottom); | 281 void Inset(int32_t left, int32_t top, int32_t right, int32_t bottom); |
282 | 282 |
283 /// Offset() moves the rectangle by a horizontal and vertical distance. | 283 /// Offset() moves the rectangle by a horizontal and vertical distance. |
284 /// | 284 /// |
285 /// @param[in] horizontal An int32_t value representing a horzontal | 285 /// @param[in] horizontal An int32_t value representing a horizontal |
286 /// move distance. | 286 /// move distance. |
287 /// @param[in] vertical An int32_t value representing a vertical | 287 /// @param[in] vertical An int32_t value representing a vertical |
288 /// move distance. | 288 /// move distance. |
289 void Offset(int32_t horizontal, int32_t vertical); | 289 void Offset(int32_t horizontal, int32_t vertical); |
290 | 290 |
291 /// Offset() moves the rectangle by a horizontal and vertical distance. | 291 /// Offset() moves the rectangle by a horizontal and vertical distance. |
292 /// | 292 /// |
293 /// @param[in] point A pointer to a <code>Point</code> representing the | 293 /// @param[in] point A pointer to a <code>Point</code> representing the |
294 /// horizontal and vertical move distances. | 294 /// horizontal and vertical move distances. |
295 void Offset(const Point& point) { | 295 void Offset(const Point& point) { |
(...skipping 28 matching lines...) Expand all Loading... |
324 return Contains(point.x(), point.y()); | 324 return Contains(point.x(), point.y()); |
325 } | 325 } |
326 | 326 |
327 /// Contains() determines if this rectangle contains the specified rectangle. | 327 /// Contains() determines if this rectangle contains the specified rectangle. |
328 /// | 328 /// |
329 /// @param[in] rect A pointer to a <code>Rect</code>. | 329 /// @param[in] rect A pointer to a <code>Rect</code>. |
330 /// | 330 /// |
331 /// @return true if the rectangle fall inside this rectangle. | 331 /// @return true if the rectangle fall inside this rectangle. |
332 bool Contains(const Rect& rect) const; | 332 bool Contains(const Rect& rect) const; |
333 | 333 |
334 /// Insersects() determines if this rectangle intersects the specified | 334 /// Intersects() determines if this rectangle intersects the specified |
335 /// rectangle. | 335 /// rectangle. |
336 /// | 336 /// |
337 /// @param[in] rect A pointer to a <code>Rect</code>. | 337 /// @param[in] rect A pointer to a <code>Rect</code>. |
338 /// | 338 /// |
339 /// @return true if the rectangle intersects this rectangle. | 339 /// @return true if the rectangle intersects this rectangle. |
340 bool Intersects(const Rect& rect) const; | 340 bool Intersects(const Rect& rect) const; |
341 | 341 |
342 /// Intersect() computes the intersection of this rectangle with the given | 342 /// Intersect() computes the intersection of this rectangle with the given |
343 /// rectangle. | 343 /// rectangle. |
344 /// | 344 /// |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 /// @param[in] rhs The <code>Rect</code> on the right-hand side of the | 418 /// @param[in] rhs The <code>Rect</code> on the right-hand side of the |
419 /// equation. | 419 /// equation. |
420 /// | 420 /// |
421 /// @return true if the given Rects are equal, otherwise false. | 421 /// @return true if the given Rects are equal, otherwise false. |
422 inline bool operator!=(const pp::Rect& lhs, const pp::Rect& rhs) { | 422 inline bool operator!=(const pp::Rect& lhs, const pp::Rect& rhs) { |
423 return !(lhs == rhs); | 423 return !(lhs == rhs); |
424 } | 424 } |
425 | 425 |
426 #endif | 426 #endif |
427 | 427 |
OLD | NEW |