OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ |
| 6 #define MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ |
| 7 |
| 8 #include "mojo/geometry/mojo_geometry_export.h" |
| 9 #include "mojo/public/interfaces/geometry/geometry.mojom.h" |
| 10 #include "ui/gfx/geometry/rect.h" |
| 11 |
| 12 namespace mojo { |
| 13 |
| 14 template<> |
| 15 class MOJO_GEOMETRY_EXPORT TypeConverter<Point, gfx::Point> { |
| 16 public: |
| 17 static Point ConvertFrom(const gfx::Point& input, Buffer* buf); |
| 18 static gfx::Point ConvertTo(const Point& input); |
| 19 |
| 20 MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION(); |
| 21 }; |
| 22 |
| 23 template<> |
| 24 class MOJO_GEOMETRY_EXPORT TypeConverter<Size, gfx::Size> { |
| 25 public: |
| 26 static Size ConvertFrom(const gfx::Size& input, Buffer* buf); |
| 27 static gfx::Size ConvertTo(const Size& input); |
| 28 |
| 29 MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION(); |
| 30 }; |
| 31 |
| 32 template<> |
| 33 class MOJO_GEOMETRY_EXPORT TypeConverter<Rect, gfx::Rect> { |
| 34 public: |
| 35 static Rect ConvertFrom(const gfx::Rect& input, Buffer* buf); |
| 36 static gfx::Rect ConvertTo(const Rect& input); |
| 37 |
| 38 MOJO_ALLOW_IMPLICIT_TYPE_CONVERSION(); |
| 39 }; |
| 40 |
| 41 } // namespace mojo |
| 42 |
| 43 #endif // MOJO_GEOMETRY_GEOMETRY_TYPE_CONVERTERS_H_ |
OLD | NEW |