| 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 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // An interface implemented by an object that changes coordinates on a | 24 // An interface implemented by an object that changes coordinates on a |
| 25 // RootWindow into system coordinates. | 25 // RootWindow into system coordinates. |
| 26 class AURA_EXPORT ScreenPositionClient { | 26 class AURA_EXPORT ScreenPositionClient { |
| 27 public: | 27 public: |
| 28 // Converts the |screen_point| from a given |window|'s coordinate space | 28 // Converts the |screen_point| from a given |window|'s coordinate space |
| 29 // into screen coordinate space. | 29 // into screen coordinate space. |
| 30 virtual void ConvertPointToScreen(const Window* window, | 30 virtual void ConvertPointToScreen(const Window* window, |
| 31 gfx::Point* point) = 0; | 31 gfx::Point* point) = 0; |
| 32 virtual void ConvertPointFromScreen(const Window* window, | 32 virtual void ConvertPointFromScreen(const Window* window, |
| 33 gfx::Point* point) = 0; | 33 gfx::Point* point) = 0; |
| 34 // Converts the |screen_point| from a given |window|'s native screen |
| 35 // coordinate space into screen coordinate space. |
| 36 // A typical example of using this function instead of ConvertPointToScreen is |
| 37 // when X's native input is captured by a drag operation. |
| 38 // See the comments in ash::wm::GetRootWindowRelativeToWindow for details. |
| 39 virtual void ConvertNativePointToScreen(Window* window, |
| 40 gfx::Point* point) = 0; |
| 34 // Sets the bounds of the window. The implementation is responsible | 41 // Sets the bounds of the window. The implementation is responsible |
| 35 // for finding out and translating the right coordinates for the |window|. | 42 // for finding out and translating the right coordinates for the |window|. |
| 36 virtual void SetBounds(Window* window, | 43 virtual void SetBounds(Window* window, |
| 37 const gfx::Rect& bounds, | 44 const gfx::Rect& bounds, |
| 38 const gfx::Display& display) = 0; | 45 const gfx::Display& display) = 0; |
| 39 virtual ~ScreenPositionClient() {} | 46 virtual ~ScreenPositionClient() {} |
| 40 }; | 47 }; |
| 41 | 48 |
| 42 // Sets/Gets the activation client on the Window. | 49 // Sets/Gets the activation client on the Window. |
| 43 AURA_EXPORT void SetScreenPositionClient(RootWindow* window, | 50 AURA_EXPORT void SetScreenPositionClient(RootWindow* window, |
| 44 ScreenPositionClient* client); | 51 ScreenPositionClient* client); |
| 45 AURA_EXPORT ScreenPositionClient* GetScreenPositionClient( | 52 AURA_EXPORT ScreenPositionClient* GetScreenPositionClient( |
| 46 const RootWindow* window); | 53 const RootWindow* window); |
| 47 | 54 |
| 48 } // namespace clients | 55 } // namespace clients |
| 49 } // namespace aura | 56 } // namespace aura |
| 50 | 57 |
| 51 #endif // UI_AURA_SCREEN_POSITION_CLIENT_H_ | 58 #endif // UI_AURA_SCREEN_POSITION_CLIENT_H_ |
| OLD | NEW |