Mir
broadcasting_session_event_sink.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 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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_SCENE_BROADCASTING_SESSION_EVENT_SINK_H_
20 #define MIR_SCENE_BROADCASTING_SESSION_EVENT_SINK_H_
21 
22 #include "session_event_sink.h"
24 
25 #include <vector>
26 #include <mutex>
27 
28 namespace mir
29 {
30 namespace scene
31 {
34 {
35 public:
36  void handle_focus_change(std::shared_ptr<Session> const& session);
37  void handle_no_focus();
38  void handle_session_stopping(std::shared_ptr<Session> const& session);
39 
41  std::function<void(std::shared_ptr<Session> const& session)> const& handler);
43  std::function<void()> const& handler);
45  std::function<void(std::shared_ptr<Session> const& session)> const& handler);
46 
47 private:
48  std::mutex handler_mutex;
49  std::vector<std::function<void(std::shared_ptr<Session> const&)>> focus_change_handlers;
50  std::vector<std::function<void()>> no_focus_handlers;
51  std::vector<std::function<void(std::shared_ptr<Session> const&)>> session_stopping_handlers;
52 };
53 
54 }
55 }
56 
57 #endif /* MIR_SCENE_BROADCASTING_SESSION_EVENT_SINK_H_ */
void register_no_focus_handler(std::function< void()> const &handler)
Definition: broadcasting_session_event_sink.cpp:80
All things Mir.
Definition: atomic_callback.h:25
void handle_session_stopping(std::shared_ptr< Session > const &session)
Definition: broadcasting_session_event_sink.cpp:58
void handle_focus_change(std::shared_ptr< Session > const &session)
Definition: broadcasting_session_event_sink.cpp:31
void register_focus_change_handler(std::function< void(std::shared_ptr< Session > const &session)> const &handler)
Definition: broadcasting_session_event_sink.cpp:72
Definition: broadcasting_session_event_sink.h:32
Definition: session_event_sink.h:30
void handle_no_focus()
Definition: broadcasting_session_event_sink.cpp:45
Definition: session_event_handler_register.h:31
void register_session_stopping_handler(std::function< void(std::shared_ptr< Session > const &session)> const &handler)
Definition: broadcasting_session_event_sink.cpp:88

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016