Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
inprocess_egl_client.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
5  * it under the terms of the GNU 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 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: Robert Carr <robert.carr@canonical.com>
17  */
18 
19 #ifndef MIR_EXAMPLES_INPROCESS_EGL_CLIENT_H_
20 #define MIR_EXAMPLES_INPROCESS_EGL_CLIENT_H_
21 
22 #include "mir_toolkit/event.h"
23 
24 #include <thread>
25 #include <memory>
26 #include <atomic>
27 
28 namespace mir
29 {
30 class MainLoop;
31 namespace input
32 {
33 namespace receiver
34 {
35 class InputReceiverThread;
36 }
37 }
38 namespace graphics
39 {
40 class Platform;
41 }
42 namespace shell
43 {
44 class SessionManager;
45 }
46 
47 namespace examples
48 {
49 
52 {
53 public:
54  InprocessEGLClient(std::shared_ptr<graphics::Platform> const& graphics_platform,
55  std::shared_ptr<shell::SessionManager> const& session_manager);
56 
58 
59 protected:
60  InprocessEGLClient(InprocessEGLClient const&) = delete;
62 
63 private:
64  std::shared_ptr<graphics::Platform> const graphics_platform;
65  std::shared_ptr<shell::SessionManager> const session_manager;
66 
67  std::thread client_thread;
68 
69  std::shared_ptr<input::receiver::InputReceiverThread> input_thread;
70 
71  void thread_loop();
72  void handle_event(MirEvent *event);
73 
74  std::atomic<bool> terminate;
75 };
76 
77 }
78 } // namespace mir
79 
80 #endif // MIR_EXAMPLES_INPROCESS_EGL_CLIENT_H_

Copyright © 2012,2013 Canonical Ltd.
Generated on Wed Oct 30 18:52:19 UTC 2013