Chromium Code Reviews| Index: ui/gfx/mac/point_utils.h |
| diff --git a/ui/gfx/mac/point_utils.h b/ui/gfx/mac/point_utils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a22a71c2785e9cef0431c2b2cdabe4b6eea68c6f |
| --- /dev/null |
| +++ b/ui/gfx/mac/point_utils.h |
| @@ -0,0 +1,26 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_GFX_MAC_POINT_UTILS_H_ |
|
Robert Sesek
2014/06/25 17:06:04
Tests for these functions would be good.
tapted
2014/06/26 08:44:31
Done in https://codereview.chromium.org/345243007/
|
| +#define UI_GFX_MAC_POINT_UTILS_H_ |
| + |
| +#include "ui/gfx/gfx_export.h" |
| + |
| +typedef struct _NSRect NSRect; |
| + |
| +namespace gfx { |
| + |
| +class Rect; |
| + |
| +// Convert a gfx::Rect specified with the origin at the top left of the primary |
| +// display into AppKit secreen coordinates (origin at the bottom left). |
| +GFX_EXPORT NSRect ScreenRectToNSRect(const gfx::Rect& rect); |
| + |
| +// Convert an AppKit NSRect with origin in the bottom left of the primary |
| +// display into a gfx::Rect with origin at the top left of the primary display. |
| +GFX_EXPORT gfx::Rect ScreenRectFromNSRect(const NSRect& point); |
| + |
| +} // namespace gfx |
| + |
| +#endif // UI_GFX_MAC_POINT_UTILS_H_ |
|
tapted
2014/06/25 10:55:56
note: not sure it's the best filename, but I've pu
sky
2014/06/25 16:52:22
If you want this to be focused around screen conve
tapted
2014/06/26 08:44:31
Done - went with coordinate_conversions.h/mm (disc
|