Mir
output_properties_cache.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
17  */
18 
19 #ifndef MIR_SCENE_OUTPUT_PROPERTIES_CACHE_H_
20 #define MIR_SCENE_OUTPUT_PROPERTIES_CACHE_H_
21 
22 #include "mir_toolkit/common.h"
23 #include "mir/geometry/rectangle.h"
25 
26 #include <vector>
27 #include <memory>
28 #include <mutex>
29 
30 namespace mir
31 {
32 
33 namespace scene
34 {
36 {
38  int dpi;
39  float scale;
42 };
43 
45 {
46 public:
47 
48  void update_from(graphics::DisplayConfiguration const& config);
49 
50  std::shared_ptr<OutputProperties const> properties_for(geometry::Rectangle const& extents) const;
51 
52 private:
53  std::shared_ptr<std::vector<OutputProperties>> get_cache() const;
54 
55  std::mutex mutable mutex;
56  std::shared_ptr<std::vector<OutputProperties>> cache;
57 };
58 
59 }
60 }
61 
62 
63 
64 #endif //MIR_SCENE_OUTPUT_PROPERTIES_CACHE_H_
All things Mir.
Definition: atomic_callback.h:25
geometry::Rectangle extents
Definition: output_properties_cache.h:37
Definition: output_properties_cache.h:35
float scale
Definition: output_properties_cache.h:39
int dpi
Definition: output_properties_cache.h:38
MirFormFactor
Form factor associated with a physical output.
Definition: common.h:197
Definition: rectangle.h:33
graphics::DisplayConfigurationOutputId id
Definition: output_properties_cache.h:41
MirFormFactor form_factor
Definition: output_properties_cache.h:40
Definition: output_properties_cache.h:44
Interface to a configuration of display cards and outputs.
Definition: display_configuration.h:167

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016