Mir

Merge lp:~alan-griffiths/mir/first-cut-at-lp1415321 into lp:mir

Proposed by Alan Griffiths
Status: Work in progress
Proposed branch: lp:~alan-griffiths/mir/first-cut-at-lp1415321
Merge into: lp:mir
Diff against target: 284 lines (+65/-39)
12 files modified
src/client/CMakeLists.txt (+17/-2)
src/client/events/CMakeLists.txt (+2/-2)
src/client/input/CMakeLists.txt (+8/-12)
src/client/input/input_event.cpp (+1/-1)
src/client/symbols.map (+27/-0)
src/common/CMakeLists.txt (+0/-10)
src/common/sharedlibrary/CMakeLists.txt (+4/-1)
src/include/common/mir/logging/input_timestamp.h (+1/-5)
src/server/CMakeLists.txt (+2/-1)
src/server/graphics/nested/CMakeLists.txt (+0/-4)
tests/unit-tests/CMakeLists.txt (+2/-0)
tests/unit-tests/client/input/test_android_input_receiver.cpp (+1/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/first-cut-at-lp1415321
Reviewer Review Type Date Requested Status
Chris Halse Rogers Needs Fixing
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+252627@code.launchpad.net

Commit message

common, client: move client library code into libmirclient

Description of the change

common, client: move client library code into libmirclient

This is a first cut - there is probably more tidy-up required. But offered up so that other eyes can help spot the opportunities.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Halse Rogers (raof) wrote :

Why is mir::Udev::* in mirclient now? That's used by the platform code, and not by the client at all AFAIK.

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

> Why is mir::Udev::* in mirclient now? That's used by the platform code, and
> not by the client at all AFAIK.

Because it was hidden in common/input.

Good catch. Thanks

Unmerged revisions

2389. By Alan Griffiths

Fix linker issues

2388. By Alan Griffiths

Move a bunch of client library code out of libmircommon

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'include/client/mir'
2=== renamed directory 'include/common/mir/input' => 'include/client/mir/input'
3=== renamed file 'include/common/mir_toolkit/client_types.h' => 'include/client/mir_toolkit/client_types.h'
4=== renamed file 'include/common/mir_toolkit/event.h' => 'include/client/mir_toolkit/event.h'
5=== renamed directory 'include/common/mir_toolkit/events' => 'include/client/mir_toolkit/events'
6=== modified file 'src/client/CMakeLists.txt'
7--- src/client/CMakeLists.txt 2015-03-10 03:17:27 +0000
8+++ src/client/CMakeLists.txt 2015-03-11 18:04:02 +0000
9@@ -30,14 +30,24 @@
10 add_definitions(-DCLIENT_PLATFORM_VERSION="${MIR_CLIENT_PLATFORM_VERSION}")
11 add_definitions(-DMIR_LOGGING_COMPONENT_FALLBACK="mirclient")
12
13+set(MIR_CLIENT_SOURCES)
14+set(MIR_CLIENT_REFERENCES)
15+
16 add_subdirectory(rpc/)
17 add_subdirectory(lttng/)
18+add_subdirectory(events)
19+add_subdirectory(input)
20+
21+MESSAGE( STATUS "MIR_CLIENT_SOURCES. . . : ${MIR_CLIENT_SOURCES}" )
22+MESSAGE( STATUS "MIR_CLIENT_REFERENCES . : ${MIR_CLIENT_REFERENCES}" )
23+
24
25 add_library(mirclientobjects OBJECT
26
27 client_buffer_depository.cpp
28 display_configuration.cpp
29 error_connections.cpp
30+ event.cpp
31 mir_connection.cpp
32 mir_connection_api.cpp
33 mir_wait_handle.cpp
34@@ -63,14 +73,19 @@
35 buffer_stream.cpp
36 mir_buffer_stream_api.cpp
37 default_client_buffer_stream_factory.cpp
38+ ${MIR_CLIENT_SOURCES}
39 )
40
41 # Ensure protobuf C++ headers have been produced before
42 # trying to compile mirclientobjects
43 add_dependencies(mirclientobjects mirprotobuf)
44
45-add_library(mirclient SHARED $<TARGET_OBJECTS:mirclientobjects>)
46-add_library(mirclient-static STATIC $<TARGET_OBJECTS:mirclientobjects>)
47+add_library(mirclient SHARED $<TARGET_OBJECTS:mirclientobjects> $<TARGET_OBJECTS:mirsharedinput>)
48+add_library(mirclient-static STATIC $<TARGET_OBJECTS:mirclientobjects> $<TARGET_OBJECTS:mirsharedinput>)
49+
50+target_link_libraries(mirclient
51+ ${MIR_CLIENT_REFERENCES}
52+)
53
54 set_target_properties(mirclient
55
56
57=== renamed file 'src/common/event.cpp' => 'src/client/event.cpp'
58=== renamed directory 'src/common/events' => 'src/client/events'
59=== modified file 'src/client/events/CMakeLists.txt'
60--- src/common/events/CMakeLists.txt 2015-01-22 22:56:47 +0000
61+++ src/client/events/CMakeLists.txt 2015-03-11 18:04:02 +0000
62@@ -14,8 +14,8 @@
63 #
64 # Authored by: Robert Carr <robert.carr@canonical.com>
65
66-list(APPEND MIR_COMMON_SOURCES
67+list(APPEND MIR_CLIENT_SOURCES
68 ${CMAKE_CURRENT_SOURCE_DIR}/event_builders.cpp
69 )
70
71-set(MIR_COMMON_SOURCES ${MIR_COMMON_SOURCES} PARENT_SCOPE)
72+set(MIR_CLIENT_SOURCES ${MIR_CLIENT_SOURCES} PARENT_SCOPE)
73
74=== renamed directory 'src/common/input' => 'src/client/input'
75=== modified file 'src/client/input/CMakeLists.txt'
76--- src/common/input/CMakeLists.txt 2015-03-05 05:47:28 +0000
77+++ src/client/input/CMakeLists.txt 2015-03-11 18:04:02 +0000
78@@ -30,17 +30,13 @@
79 ${CMAKE_CURRENT_SOURCE_DIR}/xkb_mapper.cpp
80 )
81
82-list(APPEND MIR_COMMON_SOURCES
83- $<TARGET_OBJECTS:mirsharedinput>
84-)
85-
86-# As we put android-input in MIR_COMMON_REFERENCES it ends up linked into
87+# As we put android-input in MIR_CLIENT_REFERENCES it ends up linked into
88 # libmirserver. But linking into libmircommon fails as it in turn needs
89 # mir::mir::terminate_with_current_exception() from mirserver
90-list(APPEND MIR_COMMON_REFERENCES android-input)
91-
92-list(APPEND MIR_COMMON_REFERENCES ${XKBCOMMON_LIBRARIES})
93-list(APPEND MIR_COMMON_REFERENCES ${UDEV_LDFLAGS} ${UDEV_LIBRARIES})
94-
95-set(MIR_COMMON_SOURCES ${MIR_COMMON_SOURCES} PARENT_SCOPE)
96-set(MIR_COMMON_REFERENCES ${MIR_COMMON_REFERENCES} PARENT_SCOPE)
97+list(APPEND MIR_CLIENT_REFERENCES android-input)
98+
99+list(APPEND MIR_CLIENT_REFERENCES ${XKBCOMMON_LIBRARIES})
100+list(APPEND MIR_CLIENT_REFERENCES ${UDEV_LDFLAGS} ${UDEV_LIBRARIES})
101+
102+set(MIR_CLIENT_SOURCES ${MIR_CLIENT_SOURCES} PARENT_SCOPE)
103+set(MIR_CLIENT_REFERENCES ${MIR_CLIENT_REFERENCES} PARENT_SCOPE)
104
105=== modified file 'src/client/input/input_event.cpp'
106--- src/common/input/input_event.cpp 2015-02-18 05:27:28 +0000
107+++ src/client/input/input_event.cpp 2015-03-11 18:04:02 +0000
108@@ -18,7 +18,7 @@
109
110 #define MIR_INCLUDE_DEPRECATED_EVENT_HEADER
111
112-#define MIR_LOGGING_COMPONENT "input-event-access"
113+#define MIR_LOG_COMPONENT "input-event-access"
114
115 #include "mir/event_type_to_string.h"
116 #include "mir/log.h"
117
118=== modified file 'src/client/symbols.map'
119--- src/client/symbols.map 2015-02-18 05:27:28 +0000
120+++ src/client/symbols.map 2015-03-11 18:04:02 +0000
121@@ -44,3 +44,30 @@
122 mir_connection_create_spec_for_dialog;
123 mir_connection_platform_operation;
124 } MIR_CLIENT_8.2;
125+
126+MIR_CLIENT_8.4{
127+ global:
128+ extern "C++" {
129+ mir::events::make_event*;
130+ mir::input::android::Lexicon::translate*;
131+ mir::udev::Context::?Context*;
132+ mir::udev::Context::Context*;
133+ mir::udev::Enumerator::begin*;
134+ mir::udev::Enumerator::end*;
135+ mir::udev::Enumerator::?Enumerator*;
136+ mir::udev::Enumerator::Enumerator*;
137+ mir::udev::Enumerator::iterator::operator*;
138+ mir::udev::Enumerator::match_parent*;
139+ mir::udev::Enumerator::match_subsystem*;
140+ mir::udev::Enumerator::match_sysname*;
141+ mir::udev::Enumerator::scan_devices*;
142+ mir::udev::Monitor::enable*;
143+ mir::udev::Monitor::fd*;
144+ mir::udev::Monitor::filter_by_subsystem*;
145+ mir::udev::Monitor::?Monitor*;
146+ mir::udev::Monitor::Monitor*;
147+ mir::udev::Monitor::process_events*;
148+ mir::udev::operator*;
149+ };
150+} MIR_CLIENT_8.3;
151+
152
153=== modified file 'src/common/CMakeLists.txt'
154--- src/common/CMakeLists.txt 2015-02-18 05:27:28 +0000
155+++ src/common/CMakeLists.txt 2015-03-11 18:04:02 +0000
156@@ -10,7 +10,6 @@
157
158 add_subdirectory(fd)
159 add_subdirectory(geometry)
160-add_subdirectory(input)
161 add_subdirectory(logging)
162 add_subdirectory(report/lttng)
163 add_subdirectory(env)
164@@ -23,7 +22,6 @@
165 $<TARGET_OBJECTS:mirtime>
166 ${CMAKE_CURRENT_SOURCE_DIR}/log.cpp
167 )
168-add_subdirectory(events)
169
170 set(PREFIX "${CMAKE_INSTALL_PREFIX}")
171 set(EXEC_PREFIX "${CMAKE_INSTALL_PREFIX}")
172@@ -35,14 +33,6 @@
173 ${MIR_GENERATED_INCLUDE_DIRECTORIES}
174 PARENT_SCOPE)
175
176-
177-MESSAGE( STATUS "MIR_COMMON_SOURCES. . . : ${MIR_COMMON_SOURCES}" )
178-MESSAGE( STATUS "MIR_COMMON_REFERENCES . : ${MIR_COMMON_REFERENCES}" )
179-
180-list(APPEND MIR_COMMON_SOURCES
181- ${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
182-)
183-
184 add_library(mircommon
185 SHARED
186 ${MIR_COMMON_SOURCES}
187
188=== modified file 'src/common/sharedlibrary/CMakeLists.txt'
189--- src/common/sharedlibrary/CMakeLists.txt 2015-03-05 05:47:28 +0000
190+++ src/common/sharedlibrary/CMakeLists.txt 2015-03-11 18:04:02 +0000
191@@ -24,7 +24,10 @@
192 $<TARGET_OBJECTS:mirsharedsharedlibrary>
193 )
194
195-list(APPEND MIR_COMMON_REFERENCES dl)
196+list(APPEND MIR_COMMON_REFERENCES
197+ dl
198+ ${Boost_LIBRARIES}
199+)
200
201 set(MIR_COMMON_SOURCES ${MIR_COMMON_SOURCES} PARENT_SCOPE)
202 set(MIR_COMMON_REFERENCES ${MIR_COMMON_REFERENCES} PARENT_SCOPE)
203
204=== modified file 'src/include/common/mir/logging/input_timestamp.h'
205--- src/include/common/mir/logging/input_timestamp.h 2015-02-18 05:27:28 +0000
206+++ src/include/common/mir/logging/input_timestamp.h 2015-03-11 18:04:02 +0000
207@@ -1,5 +1,5 @@
208 /*
209- * Copyright © 2013 Canonical Ltd.
210+ * Copyright © 2013-2015 Canonical Ltd.
211 *
212 * This program is free software: you can redistribute it and/or modify it
213 * under the terms of the GNU Lesser General Public License version 3,
214@@ -19,10 +19,6 @@
215 #ifndef MIR_LOGGING_INPUT_TIMESTAMP_H_
216 #define MIR_LOGGING_INPUT_TIMESTAMP_H_
217
218-#define MIR_INCLUDE_DEPRECATED_EVENT_HEADER
219-
220-#include "mir_toolkit/event.h"
221-
222 #include <string>
223 #include <chrono>
224
225
226=== modified file 'src/server/CMakeLists.txt'
227--- src/server/CMakeLists.txt 2015-03-05 05:47:28 +0000
228+++ src/server/CMakeLists.txt 2015-03-11 18:04:02 +0000
229@@ -5,8 +5,9 @@
230
231 include_directories(
232 ${PROJECT_SOURCE_DIR}/include/platform
233+ ${PROJECT_SOURCE_DIR}/include/client
234+ ${PROJECT_SOURCE_DIR}/include/server
235 ${PROJECT_SOURCE_DIR}/src/include/platform
236- ${PROJECT_SOURCE_DIR}/include/server
237 ${PROJECT_SOURCE_DIR}/src/include/server
238 ${GLIB_INCLUDE_DIRS}
239 )
240
241=== modified file 'src/server/graphics/nested/CMakeLists.txt'
242--- src/server/graphics/nested/CMakeLists.txt 2015-01-21 07:34:50 +0000
243+++ src/server/graphics/nested/CMakeLists.txt 2015-03-11 18:04:02 +0000
244@@ -1,7 +1,3 @@
245-include_directories(
246- ${PROJECT_SOURCE_DIR}/include/client
247-)
248-
249 add_library(
250 mirnestedgraphics OBJECT
251
252
253=== modified file 'tests/unit-tests/CMakeLists.txt'
254--- tests/unit-tests/CMakeLists.txt 2015-03-05 05:47:28 +0000
255+++ tests/unit-tests/CMakeLists.txt 2015-03-11 18:04:02 +0000
256@@ -83,6 +83,7 @@
257 ${UNIT_TEST_SOURCES}
258 ${MIR_SERVER_OBJECTS}
259 $<TARGET_OBJECTS:mirclientobjects>
260+ $<TARGET_OBJECTS:mirsharedinput>
261 ${MIR_PLATFORM_OBJECTS}
262 ${MIR_COMMON_OBJECTS}
263 )
264@@ -130,6 +131,7 @@
265 ${MIR_PLATFORM_REFERENCES}
266 ${MIR_COMMON_REFERENCES}
267 ${MIR_SERVER_REFERENCES}
268+ ${XKBCOMMON_LIBRARIES}
269 )
270
271 if (MIR_BUILD_PLATFORM_ANDROID)
272
273=== modified file 'tests/unit-tests/client/input/test_android_input_receiver.cpp'
274--- tests/unit-tests/client/input/test_android_input_receiver.cpp 2015-03-05 05:47:28 +0000
275+++ tests/unit-tests/client/input/test_android_input_receiver.cpp 2015-03-11 18:04:02 +0000
276@@ -18,7 +18,7 @@
277
278 #define MIR_INCLUDE_DEPRECATED_EVENT_HEADER
279
280-#include "src/common/input/android/android_input_receiver.h"
281+#include "src/client/input/android/android_input_receiver.h"
282 #include "mir/input/null_input_receiver_report.h"
283 #include "mir/input/xkb_mapper.h"
284 #include "mir_toolkit/event.h"

Subscribers

People subscribed via source and target branches