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 Rect; | 13 class Rect; |
13 } | 14 } |
14 | 15 |
15 namespace aura { | 16 namespace aura { |
16 | 17 |
17 class Event; | 18 class Event; |
18 class RootWindow; | 19 class RootWindow; |
19 class Window; | 20 class Window; |
20 | 21 |
21 namespace client { | 22 namespace client { |
22 | 23 |
23 // An interface implemented by an object that changes coordinates on a | 24 // An interface implemented by an object that changes coordinates on a |
24 // RootWindow into system coordinates. | 25 // RootWindow into system coordinates. |
25 class AURA_EXPORT ScreenPositionClient { | 26 class AURA_EXPORT ScreenPositionClient { |
26 public: | 27 public: |
27 // Converts the |screen_point| from a given |window|'s coordinate space | 28 // Converts the |screen_point| from a given |window|'s coordinate space |
28 // into screen coordinate space. | 29 // into screen coordinate space. |
29 virtual void ConvertPointToScreen(const Window* window, | 30 virtual void ConvertPointToScreen(const Window* window, |
30 gfx::Point* point) = 0; | 31 gfx::Point* point) = 0; |
31 virtual void ConvertPointFromScreen(const Window* window, | 32 virtual void ConvertPointFromScreen(const Window* window, |
32 gfx::Point* point) = 0; | 33 gfx::Point* point) = 0; |
33 // Sets the bounds of the window. The implementation is responsible | 34 // Sets the bounds of the window. The implementation is responsible |
34 // for finding out and translating the right coordinates for the |window|. | 35 // for finding out and translating the right coordinates for the |window|. |
35 virtual void SetBounds(Window* window, const gfx::Rect& bounds) = 0; | 36 virtual void SetBounds(Window* window, |
| 37 const gfx::Rect& bounds, |
| 38 const gfx::Display& display) = 0; |
36 virtual ~ScreenPositionClient() {} | 39 virtual ~ScreenPositionClient() {} |
37 }; | 40 }; |
38 | 41 |
39 // Sets/Gets the activation client on the Window. | 42 // Sets/Gets the activation client on the Window. |
40 AURA_EXPORT void SetScreenPositionClient(RootWindow* window, | 43 AURA_EXPORT void SetScreenPositionClient(RootWindow* window, |
41 ScreenPositionClient* client); | 44 ScreenPositionClient* client); |
42 AURA_EXPORT ScreenPositionClient* GetScreenPositionClient( | 45 AURA_EXPORT ScreenPositionClient* GetScreenPositionClient( |
43 const RootWindow* window); | 46 const RootWindow* window); |
44 | 47 |
45 } // namespace clients | 48 } // namespace clients |
46 } // namespace aura | 49 } // namespace aura |
47 | 50 |
48 #endif // UI_AURA_SCREEN_POSITION_CLIENT_H_ | 51 #endif // UI_AURA_SCREEN_POSITION_CLIENT_H_ |
OLD | NEW |