1116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Copyright 2014 The Chromium Authors. All rights reserved.
2116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Use of this source code is governed by a BSD-style license that can be
3116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// found in the LICENSE file.
4116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
5116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#ifndef UI_GFX_MAC_COORDINATE_CONVERSION_H_
6116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#define UI_GFX_MAC_COORDINATE_CONVERSION_H_
7116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
8116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#import <Foundation/Foundation.h>
9116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
10116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#include "ui/gfx/gfx_export.h"
11116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
12116680a4aac90f2aa7413d9095a592090648e557Ben Murdochnamespace gfx {
13116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
14116680a4aac90f2aa7413d9095a592090648e557Ben Murdochclass Rect;
15116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
16116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Convert a gfx::Rect specified with the origin at the top left of the primary
17116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// display into AppKit secreen coordinates (origin at the bottom left).
18116680a4aac90f2aa7413d9095a592090648e557Ben MurdochGFX_EXPORT NSRect ScreenRectToNSRect(const gfx::Rect& rect);
19116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
20116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Convert an AppKit NSRect with origin in the bottom left of the primary
21116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// display into a gfx::Rect with origin at the top left of the primary display.
22116680a4aac90f2aa7413d9095a592090648e557Ben MurdochGFX_EXPORT gfx::Rect ScreenRectFromNSRect(const NSRect& point);
23116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
24116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch}  // namespace gfx
25116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
26116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#endif  // UI_GFX_MAC_COORDINATE_CONVERSION_H_
27