Mir
server_example_input_event_filter.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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 EXAMPLE_INPUT_EVENT_FILTER_H_
20 #define EXAMPLE_INPUT_EVENT_FILTER_H_
21 
22 #include "mir/input/event_filter.h"
23 
24 #include <functional>
25 #include <memory>
26 
27 namespace mir
28 {
29 class Server;
30 
31 namespace examples
32 {
34 {
35 public:
36  QuitFilter(std::function<void()> const& quit_action);
37 
38  bool handle(MirEvent const& event) override;
39 
40 private:
41  std::function<void()> const quit_action;
42 };
43 
44 // Set up a Ctrl+Alt+BkSp => quit
45 auto make_quit_filter_for(Server& server) -> std::shared_ptr<mir::input::EventFilter>;
46 }
47 }
48 
49 #endif /* EXAMPLE_INPUT_EVENT_FILTER_H_ */
Definition: as_render_target.h:27
bool handle(MirEvent const &event) override
Definition: server_example_input_event_filter.cpp:36
Customise and run a Mir server.
Definition: server.h:85
Definition: server_example_input_event_filter.h:33
QuitFilter(std::function< void()> const &quit_action)
Definition: server_example_input_event_filter.cpp:31
auto make_quit_filter_for(Server &server) -> std::shared_ptr< mir::input::EventFilter >
Definition: server_example_input_event_filter.cpp:58
struct MirEvent MirEvent
Definition: event.h:84
Definition: event_filter.h:29

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Jun 5 13:49:26 UTC 2017