Mir
device_quirks.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_ANDROID_DEVICE_QUIRKS_H_
20 #define MIR_GRAPHICS_ANDROID_DEVICE_QUIRKS_H_
21 
22 #include <hybris/properties/properties.h>
23 #include <string>
24 
25 namespace boost{ namespace program_options {class options_description;}}
26 
27 namespace mir
28 {
29 namespace options{ class Option; }
30 namespace graphics
31 {
32 namespace android
33 {
35 {
36 public:
37  PropertiesWrapper() = default;
38  virtual ~PropertiesWrapper() = default;
39  virtual int property_get(
40  char const* key,
41  char* value,
42  char const* default_value) const = 0;
43 private:
44  PropertiesWrapper(PropertiesWrapper const&) = delete;
45  PropertiesWrapper& operator=(PropertiesWrapper const&) = delete;
46 };
47 
49 {
50 public:
51  int property_get(
52  char const* key,
53  char* value,
54  char const* default_value) const;
55 };
56 
58 {
59 public:
60  DeviceQuirks(PropertiesWrapper const& properties);
61  DeviceQuirks(PropertiesWrapper const& properties, mir::options::Option const& options);
62 
63  unsigned int num_framebuffers() const;
64  bool gralloc_reopenable_after_close() const;
65  int aligned_width(int width) const;
66 
67  static void add_options(boost::program_options::options_description& config);
68 
69 private:
70  DeviceQuirks(DeviceQuirks const&) = delete;
71  DeviceQuirks & operator=(DeviceQuirks const&) = delete;
72  std::string const device_name;
73  unsigned int const num_framebuffers_;
74  bool const gralloc_reopenable_after_close_;
75  bool const enable_width_alignment_quirk;
76 };
77 }
78 }
79 }
80 #endif /* MIR_GRAPHICS_ANDROID_DEVICE_QUIRKS_H_ */
All things Mir.
Definition: atomic_callback.h:25
Definition: device_quirks.h:25
int aligned_width(int width) const
Definition: device_quirks.cpp:90
Definition: device_quirks.h:57
virtual int property_get(char const *key, char *value, char const *default_value) const =0
int property_get(char const *key, char *value, char const *default_value) const
Definition: device_quirks.cpp:27
unsigned int width
Definition: black_arrow.c:4
DeviceQuirks(PropertiesWrapper const &properties)
Definition: device_quirks.cpp:64
Definition: device_quirks.h:48
Definition: device_quirks.h:34
bool gralloc_reopenable_after_close() const
Definition: device_quirks.cpp:85
Definition: android_input_receiver.h:36
unsigned int num_framebuffers() const
Definition: device_quirks.cpp:80
Definition: option.h:33
static void add_options(boost::program_options::options_description &config)
Definition: device_quirks.cpp:97

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015