OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium 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 UI_DISPLAY_CHROMEOS_DISPLAY_SNAPSHOT_H_ | |
6 #define UI_DISPLAY_CHROMEOS_DISPLAY_SNAPSHOT_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "ui/display/chromeos/display_mode.h" | |
11 #include "ui/display/chromeos/display_snapshot.h" | |
12 #include "ui/display/display_constants.h" | |
13 #include "ui/gfx/geometry/point.h" | |
14 #include "ui/gfx/geometry/size.h" | |
15 | |
16 namespace ui { | |
17 | |
18 // This class represents the state of a display at one point in time. Platforms | |
19 // will extend this class in order to add platform specific configuration and | |
20 // identifiers required to configure this display. | |
21 class DISPLAY_EXPORT DisplaySnapshot { | |
22 public: | |
23 DisplaySnapshot(int64_t display_id, | |
24 bool has_proper_display_id, | |
25 const gfx::Point& origin, | |
26 const gfx::Size& physical_size, | |
27 DisplayConnectionType type, | |
28 bool is_aspect_preserving_scaling, | |
29 bool has_overscan, | |
30 std::string display_name, | |
31 const std::vector<const DisplayMode*>& modes, | |
32 const DisplayMode* current_mode, | |
33 const DisplayMode* native_mode); | |
34 virtual ~DisplaySnapshot(); | |
35 | |
36 const gfx::Point& origin() const { return origin_; } | |
37 const gfx::Size& physical_size() const { return physical_size_; } | |
38 ui::DisplayConnectionType type() const { return type_; } | |
39 bool is_aspect_preserving_scaling() const { | |
40 return is_aspect_preserving_scaling_; | |
41 } | |
42 bool has_overscan() const { return has_overscan_; } | |
43 std::string display_name() const { return display_name_; } | |
44 | |
45 int64_t display_id() const { return display_id_; } | |
46 bool has_proper_display_id() const { return has_proper_display_id_; } | |
47 | |
48 const DisplayMode* current_mode() const { return current_mode_; } | |
49 const DisplayMode* native_mode() const { return native_mode_; } | |
50 | |
51 const std::vector<const DisplayMode*>& modes() const { return modes_; } | |
52 | |
53 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } | |
54 void set_origin(const gfx::Point& origin) { origin_ = origin; } | |
55 void add_mode(const DisplayMode* mode) { modes_.push_back(mode); } | |
56 | |
57 // Returns a textual representation of this display state. | |
58 virtual std::string ToString() const = 0; | |
59 | |
60 protected: | |
61 // Display id for this output. | |
62 int64_t display_id_; | |
63 bool has_proper_display_id_; | |
64 | |
65 // Display's origin on the framebuffer. | |
66 gfx::Point origin_; | |
67 | |
68 gfx::Size physical_size_; | |
69 | |
70 DisplayConnectionType type_; | |
71 | |
72 bool is_aspect_preserving_scaling_; | |
73 | |
74 bool has_overscan_; | |
75 | |
76 std::string display_name_; | |
77 | |
78 std::vector<const DisplayMode*> modes_; // Not owned. | |
79 | |
80 // Mode currently being used by the output. | |
81 const DisplayMode* current_mode_; | |
82 | |
83 // "Best" mode supported by the output. | |
84 const DisplayMode* native_mode_; | |
85 | |
86 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); | |
87 }; | |
88 | |
89 } // namespace ui | |
90 | |
91 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_SNAPSHOT_H_ | |
OLD | NEW |