1 // Copyright (c) 2012 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 ASH_WM_COORDINATE_CONVERSION_H_ 6 #define ASH_WM_COORDINATE_CONVERSION_H_ 7 8 #include "ash/ash_export.h" 9 10 namespace aura { 11 class RootWindow; 12 class Window; 13 } // namespace gfx 14 15 namespace gfx { 16 class Point; 17 class Rect; 18 } // namespace gfx 19 20 namespace ash { 21 namespace wm { 22 23 // Returns the RootWindow at |point| in the virtual screen coordinates. 24 // Returns NULL if the root window does not exist at the given 25 // point. 26 ASH_EXPORT aura::RootWindow* GetRootWindowAt(const gfx::Point& point); 27 28 // Returns the RootWindow that shares the most area with |rect| in 29 // the virtual scren coordinates. 30 ASH_EXPORT aura::RootWindow* GetRootWindowMatching(const gfx::Rect& rect); 31 32 // Converts the |point| from a given |window|'s coordinates into the screen 33 // coordinates. 34 ASH_EXPORT void ConvertPointToScreen(aura::Window* window, gfx::Point* point); 35 36 // Converts the |point| from the screen coordinates to a given |window|'s 37 // coordinates. 38 ASH_EXPORT void ConvertPointFromScreen(aura::Window* window, 39 gfx::Point* point_in_screen); 40 41 } // namespace wm 42 } // namespace ash 43 44 #endif // ASH_WM_COORDINATE_CONVERSION_H_ 45