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
=== modified file 'include/mir/default_server_configuration.h'
--- include/mir/default_server_configuration.h 2013-03-04 16:02:02 +0000
+++ include/mir/default_server_configuration.h 2013-03-05 18:31:21 +0000
@@ -102,8 +102,8 @@
102102
103 virtual std::shared_ptr<logging::Logger> the_logger();103 virtual std::shared_ptr<logging::Logger> the_logger();
104104
105 virtual std::shared_ptr<input::InputManager> the_input_manager(105 virtual std::initializer_list<std::shared_ptr<input::EventFilter> const> the_event_filters();
106 const std::initializer_list<std::shared_ptr<input::EventFilter> const>& event_filters);106 virtual std::shared_ptr<input::InputManager> the_input_manager();
107107
108protected:108protected:
109 virtual std::shared_ptr<options::Option> the_options() const;109 virtual std::shared_ptr<options::Option> the_options() const;
110110
=== modified file 'include/mir/server_configuration.h'
--- include/mir/server_configuration.h 2013-03-04 16:02:02 +0000
+++ include/mir/server_configuration.h 2013-03-05 18:31:21 +0000
@@ -52,11 +52,7 @@
52 virtual std::shared_ptr<sessions::SessionStore> the_session_store() = 0;52 virtual std::shared_ptr<sessions::SessionStore> the_session_store() = 0;
53 virtual std::shared_ptr<graphics::Display> the_display() = 0;53 virtual std::shared_ptr<graphics::Display> the_display() = 0;
54 virtual std::shared_ptr<compositor::Drawer> the_drawer() = 0;54 virtual std::shared_ptr<compositor::Drawer> the_drawer() = 0;
5555 virtual std::shared_ptr<input::InputManager> the_input_manager() = 0;
56 // TODO this should not be taking a parameter, but as
57 // TODO input still needs proper integration left for later
58 virtual std::shared_ptr<input::InputManager> the_input_manager(
59 const std::initializer_list<std::shared_ptr<input::EventFilter> const>& event_filters) = 0;
6056
61protected:57protected:
62 ServerConfiguration() = default;58 ServerConfiguration() = default;
6359
=== modified file 'include/mir_test_framework/testing_server_configuration.h'
--- include/mir_test_framework/testing_server_configuration.h 2013-03-04 16:02:02 +0000
+++ include/mir_test_framework/testing_server_configuration.h 2013-03-05 18:31:21 +0000
@@ -48,8 +48,7 @@
48 // We override the_input_manager in the default server configuration48 // We override the_input_manager in the default server configuration
49 // to avoid starting and stopping the full android input stack for tests49 // to avoid starting and stopping the full android input stack for tests
50 // which do not leverage input.50 // which do not leverage input.
51 virtual std::shared_ptr<input::InputManager> the_input_manager(51 virtual std::shared_ptr<input::InputManager> the_input_manager();
52 const std::initializer_list<std::shared_ptr<input::EventFilter> const>& event_filters);
5352
54 virtual std::string the_socket_file() const;53 virtual std::string the_socket_file() const;
55 using DefaultServerConfiguration::the_options;54 using DefaultServerConfiguration::the_options;
5655
=== modified file 'src/default_server_configuration.cpp'
--- src/default_server_configuration.cpp 2013-03-04 16:02:02 +0000
+++ src/default_server_configuration.cpp 2013-03-05 18:31:21 +0000
@@ -59,6 +59,11 @@
5959
60namespace60namespace
61{61{
62std::initializer_list<std::shared_ptr<mi::EventFilter> const> empty_filter_list{};
63}
64
65namespace
66{
62class DefaultIpcFactory : public mf::ProtobufIpcFactory67class DefaultIpcFactory : public mf::ProtobufIpcFactory
63{68{
64public:69public:
@@ -257,14 +262,19 @@
257 });262 });
258}263}
259264
265std::initializer_list<std::shared_ptr<mi::EventFilter> const>
266mir::DefaultServerConfiguration::the_event_filters()
267{
268 return empty_filter_list;
269}
270
260std::shared_ptr<mi::InputManager>271std::shared_ptr<mi::InputManager>
261mir::DefaultServerConfiguration::the_input_manager(272mir::DefaultServerConfiguration::the_input_manager()
262 const std::initializer_list<std::shared_ptr<mi::EventFilter> const>& event_filters)
263{273{
264 return input_manager(274 return input_manager(
265 [&, this]()275 [&, this]()
266 {276 {
267 return mi::create_input_manager(event_filters, the_display());277 return mi::create_input_manager(the_event_filters(), the_display());
268 });278 });
269}279}
270280
271281
=== modified file 'src/display_server.cpp'
--- src/display_server.cpp 2013-03-04 16:02:02 +0000
+++ src/display_server.cpp 2013-03-05 18:31:21 +0000
@@ -35,11 +35,6 @@
35namespace mg = mir::graphics;35namespace mg = mir::graphics;
36namespace mi = mir::input;36namespace mi = mir::input;
3737
38namespace
39{
40std::initializer_list<std::shared_ptr<mi::EventFilter> const> empty_filter_list{};
41}
42
43struct mir::DisplayServer::Private38struct mir::DisplayServer::Private
44{39{
45 Private(ServerConfiguration& config)40 Private(ServerConfiguration& config)
@@ -47,7 +42,7 @@
47 compositor{config.the_drawer()},42 compositor{config.the_drawer()},
48 session_store{config.the_session_store()},43 session_store{config.the_session_store()},
49 communicator{config.the_communicator()},44 communicator{config.the_communicator()},
50 input_manager{config.the_input_manager(empty_filter_list)},45 input_manager{config.the_input_manager()},
51 exit(false)46 exit(false)
52 {47 {
53 }48 }
5449
=== modified file 'tests/integration-tests/cucumber/test_session_management_context.cpp'
--- tests/integration-tests/cucumber/test_session_management_context.cpp 2013-02-25 10:57:42 +0000
+++ tests/integration-tests/cucumber/test_session_management_context.cpp 2013-03-05 18:31:21 +0000
@@ -45,8 +45,7 @@
45{45{
46 MOCK_METHOD0(the_communicator, std::shared_ptr<mf::Communicator>());46 MOCK_METHOD0(the_communicator, std::shared_ptr<mf::Communicator>());
47 MOCK_METHOD0(the_session_store, std::shared_ptr<msess::SessionStore>());47 MOCK_METHOD0(the_session_store, std::shared_ptr<msess::SessionStore>());
48 MOCK_METHOD1(the_input_manager, std::shared_ptr<mi::InputManager>(48 MOCK_METHOD0(the_input_manager, std::shared_ptr<mi::InputManager>());
49 std::initializer_list<std::shared_ptr<mi::EventFilter> const> const&));
50 MOCK_METHOD0(the_display, std::shared_ptr<mg::Display>());49 MOCK_METHOD0(the_display, std::shared_ptr<mg::Display>());
51 MOCK_METHOD0(the_drawer, std::shared_ptr<mc::Drawer>());50 MOCK_METHOD0(the_drawer, std::shared_ptr<mc::Drawer>());
52};51};
5352
=== modified file 'tests/mir_test_framework/testing_server_options.cpp'
--- tests/mir_test_framework/testing_server_options.cpp 2013-03-01 14:43:42 +0000
+++ tests/mir_test_framework/testing_server_options.cpp 2013-03-05 18:31:21 +0000
@@ -126,11 +126,11 @@
126}126}
127127
128128
129std::shared_ptr<mi::InputManager> mtf::TestingServerConfiguration::the_input_manager(const std::initializer_list<std::shared_ptr<mi::EventFilter> const>& event_filters)129std::shared_ptr<mi::InputManager> mtf::TestingServerConfiguration::the_input_manager()
130{130{
131 auto options = the_options();131 auto options = the_options();
132 if (options->get("tests-use-real-input", false))132 if (options->get("tests-use-real-input", false))
133 return mi::create_input_manager(event_filters, the_display());133 return mi::create_input_manager(the_event_filters(), the_display());
134 else134 else
135 return std::make_shared<StubInputManager>();135 return std::make_shared<StubInputManager>();
136}136}

Subscribers

People subscribed via source and target branches