Mir

Merge lp:~robertcarr/mir/rework-input-manager-configuration into lp:~mir-team/mir/trunk

Proposed by Robert Carr
Status: Merged
Approved by: Alexandros Frantzis
Approved revision: no longer in the source branch.
Merged at revision: 465
Proposed branch: lp:~robertcarr/mir/rework-input-manager-configuration
Merge into: lp:~mir-team/mir/trunk
Diff against target: 141 lines (+21/-22)
7 files modified
include/mir/default_server_configuration.h (+2/-2)
include/mir/server_configuration.h (+1/-5)
include/mir_test_framework/testing_server_configuration.h (+1/-2)
src/default_server_configuration.cpp (+13/-3)
src/display_server.cpp (+1/-6)
tests/integration-tests/cucumber/test_session_management_context.cpp (+1/-2)
tests/mir_test_framework/testing_server_options.cpp (+2/-2)
To merge this branch: bzr merge lp:~robertcarr/mir/rework-input-manager-configuration
Reviewer Review Type Date Requested Status
Kevin DuBois (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Approve
Review via email: mp+151636@code.launchpad.net

Commit message

Rework filter parameter to ServerConfiguration::the_input_manager as a seperate configuration method

Description of the change

Rework filter parameter to ServerConfiguration::the_input_manager as a seperate configuration method

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

10 + virtual std::initializer_list<std::shared_ptr<input::EventFilter> const> the_event_filters();

118 + MOCK_METHOD0(the_event_filters, std::initializer_list<std::shared_ptr<mi::EventFilter> const>());

Not needed.

~~~~

64 +std::initializer_list<std::shared_ptr<mi::EventFilter> const>
65 +mir::DefaultServerConfiguration::the_event_filters()
66 +{
67 + return empty_filter_list;
68 +}

This is probably OK for now (because the list is empty).

When real event filters are collected we will want to return the same list from each call and this may not be the best way to do it.

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

This is probably OK for now

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

seems ok to me as well. I'm curious about if the_event_filters will change (eg, will the event filter list change?) Either way its ok as it is as the structure of the event filters will probably change a bit more before they're complete

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/mir/default_server_configuration.h'
2--- include/mir/default_server_configuration.h 2013-03-04 16:02:02 +0000
3+++ include/mir/default_server_configuration.h 2013-03-05 18:31:21 +0000
4@@ -102,8 +102,8 @@
5
6 virtual std::shared_ptr<logging::Logger> the_logger();
7
8- virtual std::shared_ptr<input::InputManager> the_input_manager(
9- const std::initializer_list<std::shared_ptr<input::EventFilter> const>& event_filters);
10+ virtual std::initializer_list<std::shared_ptr<input::EventFilter> const> the_event_filters();
11+ virtual std::shared_ptr<input::InputManager> the_input_manager();
12
13 protected:
14 virtual std::shared_ptr<options::Option> the_options() const;
15
16=== modified file 'include/mir/server_configuration.h'
17--- include/mir/server_configuration.h 2013-03-04 16:02:02 +0000
18+++ include/mir/server_configuration.h 2013-03-05 18:31:21 +0000
19@@ -52,11 +52,7 @@
20 virtual std::shared_ptr<sessions::SessionStore> the_session_store() = 0;
21 virtual std::shared_ptr<graphics::Display> the_display() = 0;
22 virtual std::shared_ptr<compositor::Drawer> the_drawer() = 0;
23-
24- // TODO this should not be taking a parameter, but as
25- // TODO input still needs proper integration left for later
26- virtual std::shared_ptr<input::InputManager> the_input_manager(
27- const std::initializer_list<std::shared_ptr<input::EventFilter> const>& event_filters) = 0;
28+ virtual std::shared_ptr<input::InputManager> the_input_manager() = 0;
29
30 protected:
31 ServerConfiguration() = default;
32
33=== modified file 'include/mir_test_framework/testing_server_configuration.h'
34--- include/mir_test_framework/testing_server_configuration.h 2013-03-04 16:02:02 +0000
35+++ include/mir_test_framework/testing_server_configuration.h 2013-03-05 18:31:21 +0000
36@@ -48,8 +48,7 @@
37 // We override the_input_manager in the default server configuration
38 // to avoid starting and stopping the full android input stack for tests
39 // which do not leverage input.
40- virtual std::shared_ptr<input::InputManager> the_input_manager(
41- const std::initializer_list<std::shared_ptr<input::EventFilter> const>& event_filters);
42+ virtual std::shared_ptr<input::InputManager> the_input_manager();
43
44 virtual std::string the_socket_file() const;
45 using DefaultServerConfiguration::the_options;
46
47=== modified file 'src/default_server_configuration.cpp'
48--- src/default_server_configuration.cpp 2013-03-04 16:02:02 +0000
49+++ src/default_server_configuration.cpp 2013-03-05 18:31:21 +0000
50@@ -59,6 +59,11 @@
51
52 namespace
53 {
54+std::initializer_list<std::shared_ptr<mi::EventFilter> const> empty_filter_list{};
55+}
56+
57+namespace
58+{
59 class DefaultIpcFactory : public mf::ProtobufIpcFactory
60 {
61 public:
62@@ -257,14 +262,19 @@
63 });
64 }
65
66+std::initializer_list<std::shared_ptr<mi::EventFilter> const>
67+mir::DefaultServerConfiguration::the_event_filters()
68+{
69+ return empty_filter_list;
70+}
71+
72 std::shared_ptr<mi::InputManager>
73-mir::DefaultServerConfiguration::the_input_manager(
74- const std::initializer_list<std::shared_ptr<mi::EventFilter> const>& event_filters)
75+mir::DefaultServerConfiguration::the_input_manager()
76 {
77 return input_manager(
78 [&, this]()
79 {
80- return mi::create_input_manager(event_filters, the_display());
81+ return mi::create_input_manager(the_event_filters(), the_display());
82 });
83 }
84
85
86=== modified file 'src/display_server.cpp'
87--- src/display_server.cpp 2013-03-04 16:02:02 +0000
88+++ src/display_server.cpp 2013-03-05 18:31:21 +0000
89@@ -35,11 +35,6 @@
90 namespace mg = mir::graphics;
91 namespace mi = mir::input;
92
93-namespace
94-{
95-std::initializer_list<std::shared_ptr<mi::EventFilter> const> empty_filter_list{};
96-}
97-
98 struct mir::DisplayServer::Private
99 {
100 Private(ServerConfiguration& config)
101@@ -47,7 +42,7 @@
102 compositor{config.the_drawer()},
103 session_store{config.the_session_store()},
104 communicator{config.the_communicator()},
105- input_manager{config.the_input_manager(empty_filter_list)},
106+ input_manager{config.the_input_manager()},
107 exit(false)
108 {
109 }
110
111=== modified file 'tests/integration-tests/cucumber/test_session_management_context.cpp'
112--- tests/integration-tests/cucumber/test_session_management_context.cpp 2013-02-25 10:57:42 +0000
113+++ tests/integration-tests/cucumber/test_session_management_context.cpp 2013-03-05 18:31:21 +0000
114@@ -45,8 +45,7 @@
115 {
116 MOCK_METHOD0(the_communicator, std::shared_ptr<mf::Communicator>());
117 MOCK_METHOD0(the_session_store, std::shared_ptr<msess::SessionStore>());
118- MOCK_METHOD1(the_input_manager, std::shared_ptr<mi::InputManager>(
119- std::initializer_list<std::shared_ptr<mi::EventFilter> const> const&));
120+ MOCK_METHOD0(the_input_manager, std::shared_ptr<mi::InputManager>());
121 MOCK_METHOD0(the_display, std::shared_ptr<mg::Display>());
122 MOCK_METHOD0(the_drawer, std::shared_ptr<mc::Drawer>());
123 };
124
125=== modified file 'tests/mir_test_framework/testing_server_options.cpp'
126--- tests/mir_test_framework/testing_server_options.cpp 2013-03-01 14:43:42 +0000
127+++ tests/mir_test_framework/testing_server_options.cpp 2013-03-05 18:31:21 +0000
128@@ -126,11 +126,11 @@
129 }
130
131
132-std::shared_ptr<mi::InputManager> mtf::TestingServerConfiguration::the_input_manager(const std::initializer_list<std::shared_ptr<mi::EventFilter> const>& event_filters)
133+std::shared_ptr<mi::InputManager> mtf::TestingServerConfiguration::the_input_manager()
134 {
135 auto options = the_options();
136 if (options->get("tests-use-real-input", false))
137- return mi::create_input_manager(event_filters, the_display());
138+ return mi::create_input_manager(the_event_filters(), the_display());
139 else
140 return std::make_shared<StubInputManager>();
141 }

Subscribers

People subscribed via source and target branches