Mir
set_compositor.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2021 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 
17 #ifndef MIROIL_SET_COMPOSITOR_H
18 #define MIROIL_SET_COMPOSITOR_H
19 #include <memory>
20 #include <functional>
21 
22 namespace mir { class Server; }
23 namespace mir { namespace graphics { class Display; } }
24 namespace mir { namespace compositor { class DisplayListener; } }
25 
26 namespace miroil
27 {
28  class Compositor;
29 
30 // Configure the server for using the Qt compositor
32 {
33  using InitFunction = std::function<void(const std::shared_ptr<mir::graphics::Display>& display,
34  const std::shared_ptr<Compositor> & compositor,
35  const std::shared_ptr<mir::compositor::DisplayListener>& displayListener)>;
36 
37  using ConstructorFunction = std::function<std::shared_ptr<Compositor>()>;
38 
39 public:
40  SetCompositor(ConstructorFunction constructor, InitFunction init);
41 
42  void operator()(mir::Server& server);
43 
44 private:
45  struct CompositorImpl;
46 
47  std::weak_ptr<CompositorImpl> compositor_impl;
48  ConstructorFunction constructor_function;
49  InitFunction init_function;
50 };
51 
52 }
53 
54 #endif //MIROIL_SET_COMPOSITOR_H
Definition: set_compositor.h:32
SetCompositor(ConstructorFunction constructor, InitFunction init)
void operator()(mir::Server &server)
Definition: splash_session.h:22
Definition: compositor.h:21

Copyright © 2012-2022 Canonical Ltd.
Generated on Tue May 24 14:35:34 UTC 2022
This documentation is licensed under the GPL version 2 or 3.