Mir
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 2 or 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 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 <functional>
23 #include <memory>
24 #include <vector>
25 
26 namespace mir { class Server; }
27 
28 namespace miral
29 {
30 class Output;
31 
33 {
34 public:
35  ActiveOutputsListener() = default;
36 
38  virtual void advise_output_begin();
39 
41  virtual void advise_output_end();
42 
43  virtual void advise_output_create(Output const& output);
44  virtual void advise_output_update(Output const& updated, Output const& original);
45  virtual void advise_output_delete(Output const& output);
46 
47 protected:
48  virtual ~ActiveOutputsListener() = default;
50  ActiveOutputsListener operator=(ActiveOutputsListener const&) = delete;
51 };
52 
54 {
55 public:
59  ActiveOutputsMonitor& operator=(ActiveOutputsMonitor const&);
60 
61  void add_listener(ActiveOutputsListener* listener);
62  void delete_listener(ActiveOutputsListener* listener);
63 
64  void operator()(mir::Server& server);
65 
66  void process_outputs(std::function<void(std::vector<Output> const& outputs)> const& functor) const;
67 
68 private:
69  struct Self;
70  std::shared_ptr<Self> self;
71 };
72 }
73 
74 #endif //MIRAL_ACTIVE_OUTPUTS_H
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: sw_splash.h:26
Definition: active_outputs.h:53
Definition: active_outputs.h:32
Definition: output.h:35
Mir Abstraction Layer.
Definition: floating_window_manager.h:32

Copyright © 2012-2018 Canonical Ltd.
Generated on Mon Feb 19 14:05:11 UTC 2018