| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 UI_GFX_RANGE_RANGE_F_H_ | 5 #ifndef UI_GFX_RANGE_RANGE_F_H_ |
| 6 #define UI_GFX_RANGE_RANGE_F_H_ | 6 #define UI_GFX_RANGE_RANGE_F_H_ |
| 7 | 7 |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "ui/gfx/gfx_export.h" | 11 #include "ui/gfx/range/gfx_range_export.h" |
| 12 #include "ui/gfx/range/range.h" | 12 #include "ui/gfx/range/range.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 | 15 |
| 16 // A float version of Range. RangeF is made of a start and end position; when | 16 // A float version of Range. RangeF is made of a start and end position; when |
| 17 // they are the same, the range is empty. Note that |start_| can be greater | 17 // they are the same, the range is empty. Note that |start_| can be greater |
| 18 // than |end_| to respect the directionality of the range. | 18 // than |end_| to respect the directionality of the range. |
| 19 class GFX_EXPORT RangeF { | 19 class GFX_RANGE_EXPORT RangeF { |
| 20 public: | 20 public: |
| 21 // Creates an empty range {0,0}. | 21 // Creates an empty range {0,0}. |
| 22 RangeF(); | 22 RangeF(); |
| 23 | 23 |
| 24 // Initializes the range with a start and end. | 24 // Initializes the range with a start and end. |
| 25 RangeF(float start, float end); | 25 RangeF(float start, float end); |
| 26 | 26 |
| 27 // Initializes the range with the same start and end positions. | 27 // Initializes the range with the same start and end positions. |
| 28 explicit RangeF(float position); | 28 explicit RangeF(float position); |
| 29 | 29 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 Range Ceil() const; | 74 Range Ceil() const; |
| 75 Range Round() const; | 75 Range Round() const; |
| 76 | 76 |
| 77 std::string ToString() const; | 77 std::string ToString() const; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 float start_; | 80 float start_; |
| 81 float end_; | 81 float end_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 GFX_EXPORT std::ostream& operator<<(std::ostream& os, const RangeF& range); | 84 GFX_RANGE_EXPORT std::ostream& operator<<(std::ostream& os, |
| 85 const RangeF& range); |
| 85 | 86 |
| 86 } // namespace gfx | 87 } // namespace gfx |
| 87 | 88 |
| 88 #endif // UI_GFX_RANGE_RANGE_F_H_ | 89 #endif // UI_GFX_RANGE_RANGE_F_H_ |
| OLD | NEW |