1 | // Copyright 2013 The Flutter Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #ifndef FLUTTER_LIB_UI_WINDOW_VIEWPORT_METRICS_H_ |
6 | #define FLUTTER_LIB_UI_WINDOW_VIEWPORT_METRICS_H_ |
7 | |
8 | namespace flutter { |
9 | |
10 | struct ViewportMetrics { |
11 | ViewportMetrics(); |
12 | ViewportMetrics(double p_device_pixel_ratio, |
13 | double p_physical_width, |
14 | double p_physical_height, |
15 | double p_physical_padding_top, |
16 | double p_physical_padding_right, |
17 | double p_physical_padding_bottom, |
18 | double p_physical_padding_left, |
19 | double p_physical_view_inset_top, |
20 | double p_physical_view_inset_right, |
21 | double p_physical_view_inset_bottom, |
22 | double p_physical_view_inset_left, |
23 | double p_physical_system_gesture_inset_top, |
24 | double p_physical_system_gesture_inset_right, |
25 | double p_physical_system_gesture_inset_bottom, |
26 | double p_physical_system_gesture_inset_left); |
27 | |
28 | // Create a ViewportMetrics instance that doesn't include depth, padding, or |
29 | // insets. |
30 | ViewportMetrics(double p_device_pixel_ratio, |
31 | double p_physical_width, |
32 | double p_physical_height); |
33 | |
34 | double device_pixel_ratio = 1.0; |
35 | double physical_width = 0; |
36 | double physical_height = 0; |
37 | double physical_padding_top = 0; |
38 | double physical_padding_right = 0; |
39 | double physical_padding_bottom = 0; |
40 | double physical_padding_left = 0; |
41 | double physical_view_inset_top = 0; |
42 | double physical_view_inset_right = 0; |
43 | double physical_view_inset_bottom = 0; |
44 | double physical_view_inset_left = 0; |
45 | double physical_system_gesture_inset_top = 0; |
46 | double physical_system_gesture_inset_right = 0; |
47 | double physical_system_gesture_inset_bottom = 0; |
48 | double physical_system_gesture_inset_left = 0; |
49 | }; |
50 | |
51 | struct LogicalSize { |
52 | double width = 0.0; |
53 | double height = 0.0; |
54 | }; |
55 | |
56 | struct LogicalInset { |
57 | double left = 0.0; |
58 | double top = 0.0; |
59 | double right = 0.0; |
60 | double bottom = 0.0; |
61 | }; |
62 | |
63 | struct LogicalMetrics { |
64 | LogicalSize size; |
65 | double scale = 1.0; |
66 | LogicalInset padding; |
67 | LogicalInset view_inset; |
68 | }; |
69 | |
70 | } // namespace flutter |
71 | |
72 | #endif // FLUTTER_LIB_UI_WINDOW_VIEWPORT_METRICS_H_ |
73 | |