coordinate_conversion.h revision 1e9bf3e0803691d0a228da41fc608347b6db4340
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 Window;
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace gfx
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace gfx {
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Point;
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Rect;
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace gfx
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ash {
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace wm {
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the RootWindow at |point| in the virtual screen coordinates.
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns NULL if the root window does not exist at the given
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// point.
251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)ASH_EXPORT aura::Window* GetRootWindowAt(const gfx::Point& point);
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the RootWindow that shares the most area with |rect| in
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the virtual scren coordinates.
291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)ASH_EXPORT aura::Window* GetRootWindowMatching(const gfx::Rect& rect);
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Converts the |point| from a given |window|'s coordinates into the screen
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// coordinates.
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void ConvertPointToScreen(aura::Window* window, gfx::Point* point);
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Converts the |point| from the screen coordinates to a given |window|'s
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// coordinates.
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)ASH_EXPORT void ConvertPointFromScreen(aura::Window* window,
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                       gfx::Point* point_in_screen);
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace wm
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace ash
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // ASH_WM_COORDINATE_CONVERSION_H_
44