[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 5 | #ifndef ASH_HOST_ROOT_WINDOW_TRANSFORMER_H_ |
6 | #define ASH_HOST_ROOT_WINDOW_TRANSFORMER_H_ | ||||
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 7 | |
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 8 | #include "ash/ash_export.h" |
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 9 | |
10 | namespace gfx { | ||||
11 | class Insets; | ||||
12 | class Rect; | ||||
13 | class Size; | ||||
14 | class Transform; | ||||
15 | } | ||||
16 | |||||
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 17 | namespace ash { |
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 18 | |
19 | // RootWindowTransformer controls how RootWindow should be placed and | ||||
20 | // transformed inside the host window. | ||||
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 21 | class ASH_EXPORT RootWindowTransformer { |
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 22 | public: |
23 | virtual ~RootWindowTransformer() {} | ||||
24 | |||||
Addison Luh | 8fd012f | 2022-02-15 19:00:47 | [diff] [blame^] | 25 | // Returns the transform that converts root window coordinates in DIP to |
26 | // host (platform) window coordinates. The transform normally includes | ||||
27 | // rotation and scaling, except for unified desktop, which doesn't include | ||||
28 | // rotation. | ||||
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 29 | virtual gfx::Transform GetTransform() const = 0; |
30 | |||||
31 | // Returns the inverse of the transform above. This method is to | ||||
Addison Luh | 8fd012f | 2022-02-15 19:00:47 | [diff] [blame^] | 32 | // provide an accurate inverse of the transform because the result of |
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 33 | // |gfx::Transform::GetInverse| may contains computational error. |
34 | virtual gfx::Transform GetInverseTransform() const = 0; | ||||
35 | |||||
36 | // Returns the root window's bounds for given host window size in DIP. | ||||
37 | // This is necessary to handle the case where the root window's size | ||||
38 | // is bigger than the host window. (Screen magnifier for example). | ||||
39 | virtual gfx::Rect GetRootWindowBounds(const gfx::Size& host_size) const = 0; | ||||
40 | |||||
41 | // Returns the insets that specifies the effective area of | ||||
42 | // the host window. | ||||
43 | virtual gfx::Insets GetHostInsets() const = 0; | ||||
Xiyuan Xia | e1ab9d1a | 2019-10-30 17:49:41 | [diff] [blame] | 44 | |
45 | // Returns the transform for applying host insets and magnifier scale. It is | ||||
46 | // similar to GetTransform() but without the screen rotation. | ||||
47 | virtual gfx::Transform GetInsetsAndScaleTransform() const = 0; | ||||
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 48 | }; |
49 | |||||
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 50 | } // namespace ash |
[email protected] | 84654d61 | 2013-04-03 08:10:55 | [diff] [blame] | 51 | |
[email protected] | f5c9dbc | 2014-04-11 08:13:45 | [diff] [blame] | 52 | #endif // ASH_HOST_ROOT_WINDOW_TRANSFORMER_H_ |