Mir

Merge lp:~mir-team/mir/add-input-method-surface-spec into lp:mir

Proposed by Robert Carr on 2015-01-29
Status: Merged
Approved by: Robert Carr on 2015-02-03
Approved revision: 2284
Merged at revision: 2287
Proposed branch: lp:~mir-team/mir/add-input-method-surface-spec
Merge into: lp:mir
Diff against target: 82 lines (+41/-1)
4 files modified
client-ABI-sha1sums (+1/-1)
include/client/mir_toolkit/mir_surface.h (+16/-0)
src/client/mir_surface_api.cpp (+10/-0)
tests/acceptance-tests/test_client_surfaces.cpp (+14/-0)
To merge this branch: bzr merge lp:~mir-team/mir/add-input-method-surface-spec
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-02-03
Alberto Aguirre Approve on 2015-01-30
Alan Griffiths Approve on 2015-01-30
Alexandros Frantzis (community) Approve on 2015-01-30
Chris Halse Rogers 2015-01-29 Approve on 2015-01-30
Review via email: mp+248063@code.launchpad.net

Commit Message

Add input method surface spec constructor to client API

Description of the Change

For the OSK. Presently its using platform API via qtubuntu. Platform API doesn't build with -Werror-deprecated-declarations and hascontinued to use mir_surface_set_type.

This is required to unblock qtubuntu/port-to-mirclient

To post a comment you must log in.
Chris Halse Rogers (raof) wrote :

Seems legit

review: Approve
Alexandros Frantzis (afrantzis) wrote :

Looks good. CI failure is unrelated.

review: Approve
Alan Griffiths (alan-griffiths) wrote :

71 +
72 +
73 +
...
110 +

Is there a surplus of whitespace?

review: Approve
Alberto Aguirre (albaguirre) wrote :

LGTM

review: Approve
Robert Carr (robertcarr) wrote :

Accidentally --overwrote branch with lp:mir lol...just a sec.

2284. By Robert Carr <racarr@ocelot> on 2015-02-03

Update sha1sums

Robert Carr (robertcarr) wrote :

sha1sums strikes again :(

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client-ABI-sha1sums'
2--- client-ABI-sha1sums 2015-01-29 04:34:12 +0000
3+++ client-ABI-sha1sums 2015-02-03 09:56:22 +0000
4@@ -6,7 +6,7 @@
5 d739af6e64db6b314a727b5fb00be662b98ccd57 include/client/mir_toolkit/mir_platform_message.h
6 9d50df5a141ca03ee8a79f7e844ed4b8b3b7d5d3 include/client/mir_toolkit/mir_prompt_session.h
7 21d07e655e85eeec8a3523e1c6f9c2252176ec01 include/client/mir_toolkit/mir_screencast.h
8-232664cab86958838946ab051e845be5fbd485ca include/client/mir_toolkit/mir_surface.h
9+07c140966a72af13606993f7f8e58b79441f92e6 include/client/mir_toolkit/mir_surface.h
10 b141c4d79802ad626d969249c0004744e5c2a525 include/client/mir_toolkit/mir_wait.h
11 6f7b4ecc22afba923806ed2bd7d8244be90b0cfd include/client/mir_toolkit/version.h
12 3350dac884d6006753de2a955bc7a05663cd9449 include/common/mir_toolkit/client_types.h
13
14=== modified file 'include/client/mir_toolkit/mir_surface.h'
15--- include/client/mir_toolkit/mir_surface.h 2015-01-22 14:33:14 +0000
16+++ include/client/mir_toolkit/mir_surface.h 2015-02-03 09:56:22 +0000
17@@ -548,6 +548,22 @@
18 */
19 MirOrientationMode mir_surface_get_preferred_orientation(MirSurface *surface);
20
21+/**
22+ * Create a surface specification for an input method surface.
23+ *
24+ * Currently this is only appropriate for the Unity On-Screen-Keyboard.
25+ *
26+ * \param [in] connection Connection the surface will be created on
27+ * \param [in] width Requested width. The server is not guaranteed to return a surface of this width.
28+ * \param [in] height Requested height. The server is not guaranteed to return a surface of this height.
29+ * \param [in] format Pixel format for the surface.
30+ * \return A handle that can be passed to mir_surface_create() to complete construction.
31+ */
32+MirSurfaceSpec* mir_connection_create_spec_for_input_method(MirConnection* connection,
33+ int width,
34+ int height,
35+ MirPixelFormat format);
36+
37 #ifdef __cplusplus
38 }
39 /**@}*/
40
41=== modified file 'src/client/mir_surface_api.cpp'
42--- src/client/mir_surface_api.cpp 2015-01-22 14:33:14 +0000
43+++ src/client/mir_surface_api.cpp 2015-02-03 09:56:22 +0000
44@@ -97,6 +97,16 @@
45 return spec;
46 }
47
48+MirSurfaceSpec* mir_connection_create_spec_for_input_method(MirConnection* connection,
49+ int width,
50+ int height,
51+ MirPixelFormat format)
52+{
53+ auto spec = new MirSurfaceSpec{connection, width, height, format};
54+ spec->type = mir_surface_type_inputmethod;
55+ return spec;
56+}
57+
58 MirSurfaceSpec* mir_connection_create_spec_for_modal_dialog(MirConnection* connection,
59 int width,
60 int height,
61
62=== modified file 'tests/acceptance-tests/test_client_surfaces.cpp'
63--- tests/acceptance-tests/test_client_surfaces.cpp 2015-01-20 16:30:18 +0000
64+++ tests/acceptance-tests/test_client_surfaces.cpp 2015-02-03 09:56:22 +0000
65@@ -282,3 +282,17 @@
66 mir_surface_release_sync(dialog);
67 }
68
69+TEST_F(ClientSurfaces, can_be_input_methods)
70+{
71+ auto spec = mir_connection_create_spec_for_input_method(connection, 640, 480,
72+ mir_pixel_format_abgr_8888);
73+ ASSERT_THAT(spec, NotNull());
74+
75+ auto im = mir_surface_create_sync(spec);
76+ mir_surface_spec_release(spec);
77+
78+ EXPECT_EQ(mir_surface_get_type(im), mir_surface_type_inputmethod);
79+
80+ mir_surface_release_sync(im);
81+}
82+

Subscribers

People subscribed via source and target branches