OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_AURA_SCREEN_POSITION_CLIENT_H_ | 5 #ifndef UI_AURA_SCREEN_POSITION_CLIENT_H_ |
6 #define UI_AURA_SCREEN_POSITION_CLIENT_H_ | 6 #define UI_AURA_SCREEN_POSITION_CLIENT_H_ |
7 | 7 |
8 #include "ui/aura/aura_export.h" | 8 #include "ui/aura/aura_export.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Display; | 12 class Display; |
13 class Rect; | 13 class Rect; |
14 } | 14 } |
15 | 15 |
16 namespace aura { | 16 namespace aura { |
17 | |
18 class Event; | |
19 class RootWindow; | |
20 class Window; | 17 class Window; |
21 | |
22 namespace client { | 18 namespace client { |
23 | 19 |
24 // An interface implemented by an object that changes coordinates on a | 20 // An interface implemented by an object that changes coordinates within a root |
25 // RootWindow into system coordinates. | 21 // Window into system coordinates. |
26 class AURA_EXPORT ScreenPositionClient { | 22 class AURA_EXPORT ScreenPositionClient { |
27 public: | 23 public: |
28 // Converts the |screen_point| from a given |window|'s coordinate space | 24 // Converts the |screen_point| from a given |window|'s coordinate space |
29 // into screen coordinate space. | 25 // into screen coordinate space. |
30 virtual void ConvertPointToScreen(const Window* window, | 26 virtual void ConvertPointToScreen(const Window* window, |
31 gfx::Point* point) = 0; | 27 gfx::Point* point) = 0; |
32 virtual void ConvertPointFromScreen(const Window* window, | 28 virtual void ConvertPointFromScreen(const Window* window, |
33 gfx::Point* point) = 0; | 29 gfx::Point* point) = 0; |
34 // Converts the |screen_point| from root window host's coordinate of | 30 // Converts the |screen_point| from root window host's coordinate of |
35 // into screen coordinate space. | 31 // into screen coordinate space. |
36 // A typical example of using this function instead of ConvertPointToScreen is | 32 // A typical example of using this function instead of ConvertPointToScreen is |
37 // when X's native input is captured by a drag operation. | 33 // when X's native input is captured by a drag operation. |
38 // See the comments for ash::GetRootWindowRelativeToWindow for details. | 34 // See the comments for ash::GetRootWindowRelativeToWindow for details. |
39 virtual void ConvertHostPointToScreen(aura::RootWindow* root_window, | 35 virtual void ConvertHostPointToScreen(Window* root_window, |
40 gfx::Point* point) = 0; | 36 gfx::Point* point) = 0; |
41 // Sets the bounds of the window. The implementation is responsible | 37 // Sets the bounds of the window. The implementation is responsible |
42 // for finding out and translating the right coordinates for the |window|. | 38 // for finding out and translating the right coordinates for the |window|. |
43 virtual void SetBounds(Window* window, | 39 virtual void SetBounds(Window* window, |
44 const gfx::Rect& bounds, | 40 const gfx::Rect& bounds, |
45 const gfx::Display& display) = 0; | 41 const gfx::Display& display) = 0; |
46 virtual ~ScreenPositionClient() {} | 42 virtual ~ScreenPositionClient() {} |
47 }; | 43 }; |
48 | 44 |
49 // Sets/Gets the activation client on the Window. | 45 // Sets/Gets the activation client on the Window. |
50 AURA_EXPORT void SetScreenPositionClient(RootWindow* window, | 46 AURA_EXPORT void SetScreenPositionClient(Window* root_window, |
51 ScreenPositionClient* client); | 47 ScreenPositionClient* client); |
52 AURA_EXPORT ScreenPositionClient* GetScreenPositionClient( | 48 AURA_EXPORT ScreenPositionClient* GetScreenPositionClient( |
53 const RootWindow* window); | 49 const Window* root_window); |
54 | 50 |
55 } // namespace clients | 51 } // namespace clients |
56 } // namespace aura | 52 } // namespace aura |
57 | 53 |
58 #endif // UI_AURA_SCREEN_POSITION_CLIENT_H_ | 54 #endif // UI_AURA_SCREEN_POSITION_CLIENT_H_ |
OLD | NEW |