MirAL
active_outputs.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 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: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIRAL_ACTIVE_OUTPUTS_H
20 #define MIRAL_ACTIVE_OUTPUTS_H
21 
22 #include <memory>
23 #include <vector>
24 
25 namespace mir { class Server; }
26 
27 namespace miral
28 {
29 class Output;
30 
32 {
33 public:
34  ActiveOutputsListener() = default;
35 
37  virtual void advise_output_begin();
38 
40  virtual void advise_output_end();
41 
42  virtual void advise_output_create(Output const& output);
43  virtual void advise_output_update(Output const& updated, Output const& original);
44  virtual void advise_output_delete(Output const& output);
45 
46 protected:
47  virtual ~ActiveOutputsListener() = default;
49  ActiveOutputsListener operator=(ActiveOutputsListener const&) = delete;
50 };
51 
53 {
54 public:
58  ActiveOutputsMonitor& operator=(ActiveOutputsMonitor const&);
59 
60  void add_listener(ActiveOutputsListener* listener);
61  void delete_listener(ActiveOutputsListener* listener);
62 
63  void operator()(mir::Server& server);
64 
65  void process_outputs(std::function<void(std::vector<Output> const& outputs)> const& functor) const;
66 
67 private:
68  struct Self;
69  std::shared_ptr<Self> self;
70 };
71 }
72 
73 #endif //MIRAL_ACTIVE_OUTPUTS_H
Definition: connection.h:26
Definition: active_outputs.h:52
Definition: active_outputs.h:31
Definition: output.h:35
Mir Abstraction Layer.
Definition: active_outputs.h:27

Copyright © 2016 Canonical Ltd.
Generated on Fri Mar 3 10:22:14 UTC 2017