Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_MAC_COORDINATE_CONVERSION_H_ | 5 #ifndef UI_GFX_MAC_COORDINATE_CONVERSION_H_ |
| 6 #define UI_GFX_MAC_COORDINATE_CONVERSION_H_ | 6 #define UI_GFX_MAC_COORDINATE_CONVERSION_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include "ui/gfx/gfx_export.h" | 10 #include "ui/gfx/gfx_export.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 | 13 |
| 14 class Point; | |
| 14 class Rect; | 15 class Rect; |
| 15 | 16 |
| 16 // Convert a gfx::Rect specified with the origin at the top left of the primary | 17 // Convert a gfx::Rect specified with the origin at the top left of the primary |
| 17 // display into AppKit secreen coordinates (origin at the bottom left). | 18 // display into AppKit secreen coordinates (origin at the bottom left). |
| 18 GFX_EXPORT NSRect ScreenRectToNSRect(const gfx::Rect& rect); | 19 GFX_EXPORT NSRect ScreenRectToNSRect(const gfx::Rect& rect); |
| 19 | 20 |
| 20 // Convert an AppKit NSRect with origin in the bottom left of the primary | 21 // Convert an AppKit NSRect with origin in the bottom left of the primary |
| 21 // display into a gfx::Rect with origin at the top left of the primary display. | 22 // display into a gfx::Rect with origin at the top left of the primary display. |
| 22 GFX_EXPORT gfx::Rect ScreenRectFromNSRect(const NSRect& point); | 23 GFX_EXPORT gfx::Rect ScreenRectFromNSRect(const NSRect& point); |
| 23 | 24 |
| 25 // Convert a gfx::Point specified with the origin at the top left of the primary | |
| 26 // display into AppKit screen coordinates (origin at the bottom left). | |
| 27 GFX_EXPORT NSPoint ScreenPointToNSPoint(const gfx::Point& point); | |
|
tapted
2015/08/11 01:23:19
hm - these are all in namespace gfx:: already - ca
jackhou1
2015/08/11 03:09:24
Done.
| |
| 28 | |
| 29 // Convert an AppKit Point with origin in the bottom left of the primary | |
|
tapted
2015/08/11 01:23:19
nit Point -> NSPoint
jackhou1
2015/08/11 03:09:24
Done.
| |
| 30 // display into a gfx::Rect with origin at the top left of the primary display. | |
|
tapted
2015/08/11 01:23:19
gfx::Rect -> gfx::Point
jackhou1
2015/08/11 03:09:24
Done.
| |
| 31 GFX_EXPORT gfx::Point ScreenPointFromNSPoint(const NSPoint& point); | |
| 32 | |
| 24 } // namespace gfx | 33 } // namespace gfx |
| 25 | 34 |
| 26 #endif // UI_GFX_MAC_COORDINATE_CONVERSION_H_ | 35 #endif // UI_GFX_MAC_COORDINATE_CONVERSION_H_ |
| OLD | NEW |