Mir
display_configuration.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser 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 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_CLIENT_DISPLAY_CONFIGURATION_H_
20 #define MIR_CLIENT_DISPLAY_CONFIGURATION_H_
21 
23 #include "mir_protobuf.pb.h"
24 
25 #include <mutex>
26 #include <functional>
27 #include <vector>
28 #include <memory>
29 
30 namespace mir
31 {
32 namespace client
33 {
35 {
36 public:
37  DisplayOutput(size_t num_modes_, size_t num_formats);
39 };
40 
41 //convenient helper
43 
45 {
46 public:
49 
50  void set_configuration(mir::protobuf::DisplayConfiguration const& msg);
51  void update_configuration(mir::protobuf::DisplayConfiguration const& msg);
52  void set_display_change_handler(std::function<void()> const&);
53 
54  //copying to a c POD, so kinda kludgy
56 
57 private:
58  std::mutex mutable guard;
59  std::vector<MirDisplayCard> cards;
60  std::vector<std::shared_ptr<DisplayOutput>> outputs;
61  std::function<void()> notify_change;
62 };
63 
64 
65 }
66 }
67 
68 #endif /* MIR_CLIENT_DISPLAY_CONFIGURATION_H_ */
DisplayConfiguration()
Definition: display_configuration.cpp:105
All things Mir.
Definition: buffer_stream.h:37
Definition: display_configuration.h:44
Definition: client_types.h:270
~DisplayOutput()
Definition: display_configuration.cpp:56
void update_configuration(mir::protobuf::DisplayConfiguration const &msg)
Definition: display_configuration.cpp:137
DisplayOutput(size_t num_modes_, size_t num_formats)
Definition: display_configuration.cpp:47
Definition: client_types.h:242
MirDisplayConfiguration * copy_to_client() const
Definition: display_configuration.cpp:145
void set_configuration(mir::protobuf::DisplayConfiguration const &msg)
Definition: display_configuration.cpp:114
Definition: display_configuration.h:34
void delete_config_storage(MirDisplayConfiguration *config)
Definition: display_configuration.cpp:26
void set_display_change_handler(std::function< void()> const &)
Definition: display_configuration.cpp:179
~DisplayConfiguration()
Definition: display_configuration.cpp:110

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015