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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 /// | 382 /// |
383 /// @return A <code>Point</code> representing the center of this rectangle. | 383 /// @return A <code>Point</code> representing the center of this rectangle. |
384 Point CenterPoint() const; | 384 Point CenterPoint() const; |
385 | 385 |
386 /// SharesEdgeWith() determines if this rectangle shares an entire edge | 386 /// SharesEdgeWith() determines if this rectangle shares an entire edge |
387 /// (same width or same height) with the given rectangle, and the | 387 /// (same width or same height) with the given rectangle, and the |
388 /// rectangles do not overlap. | 388 /// rectangles do not overlap. |
389 /// | 389 /// |
390 /// @param[in] rect A pointer to a <code>Rect</code>. | 390 /// @param[in] rect A pointer to a <code>Rect</code>. |
391 /// | 391 /// |
392 /// @return true if this rectangle and supplied rectangle share an edge. | 392 /// @return True if this rectangle and supplied rectangle share an edge. |
393 bool SharesEdgeWith(const Rect& rect) const; | 393 bool SharesEdgeWith(const Rect& rect) const; |
394 | 394 |
395 private: | 395 private: |
396 PP_Rect rect_; | 396 PP_Rect rect_; |
397 }; | 397 }; |
398 | 398 |
399 } // namespace pp | 399 } // namespace pp |
400 | 400 |
401 /// This function determines whether the x, y, width, and height values of two | 401 /// This function determines whether the x, y, width, and height values of two |
402 /// rectangles and are equal. | 402 /// rectangles and are equal. |
403 /// | 403 /// |
404 /// @param[in] lhs The <code>Rect</code> on the left-hand side of the equation. | 404 /// @param[in] lhs The <code>Rect</code> on the left-hand side of the equation. |
405 /// @param[in] rhs The <code>Rect</code> on the right-hand side of the equation. | 405 /// @param[in] rhs The <code>Rect</code> on the right-hand side of the equation. |
406 /// | 406 /// |
407 /// @return true if they are equal, false if unequal. | 407 /// @return True if they are equal, false if unequal. |
408 inline bool operator==(const pp::Rect& lhs, const pp::Rect& rhs) { | 408 inline bool operator==(const pp::Rect& lhs, const pp::Rect& rhs) { |
409 return lhs.x() == rhs.x() && | 409 return lhs.x() == rhs.x() && |
410 lhs.y() == rhs.y() && | 410 lhs.y() == rhs.y() && |
411 lhs.width() == rhs.width() && | 411 lhs.width() == rhs.width() && |
412 lhs.height() == rhs.height(); | 412 lhs.height() == rhs.height(); |
413 } | 413 } |
414 | 414 |
415 /// This function determines whether two Rects are not equal. | 415 /// This function determines whether two Rects are not equal. |
416 /// | 416 /// |
417 /// @param[in] lhs The <code>Rect</code> on the left-hand side of the equation. | 417 /// @param[in] lhs The <code>Rect</code> on the left-hand side of the equation. |
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 |