coordinate_conversion.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef ASH_WM_COORDINATE_CONVERSION_H_ 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define ASH_WM_COORDINATE_CONVERSION_H_ 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ash/ash_export.h" 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace aura { 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class RootWindow; 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Window; 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace gfx 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace gfx { 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Point; 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Rect; 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace gfx 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ash { 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace wm { 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the RootWindow at |point| in the virtual screen coordinates. 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns NULL if the root window does not exist at the given 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// point. 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT aura::RootWindow* GetRootWindowAt(const gfx::Point& point); 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the RootWindow that shares the most area with |rect| in 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the virtual scren coordinates. 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT aura::RootWindow* GetRootWindowMatching(const gfx::Rect& rect); 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Converts the |point| from a given |window|'s coordinates into the screen 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// coordinates. 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void ConvertPointToScreen(aura::Window* window, gfx::Point* point); 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Converts the |point| from the screen coordinates to a given |window|'s 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// coordinates. 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void ConvertPointFromScreen(aura::Window* window, 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Point* point_in_screen); 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace wm 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace ash 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // ASH_WM_COORDINATE_CONVERSION_H_ 45