Merge lp:~raof/mir/the-least-dirty-thing into lp:mir
- the-least-dirty-thing
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Alberto Aguirre |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2005 |
Proposed branch: | lp:~raof/mir/the-least-dirty-thing |
Merge into: | lp:mir |
Diff against target: |
1865 lines (+1026/-46) 53 files modified
client-ABI-sha1sums (+1/-1) debian/control (+46/-0) debian/libmirclient-debug-extension-dev.install (+3/-0) debian/libmirclient-debug-extension1.install (+1/-0) debian/libmirclient-dev.install (+1/-1) include/client/mir_toolkit/debug/surface.h (+20/-0) include/platform/mir/options/configuration.h (+1/-0) include/server/mir/default_server_configuration.h (+3/-0) include/server/mir/scene/coordinate_translator.h (+66/-0) platform-ABI-sha1sums (+1/-1) server-ABI-sha1sums (+3/-2) src/client/CMakeLists.txt (+52/-2) src/client/mir_connection.cpp (+3/-1) src/client/mir_connection.h (+1/-0) src/client/mir_debug_api.cpp (+39/-0) src/client/mir_surface.cpp (+63/-0) src/client/mir_surface.h (+16/-1) src/client/mir_surface_api.cpp (+2/-3) src/client/mirclient-debug-extension.pc.in (+11/-0) src/client/mirclient.pc.in (+5/-3) src/client/symbols-debug.map (+5/-0) src/common/protobuf/mir_protobuf.proto (+17/-0) src/common/symbols.map (+54/-0) src/include/server/mir/frontend/unsupported_feature_exception.h (+41/-0) src/platform/options/default_configuration.cpp (+4/-1) src/platform/symbols.map (+1/-0) src/server/frontend/CMakeLists.txt (+1/-0) src/server/frontend/default_configuration.cpp (+21/-8) src/server/frontend/default_ipc_factory.cpp (+6/-3) src/server/frontend/default_ipc_factory.h (+8/-1) src/server/frontend/protobuf_message_processor.cpp (+37/-0) src/server/frontend/session_mediator.cpp (+30/-2) src/server/frontend/session_mediator.h (+16/-2) src/server/frontend/unsupported_coordinate_translator.cpp (+32/-0) src/server/frontend/unsupported_coordinate_translator.h (+37/-0) src/server/scene/CMakeLists.txt (+1/-0) src/server/scene/default_configuration.cpp (+11/-0) src/server/scene/default_coordinate_translator.cpp (+32/-0) src/server/scene/default_coordinate_translator.h (+37/-0) src/server/symbols.map (+6/-0) tests/acceptance-tests/CMakeLists.txt (+2/-0) tests/acceptance-tests/test_client_library.cpp (+0/-1) tests/acceptance-tests/test_client_surface_events.cpp (+1/-1) tests/acceptance-tests/test_client_surfaces.cpp (+1/-1) tests/acceptance-tests/test_custom_input_dispatcher.cpp (+2/-2) tests/acceptance-tests/test_debug_api.cpp (+231/-0) tests/include/mir_test_doubles/mock_coordinate_translator.h (+42/-0) tests/include/mir_test_doubles/mock_surface.h (+2/-1) tests/integration-tests/CMakeLists.txt (+1/-0) tests/integration-tests/test_stale_frames.cpp (+1/-1) tests/unit-tests/frontend/test_session_mediator.cpp (+5/-5) tests/unit-tests/frontend/test_session_mediator_android.cpp (+1/-1) tests/unit-tests/frontend/test_session_mediator_mesa.cpp (+2/-1) |
To merge this branch: | bzr merge lp:~raof/mir/the-least-dirty-thing |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Alberto Aguirre (community) | Approve | ||
Alan Griffiths | Approve | ||
Daniel van Vugt | Abstain | ||
Andreas Pokorny (community) | Approve | ||
Alexandros Frantzis (community) | Approve | ||
Kevin DuBois (community) | Abstain | ||
Review via email: mp+231679@code.launchpad.net |
Commit message
Add a debug interface to translate from surface to screen coordinates.
This is the Mir part of the infrastructure for Autopilot to determine the screen location of widgets, for full-stack testing.
This is hidden behind a --debug server option, to make it absolutely clear that applications cannot depend on this functionality outside of a constrained environment.
(See also https:/
Description of the change
Add a translate_
This can be somewhat cleaned up when we've got real support for extensions, but should do for now.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1849
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
Minor observations so far:
(1) 18 +Package: libmirclient-debug
is potentially confusing with the existing convention: packagename-dbg
so I think the dash needs removing. Something like "libmirclientte
(2) It seems we're going backwards in code bloat faster than I can keep up with fixing it. Can we avoid this part?
176 +
177 +# TODO: Extension apparatus so that mirclient-debug can be a MODULE and not
178 +# duplicate (almost) the entirity of mirclient
179 +add_library(
180 + mirclient-debug SHARED
181 +
182 + mir_debug_api.cpp
183 + $<TARGET_
184 +)
(3) The amount of coupling we have is a bit excessive. Or is that an existing issue imposed by the existing class design?; "make_mediator()"
Kevin DuBois (kdub) wrote : | # |
36 + Interfaces will come and go; end-user applications SHOULD NOT be linked
37 + against this library.
"interfaces come and go" is true of all the public interfaces... We should say something stronger like:
"Not all mir servers run with the capability to service this api; end-user applications SHOULD NOT depend on the functionality of this api."
Chris Halse Rogers (raof) wrote : | # |
> Minor observations so far:
>
> (1) 18 +Package: libmirclient-debug
> is potentially confusing with the existing convention: packagename-dbg
> so I think the dash needs removing. Something like "libmirclientte
> since it's really not about "debugging" Mir at all.
It actually is a bit about debugging Mir; at least, I've used the symbols in there to debug Mir and low-level client bits like XMir.
>
> (2) It seems we're going backwards in code bloat faster than I can keep up
> with fixing it. Can we avoid this part?
Not without either (a) exposing all the libmirclient internal symbols, or (b) adding in a real extension mechanism.
Since this library isn't expected to be installed on anything but development machines I wouldn't care if it was 100MB. I don't think we should spend any significant effort caring about its size.
We'll want an actual extension mechanism at some point in the future. At that point this can be switched to using that and libmirclient-
>
> (3) The amount of coupling we have is a bit excessive. Or is that an existing
> issue imposed by the existing class design?; "make_mediator()"
Yeah, that's the existing class design.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1852
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
> "Not all mir servers run with the capability to service this api; end-user applications SHOULD NOT depend on the functionality of this api."
I agree with Kevin. I don't think it's worth having a different debugging version of the client library. Until we get an extension mechanism, I would prefer just exposing the debug APIs in our normal client library builds (like we have been doing up to now).
Chris Halse Rogers (raof) wrote : | # |
From the client perspective it *is* an extension; libmirclient-
I can, of course, fold those symbols back into libmirclient. I think it's useful to have the non-core things split out a bit, though.
Daniel van Vugt (vanvugt) wrote : | # |
OK, I still have the same concerns as mentioned above. But nothing strictly blocking. That's not to say this is a proper review.
Chris Halse Rogers (raof) wrote : | # |
So, I'm not sure what needs to be done here in order to make this acceptable.
Do I need to fold the three debugging APIs back into libmirclient rather than their own DSO? Do I need to reduce the on-disc size of libmirclient-
Alexandros Frantzis (afrantzis) wrote : | # |
> Do I need to fold the three debugging APIs back into libmirclient rather than their own DSO?
> Do I need to reduce the on-disc size of libmirclient-
> infrastructure for extension loading in libmirclient?
I am fine with folding the debugging APIs back into libmirclient until we get a proper extension mechanism.
Kevin DuBois (kdub) wrote : | # |
So, the stronger wording seems better, so that 'needs fixing' is resolved. As for having two libraries vs the one, I'm on the fence, so I won't object. I somewhat like that there's less temptation to roll these functions into the public api.
As for the DebuggingSessio
OTOH, SessionMediator already has a pretty bloated constructor... but I'd rather have one bloated constructor on SessionMediator than a bloated constructor on both SessionMediator and DebuggingSessio
Chris Halse Rogers (raof) wrote : | # |
Yeah, I could make an extra interface for SessionMediator to depend on. I'll ask the list first about the general “how many DSOs should this be” question and then see what that version of SessionMediator would look like.
A bit ugly, because we're adding even more special-purpose code to a general interface, but until it gains an extension mechanism... :)
Andreas Pokorny (andreas-pokorny) wrote : | # |
In src/server/
743 + response-
744 + response-
You have to transform x and y according to the surface orientation here (and in theory surface transformation but i doubt we want to be super correct - makes me wonder whether unity8 overrides that information stored at the surface? ). Furthermore in the nested case you have to forward that request to the system compositor.
So dl-load the debug extension in mirserver, and fail unlikely if not available.
Regarding the library vs internal topic. I prefer the separate library approach already implemented in this MP
kevin gunn (kgunn72) wrote : | # |
As long as it's a dbug module that's not going to be part of a release image & you have to install when you want. Then I prefer the bloat-on-debug hit to keep it separated from regular ol' libmirclient.
however, is there a plan or mechanism to help resynch this with libmirclient where the code is duplicated ?
iirc, we're adding primarily for AP testing... so we'd want to keep the the functionality the same in the debug client, as to ensure the testing/config is valid and we trust the results.
Chris Halse Rogers (raof) wrote : | # |
Clients wanting to use the debug extensions link against libmirclient as normal, and *also* libmirclient-
Andreas: Urgh, yeah, I guess so. I _think_ we have enough information in the nested case to do the translation without bouncing up to the host server, but it'll be safer to do so, yeah.
Kevin DuBois (kdub) wrote : | # |
Its looking like we're coalescing around 2 DSO's then, everyone? (a second debug library is good by me)
Chris Halse Rogers (raof) wrote : | # |
Andreas: Actually, I don't think we *do* need to forward to the system compositor - the nested compositor ensures it has a logical coordinate space that's identical to the system compositor's by means of the display configuration.
And we don't actually use the surface orientation anywhere, so I don't think we need to transform according to that either?
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1855
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1857
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1858
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andreas Pokorny (andreas-pokorny) wrote : | # |
> Andreas: Actually, I don't think we *do* need to forward to the system
> compositor - the nested compositor ensures it has a logical coordinate space
> that's identical to the system compositor's by means of the display
> configuration.
>
> And we don't actually use the surface orientation anywhere, so I don't think
> we need to transform according to that either
I agree for a 'we' as in u-s-c + unity8 - since usc does not change the properties of unity8 surface. hmm.. it could still decide that unity8 and thus the client surface is not visible. But that is probably not a relevant result of the transformation? So I agree if you count demo shell out.
> And we don't actually use the surface orientation anywhere, so I don't think
> we need to transform according to that either
I thought for that calculation coordinates are given as client surface coordinates. Rotating the device turns a client surface of 400x900 pixels into a 900x400 grid. Whatever is now on 800x10, must be touched by the user at 390x800 or 10x100...
Alexandros Frantzis (afrantzis) wrote : | # |
OK. Hopefully we will get a proper extension mechanism in the near/medium term.
509 +TEST_F(
"Unavailable"
> I thought for that calculation coordinates are given as client surface coordinates. Rotating the
> device turns a client surface of 400x900 pixels into a 900x400 grid. Whatever is now on 800x10,
> must be touched by the user at 390x800 or 10x100...
Not sure about this aspect of the code, so a weak approval for me pending further information on this.
Andreas Pokorny (andreas-pokorny) wrote : | # |
As far as I can see qtmir/unity8 is not using mirs orientation values(, yet?). But it will need a way to influence the calculation instead.
Chris Halse Rogers (raof) wrote : | # |
Yup. CoordinateTrans
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1859
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1860
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1861
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1862
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andreas Pokorny (andreas-pokorny) wrote : | # |
lgtm.
one little detail .. why int32_t in the protobuf messages/int in the client api - but unsigned in the CoordinateTrans
(negative positions could be possible too, if decorations are in negative coordinate space of the surface)
Chris Halse Rogers (raof) wrote : | # |
Probably best to use int32_t everywhere. Good catch.
Daniel van Vugt (vanvugt) wrote : | # |
We do indeed have negative coordinates. So make sure your x's and y's are signed.
Although I recommend against int32_t for a few reasons. "int" is better because:
* On any modern platform "int" is already >= 32 bits
* On some 64-bit platforms "int" is 64-bit and it's more efficient to use that native word size than forcing 32-bits.
* int32_t increases coupling to yet another header.
Alberto Aguirre (albaguirre) wrote : | # |
> Although I recommend against int32_t for a few reasons. "int" is better
> because:
> * On any modern platform "int" is already >= 32 bits
> * On some 64-bit platforms "int" is 64-bit and it's more efficient to use
> that native word size than forcing 32-bits.
> * int32_t increases coupling to yet another header.
No since it involves protobuf (https:/
The type should match the type assigned in protobuf or in the very least specifically converted from int32_t to whatever internal type you use. The last thing we need is a subtle type conversion issue.
Daniel van Vugt (vanvugt) wrote : | # |
Alright, still needs conversion to signed ints though. Like in:
232 + virtual geometry::Point surface_
233 + uint32_t x, uint32_t y) = 0;
Even local coordinates can go negative -- Consider what happens when you drag something like a scroll bar or image. The scrolling keeps responding even when the pointer itself is out of the window (so could be in negative coordinates).
Daniel van Vugt (vanvugt) wrote : | # |
Actually I still disagree with int32_t. If you make the decision to use that type just because Protobuf does, then you leak that information throughout your APIs in a very ugly way. "int" should be used instead, so that we at least hide the protocol implementation details from our client API design.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1865
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Chris Halse Rogers (raof) wrote : | # |
Hah. I think we've found another area in which our stylistic preferences disagree :)
The way I see it, we currently hide the fact from our client API that Mir's coordinates system has exactly 32bits of significant data. “int” isn't hiding irrelevant implementation details, it's hiding a potentially relevant aspect of our API.
Indeed, I think we should be explicitly sizing *all* our types where they correspond to coordinates or other data types that are a part of our API that happen to be integral.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1866
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
Remember we only support client and server on the same host, and only plan on supporting that. As such the client and server can safely use the same type with an unspecified width, like "int".
Only if you're supporting a networked environment with heterogeneous word sizes is it necessary to specify the size. But we have no plans to ever make Mir a network protocol.
Chris Halse Rogers (raof) wrote : | # |
I run armhf code on my amd64 machine all the time. Local machine only does *not* imply same-word-size, or even same-endianness.
Chris Halse Rogers (raof) wrote : | # |
And, obviously, i386/amd64 is an even more common usecase.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1867
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andreas Pokorny (andreas-pokorny) wrote : | # |
> And, obviously, i386/amd64 is an even more common usecase.
hm maybe we could add something to the ci script that takes the x86 build and tries to run it with an amd64 server
Daniel van Vugt (vanvugt) wrote : | # |
You have an armhf client/server talking to an amd64 server/client? That sounds interesting. QEMU?
Also interesting is the idea of mixing and matching amd64 and i386 on the same host. That does sound like a plausible albeit uncommon scenario.
Still, even if there are reasonable use cases for mixing and matching I think it's much cleaner design to choose the client API and then modify the protocol to fit rather than vice-versa.
Chris Halse Rogers (raof) wrote : | # |
On Tue, Oct 14, 2014 at 5:06 PM, Daniel van Vugt
<email address hidden> wrote:
> Review: Abstain
>
> You have an armhf client/server talking to an amd64 server/client?
> That sounds interesting. QEMU?
Indeed. With dpkg multiarch the only limitation on the architecture
combinations are the qemu system hosts.
>
> Also interesting is the idea of mixing and matching amd64 and i386 on
> the same host. That does sound like a plausible albeit uncommon
> scenario.
It's actually *super* common; does Steam ship an amd64 binary, for
example? The majority of games are still i386 binaries.
If Intel has its way we'll end up with lots of x32 binaries on amd64
systems as the norm :).
>
> Still, even if there are reasonable use cases for mixing and matching
> I think it's much cleaner design to choose the client API and then
> modify the protocol to fit rather than vice-versa.
Indeed, but the client API should guarantee appropriately sized data
types :)
Alan Griffiths (alan-griffiths) wrote : | # |
I'd rather we didn't have to do this
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1868
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1869
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Chris Halse Rogers (raof) wrote : | # |
Dear protobuf: Your behaviour in registering an init thing that aborts on double-load is really annoying.
Alan Griffiths (alan-griffiths) wrote : | # |
On 20/10/14 22:04, Chris Halse Rogers wrote:
> Dear protobuf: Your behaviour in registering an init thing that aborts on double-load is really annoying.
Yes, maybe it was a mistake to roll libmirprotobuf into libmircommon and
we should split it out again.
--
Alan Griffiths +44 (0)798 9938 758
Octopull Ltd http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1869
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1870
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alberto Aguirre (albaguirre) wrote : | # |
Does what it claims to do
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Alberto Aguirre (albaguirre) wrote : | # |
Looks like a CI hiccup unrelated to MP let's try again...
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'client-ABI-sha1sums' | |||
2 | --- client-ABI-sha1sums 2014-10-21 16:21:14 +0000 | |||
3 | +++ client-ABI-sha1sums 2014-10-23 13:30:17 +0000 | |||
4 | @@ -1,4 +1,4 @@ | |||
6 | 1 | cbe1e3ccfea6ab5865510f4f598ec11571fcc852 include/client/mir_toolkit/mir_client_library_debug.h | 1 | 3a60fb3b2b250ca67f54ade346ef658c9259c9a7 include/client/mir_toolkit/debug/surface.h |
7 | 2 | b53736bcb22ddc09aab8275cfdd05c109fdd0f12 include/client/mir_toolkit/mir_client_library_drm.h | 2 | b53736bcb22ddc09aab8275cfdd05c109fdd0f12 include/client/mir_toolkit/mir_client_library_drm.h |
8 | 3 | 1522a5fcdb01c0d9a990364539c4f1255853eef7 include/client/mir_toolkit/mir_client_library.h | 3 | 1522a5fcdb01c0d9a990364539c4f1255853eef7 include/client/mir_toolkit/mir_client_library.h |
9 | 4 | e6185b680533c5fdcf1294a4797d5c3dd01d433f include/client/mir_toolkit/mir_connection.h | 4 | e6185b680533c5fdcf1294a4797d5c3dd01d433f include/client/mir_toolkit/mir_connection.h |
10 | 5 | 5 | ||
11 | === modified file 'debian/control' | |||
12 | --- debian/control 2014-10-21 17:22:26 +0000 | |||
13 | +++ debian/control 2014-10-23 13:30:17 +0000 | |||
14 | @@ -165,6 +165,52 @@ | |||
15 | 165 | . | 165 | . |
16 | 166 | Contains header files required to develop against Mir. | 166 | Contains header files required to develop against Mir. |
17 | 167 | 167 | ||
18 | 168 | Package: libmirclient-debug-extension1 | ||
19 | 169 | Section: libs | ||
20 | 170 | Architecture: i386 amd64 armhf arm64 | ||
21 | 171 | Multi-Arch: same | ||
22 | 172 | Pre-Depends: ${misc:Pre-Depends} | ||
23 | 173 | Depends: ${misc:Depends}, | ||
24 | 174 | ${shlibs:Depends}, | ||
25 | 175 | Description: Display server for Ubuntu - optional client debug interfaces | ||
26 | 176 | Mir is a display server running on linux systems, with a focus on efficiency, | ||
27 | 177 | robust operation and a well-defined driver model. | ||
28 | 178 | . | ||
29 | 179 | This package contains both a shared library containing the client side of | ||
30 | 180 | various optional debugging interfaces and the development headers required | ||
31 | 181 | to use them. | ||
32 | 182 | . | ||
33 | 183 | This is primarily useful for developing Mir servers, low-level client | ||
34 | 184 | toolkits, or for automated testing in constrained environments. | ||
35 | 185 | . | ||
36 | 186 | Not all Mir servers have the capability to service these APIs; end-user | ||
37 | 187 | applications SHOULD NOT depend on this library. | ||
38 | 188 | |||
39 | 189 | Package: libmirclient-debug-extension-dev | ||
40 | 190 | Section: libdevel | ||
41 | 191 | Architecture: i386 amd64 armhf arm64 | ||
42 | 192 | Multi-Arch: same | ||
43 | 193 | Pre-Depends: ${misc:Pre-Depends} | ||
44 | 194 | Depends: libmirclient-debug-extension1 (= ${binary:Version}) | ||
45 | 195 | ${misc:Depends}, | ||
46 | 196 | ${shlibs:Depends}, | ||
47 | 197 | Description: Display server for Ubuntu - client debug interface headers | ||
48 | 198 | Mir is a display server running on linux systems, with a focus on efficiency, | ||
49 | 199 | robust operation and a well-defined driver model. | ||
50 | 200 | . | ||
51 | 201 | This package contains both a shared library containing the client side of | ||
52 | 202 | various optional debugging interfaces and the development headers required | ||
53 | 203 | to use them. | ||
54 | 204 | . | ||
55 | 205 | This is primarily useful for developing Mir servers, low-level client | ||
56 | 206 | toolkits, or for automated testing in constrained environments. | ||
57 | 207 | . | ||
58 | 208 | Not all Mir servers have the capability to service these APIs; end-user | ||
59 | 209 | applications SHOULD NOT depend on this library. | ||
60 | 210 | . | ||
61 | 211 | This package contains the development headers required to develop against | ||
62 | 212 | the debug extensions. | ||
63 | 213 | |||
64 | 168 | Package: mir-demos | 214 | Package: mir-demos |
65 | 169 | Architecture: i386 amd64 armhf arm64 | 215 | Architecture: i386 amd64 armhf arm64 |
66 | 170 | Depends: ${misc:Depends}, | 216 | Depends: ${misc:Depends}, |
67 | 171 | 217 | ||
68 | === added file 'debian/libmirclient-debug-extension-dev.install' | |||
69 | --- debian/libmirclient-debug-extension-dev.install 1970-01-01 00:00:00 +0000 | |||
70 | +++ debian/libmirclient-debug-extension-dev.install 2014-10-23 13:30:17 +0000 | |||
71 | @@ -0,0 +1,3 @@ | |||
72 | 1 | usr/include/mirclient/mir_toolkit/debug | ||
73 | 2 | usr/lib/*/pkgconfig/mirclient-debug-extension.pc | ||
74 | 3 | usr/lib/*/libmirclient-debug-extension.so | ||
75 | 0 | 4 | ||
76 | === added file 'debian/libmirclient-debug-extension1.install' | |||
77 | --- debian/libmirclient-debug-extension1.install 1970-01-01 00:00:00 +0000 | |||
78 | +++ debian/libmirclient-debug-extension1.install 2014-10-23 13:30:17 +0000 | |||
79 | @@ -0,0 +1,1 @@ | |||
80 | 1 | usr/lib/*/libmirclient-debug-extension.so.* | ||
81 | 0 | 2 | ||
82 | === modified file 'debian/libmirclient-dev.install' | |||
83 | --- debian/libmirclient-dev.install 2013-06-24 12:15:28 +0000 | |||
84 | +++ debian/libmirclient-dev.install 2014-10-23 13:30:17 +0000 | |||
85 | @@ -1,3 +1,3 @@ | |||
87 | 1 | usr/include/mirclient | 1 | usr/include/mirclient/mir_toolkit/*.h |
88 | 2 | usr/lib/*/pkgconfig/mirclient.pc | 2 | usr/lib/*/pkgconfig/mirclient.pc |
89 | 3 | usr/lib/*/libmirclient.so | 3 | usr/lib/*/libmirclient.so |
90 | 4 | 4 | ||
91 | === added directory 'include/client/mir_toolkit/debug' | |||
92 | === renamed file 'include/client/mir_toolkit/mir_client_library_debug.h' => 'include/client/mir_toolkit/debug/surface.h' | |||
93 | --- include/client/mir_toolkit/mir_client_library_debug.h 2014-10-01 06:25:56 +0000 | |||
94 | +++ include/client/mir_toolkit/debug/surface.h 2014-10-23 13:30:17 +0000 | |||
95 | @@ -28,6 +28,7 @@ | |||
96 | 28 | 28 | ||
97 | 29 | /** | 29 | /** |
98 | 30 | * Return the ID of a surface (only useful for debug output). | 30 | * Return the ID of a surface (only useful for debug output). |
99 | 31 | * \pre The surface is valid | ||
100 | 31 | * \param [in] surface The surface | 32 | * \param [in] surface The surface |
101 | 32 | * \return An internal ID that identifies the surface | 33 | * \return An internal ID that identifies the surface |
102 | 33 | */ | 34 | */ |
103 | @@ -43,6 +44,25 @@ | |||
104 | 43 | */ | 44 | */ |
105 | 44 | uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface); | 45 | uint32_t mir_debug_surface_current_buffer_id(MirSurface *surface); |
106 | 45 | 46 | ||
107 | 47 | /** | ||
108 | 48 | * Get the screen coordinates corresponding to a pair of surface coordinates | ||
109 | 49 | * \pre The surface is valid | ||
110 | 50 | * \param [in] surface The surface | ||
111 | 51 | * \param [in] x, y Surface coordinates to map to screen coordinates | ||
112 | 52 | * \param [out] screen_x, screen_y The screen coordinates corresponding to x, y. | ||
113 | 53 | * \return True if screen_x and screen_y contain values | ||
114 | 54 | * \note There are many cases where such a mapping does not exist or would be expensive | ||
115 | 55 | * to calculate. Only Mir servers started with the --debug option will ever return | ||
116 | 56 | * values for this call, and even when --debug is enabled servers are free to | ||
117 | 57 | * return nothing. | ||
118 | 58 | * | ||
119 | 59 | * This call will only be interesting for automated testing, where both the client | ||
120 | 60 | * and shell state is known and constrained. | ||
121 | 61 | */ | ||
122 | 62 | MirBool mir_debug_surface_coords_to_screen(MirSurface* surface, | ||
123 | 63 | int x, int y, | ||
124 | 64 | int* screen_x, int* screen_y); | ||
125 | 65 | |||
126 | 46 | #ifdef __cplusplus | 66 | #ifdef __cplusplus |
127 | 47 | } | 67 | } |
128 | 48 | #endif | 68 | #endif |
129 | 49 | 69 | ||
130 | === modified file 'include/platform/mir/options/configuration.h' | |||
131 | --- include/platform/mir/options/configuration.h 2014-10-01 06:25:56 +0000 | |||
132 | +++ include/platform/mir/options/configuration.h 2014-10-23 13:30:17 +0000 | |||
133 | @@ -43,6 +43,7 @@ | |||
134 | 43 | extern char const* const frontend_threads_opt; | 43 | extern char const* const frontend_threads_opt; |
135 | 44 | extern char const* const touchspots_opt; | 44 | extern char const* const touchspots_opt; |
136 | 45 | extern char const* const fatal_abort_opt; | 45 | extern char const* const fatal_abort_opt; |
137 | 46 | extern char const* const debug_opt; | ||
138 | 46 | 47 | ||
139 | 47 | extern char const* const name_opt; | 48 | extern char const* const name_opt; |
140 | 48 | extern char const* const offscreen_opt; | 49 | extern char const* const offscreen_opt; |
141 | 49 | 50 | ||
142 | === modified file 'include/server/mir/default_server_configuration.h' | |||
143 | --- include/server/mir/default_server_configuration.h 2014-10-22 18:55:40 +0000 | |||
144 | +++ include/server/mir/default_server_configuration.h 2014-10-23 13:30:17 +0000 | |||
145 | @@ -101,6 +101,7 @@ | |||
146 | 101 | class SceneReport; | 101 | class SceneReport; |
147 | 102 | class PromptSessionListener; | 102 | class PromptSessionListener; |
148 | 103 | class PromptSessionManager; | 103 | class PromptSessionManager; |
149 | 104 | class CoordinateTranslator; | ||
150 | 104 | } | 105 | } |
151 | 105 | namespace graphics | 106 | namespace graphics |
152 | 106 | { | 107 | { |
153 | @@ -286,6 +287,7 @@ | |||
154 | 286 | * @{ */ | 287 | * @{ */ |
155 | 287 | // To customize this behaviour it is recommended you override wrap_session_coordinator(). | 288 | // To customize this behaviour it is recommended you override wrap_session_coordinator(). |
156 | 288 | virtual std::shared_ptr<scene::SessionCoordinator> the_session_coordinator(); | 289 | virtual std::shared_ptr<scene::SessionCoordinator> the_session_coordinator(); |
157 | 290 | virtual std::shared_ptr<scene::CoordinateTranslator> the_coordinate_translator(); | ||
158 | 289 | /** @} */ | 291 | /** @} */ |
159 | 290 | 292 | ||
160 | 291 | 293 | ||
161 | @@ -421,6 +423,7 @@ | |||
162 | 421 | CachedPtr<scene::PromptSessionListener> prompt_session_listener; | 423 | CachedPtr<scene::PromptSessionListener> prompt_session_listener; |
163 | 422 | CachedPtr<scene::PromptSessionManager> prompt_session_manager; | 424 | CachedPtr<scene::PromptSessionManager> prompt_session_manager; |
164 | 423 | CachedPtr<scene::SessionCoordinator> session_coordinator; | 425 | CachedPtr<scene::SessionCoordinator> session_coordinator; |
165 | 426 | CachedPtr<scene::CoordinateTranslator> coordinate_translator; | ||
166 | 424 | CachedPtr<EmergencyCleanup> emergency_cleanup; | 427 | CachedPtr<EmergencyCleanup> emergency_cleanup; |
167 | 425 | CachedPtr<shell::HostLifecycleEventListener> host_lifecycle_event_listener; | 428 | CachedPtr<shell::HostLifecycleEventListener> host_lifecycle_event_listener; |
168 | 426 | 429 | ||
169 | 427 | 430 | ||
170 | === added file 'include/server/mir/scene/coordinate_translator.h' | |||
171 | --- include/server/mir/scene/coordinate_translator.h 1970-01-01 00:00:00 +0000 | |||
172 | +++ include/server/mir/scene/coordinate_translator.h 2014-10-23 13:30:17 +0000 | |||
173 | @@ -0,0 +1,66 @@ | |||
174 | 1 | /* | ||
175 | 2 | * Copyright © 2014 Canonical Ltd. | ||
176 | 3 | * | ||
177 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
178 | 5 | * under the terms of the GNU General Public License version 3, | ||
179 | 6 | * as published by the Free Software Foundation. | ||
180 | 7 | * | ||
181 | 8 | * This program is distributed in the hope that it will be useful, | ||
182 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
183 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
184 | 11 | * GNU General Public License for more details. | ||
185 | 12 | * | ||
186 | 13 | * You should have received a copy of the GNU General Public License | ||
187 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
188 | 15 | * | ||
189 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
190 | 17 | */ | ||
191 | 18 | |||
192 | 19 | #ifndef MIR_SCENE_COORDINATE_TRANSLATOR_H_ | ||
193 | 20 | #define MIR_SCENE_COORDINATE_TRANSLATOR_H_ | ||
194 | 21 | |||
195 | 22 | #include "mir/geometry/point.h" | ||
196 | 23 | #include <memory> | ||
197 | 24 | |||
198 | 25 | namespace mir | ||
199 | 26 | { | ||
200 | 27 | namespace frontend | ||
201 | 28 | { | ||
202 | 29 | class Surface; | ||
203 | 30 | } | ||
204 | 31 | |||
205 | 32 | namespace scene | ||
206 | 33 | { | ||
207 | 34 | |||
208 | 35 | /** | ||
209 | 36 | * Support for the debug "surface to screen" coordinate translation interface. | ||
210 | 37 | * \note For shells which do surface transformations the default implementation | ||
211 | 38 | * will return incorrect results. | ||
212 | 39 | */ | ||
213 | 40 | class CoordinateTranslator | ||
214 | 41 | { | ||
215 | 42 | public: | ||
216 | 43 | virtual ~CoordinateTranslator() = default; | ||
217 | 44 | |||
218 | 45 | /** | ||
219 | 46 | * \brief Translate a surface coordinate into the screen coordinate space | ||
220 | 47 | * \param [in] surface A frontend::Surface. This will need to be dynamic_cast into | ||
221 | 48 | * the scene::Surface relevant for the shell. | ||
222 | 49 | * \param [in] x, y Coordinates to translate from the surface coordinate space | ||
223 | 50 | * \return The coordinates in the screen coordinate space. | ||
224 | 51 | * \throws A std::runtime_error if the translation cannot be performed | ||
225 | 52 | * for any reason. | ||
226 | 53 | * | ||
227 | 54 | * \note It is acceptable for this call to unconditionally throw a std::runtime_error. | ||
228 | 55 | * It is not required for normal functioning of the server or clients; clients which | ||
229 | 56 | * use the debug extension will receive an appropriate failure notice. | ||
230 | 57 | */ | ||
231 | 58 | virtual geometry::Point surface_to_screen(std::shared_ptr<frontend::Surface> surface, | ||
232 | 59 | int32_t x, int32_t y) = 0; | ||
233 | 60 | }; | ||
234 | 61 | |||
235 | 62 | |||
236 | 63 | } | ||
237 | 64 | } | ||
238 | 65 | |||
239 | 66 | #endif // MIR_SCENE_COORDINATE_TRANSLATOR_H_ | ||
240 | 0 | 67 | ||
241 | === modified file 'platform-ABI-sha1sums' | |||
242 | --- platform-ABI-sha1sums 2014-10-21 16:21:14 +0000 | |||
243 | +++ platform-ABI-sha1sums 2014-10-23 13:30:17 +0000 | |||
244 | @@ -40,7 +40,7 @@ | |||
245 | 40 | 1fbe488b4581486fd01e2f03e504f31b72c09040 include/platform/mir/graphics/platform_ipc_operations.h | 40 | 1fbe488b4581486fd01e2f03e504f31b72c09040 include/platform/mir/graphics/platform_ipc_operations.h |
246 | 41 | 9c7712af84b6fde1970ff802ad2ea78f892c7b7e include/platform/mir/graphics/platform_ipc_package.h | 41 | 9c7712af84b6fde1970ff802ad2ea78f892c7b7e include/platform/mir/graphics/platform_ipc_package.h |
247 | 42 | 84c063346b3bd51b4624d9f940008d4c3f8be066 include/platform/mir/graphics/renderable.h | 42 | 84c063346b3bd51b4624d9f940008d4c3f8be066 include/platform/mir/graphics/renderable.h |
249 | 43 | f5746dab3336266cfd410ce4e4d01333df6e5b99 include/platform/mir/options/configuration.h | 43 | b19329d35a55f640edd72c0a953908995211d97e include/platform/mir/options/configuration.h |
250 | 44 | 47007c783c174f8e94d332c4b13c6b01358b48fb include/platform/mir/options/default_configuration.h | 44 | 47007c783c174f8e94d332c4b13c6b01358b48fb include/platform/mir/options/default_configuration.h |
251 | 45 | b45f14082c4f8b29efaa1b13de795dcb29deb738 include/platform/mir/options/option.h | 45 | b45f14082c4f8b29efaa1b13de795dcb29deb738 include/platform/mir/options/option.h |
252 | 46 | 3c37cc31e8b290b89c311d82f02e07d342766451 include/platform/mir/options/program_option.h | 46 | 3c37cc31e8b290b89c311d82f02e07d342766451 include/platform/mir/options/program_option.h |
253 | 47 | 47 | ||
254 | === modified file 'server-ABI-sha1sums' | |||
255 | --- server-ABI-sha1sums 2014-10-22 18:55:40 +0000 | |||
256 | +++ server-ABI-sha1sums 2014-10-23 13:30:17 +0000 | |||
257 | @@ -40,7 +40,7 @@ | |||
258 | 40 | 1fbe488b4581486fd01e2f03e504f31b72c09040 include/platform/mir/graphics/platform_ipc_operations.h | 40 | 1fbe488b4581486fd01e2f03e504f31b72c09040 include/platform/mir/graphics/platform_ipc_operations.h |
259 | 41 | 9c7712af84b6fde1970ff802ad2ea78f892c7b7e include/platform/mir/graphics/platform_ipc_package.h | 41 | 9c7712af84b6fde1970ff802ad2ea78f892c7b7e include/platform/mir/graphics/platform_ipc_package.h |
260 | 42 | 84c063346b3bd51b4624d9f940008d4c3f8be066 include/platform/mir/graphics/renderable.h | 42 | 84c063346b3bd51b4624d9f940008d4c3f8be066 include/platform/mir/graphics/renderable.h |
262 | 43 | f5746dab3336266cfd410ce4e4d01333df6e5b99 include/platform/mir/options/configuration.h | 43 | b19329d35a55f640edd72c0a953908995211d97e include/platform/mir/options/configuration.h |
263 | 44 | 47007c783c174f8e94d332c4b13c6b01358b48fb include/platform/mir/options/default_configuration.h | 44 | 47007c783c174f8e94d332c4b13c6b01358b48fb include/platform/mir/options/default_configuration.h |
264 | 45 | b45f14082c4f8b29efaa1b13de795dcb29deb738 include/platform/mir/options/option.h | 45 | b45f14082c4f8b29efaa1b13de795dcb29deb738 include/platform/mir/options/option.h |
265 | 46 | 3c37cc31e8b290b89c311d82f02e07d342766451 include/platform/mir/options/program_option.h | 46 | 3c37cc31e8b290b89c311d82f02e07d342766451 include/platform/mir/options/program_option.h |
266 | @@ -48,7 +48,7 @@ | |||
267 | 48 | a9f284ba4b05d58fd3eeb628d1f56fe4ac188526 include/server/mir/compositor/compositor_id.h | 48 | a9f284ba4b05d58fd3eeb628d1f56fe4ac188526 include/server/mir/compositor/compositor_id.h |
268 | 49 | 878ab5c4007d16dac213a3eb0105421d8ffad206 include/server/mir/compositor/scene_element.h | 49 | 878ab5c4007d16dac213a3eb0105421d8ffad206 include/server/mir/compositor/scene_element.h |
269 | 50 | 4fcf34e424128b87ddc76733594e32e09ebbd486 include/server/mir/compositor/scene.h | 50 | 4fcf34e424128b87ddc76733594e32e09ebbd486 include/server/mir/compositor/scene.h |
271 | 51 | 7e47baf423fc61960d8e4ea92eae93caf71c93e2 include/server/mir/default_server_configuration.h | 51 | c14448c8f882f44b05fa56ced7c8db51083a9bd3 include/server/mir/default_server_configuration.h |
272 | 52 | af1ff0714be973ac76d56006a2e5991f68cd1dec include/server/mir/display_server.h | 52 | af1ff0714be973ac76d56006a2e5991f68cd1dec include/server/mir/display_server.h |
273 | 53 | a35c5495d8fd28fc0e375b17495fc5caab51b329 include/server/mir/emergency_cleanup.h | 53 | a35c5495d8fd28fc0e375b17495fc5caab51b329 include/server/mir/emergency_cleanup.h |
274 | 54 | 938de641cb0e01e1098b007b39b151a7dfe4adc1 include/server/mir/frontend/display_changer.h | 54 | 938de641cb0e01e1098b007b39b151a7dfe4adc1 include/server/mir/frontend/display_changer.h |
275 | @@ -75,6 +75,7 @@ | |||
276 | 75 | 964069b241f1e8211386bb8735ee0f752b666949 include/server/mir/main_loop.h | 75 | 964069b241f1e8211386bb8735ee0f752b666949 include/server/mir/main_loop.h |
277 | 76 | edd5a0a6be0be57ef64c5af89fc5a65dc558648c include/server/mir/report_exception.h | 76 | edd5a0a6be0be57ef64c5af89fc5a65dc558648c include/server/mir/report_exception.h |
278 | 77 | 8192727cf5fa0b2b5798b2211c2c8a4ad65c9f60 include/server/mir/run_mir.h | 77 | 8192727cf5fa0b2b5798b2211c2c8a4ad65c9f60 include/server/mir/run_mir.h |
279 | 78 | c9de8b851fb22092a9a486d71cd998b4cb8392e1 include/server/mir/scene/coordinate_translator.h | ||
280 | 78 | 71d9082681aa39d652c88ad3b54665695b521d24 include/server/mir/scene/depth_id.h | 79 | 71d9082681aa39d652c88ad3b54665695b521d24 include/server/mir/scene/depth_id.h |
281 | 79 | 4e4e563ab429a13ddca7eead16f2b6cefb8edff6 include/server/mir/scene/null_surface_observer.h | 80 | 4e4e563ab429a13ddca7eead16f2b6cefb8edff6 include/server/mir/scene/null_surface_observer.h |
282 | 80 | d5273f3363b0b776427d5e3f1af99f0f2bcf3fa6 include/server/mir/scene/observer.h | 81 | d5273f3363b0b776427d5e3f1af99f0f2bcf3fa6 include/server/mir/scene/observer.h |
283 | 81 | 82 | ||
284 | === modified file 'src/client/CMakeLists.txt' | |||
285 | --- src/client/CMakeLists.txt 2014-10-21 16:21:14 +0000 | |||
286 | +++ src/client/CMakeLists.txt 2014-10-23 13:30:17 +0000 | |||
287 | @@ -8,12 +8,18 @@ | |||
288 | 8 | set(PREFIX "${CMAKE_INSTALL_PREFIX}") | 8 | set(PREFIX "${CMAKE_INSTALL_PREFIX}") |
289 | 9 | set(EXEC_PREFIX "${CMAKE_INSTALL_PREFIX}") | 9 | set(EXEC_PREFIX "${CMAKE_INSTALL_PREFIX}") |
290 | 10 | set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") | 10 | set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") |
293 | 11 | set(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/mirclient") | 11 | set(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include") |
292 | 12 | set(COMMON_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/mircommon") | ||
294 | 13 | 12 | ||
295 | 14 | configure_file( | 13 | configure_file( |
296 | 15 | ${CMAKE_CURRENT_SOURCE_DIR}/mirclient.pc.in | 14 | ${CMAKE_CURRENT_SOURCE_DIR}/mirclient.pc.in |
297 | 16 | ${CMAKE_CURRENT_BINARY_DIR}/mirclient.pc | 15 | ${CMAKE_CURRENT_BINARY_DIR}/mirclient.pc |
298 | 16 | @ONLY | ||
299 | 17 | ) | ||
300 | 18 | |||
301 | 19 | configure_file( | ||
302 | 20 | ${CMAKE_CURRENT_SOURCE_DIR}/mirclient-debug-extension.pc.in | ||
303 | 21 | ${CMAKE_CURRENT_BINARY_DIR}/mirclient-debug-extension.pc | ||
304 | 22 | @ONLY | ||
305 | 17 | ) | 23 | ) |
306 | 18 | 24 | ||
307 | 19 | include_directories( | 25 | include_directories( |
308 | @@ -113,3 +119,47 @@ | |||
309 | 113 | FILES ${CMAKE_CURRENT_BINARY_DIR}/mirclient.pc | 119 | FILES ${CMAKE_CURRENT_BINARY_DIR}/mirclient.pc |
310 | 114 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig | 120 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig |
311 | 115 | ) | 121 | ) |
312 | 122 | |||
313 | 123 | # TODO: Extension apparatus so that mirclient-debug-extension can be a MODULE and not | ||
314 | 124 | # duplicate (almost) the entirity of mirclient | ||
315 | 125 | |||
316 | 126 | set(MIRCLIENT_DEBUG_EXTENSION_ABI 1) | ||
317 | 127 | |||
318 | 128 | add_library( | ||
319 | 129 | mirclient-debug-extension SHARED | ||
320 | 130 | |||
321 | 131 | mir_debug_api.cpp | ||
322 | 132 | $<TARGET_OBJECTS:mirclientobjects> | ||
323 | 133 | ) | ||
324 | 134 | |||
325 | 135 | target_link_libraries( | ||
326 | 136 | mirclient-debug-extension | ||
327 | 137 | |||
328 | 138 | mirclient | ||
329 | 139 | ) | ||
330 | 140 | |||
331 | 141 | set(debug_symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols-debug.map) | ||
332 | 142 | |||
333 | 143 | set_target_properties( | ||
334 | 144 | mirclient-debug-extension | ||
335 | 145 | |||
336 | 146 | PROPERTIES | ||
337 | 147 | SOVERSION ${MIRCLIENT_DEBUG_EXTENSION_ABI} | ||
338 | 148 | LINK_FLAGS "-Wl,--version-script,${debug_symbol_map}" | ||
339 | 149 | ) | ||
340 | 150 | |||
341 | 151 | install( | ||
342 | 152 | DIRECTORY ${CMAKE_SOURCE_DIR}/include/client/mir_toolkit/debug | ||
343 | 153 | DESTINATION "include/mirclient/mir_toolkit/debug" | ||
344 | 154 | ) | ||
345 | 155 | |||
346 | 156 | install( | ||
347 | 157 | TARGETS mirclient-debug-extension | ||
348 | 158 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
349 | 159 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
350 | 160 | |||
351 | 161 | install( | ||
352 | 162 | FILES ${CMAKE_CURRENT_BINARY_DIR}/mirclient-debug-extension.pc | ||
353 | 163 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig | ||
354 | 164 | ) | ||
355 | 165 | |||
356 | 116 | 166 | ||
357 | === modified file 'src/client/mir_connection.cpp' | |||
358 | --- src/client/mir_connection.cpp 2014-10-01 06:25:56 +0000 | |||
359 | +++ src/client/mir_connection.cpp 2014-10-23 13:30:17 +0000 | |||
360 | @@ -87,6 +87,7 @@ | |||
361 | 87 | deregisterer{this}, | 87 | deregisterer{this}, |
362 | 88 | channel(), | 88 | channel(), |
363 | 89 | server(0), | 89 | server(0), |
364 | 90 | debug(0), | ||
365 | 90 | error_message(error_message) | 91 | error_message(error_message) |
366 | 91 | { | 92 | { |
367 | 92 | } | 93 | } |
368 | @@ -97,6 +98,7 @@ | |||
369 | 97 | platform_library{conf.the_platform_library()}, | 98 | platform_library{conf.the_platform_library()}, |
370 | 98 | channel(conf.the_rpc_channel()), | 99 | channel(conf.the_rpc_channel()), |
371 | 99 | server(channel.get(), ::google::protobuf::Service::STUB_DOESNT_OWN_CHANNEL), | 100 | server(channel.get(), ::google::protobuf::Service::STUB_DOESNT_OWN_CHANNEL), |
372 | 101 | debug(channel.get(), ::google::protobuf::Service::STUB_DOESNT_OWN_CHANNEL), | ||
373 | 100 | logger(conf.the_logger()), | 102 | logger(conf.the_logger()), |
374 | 101 | client_platform_factory(conf.the_client_platform_factory()), | 103 | client_platform_factory(conf.the_client_platform_factory()), |
375 | 102 | input_platform(conf.the_input_platform()), | 104 | input_platform(conf.the_input_platform()), |
376 | @@ -133,7 +135,7 @@ | |||
377 | 133 | mir_surface_callback callback, | 135 | mir_surface_callback callback, |
378 | 134 | void * context) | 136 | void * context) |
379 | 135 | { | 137 | { |
381 | 136 | auto surface = new MirSurface(this, server, platform->create_buffer_factory(), input_platform, params, callback, context); | 138 | auto surface = new MirSurface(this, server, &debug, platform->create_buffer_factory(), input_platform, params, callback, context); |
382 | 137 | 139 | ||
383 | 138 | return surface->get_create_wait_handle(); | 140 | return surface->get_create_wait_handle(); |
384 | 139 | } | 141 | } |
385 | 140 | 142 | ||
386 | === modified file 'src/client/mir_connection.h' | |||
387 | --- src/client/mir_connection.h 2014-10-01 06:25:56 +0000 | |||
388 | +++ src/client/mir_connection.h 2014-10-23 13:30:17 +0000 | |||
389 | @@ -149,6 +149,7 @@ | |||
390 | 149 | 149 | ||
391 | 150 | std::shared_ptr<google::protobuf::RpcChannel> const channel; | 150 | std::shared_ptr<google::protobuf::RpcChannel> const channel; |
392 | 151 | mir::protobuf::DisplayServer::Stub server; | 151 | mir::protobuf::DisplayServer::Stub server; |
393 | 152 | mir::protobuf::Debug::Stub debug; | ||
394 | 152 | std::shared_ptr<mir::logging::Logger> const logger; | 153 | std::shared_ptr<mir::logging::Logger> const logger; |
395 | 153 | mir::protobuf::Void void_response; | 154 | mir::protobuf::Void void_response; |
396 | 154 | mir::protobuf::Connection connect_result; | 155 | mir::protobuf::Connection connect_result; |
397 | 155 | 156 | ||
398 | === added file 'src/client/mir_debug_api.cpp' | |||
399 | --- src/client/mir_debug_api.cpp 1970-01-01 00:00:00 +0000 | |||
400 | +++ src/client/mir_debug_api.cpp 2014-10-23 13:30:17 +0000 | |||
401 | @@ -0,0 +1,39 @@ | |||
402 | 1 | /* | ||
403 | 2 | * Copyright © 2014 Canonical Ltd. | ||
404 | 3 | * | ||
405 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
406 | 5 | * under the terms of the GNU Lesser General Public License version 3, | ||
407 | 6 | * as published by the Free Software Foundation. | ||
408 | 7 | * | ||
409 | 8 | * This program is distributed in the hope that it will be useful, | ||
410 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
411 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
412 | 11 | * GNU Lesser General Public License for more details. | ||
413 | 12 | * | ||
414 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
415 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
416 | 15 | * | ||
417 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
418 | 17 | */ | ||
419 | 18 | |||
420 | 19 | #include "mir_toolkit/debug/surface.h" | ||
421 | 20 | |||
422 | 21 | #include "mir_surface.h" | ||
423 | 22 | |||
424 | 23 | uint32_t mir_debug_surface_current_buffer_id(MirSurface* surface) | ||
425 | 24 | { | ||
426 | 25 | return surface->get_current_buffer_id(); | ||
427 | 26 | } | ||
428 | 27 | |||
429 | 28 | int mir_debug_surface_id(MirSurface* surface) | ||
430 | 29 | { | ||
431 | 30 | return surface->id(); | ||
432 | 31 | } | ||
433 | 32 | |||
434 | 33 | MirBool mir_debug_surface_coords_to_screen(MirSurface* surface, | ||
435 | 34 | int x, int y, | ||
436 | 35 | int* screen_x, int* screen_y) | ||
437 | 36 | { | ||
438 | 37 | return surface->translate_to_screen_coordinates(x, y, screen_x, screen_y) ? | ||
439 | 38 | mir_true : mir_false ; | ||
440 | 39 | } | ||
441 | 0 | 40 | ||
442 | === modified file 'src/client/mir_surface.cpp' | |||
443 | --- src/client/mir_surface.cpp 2014-10-21 16:21:14 +0000 | |||
444 | +++ src/client/mir_surface.cpp 2014-10-23 13:30:17 +0000 | |||
445 | @@ -51,7 +51,27 @@ | |||
446 | 51 | std::shared_ptr<mircv::InputPlatform> const& input_platform, | 51 | std::shared_ptr<mircv::InputPlatform> const& input_platform, |
447 | 52 | MirSurfaceParameters const & params, | 52 | MirSurfaceParameters const & params, |
448 | 53 | mir_surface_callback callback, void * context) | 53 | mir_surface_callback callback, void * context) |
449 | 54 | : MirSurface(allocating_connection, | ||
450 | 55 | server, | ||
451 | 56 | nullptr, | ||
452 | 57 | factory, | ||
453 | 58 | input_platform, | ||
454 | 59 | params, | ||
455 | 60 | callback, context) | ||
456 | 61 | { | ||
457 | 62 | } | ||
458 | 63 | |||
459 | 64 | |||
460 | 65 | MirSurface::MirSurface( | ||
461 | 66 | MirConnection *allocating_connection, | ||
462 | 67 | mp::DisplayServer::Stub & server, | ||
463 | 68 | mp::Debug::Stub* debug, | ||
464 | 69 | std::shared_ptr<mcl::ClientBufferFactory> const& factory, | ||
465 | 70 | std::shared_ptr<mircv::InputPlatform> const& input_platform, | ||
466 | 71 | MirSurfaceParameters const & params, | ||
467 | 72 | mir_surface_callback callback, void * context) | ||
468 | 54 | : server(server), | 73 | : server(server), |
469 | 74 | debug{debug}, | ||
470 | 55 | connection(allocating_connection), | 75 | connection(allocating_connection), |
471 | 56 | buffer_depository(std::make_shared<mcl::ClientBufferDepository>(factory, mir::frontend::client_buffer_cache_size)), | 76 | buffer_depository(std::make_shared<mcl::ClientBufferDepository>(factory, mir::frontend::client_buffer_cache_size)), |
472 | 57 | input_platform(input_platform) | 77 | input_platform(input_platform) |
473 | @@ -373,6 +393,49 @@ | |||
474 | 373 | return &configure_wait_handle; | 393 | return &configure_wait_handle; |
475 | 374 | } | 394 | } |
476 | 375 | 395 | ||
477 | 396 | namespace | ||
478 | 397 | { | ||
479 | 398 | void signal_response_received(MirWaitHandle* handle) | ||
480 | 399 | { | ||
481 | 400 | handle->result_received(); | ||
482 | 401 | } | ||
483 | 402 | } | ||
484 | 403 | |||
485 | 404 | bool MirSurface::translate_to_screen_coordinates(int x, int y, | ||
486 | 405 | int *screen_x, int *screen_y) | ||
487 | 406 | { | ||
488 | 407 | if (!debug) | ||
489 | 408 | { | ||
490 | 409 | return false; | ||
491 | 410 | } | ||
492 | 411 | |||
493 | 412 | mp::CoordinateTranslationRequest request; | ||
494 | 413 | |||
495 | 414 | request.set_x(x); | ||
496 | 415 | request.set_y(y); | ||
497 | 416 | *request.mutable_surfaceid() = surface.id(); | ||
498 | 417 | mp::CoordinateTranslationResponse response; | ||
499 | 418 | |||
500 | 419 | MirWaitHandle signal; | ||
501 | 420 | signal.expect_result(); | ||
502 | 421 | |||
503 | 422 | { | ||
504 | 423 | std::lock_guard<decltype(mutex)> lock(mutex); | ||
505 | 424 | |||
506 | 425 | debug->translate_surface_to_screen( | ||
507 | 426 | nullptr, | ||
508 | 427 | &request, | ||
509 | 428 | &response, | ||
510 | 429 | google::protobuf::NewCallback(&signal_response_received, &signal)); | ||
511 | 430 | } | ||
512 | 431 | |||
513 | 432 | signal.wait_for_one(); | ||
514 | 433 | |||
515 | 434 | *screen_x = response.x(); | ||
516 | 435 | *screen_y = response.y(); | ||
517 | 436 | return !response.has_error(); | ||
518 | 437 | } | ||
519 | 438 | |||
520 | 376 | void MirSurface::on_configured() | 439 | void MirSurface::on_configured() |
521 | 377 | { | 440 | { |
522 | 378 | std::lock_guard<decltype(mutex)> lock(mutex); | 441 | std::lock_guard<decltype(mutex)> lock(mutex); |
523 | 379 | 442 | ||
524 | === modified file 'src/client/mir_surface.h' | |||
525 | --- src/client/mir_surface.h 2014-10-21 16:21:14 +0000 | |||
526 | +++ src/client/mir_surface.h 2014-10-23 13:30:17 +0000 | |||
527 | @@ -62,6 +62,15 @@ | |||
528 | 62 | MirSurface( | 62 | MirSurface( |
529 | 63 | MirConnection *allocating_connection, | 63 | MirConnection *allocating_connection, |
530 | 64 | mir::protobuf::DisplayServer::Stub & server, | 64 | mir::protobuf::DisplayServer::Stub & server, |
531 | 65 | mir::protobuf::Debug::Stub* debug, | ||
532 | 66 | std::shared_ptr<mir::client::ClientBufferFactory> const& buffer_factory, | ||
533 | 67 | std::shared_ptr<mir::input::receiver::InputPlatform> const& input_platform, | ||
534 | 68 | MirSurfaceParameters const& params, | ||
535 | 69 | mir_surface_callback callback, void * context); | ||
536 | 70 | |||
537 | 71 | MirSurface( | ||
538 | 72 | MirConnection *allocating_connection, | ||
539 | 73 | mir::protobuf::DisplayServer::Stub & server, | ||
540 | 65 | std::shared_ptr<mir::client::ClientBufferFactory> const& buffer_factory, | 74 | std::shared_ptr<mir::client::ClientBufferFactory> const& buffer_factory, |
541 | 66 | std::shared_ptr<mir::input::receiver::InputPlatform> const& input_platform, | 75 | std::shared_ptr<mir::input::receiver::InputPlatform> const& input_platform, |
542 | 67 | MirSurfaceParameters const& params, | 76 | MirSurfaceParameters const& params, |
543 | @@ -87,6 +96,11 @@ | |||
544 | 87 | EGLNativeWindowType generate_native_window(); | 96 | EGLNativeWindowType generate_native_window(); |
545 | 88 | 97 | ||
546 | 89 | MirWaitHandle* configure(MirSurfaceAttrib a, int value); | 98 | MirWaitHandle* configure(MirSurfaceAttrib a, int value); |
547 | 99 | |||
548 | 100 | // TODO: Some sort of extension mechanism so that this can be moved | ||
549 | 101 | // out into a separate class in the libmirclient-debug DSO. | ||
550 | 102 | bool translate_to_screen_coordinates(int x, int y, | ||
551 | 103 | int* screen_x, int* screen_y); | ||
552 | 90 | 104 | ||
553 | 91 | // Non-blocking | 105 | // Non-blocking |
554 | 92 | int attrib(MirSurfaceAttrib a) const; | 106 | int attrib(MirSurfaceAttrib a) const; |
555 | @@ -115,7 +129,8 @@ | |||
556 | 115 | MirPixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf); | 129 | MirPixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf); |
557 | 116 | void release_cpu_region(); | 130 | void release_cpu_region(); |
558 | 117 | 131 | ||
560 | 118 | mir::protobuf::DisplayServer::Stub & server; | 132 | mir::protobuf::DisplayServer::Stub& server; |
561 | 133 | mir::protobuf::Debug::Stub* debug; | ||
562 | 119 | mir::protobuf::Surface surface; | 134 | mir::protobuf::Surface surface; |
563 | 120 | mir::protobuf::BufferRequest buffer_request; | 135 | mir::protobuf::BufferRequest buffer_request; |
564 | 121 | std::string error_message; | 136 | std::string error_message; |
565 | 122 | 137 | ||
566 | === modified file 'src/client/mir_surface_api.cpp' | |||
567 | --- src/client/mir_surface_api.cpp 2014-10-01 06:25:56 +0000 | |||
568 | +++ src/client/mir_surface_api.cpp 2014-10-23 13:30:17 +0000 | |||
569 | @@ -18,7 +18,6 @@ | |||
570 | 18 | 18 | ||
571 | 19 | #include "mir_toolkit/mir_surface.h" | 19 | #include "mir_toolkit/mir_surface.h" |
572 | 20 | #include "mir_toolkit/mir_wait.h" | 20 | #include "mir_toolkit/mir_wait.h" |
573 | 21 | #include "mir_toolkit/mir_client_library_debug.h" | ||
574 | 22 | 21 | ||
575 | 23 | #include "mir_connection.h" | 22 | #include "mir_connection.h" |
576 | 24 | #include "mir_surface.h" | 23 | #include "mir_surface.h" |
577 | @@ -152,9 +151,9 @@ | |||
578 | 152 | nullptr)); | 151 | nullptr)); |
579 | 153 | } | 152 | } |
580 | 154 | 153 | ||
582 | 155 | int mir_surface_get_id(MirSurface* surface) | 154 | int mir_surface_get_id(MirSurface* /*surface*/) |
583 | 156 | { | 155 | { |
585 | 157 | return mir_debug_surface_id(surface); | 156 | return 0; |
586 | 158 | } | 157 | } |
587 | 159 | 158 | ||
588 | 160 | MirWaitHandle* mir_surface_set_type(MirSurface* surf, | 159 | MirWaitHandle* mir_surface_set_type(MirSurface* surf, |
589 | 161 | 160 | ||
590 | === added file 'src/client/mirclient-debug-extension.pc.in' | |||
591 | --- src/client/mirclient-debug-extension.pc.in 1970-01-01 00:00:00 +0000 | |||
592 | +++ src/client/mirclient-debug-extension.pc.in 2014-10-23 13:30:17 +0000 | |||
593 | @@ -0,0 +1,11 @@ | |||
594 | 1 | prefix=@PREFIX@ | ||
595 | 2 | exec_prefix=@EXEC_PREFIX@ | ||
596 | 3 | libdir=@LIBDIR@ | ||
597 | 4 | includedir=@INCLUDEDIR@/mirclient-debug | ||
598 | 5 | common_includedir=@INCLUDEDIR@/mircommon | ||
599 | 6 | |||
600 | 7 | Name: mirclient-debug | ||
601 | 8 | Description: Mir client debug library | ||
602 | 9 | Version: @MIR_VERSION@ | ||
603 | 10 | Libs: -L${libdir} -lmirclient-debug | ||
604 | 11 | Cflags: -I${includedir} -I${common_includedir} | ||
605 | 0 | 12 | ||
606 | === modified file 'src/client/mirclient.pc.in' | |||
607 | --- src/client/mirclient.pc.in 2014-10-01 06:25:56 +0000 | |||
608 | +++ src/client/mirclient.pc.in 2014-10-23 13:30:17 +0000 | |||
609 | @@ -1,11 +1,13 @@ | |||
610 | 1 | prefix=@PREFIX@ | 1 | prefix=@PREFIX@ |
611 | 2 | exec_prefix=@EXEC_PREFIX@ | 2 | exec_prefix=@EXEC_PREFIX@ |
612 | 3 | libdir=@LIBDIR@ | 3 | libdir=@LIBDIR@ |
614 | 4 | includedir=@INCLUDEDIR@ | 4 | includedir=@INCLUDEDIR@/mirclient |
615 | 5 | common_includedir=@INCLUDEDIR@/mircommon | ||
616 | 6 | |||
617 | 5 | 7 | ||
618 | 6 | Name: mirclient | 8 | Name: mirclient |
619 | 7 | Description: Mir client library | 9 | Description: Mir client library |
620 | 8 | Version: @MIR_VERSION@ | 10 | Version: @MIR_VERSION@ |
621 | 9 | Requires.private: protobuf >= 2.4.1 | 11 | Requires.private: protobuf >= 2.4.1 |
624 | 10 | Libs: -L@LIBDIR@ -lmirclient | 12 | Libs: -L${libdir} -lmirclient |
625 | 11 | Cflags: -I@INCLUDEDIR@ -I@COMMON_INCLUDEDIR@ | 13 | Cflags: -I${includedir} -I${common_includedir} |
626 | 12 | 14 | ||
627 | === added file 'src/client/symbols-debug.map' | |||
628 | --- src/client/symbols-debug.map 1970-01-01 00:00:00 +0000 | |||
629 | +++ src/client/symbols-debug.map 2014-10-23 13:30:17 +0000 | |||
630 | @@ -0,0 +1,5 @@ | |||
631 | 1 | { | ||
632 | 2 | global: | ||
633 | 3 | mir_debug_*; | ||
634 | 4 | local: *; | ||
635 | 5 | }; | ||
636 | 0 | 6 | ||
637 | === modified file 'src/common/protobuf/mir_protobuf.proto' | |||
638 | --- src/common/protobuf/mir_protobuf.proto 2014-10-21 16:21:14 +0000 | |||
639 | +++ src/common/protobuf/mir_protobuf.proto 2014-10-23 13:30:17 +0000 | |||
640 | @@ -228,3 +228,20 @@ | |||
641 | 228 | rpc stop_prompt_session(Void) returns (Void); | 228 | rpc stop_prompt_session(Void) returns (Void); |
642 | 229 | rpc exchange_buffer(BufferRequest) returns (Buffer); | 229 | rpc exchange_buffer(BufferRequest) returns (Buffer); |
643 | 230 | } | 230 | } |
644 | 231 | |||
645 | 232 | message CoordinateTranslationRequest { | ||
646 | 233 | required SurfaceId surfaceid = 1; | ||
647 | 234 | required int32 x = 2; | ||
648 | 235 | required int32 y = 3; | ||
649 | 236 | } | ||
650 | 237 | |||
651 | 238 | message CoordinateTranslationResponse { | ||
652 | 239 | optional int32 x = 1; | ||
653 | 240 | optional int32 y = 2; | ||
654 | 241 | |||
655 | 242 | optional string error = 127; | ||
656 | 243 | } | ||
657 | 244 | |||
658 | 245 | service Debug { | ||
659 | 246 | rpc translate_surface_to_screen(CoordinateTranslationRequest) returns (CoordinateTranslationResponse); | ||
660 | 247 | } | ||
661 | 231 | 248 | ||
662 | === modified file 'src/common/symbols.map' | |||
663 | --- src/common/symbols.map 2014-10-21 16:21:14 +0000 | |||
664 | +++ src/common/symbols.map 2014-10-23 13:30:17 +0000 | |||
665 | @@ -143,6 +143,42 @@ | |||
666 | 143 | mir::protobuf::ConnectParameters::SerializeWithCachedSizes*; | 143 | mir::protobuf::ConnectParameters::SerializeWithCachedSizes*; |
667 | 144 | mir::protobuf::ConnectParameters::SerializeWithCachedSizesToArray*; | 144 | mir::protobuf::ConnectParameters::SerializeWithCachedSizesToArray*; |
668 | 145 | mir::protobuf::ConnectParameters::Swap*; | 145 | mir::protobuf::ConnectParameters::Swap*; |
669 | 146 | mir::protobuf::CoordinateTranslationRequest::ByteSize*; | ||
670 | 147 | mir::protobuf::CoordinateTranslationRequest::Clear*; | ||
671 | 148 | mir::protobuf::CoordinateTranslationRequest::?CoordinateTranslationRequest*; | ||
672 | 149 | mir::protobuf::CoordinateTranslationRequest::CoordinateTranslationRequest*; | ||
673 | 150 | mir::protobuf::CoordinateTranslationRequest::CopyFrom*; | ||
674 | 151 | mir::protobuf::CoordinateTranslationRequest::default_instance*; | ||
675 | 152 | mir::protobuf::CoordinateTranslationRequest::descriptor*; | ||
676 | 153 | mir::protobuf::CoordinateTranslationRequest::GetMetadata*; | ||
677 | 154 | mir::protobuf::CoordinateTranslationRequest::IsInitialized*; | ||
678 | 155 | mir::protobuf::CoordinateTranslationRequest::kSurfaceidFieldNumber*; | ||
679 | 156 | mir::protobuf::CoordinateTranslationRequest::kXFieldNumber*; | ||
680 | 157 | mir::protobuf::CoordinateTranslationRequest::kYFieldNumber*; | ||
681 | 158 | mir::protobuf::CoordinateTranslationRequest::MergeFrom*; | ||
682 | 159 | mir::protobuf::CoordinateTranslationRequest::MergePartialFromCodedStream*; | ||
683 | 160 | mir::protobuf::CoordinateTranslationRequest::New*; | ||
684 | 161 | mir::protobuf::CoordinateTranslationRequest::SerializeWithCachedSizes*; | ||
685 | 162 | mir::protobuf::CoordinateTranslationRequest::SerializeWithCachedSizesToArray*; | ||
686 | 163 | mir::protobuf::CoordinateTranslationRequest::Swap*; | ||
687 | 164 | mir::protobuf::CoordinateTranslationResponse::ByteSize*; | ||
688 | 165 | mir::protobuf::CoordinateTranslationResponse::Clear*; | ||
689 | 166 | mir::protobuf::CoordinateTranslationResponse::?CoordinateTranslationResponse*; | ||
690 | 167 | mir::protobuf::CoordinateTranslationResponse::CoordinateTranslationResponse*; | ||
691 | 168 | mir::protobuf::CoordinateTranslationResponse::CopyFrom*; | ||
692 | 169 | mir::protobuf::CoordinateTranslationResponse::default_instance*; | ||
693 | 170 | mir::protobuf::CoordinateTranslationResponse::descriptor*; | ||
694 | 171 | mir::protobuf::CoordinateTranslationResponse::GetMetadata*; | ||
695 | 172 | mir::protobuf::CoordinateTranslationResponse::IsInitialized*; | ||
696 | 173 | mir::protobuf::CoordinateTranslationResponse::kErrorFieldNumber*; | ||
697 | 174 | mir::protobuf::CoordinateTranslationResponse::kXFieldNumber*; | ||
698 | 175 | mir::protobuf::CoordinateTranslationResponse::kYFieldNumber*; | ||
699 | 176 | mir::protobuf::CoordinateTranslationResponse::MergeFrom*; | ||
700 | 177 | mir::protobuf::CoordinateTranslationResponse::MergePartialFromCodedStream*; | ||
701 | 178 | mir::protobuf::CoordinateTranslationResponse::New*; | ||
702 | 179 | mir::protobuf::CoordinateTranslationResponse::SerializeWithCachedSizes*; | ||
703 | 180 | mir::protobuf::CoordinateTranslationResponse::SerializeWithCachedSizesToArray*; | ||
704 | 181 | mir::protobuf::CoordinateTranslationResponse::Swap*; | ||
705 | 146 | mir::protobuf::CursorSetting::ByteSize*; | 182 | mir::protobuf::CursorSetting::ByteSize*; |
706 | 147 | mir::protobuf::CursorSetting::Clear*; | 183 | mir::protobuf::CursorSetting::Clear*; |
707 | 148 | mir::protobuf::CursorSetting::CopyFrom*; | 184 | mir::protobuf::CursorSetting::CopyFrom*; |
708 | @@ -160,6 +196,16 @@ | |||
709 | 160 | mir::protobuf::CursorSetting::SerializeWithCachedSizes*; | 196 | mir::protobuf::CursorSetting::SerializeWithCachedSizes*; |
710 | 161 | mir::protobuf::CursorSetting::SerializeWithCachedSizesToArray*; | 197 | mir::protobuf::CursorSetting::SerializeWithCachedSizesToArray*; |
711 | 162 | mir::protobuf::CursorSetting::Swap*; | 198 | mir::protobuf::CursorSetting::Swap*; |
712 | 199 | mir::protobuf::Debug::CallMethod*; | ||
713 | 200 | mir::protobuf::Debug::?Debug*; | ||
714 | 201 | mir::protobuf::Debug::descriptor*; | ||
715 | 202 | mir::protobuf::Debug::GetDescriptor*; | ||
716 | 203 | mir::protobuf::Debug::GetRequestPrototype*; | ||
717 | 204 | mir::protobuf::Debug::GetResponsePrototype*; | ||
718 | 205 | mir::protobuf::Debug_Stub::?Debug_Stub*; | ||
719 | 206 | mir::protobuf::Debug_Stub::Debug_Stub*; | ||
720 | 207 | mir::protobuf::Debug_Stub::translate_surface_to_screen*; | ||
721 | 208 | mir::protobuf::Debug::translate_surface_to_screen*; | ||
722 | 163 | mir::protobuf::DisplayCard::ByteSize*; | 209 | mir::protobuf::DisplayCard::ByteSize*; |
723 | 164 | mir::protobuf::DisplayCard::Clear*; | 210 | mir::protobuf::DisplayCard::Clear*; |
724 | 165 | mir::protobuf::DisplayCard::CopyFrom*; | 211 | mir::protobuf::DisplayCard::CopyFrom*; |
725 | @@ -780,7 +826,11 @@ | |||
726 | 780 | typeinfo?for?mir::protobuf::BufferRequest; | 826 | typeinfo?for?mir::protobuf::BufferRequest; |
727 | 781 | typeinfo?for?mir::protobuf::Connection; | 827 | typeinfo?for?mir::protobuf::Connection; |
728 | 782 | typeinfo?for?mir::protobuf::ConnectParameters; | 828 | typeinfo?for?mir::protobuf::ConnectParameters; |
729 | 829 | typeinfo?for?mir::protobuf::CoordinateTranslationRequest; | ||
730 | 830 | typeinfo?for?mir::protobuf::CoordinateTranslationResponse; | ||
731 | 783 | typeinfo?for?mir::protobuf::CursorSetting; | 831 | typeinfo?for?mir::protobuf::CursorSetting; |
732 | 832 | typeinfo?for?mir::protobuf::Debug; | ||
733 | 833 | typeinfo?for?mir::protobuf::Debug_Stub; | ||
734 | 784 | typeinfo?for?mir::protobuf::DisplayCard; | 834 | typeinfo?for?mir::protobuf::DisplayCard; |
735 | 785 | typeinfo?for?mir::protobuf::DisplayConfiguration; | 835 | typeinfo?for?mir::protobuf::DisplayConfiguration; |
736 | 786 | typeinfo?for?mir::protobuf::DisplayInfo; | 836 | typeinfo?for?mir::protobuf::DisplayInfo; |
737 | @@ -847,7 +897,11 @@ | |||
738 | 847 | vtable?for?mir::protobuf::BufferRequest; | 897 | vtable?for?mir::protobuf::BufferRequest; |
739 | 848 | vtable?for?mir::protobuf::Connection; | 898 | vtable?for?mir::protobuf::Connection; |
740 | 849 | vtable?for?mir::protobuf::ConnectParameters; | 899 | vtable?for?mir::protobuf::ConnectParameters; |
741 | 900 | vtable?for?mir::protobuf::CoordinateTranslationRequest; | ||
742 | 901 | vtable?for?mir::protobuf::CoordinateTranslationResponse; | ||
743 | 850 | vtable?for?mir::protobuf::CursorSetting; | 902 | vtable?for?mir::protobuf::CursorSetting; |
744 | 903 | vtable?for?mir::protobuf::Debug; | ||
745 | 904 | vtable?for?mir::protobuf::Debug_Stub; | ||
746 | 851 | vtable?for?mir::protobuf::DisplayCard; | 905 | vtable?for?mir::protobuf::DisplayCard; |
747 | 852 | vtable?for?mir::protobuf::DisplayConfiguration; | 906 | vtable?for?mir::protobuf::DisplayConfiguration; |
748 | 853 | vtable?for?mir::protobuf::DisplayInfo; | 907 | vtable?for?mir::protobuf::DisplayInfo; |
749 | 854 | 908 | ||
750 | === added file 'src/include/server/mir/frontend/unsupported_feature_exception.h' | |||
751 | --- src/include/server/mir/frontend/unsupported_feature_exception.h 1970-01-01 00:00:00 +0000 | |||
752 | +++ src/include/server/mir/frontend/unsupported_feature_exception.h 2014-10-23 13:30:17 +0000 | |||
753 | @@ -0,0 +1,41 @@ | |||
754 | 1 | /* | ||
755 | 2 | * Copyright © 2014 Canonical Ltd. | ||
756 | 3 | * | ||
757 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
758 | 5 | * under the terms of the GNU General Public License version 3, | ||
759 | 6 | * as published by the Free Software Foundation. | ||
760 | 7 | * | ||
761 | 8 | * This program is distributed in the hope that it will be useful, | ||
762 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
763 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
764 | 11 | * GNU General Public License for more details. | ||
765 | 12 | * | ||
766 | 13 | * You should have received a copy of the GNU General Public License | ||
767 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
768 | 15 | * | ||
769 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
770 | 17 | */ | ||
771 | 18 | |||
772 | 19 | |||
773 | 20 | #ifndef MIR_FRONTEND_UNSUPPORTED_FEATURE_EXCEPTION_H_ | ||
774 | 21 | #define MIR_FRONTEND_UNSUPPORTED_FEATURE_EXCEPTION_H_ | ||
775 | 22 | |||
776 | 23 | #include <stdexcept> | ||
777 | 24 | |||
778 | 25 | namespace mir | ||
779 | 26 | { | ||
780 | 27 | namespace frontend | ||
781 | 28 | { | ||
782 | 29 | class unsupported_feature : public std::runtime_error | ||
783 | 30 | { | ||
784 | 31 | public: | ||
785 | 32 | unsupported_feature() | ||
786 | 33 | : std::runtime_error{"Unsupported feature requested"} | ||
787 | 34 | { | ||
788 | 35 | } | ||
789 | 36 | }; | ||
790 | 37 | } | ||
791 | 38 | } | ||
792 | 39 | |||
793 | 40 | |||
794 | 41 | #endif /* MIR_FRONTEND_UNSUPPORTED_FEATURE_EXCEPTION_H_ */ | ||
795 | 0 | 42 | ||
796 | === modified file 'src/platform/options/default_configuration.cpp' | |||
797 | --- src/platform/options/default_configuration.cpp 2014-10-01 06:25:56 +0000 | |||
798 | +++ src/platform/options/default_configuration.cpp 2014-10-23 13:30:17 +0000 | |||
799 | @@ -45,6 +45,7 @@ | |||
800 | 45 | char const* const mo::offscreen_opt = "offscreen"; | 45 | char const* const mo::offscreen_opt = "offscreen"; |
801 | 46 | char const* const mo::touchspots_opt = "enable-touchspots"; | 46 | char const* const mo::touchspots_opt = "enable-touchspots"; |
802 | 47 | char const* const mo::fatal_abort_opt = "on-fatal-error-abort"; | 47 | char const* const mo::fatal_abort_opt = "on-fatal-error-abort"; |
803 | 48 | char const* const mo::debug_opt = "debug"; | ||
804 | 48 | 49 | ||
805 | 49 | char const* const mo::glog = "glog"; | 50 | char const* const mo::glog = "glog"; |
806 | 50 | char const* const mo::glog_stderrthreshold = "glog-stderrthreshold"; | 51 | char const* const mo::glog_stderrthreshold = "glog-stderrthreshold"; |
807 | @@ -164,7 +165,9 @@ | |||
808 | 164 | (touchspots_opt, | 165 | (touchspots_opt, |
809 | 165 | "Display visualization of touchspots (e.g. for screencasting).") | 166 | "Display visualization of touchspots (e.g. for screencasting).") |
810 | 166 | (fatal_abort_opt, "On \"fatal error\" conditions [e.g. drivers behaving " | 167 | (fatal_abort_opt, "On \"fatal error\" conditions [e.g. drivers behaving " |
812 | 167 | "in unexpected ways] abort (to get a core dump)"); | 168 | "in unexpected ways] abort (to get a core dump)") |
813 | 169 | (debug_opt, "Enable extra development debugging. " | ||
814 | 170 | "This is only interesting for people doing Mir server or client development."); | ||
815 | 168 | 171 | ||
816 | 169 | add_platform_options(); | 172 | add_platform_options(); |
817 | 170 | } | 173 | } |
818 | 171 | 174 | ||
819 | === modified file 'src/platform/symbols.map' | |||
820 | --- src/platform/symbols.map 2014-10-21 16:21:14 +0000 | |||
821 | +++ src/platform/symbols.map 2014-10-23 13:30:17 +0000 | |||
822 | @@ -146,6 +146,7 @@ | |||
823 | 146 | mir::options::DefaultConfiguration::parse_environment*; | 146 | mir::options::DefaultConfiguration::parse_environment*; |
824 | 147 | mir::options::DefaultConfiguration::the_options*; | 147 | mir::options::DefaultConfiguration::the_options*; |
825 | 148 | mir::options::display_report_opt*; | 148 | mir::options::display_report_opt*; |
826 | 149 | mir::options::debug_opt*; | ||
827 | 149 | mir::options::enable_input_opt*; | 150 | mir::options::enable_input_opt*; |
828 | 150 | mir::options::fatal_abort_opt*; | 151 | mir::options::fatal_abort_opt*; |
829 | 151 | mir::options::frontend_threads_opt*; | 152 | mir::options::frontend_threads_opt*; |
830 | 152 | 153 | ||
831 | === modified file 'src/server/frontend/CMakeLists.txt' | |||
832 | --- src/server/frontend/CMakeLists.txt 2014-10-01 06:25:56 +0000 | |||
833 | +++ src/server/frontend/CMakeLists.txt 2014-10-23 13:30:17 +0000 | |||
834 | @@ -22,6 +22,7 @@ | |||
835 | 22 | session_credentials.cpp | 22 | session_credentials.cpp |
836 | 23 | default_configuration.cpp | 23 | default_configuration.cpp |
837 | 24 | default_ipc_factory.cpp | 24 | default_ipc_factory.cpp |
838 | 25 | unsupported_coordinate_translator.cpp | ||
839 | 25 | ) | 26 | ) |
840 | 26 | 27 | ||
841 | 27 | add_library( | 28 | add_library( |
842 | 28 | 29 | ||
843 | === modified file 'src/server/frontend/default_configuration.cpp' | |||
844 | --- src/server/frontend/default_configuration.cpp 2014-10-01 06:25:56 +0000 | |||
845 | +++ src/server/frontend/default_configuration.cpp 2014-10-23 13:30:17 +0000 | |||
846 | @@ -22,6 +22,8 @@ | |||
847 | 22 | #include "default_ipc_factory.h" | 22 | #include "default_ipc_factory.h" |
848 | 23 | #include "published_socket_connector.h" | 23 | #include "published_socket_connector.h" |
849 | 24 | 24 | ||
850 | 25 | #include "unsupported_coordinate_translator.h" | ||
851 | 26 | |||
852 | 25 | #include "mir/frontend/protobuf_connection_creator.h" | 27 | #include "mir/frontend/protobuf_connection_creator.h" |
853 | 26 | #include "mir/frontend/session_authorizer.h" | 28 | #include "mir/frontend/session_authorizer.h" |
854 | 27 | #include "mir/options/configuration.h" | 29 | #include "mir/options/configuration.h" |
855 | @@ -29,6 +31,7 @@ | |||
856 | 29 | 31 | ||
857 | 30 | namespace mf = mir::frontend; | 32 | namespace mf = mir::frontend; |
858 | 31 | namespace mg = mir::graphics; | 33 | namespace mg = mir::graphics; |
859 | 34 | namespace ms = mir::scene; | ||
860 | 32 | 35 | ||
861 | 33 | std::shared_ptr<mf::ConnectionCreator> | 36 | std::shared_ptr<mf::ConnectionCreator> |
862 | 34 | mir::DefaultServerConfiguration::the_connection_creator() | 37 | mir::DefaultServerConfiguration::the_connection_creator() |
863 | @@ -137,13 +140,23 @@ | |||
864 | 137 | mir::DefaultServerConfiguration::new_ipc_factory( | 140 | mir::DefaultServerConfiguration::new_ipc_factory( |
865 | 138 | std::shared_ptr<mf::SessionAuthorizer> const& session_authorizer) | 141 | std::shared_ptr<mf::SessionAuthorizer> const& session_authorizer) |
866 | 139 | { | 142 | { |
867 | 143 | std::shared_ptr<ms::CoordinateTranslator> translator; | ||
868 | 144 | if (the_options()->is_set(options::debug_opt)) | ||
869 | 145 | { | ||
870 | 146 | translator = the_coordinate_translator(); | ||
871 | 147 | } | ||
872 | 148 | else | ||
873 | 149 | { | ||
874 | 150 | translator = std::make_shared<mf::UnsupportedCoordinateTranslator>(); | ||
875 | 151 | } | ||
876 | 140 | return std::make_shared<mf::DefaultIpcFactory>( | 152 | return std::make_shared<mf::DefaultIpcFactory>( |
885 | 141 | the_frontend_shell(), | 153 | the_frontend_shell(), |
886 | 142 | the_session_mediator_report(), | 154 | the_session_mediator_report(), |
887 | 143 | the_graphics_platform(), | 155 | the_graphics_platform(), |
888 | 144 | the_frontend_display_changer(), | 156 | the_frontend_display_changer(), |
889 | 145 | the_buffer_allocator(), | 157 | the_buffer_allocator(), |
890 | 146 | the_screencast(), | 158 | the_screencast(), |
891 | 147 | session_authorizer, | 159 | session_authorizer, |
892 | 148 | the_cursor_images()); | 160 | the_cursor_images(), |
893 | 161 | translator); | ||
894 | 149 | } | 162 | } |
895 | 150 | 163 | ||
896 | === modified file 'src/server/frontend/default_ipc_factory.cpp' | |||
897 | --- src/server/frontend/default_ipc_factory.cpp 2014-10-01 06:25:56 +0000 | |||
898 | +++ src/server/frontend/default_ipc_factory.cpp 2014-10-23 13:30:17 +0000 | |||
899 | @@ -38,7 +38,8 @@ | |||
900 | 38 | std::shared_ptr<mg::GraphicBufferAllocator> const& buffer_allocator, | 38 | std::shared_ptr<mg::GraphicBufferAllocator> const& buffer_allocator, |
901 | 39 | std::shared_ptr<Screencast> const& screencast, | 39 | std::shared_ptr<Screencast> const& screencast, |
902 | 40 | std::shared_ptr<SessionAuthorizer> const& session_authorizer, | 40 | std::shared_ptr<SessionAuthorizer> const& session_authorizer, |
904 | 41 | std::shared_ptr<mi::CursorImages> const& cursor_images) : | 41 | std::shared_ptr<mi::CursorImages> const& cursor_images, |
905 | 42 | std::shared_ptr<scene::CoordinateTranslator> const& translator) : | ||
906 | 42 | shell(shell), | 43 | shell(shell), |
907 | 43 | no_prompt_shell(std::make_shared<NoPromptShell>(shell)), | 44 | no_prompt_shell(std::make_shared<NoPromptShell>(shell)), |
908 | 44 | sm_report(sm_report), | 45 | sm_report(sm_report), |
909 | @@ -48,7 +49,8 @@ | |||
910 | 48 | buffer_allocator(buffer_allocator), | 49 | buffer_allocator(buffer_allocator), |
911 | 49 | screencast(screencast), | 50 | screencast(screencast), |
912 | 50 | session_authorizer(session_authorizer), | 51 | session_authorizer(session_authorizer), |
914 | 51 | cursor_images(cursor_images) | 52 | cursor_images(cursor_images), |
915 | 53 | translator{translator} | ||
916 | 52 | { | 54 | { |
917 | 53 | } | 55 | } |
918 | 54 | 56 | ||
919 | @@ -120,5 +122,6 @@ | |||
920 | 120 | resource_cache(), | 122 | resource_cache(), |
921 | 121 | effective_screencast, | 123 | effective_screencast, |
922 | 122 | connection_context, | 124 | connection_context, |
924 | 123 | cursor_images); | 125 | cursor_images, |
925 | 126 | translator); | ||
926 | 124 | } | 127 | } |
927 | 125 | 128 | ||
928 | === modified file 'src/server/frontend/default_ipc_factory.h' | |||
929 | --- src/server/frontend/default_ipc_factory.h 2014-10-01 06:25:56 +0000 | |||
930 | +++ src/server/frontend/default_ipc_factory.h 2014-10-23 13:30:17 +0000 | |||
931 | @@ -33,6 +33,11 @@ | |||
932 | 33 | class CursorImages; | 33 | class CursorImages; |
933 | 34 | } | 34 | } |
934 | 35 | 35 | ||
935 | 36 | namespace scene | ||
936 | 37 | { | ||
937 | 38 | class CoordinateTranslator; | ||
938 | 39 | } | ||
939 | 40 | |||
940 | 36 | namespace frontend | 41 | namespace frontend |
941 | 37 | { | 42 | { |
942 | 38 | class Shell; | 43 | class Shell; |
943 | @@ -52,7 +57,8 @@ | |||
944 | 52 | std::shared_ptr<graphics::GraphicBufferAllocator> const& buffer_allocator, | 57 | std::shared_ptr<graphics::GraphicBufferAllocator> const& buffer_allocator, |
945 | 53 | std::shared_ptr<Screencast> const& screencast, | 58 | std::shared_ptr<Screencast> const& screencast, |
946 | 54 | std::shared_ptr<SessionAuthorizer> const& session_authorizer, | 59 | std::shared_ptr<SessionAuthorizer> const& session_authorizer, |
948 | 55 | std::shared_ptr<input::CursorImages> const& cursor_images); | 60 | std::shared_ptr<input::CursorImages> const& cursor_images, |
949 | 61 | std::shared_ptr<scene::CoordinateTranslator> const& translator); | ||
950 | 56 | 62 | ||
951 | 57 | std::shared_ptr<detail::DisplayServer> make_ipc_server( | 63 | std::shared_ptr<detail::DisplayServer> make_ipc_server( |
952 | 58 | SessionCredentials const& creds, | 64 | SessionCredentials const& creds, |
953 | @@ -83,6 +89,7 @@ | |||
954 | 83 | std::shared_ptr<Screencast> const screencast; | 89 | std::shared_ptr<Screencast> const screencast; |
955 | 84 | std::shared_ptr<SessionAuthorizer> const session_authorizer; | 90 | std::shared_ptr<SessionAuthorizer> const session_authorizer; |
956 | 85 | std::shared_ptr<input::CursorImages> const cursor_images; | 91 | std::shared_ptr<input::CursorImages> const cursor_images; |
957 | 92 | std::shared_ptr<scene::CoordinateTranslator> const translator; | ||
958 | 86 | }; | 93 | }; |
959 | 87 | } | 94 | } |
960 | 88 | } | 95 | } |
961 | 89 | 96 | ||
962 | === modified file 'src/server/frontend/protobuf_message_processor.cpp' | |||
963 | --- src/server/frontend/protobuf_message_processor.cpp 2014-10-22 18:55:40 +0000 | |||
964 | +++ src/server/frontend/protobuf_message_processor.cpp 2014-10-23 13:30:17 +0000 | |||
965 | @@ -21,6 +21,7 @@ | |||
966 | 21 | #include "mir/frontend/message_processor_report.h" | 21 | #include "mir/frontend/message_processor_report.h" |
967 | 22 | #include "mir/frontend/protobuf_message_sender.h" | 22 | #include "mir/frontend/protobuf_message_sender.h" |
968 | 23 | #include "mir/frontend/template_protobuf_message_processor.h" | 23 | #include "mir/frontend/template_protobuf_message_processor.h" |
969 | 24 | #include "mir/frontend/unsupported_feature_exception.h" | ||
970 | 24 | 25 | ||
971 | 25 | #include "mir_protobuf_wire.pb.h" | 26 | #include "mir_protobuf_wire.pb.h" |
972 | 26 | 27 | ||
973 | @@ -104,6 +105,24 @@ | |||
974 | 104 | self->send_response(invocation.id(), result_message); | 105 | self->send_response(invocation.id(), result_message); |
975 | 105 | } | 106 | } |
976 | 106 | } | 107 | } |
977 | 108 | |||
978 | 109 | // A partial-specialisation to handle error cases. | ||
979 | 110 | template<class Self, class ServerX, class ParameterMessage, class ResultMessage> | ||
980 | 111 | void invoke( | ||
981 | 112 | Self* self, | ||
982 | 113 | std::string* error, | ||
983 | 114 | void (ServerX::*/*function*/)( | ||
984 | 115 | ::google::protobuf::RpcController* controller, | ||
985 | 116 | const ParameterMessage* request, | ||
986 | 117 | ResultMessage* response, | ||
987 | 118 | ::google::protobuf::Closure* done), | ||
988 | 119 | Invocation const& invocation) | ||
989 | 120 | { | ||
990 | 121 | ResultMessage result_message; | ||
991 | 122 | result_message.set_error(error->c_str()); | ||
992 | 123 | self->send_response(invocation.id(), &result_message); | ||
993 | 124 | } | ||
994 | 125 | |||
995 | 107 | } | 126 | } |
996 | 108 | } | 127 | } |
997 | 109 | } | 128 | } |
998 | @@ -206,6 +225,24 @@ | |||
999 | 206 | invoke(this, display_server.get(), &DisplayServer::disconnect, invocation); | 225 | invoke(this, display_server.get(), &DisplayServer::disconnect, invocation); |
1000 | 207 | result = false; | 226 | result = false; |
1001 | 208 | } | 227 | } |
1002 | 228 | else if ("translate_surface_to_screen" == invocation.method_name()) | ||
1003 | 229 | { | ||
1004 | 230 | try | ||
1005 | 231 | { | ||
1006 | 232 | auto debug_interface = dynamic_cast<mir::protobuf::Debug*>(display_server.get()); | ||
1007 | 233 | invoke(this, debug_interface, &mir::protobuf::Debug::translate_surface_to_screen, invocation); | ||
1008 | 234 | } | ||
1009 | 235 | catch (mir::frontend::unsupported_feature const&) | ||
1010 | 236 | { | ||
1011 | 237 | std::string message{"Server does not support the client debugging interface"}; | ||
1012 | 238 | invoke(this, | ||
1013 | 239 | &message, | ||
1014 | 240 | &mir::protobuf::Debug::translate_surface_to_screen, | ||
1015 | 241 | invocation); | ||
1016 | 242 | std::runtime_error err{"Client attempted to use unavailable debug interface"}; | ||
1017 | 243 | report->exception_handled(display_server.get(), invocation.id(), err); | ||
1018 | 244 | } | ||
1019 | 245 | } | ||
1020 | 209 | else | 246 | else |
1021 | 210 | { | 247 | { |
1022 | 211 | report->unknown_method(display_server.get(), invocation.id(), invocation.method_name()); | 248 | report->unknown_method(display_server.get(), invocation.id(), invocation.method_name()); |
1023 | 212 | 249 | ||
1024 | === modified file 'src/server/frontend/session_mediator.cpp' | |||
1025 | --- src/server/frontend/session_mediator.cpp 2014-10-21 16:21:14 +0000 | |||
1026 | +++ src/server/frontend/session_mediator.cpp 2014-10-23 13:30:17 +0000 | |||
1027 | @@ -17,13 +17,13 @@ | |||
1028 | 17 | */ | 17 | */ |
1029 | 18 | 18 | ||
1030 | 19 | #include "session_mediator.h" | 19 | #include "session_mediator.h" |
1031 | 20 | #include "client_buffer_tracker.h" | ||
1032 | 21 | 20 | ||
1033 | 22 | #include "mir/frontend/session_mediator_report.h" | 21 | #include "mir/frontend/session_mediator_report.h" |
1034 | 23 | #include "mir/frontend/shell.h" | 22 | #include "mir/frontend/shell.h" |
1035 | 24 | #include "mir/frontend/session.h" | 23 | #include "mir/frontend/session.h" |
1036 | 25 | #include "mir/frontend/surface.h" | 24 | #include "mir/frontend/surface.h" |
1037 | 26 | #include "mir/scene/surface_creation_parameters.h" | 25 | #include "mir/scene/surface_creation_parameters.h" |
1038 | 26 | #include "mir/scene/coordinate_translator.h" | ||
1039 | 27 | #include "mir/frontend/display_changer.h" | 27 | #include "mir/frontend/display_changer.h" |
1040 | 28 | #include "resource_cache.h" | 28 | #include "resource_cache.h" |
1041 | 29 | #include "mir_toolkit/common.h" | 29 | #include "mir_toolkit/common.h" |
1042 | @@ -73,7 +73,8 @@ | |||
1043 | 73 | std::shared_ptr<MessageResourceCache> const& resource_cache, | 73 | std::shared_ptr<MessageResourceCache> const& resource_cache, |
1044 | 74 | std::shared_ptr<Screencast> const& screencast, | 74 | std::shared_ptr<Screencast> const& screencast, |
1045 | 75 | ConnectionContext const& connection_context, | 75 | ConnectionContext const& connection_context, |
1047 | 76 | std::shared_ptr<mi::CursorImages> const& cursor_images) : | 76 | std::shared_ptr<mi::CursorImages> const& cursor_images, |
1048 | 77 | std::shared_ptr<scene::CoordinateTranslator> const& translator) : | ||
1049 | 77 | client_pid_(0), | 78 | client_pid_(0), |
1050 | 78 | shell(shell), | 79 | shell(shell), |
1051 | 79 | graphics_platform(graphics_platform), | 80 | graphics_platform(graphics_platform), |
1052 | @@ -86,6 +87,7 @@ | |||
1053 | 86 | screencast(screencast), | 87 | screencast(screencast), |
1054 | 87 | connection_context(connection_context), | 88 | connection_context(connection_context), |
1055 | 88 | cursor_images(cursor_images), | 89 | cursor_images(cursor_images), |
1056 | 90 | translator{translator}, | ||
1057 | 89 | surface_tracker{static_cast<size_t>(client_buffer_cache_size)} | 91 | surface_tracker{static_cast<size_t>(client_buffer_cache_size)} |
1058 | 90 | { | 92 | { |
1059 | 91 | } | 93 | } |
1060 | @@ -551,6 +553,32 @@ | |||
1061 | 551 | done->Run(); | 553 | done->Run(); |
1062 | 552 | } | 554 | } |
1063 | 553 | 555 | ||
1064 | 556 | void mir::frontend::SessionMediator::translate_surface_to_screen( | ||
1065 | 557 | ::google::protobuf::RpcController* , | ||
1066 | 558 | ::mir::protobuf::CoordinateTranslationRequest const* request, | ||
1067 | 559 | ::mir::protobuf::CoordinateTranslationResponse* response, | ||
1068 | 560 | ::google::protobuf::Closure *done) | ||
1069 | 561 | { | ||
1070 | 562 | { | ||
1071 | 563 | std::unique_lock<std::mutex> lock(session_mutex); | ||
1072 | 564 | |||
1073 | 565 | auto session = weak_session.lock(); | ||
1074 | 566 | |||
1075 | 567 | if (session.get() == nullptr) | ||
1076 | 568 | BOOST_THROW_EXCEPTION(std::logic_error("Invalid application session")); | ||
1077 | 569 | |||
1078 | 570 | auto const id = frontend::SurfaceId(request->surfaceid().value()); | ||
1079 | 571 | |||
1080 | 572 | auto const coords = translator->surface_to_screen(session->get_surface(id), | ||
1081 | 573 | request->x(), | ||
1082 | 574 | request->y()); | ||
1083 | 575 | |||
1084 | 576 | response->set_x(coords.x.as_uint32_t()); | ||
1085 | 577 | response->set_y(coords.y.as_uint32_t()); | ||
1086 | 578 | } | ||
1087 | 579 | done->Run(); | ||
1088 | 580 | } | ||
1089 | 581 | |||
1090 | 554 | void mf::SessionMediator::drm_auth_magic( | 582 | void mf::SessionMediator::drm_auth_magic( |
1091 | 555 | google::protobuf::RpcController* /*controller*/, | 583 | google::protobuf::RpcController* /*controller*/, |
1092 | 556 | const mir::protobuf::DRMMagic* request, | 584 | const mir::protobuf::DRMMagic* request, |
1093 | 557 | 585 | ||
1094 | === modified file 'src/server/frontend/session_mediator.h' | |||
1095 | --- src/server/frontend/session_mediator.h 2014-10-21 16:21:14 +0000 | |||
1096 | +++ src/server/frontend/session_mediator.h 2014-10-23 13:30:17 +0000 | |||
1097 | @@ -46,6 +46,11 @@ | |||
1098 | 46 | class CursorImages; | 46 | class CursorImages; |
1099 | 47 | } | 47 | } |
1100 | 48 | 48 | ||
1101 | 49 | namespace scene | ||
1102 | 50 | { | ||
1103 | 51 | class CoordinateTranslator; | ||
1104 | 52 | } | ||
1105 | 53 | |||
1106 | 49 | /// Frontend interface. Mediates the interaction between client | 54 | /// Frontend interface. Mediates the interaction between client |
1107 | 50 | /// processes and the core of the mir system. | 55 | /// processes and the core of the mir system. |
1108 | 51 | namespace frontend | 56 | namespace frontend |
1109 | @@ -62,7 +67,7 @@ | |||
1110 | 62 | class PromptSession; | 67 | class PromptSession; |
1111 | 63 | 68 | ||
1112 | 64 | // SessionMediator relays requests from the client process into the server. | 69 | // SessionMediator relays requests from the client process into the server. |
1114 | 65 | class SessionMediator : public detail::DisplayServer | 70 | class SessionMediator : public detail::DisplayServer, public mir::protobuf::Debug |
1115 | 66 | { | 71 | { |
1116 | 67 | public: | 72 | public: |
1117 | 68 | 73 | ||
1118 | @@ -76,7 +81,8 @@ | |||
1119 | 76 | std::shared_ptr<MessageResourceCache> const& resource_cache, | 81 | std::shared_ptr<MessageResourceCache> const& resource_cache, |
1120 | 77 | std::shared_ptr<Screencast> const& screencast, | 82 | std::shared_ptr<Screencast> const& screencast, |
1121 | 78 | ConnectionContext const& connection_context, | 83 | ConnectionContext const& connection_context, |
1123 | 79 | std::shared_ptr<input::CursorImages> const& cursor_images); | 84 | std::shared_ptr<input::CursorImages> const& cursor_images, |
1124 | 85 | std::shared_ptr<scene::CoordinateTranslator> const& translator); | ||
1125 | 80 | 86 | ||
1126 | 81 | ~SessionMediator() noexcept; | 87 | ~SessionMediator() noexcept; |
1127 | 82 | 88 | ||
1128 | @@ -167,6 +173,13 @@ | |||
1129 | 167 | ::mir::protobuf::SocketFD* response, | 173 | ::mir::protobuf::SocketFD* response, |
1130 | 168 | ::google::protobuf::Closure* done) override; | 174 | ::google::protobuf::Closure* done) override; |
1131 | 169 | 175 | ||
1132 | 176 | // TODO: Split this into a separate thing | ||
1133 | 177 | void translate_surface_to_screen( | ||
1134 | 178 | ::google::protobuf::RpcController* controller, | ||
1135 | 179 | ::mir::protobuf::CoordinateTranslationRequest const* request, | ||
1136 | 180 | ::mir::protobuf::CoordinateTranslationResponse* response, | ||
1137 | 181 | ::google::protobuf::Closure *done) override; | ||
1138 | 182 | |||
1139 | 170 | private: | 183 | private: |
1140 | 171 | void pack_protobuf_buffer(protobuf::Buffer& protobuf_buffer, | 184 | void pack_protobuf_buffer(protobuf::Buffer& protobuf_buffer, |
1141 | 172 | graphics::Buffer* graphics_buffer, | 185 | graphics::Buffer* graphics_buffer, |
1142 | @@ -193,6 +206,7 @@ | |||
1143 | 193 | std::shared_ptr<Screencast> const screencast; | 206 | std::shared_ptr<Screencast> const screencast; |
1144 | 194 | ConnectionContext const connection_context; | 207 | ConnectionContext const connection_context; |
1145 | 195 | std::shared_ptr<input::CursorImages> const cursor_images; | 208 | std::shared_ptr<input::CursorImages> const cursor_images; |
1146 | 209 | std::shared_ptr<scene::CoordinateTranslator> const translator; | ||
1147 | 196 | 210 | ||
1148 | 197 | SurfaceTracker surface_tracker; | 211 | SurfaceTracker surface_tracker; |
1149 | 198 | 212 | ||
1150 | 199 | 213 | ||
1151 | === added file 'src/server/frontend/unsupported_coordinate_translator.cpp' | |||
1152 | --- src/server/frontend/unsupported_coordinate_translator.cpp 1970-01-01 00:00:00 +0000 | |||
1153 | +++ src/server/frontend/unsupported_coordinate_translator.cpp 2014-10-23 13:30:17 +0000 | |||
1154 | @@ -0,0 +1,32 @@ | |||
1155 | 1 | /* | ||
1156 | 2 | * Copyright © 2014 Canonical Ltd. | ||
1157 | 3 | * | ||
1158 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
1159 | 5 | * under the terms of the GNU General Public License version 3, | ||
1160 | 6 | * as published by the Free Software Foundation. | ||
1161 | 7 | * | ||
1162 | 8 | * This program is distributed in the hope that it will be useful, | ||
1163 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1164 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1165 | 11 | * GNU General Public License for more details. | ||
1166 | 12 | * | ||
1167 | 13 | * You should have received a copy of the GNU General Public License | ||
1168 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1169 | 15 | * | ||
1170 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
1171 | 17 | */ | ||
1172 | 18 | |||
1173 | 19 | #include "unsupported_coordinate_translator.h" | ||
1174 | 20 | #include "mir/frontend/unsupported_feature_exception.h" | ||
1175 | 21 | |||
1176 | 22 | #include <boost/exception/all.hpp> | ||
1177 | 23 | |||
1178 | 24 | namespace mg = mir::geometry; | ||
1179 | 25 | namespace mf = mir::frontend; | ||
1180 | 26 | |||
1181 | 27 | mg::Point mf::UnsupportedCoordinateTranslator::surface_to_screen( | ||
1182 | 28 | std::shared_ptr<mf::Surface> /*surface*/, | ||
1183 | 29 | int32_t /*x*/, int32_t /*y*/) | ||
1184 | 30 | { | ||
1185 | 31 | BOOST_THROW_EXCEPTION(mir::frontend::unsupported_feature()); | ||
1186 | 32 | } | ||
1187 | 0 | 33 | ||
1188 | === added file 'src/server/frontend/unsupported_coordinate_translator.h' | |||
1189 | --- src/server/frontend/unsupported_coordinate_translator.h 1970-01-01 00:00:00 +0000 | |||
1190 | +++ src/server/frontend/unsupported_coordinate_translator.h 2014-10-23 13:30:17 +0000 | |||
1191 | @@ -0,0 +1,37 @@ | |||
1192 | 1 | /* | ||
1193 | 2 | * Copyright © 2014 Canonical Ltd. | ||
1194 | 3 | * | ||
1195 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
1196 | 5 | * under the terms of the GNU General Public License version 3, | ||
1197 | 6 | * as published by the Free Software Foundation. | ||
1198 | 7 | * | ||
1199 | 8 | * This program is distributed in the hope that it will be useful, | ||
1200 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1201 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1202 | 11 | * GNU General Public License for more details. | ||
1203 | 12 | * | ||
1204 | 13 | * You should have received a copy of the GNU General Public License | ||
1205 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1206 | 15 | * | ||
1207 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
1208 | 17 | */ | ||
1209 | 18 | |||
1210 | 19 | #ifndef MIR_FRONTEND_UNSUPPORTED_COORDINATE_TRANSLATOR_H_ | ||
1211 | 20 | #define MIR_FRONTEND_UNSUPPORTED_COORDINATE_TRANSLATOR_H_ | ||
1212 | 21 | |||
1213 | 22 | #include "mir/scene/coordinate_translator.h" | ||
1214 | 23 | |||
1215 | 24 | namespace mir | ||
1216 | 25 | { | ||
1217 | 26 | namespace frontend | ||
1218 | 27 | { | ||
1219 | 28 | class UnsupportedCoordinateTranslator : public scene::CoordinateTranslator | ||
1220 | 29 | { | ||
1221 | 30 | geometry::Point surface_to_screen(std::shared_ptr<Surface> surface, | ||
1222 | 31 | int32_t x, int32_t y) override; | ||
1223 | 32 | }; | ||
1224 | 33 | |||
1225 | 34 | } | ||
1226 | 35 | } | ||
1227 | 36 | |||
1228 | 37 | #endif // MIR_FRONTEND_UNSUPPORTED_COORDINATE_TRANSLATOR_H_ | ||
1229 | 0 | 38 | ||
1230 | === modified file 'src/server/scene/CMakeLists.txt' | |||
1231 | --- src/server/scene/CMakeLists.txt 2014-10-01 06:25:56 +0000 | |||
1232 | +++ src/server/scene/CMakeLists.txt 2014-10-23 13:30:17 +0000 | |||
1233 | @@ -23,4 +23,5 @@ | |||
1234 | 23 | prompt_session_container.cpp | 23 | prompt_session_container.cpp |
1235 | 24 | prompt_session_manager_impl.cpp | 24 | prompt_session_manager_impl.cpp |
1236 | 25 | rendering_tracker.cpp | 25 | rendering_tracker.cpp |
1237 | 26 | default_coordinate_translator.cpp | ||
1238 | 26 | ) | 27 | ) |
1239 | 27 | 28 | ||
1240 | === modified file 'src/server/scene/default_configuration.cpp' | |||
1241 | --- src/server/scene/default_configuration.cpp 2014-10-01 06:25:56 +0000 | |||
1242 | +++ src/server/scene/default_configuration.cpp 2014-10-23 13:30:17 +0000 | |||
1243 | @@ -36,6 +36,7 @@ | |||
1244 | 36 | #include "surface_stack.h" | 36 | #include "surface_stack.h" |
1245 | 37 | #include "threaded_snapshot_strategy.h" | 37 | #include "threaded_snapshot_strategy.h" |
1246 | 38 | #include "prompt_session_manager_impl.h" | 38 | #include "prompt_session_manager_impl.h" |
1247 | 39 | #include "default_coordinate_translator.h" | ||
1248 | 39 | 40 | ||
1249 | 40 | namespace mc = mir::compositor; | 41 | namespace mc = mir::compositor; |
1250 | 41 | namespace mf = mir::frontend; | 42 | namespace mf = mir::frontend; |
1251 | @@ -238,3 +239,13 @@ | |||
1252 | 238 | the_prompt_session_listener()); | 239 | the_prompt_session_listener()); |
1253 | 239 | }); | 240 | }); |
1254 | 240 | } | 241 | } |
1255 | 242 | |||
1256 | 243 | std::shared_ptr<ms::CoordinateTranslator> | ||
1257 | 244 | mir::DefaultServerConfiguration::the_coordinate_translator() | ||
1258 | 245 | { | ||
1259 | 246 | return coordinate_translator( | ||
1260 | 247 | [this]() | ||
1261 | 248 | { | ||
1262 | 249 | return std::make_shared<ms::DefaultCoordinateTranslator>(); | ||
1263 | 250 | }); | ||
1264 | 251 | } | ||
1265 | 241 | 252 | ||
1266 | === added file 'src/server/scene/default_coordinate_translator.cpp' | |||
1267 | --- src/server/scene/default_coordinate_translator.cpp 1970-01-01 00:00:00 +0000 | |||
1268 | +++ src/server/scene/default_coordinate_translator.cpp 2014-10-23 13:30:17 +0000 | |||
1269 | @@ -0,0 +1,32 @@ | |||
1270 | 1 | /* | ||
1271 | 2 | * Copyright © 2014 Canonical Ltd. | ||
1272 | 3 | * | ||
1273 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
1274 | 5 | * under the terms of the GNU General Public License version 3, | ||
1275 | 6 | * as published by the Free Software Foundation. | ||
1276 | 7 | * | ||
1277 | 8 | * This program is distributed in the hope that it will be useful, | ||
1278 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1279 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1280 | 11 | * GNU General Public License for more details. | ||
1281 | 12 | * | ||
1282 | 13 | * You should have received a copy of the GNU General Public License | ||
1283 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1284 | 15 | * | ||
1285 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
1286 | 17 | */ | ||
1287 | 18 | |||
1288 | 19 | #include "default_coordinate_translator.h" | ||
1289 | 20 | #include "basic_surface.h" | ||
1290 | 21 | |||
1291 | 22 | namespace geom = mir::geometry; | ||
1292 | 23 | namespace mf = mir::frontend; | ||
1293 | 24 | namespace ms = mir::scene; | ||
1294 | 25 | |||
1295 | 26 | geom::Point ms::DefaultCoordinateTranslator::surface_to_screen(std::shared_ptr<mf::Surface> surface, int32_t x, | ||
1296 | 27 | int32_t y) | ||
1297 | 28 | { | ||
1298 | 29 | auto const scene_surface = std::dynamic_pointer_cast<ms::BasicSurface>(surface); | ||
1299 | 30 | |||
1300 | 31 | return geom::Point{x + scene_surface->top_left().x.as_int(), y + scene_surface->top_left().y.as_int()}; | ||
1301 | 32 | } | ||
1302 | 0 | 33 | ||
1303 | === added file 'src/server/scene/default_coordinate_translator.h' | |||
1304 | --- src/server/scene/default_coordinate_translator.h 1970-01-01 00:00:00 +0000 | |||
1305 | +++ src/server/scene/default_coordinate_translator.h 2014-10-23 13:30:17 +0000 | |||
1306 | @@ -0,0 +1,37 @@ | |||
1307 | 1 | /* | ||
1308 | 2 | * Copyright © 2014 Canonical Ltd. | ||
1309 | 3 | * | ||
1310 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
1311 | 5 | * under the terms of the GNU General Public License version 3, | ||
1312 | 6 | * as published by the Free Software Foundation. | ||
1313 | 7 | * | ||
1314 | 8 | * This program is distributed in the hope that it will be useful, | ||
1315 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1316 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1317 | 11 | * GNU General Public License for more details. | ||
1318 | 12 | * | ||
1319 | 13 | * You should have received a copy of the GNU General Public License | ||
1320 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1321 | 15 | * | ||
1322 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
1323 | 17 | */ | ||
1324 | 18 | |||
1325 | 19 | #ifndef MIR_FRONTEND_DEFAULT_COORDINATE_TRANSLATOR_H_ | ||
1326 | 20 | #define MIR_FRONTEND_DEFAULT_COORDINATE_TRANSLATOR_H_ | ||
1327 | 21 | |||
1328 | 22 | #include "mir/scene/coordinate_translator.h" | ||
1329 | 23 | |||
1330 | 24 | namespace mir | ||
1331 | 25 | { | ||
1332 | 26 | namespace scene | ||
1333 | 27 | { | ||
1334 | 28 | class DefaultCoordinateTranslator : public CoordinateTranslator | ||
1335 | 29 | { | ||
1336 | 30 | public: | ||
1337 | 31 | geometry::Point surface_to_screen(std::shared_ptr<frontend::Surface> surface, int32_t x, int32_t y); | ||
1338 | 32 | }; | ||
1339 | 33 | |||
1340 | 34 | } | ||
1341 | 35 | } | ||
1342 | 36 | |||
1343 | 37 | #endif // MIR_FRONTEND_DEFAULT_COORDINATE_TRANSLATOR_H_ | ||
1344 | 0 | 38 | ||
1345 | === modified file 'src/server/symbols.map' | |||
1346 | --- src/server/symbols.map 2014-10-22 18:55:40 +0000 | |||
1347 | +++ src/server/symbols.map 2014-10-23 13:30:17 +0000 | |||
1348 | @@ -39,6 +39,7 @@ | |||
1349 | 39 | mir::DefaultServerConfiguration::the_connection_creator*; | 39 | mir::DefaultServerConfiguration::the_connection_creator*; |
1350 | 40 | mir::DefaultServerConfiguration::the_connector*; | 40 | mir::DefaultServerConfiguration::the_connector*; |
1351 | 41 | mir::DefaultServerConfiguration::the_connector_report*; | 41 | mir::DefaultServerConfiguration::the_connector_report*; |
1352 | 42 | mir::DefaultServerConfiguration::the_coordinate_translator*; | ||
1353 | 42 | mir::DefaultServerConfiguration::the_cursor*; | 43 | mir::DefaultServerConfiguration::the_cursor*; |
1354 | 43 | mir::DefaultServerConfiguration::the_cursor_images*; | 44 | mir::DefaultServerConfiguration::the_cursor_images*; |
1355 | 44 | mir::DefaultServerConfiguration::the_cursor_listener*; | 45 | mir::DefaultServerConfiguration::the_cursor_listener*; |
1356 | @@ -244,6 +245,9 @@ | |||
1357 | 244 | mir::report_exception*; | 245 | mir::report_exception*; |
1358 | 245 | mir::run_mir*; | 246 | mir::run_mir*; |
1359 | 246 | mir::scene::a_surface*; | 247 | mir::scene::a_surface*; |
1360 | 248 | mir::scene::CoordinateTranslator::?CoordinateTranslator*; | ||
1361 | 249 | mir::scene::CoordinateTranslator::CoordinateTranslator*; | ||
1362 | 250 | mir::scene::CoordinateTranslator::surface_to_screen*; | ||
1363 | 247 | mir::scene::NullSurfaceObserver::alpha_set_to*; | 251 | mir::scene::NullSurfaceObserver::alpha_set_to*; |
1364 | 248 | mir::scene::NullSurfaceObserver::attrib_changed*; | 252 | mir::scene::NullSurfaceObserver::attrib_changed*; |
1365 | 249 | mir::scene::NullSurfaceObserver::cursor_image_set_to*; | 253 | mir::scene::NullSurfaceObserver::cursor_image_set_to*; |
1366 | @@ -648,6 +652,7 @@ | |||
1367 | 648 | typeinfo?for?mir::input::TouchVisualizer; | 652 | typeinfo?for?mir::input::TouchVisualizer; |
1368 | 649 | typeinfo?for?mir::input::TouchVisualizer::Spot; | 653 | typeinfo?for?mir::input::TouchVisualizer::Spot; |
1369 | 650 | typeinfo?for?mir::MainLoop; | 654 | typeinfo?for?mir::MainLoop; |
1370 | 655 | typeinfo?for?mir::scene::CoordinateTranslator; | ||
1371 | 651 | typeinfo?for?mir::scene::NullSurfaceObserver; | 656 | typeinfo?for?mir::scene::NullSurfaceObserver; |
1372 | 652 | typeinfo?for?mir::scene::Observer; | 657 | typeinfo?for?mir::scene::Observer; |
1373 | 653 | typeinfo?for?mir::scene::PlacementStrategy; | 658 | typeinfo?for?mir::scene::PlacementStrategy; |
1374 | @@ -706,6 +711,7 @@ | |||
1375 | 706 | vtable?for?mir::input::TouchVisualizer; | 711 | vtable?for?mir::input::TouchVisualizer; |
1376 | 707 | vtable?for?mir::input::TouchVisualizer::Spot; | 712 | vtable?for?mir::input::TouchVisualizer::Spot; |
1377 | 708 | vtable?for?mir::MainLoop; | 713 | vtable?for?mir::MainLoop; |
1378 | 714 | vtable?for?mir::scene::CoordinateTranslator; | ||
1379 | 709 | vtable?for?mir::scene::NullSurfaceObserver; | 715 | vtable?for?mir::scene::NullSurfaceObserver; |
1380 | 710 | vtable?for?mir::scene::Observer; | 716 | vtable?for?mir::scene::Observer; |
1381 | 711 | vtable?for?mir::scene::PlacementStrategy; | 717 | vtable?for?mir::scene::PlacementStrategy; |
1382 | 712 | 718 | ||
1383 | === modified file 'tests/acceptance-tests/CMakeLists.txt' | |||
1384 | --- tests/acceptance-tests/CMakeLists.txt 2014-10-21 16:21:14 +0000 | |||
1385 | +++ tests/acceptance-tests/CMakeLists.txt 2014-10-23 13:30:17 +0000 | |||
1386 | @@ -42,6 +42,7 @@ | |||
1387 | 42 | test_server_without_active_outputs.cpp | 42 | test_server_without_active_outputs.cpp |
1388 | 43 | test_client_input.cpp | 43 | test_client_input.cpp |
1389 | 44 | test_server_startup.cpp | 44 | test_server_startup.cpp |
1390 | 45 | test_debug_api.cpp | ||
1391 | 45 | test_unresponsive_client.cpp | 46 | test_unresponsive_client.cpp |
1392 | 46 | ) | 47 | ) |
1393 | 47 | 48 | ||
1394 | @@ -67,6 +68,7 @@ | |||
1395 | 67 | 68 | ||
1396 | 68 | mirserver | 69 | mirserver |
1397 | 69 | mirclient | 70 | mirclient |
1398 | 71 | mirclient-debug-extension | ||
1399 | 70 | mirplatform | 72 | mirplatform |
1400 | 71 | 73 | ||
1401 | 72 | mir-test | 74 | mir-test |
1402 | 73 | 75 | ||
1403 | === modified file 'tests/acceptance-tests/test_client_library.cpp' | |||
1404 | --- tests/acceptance-tests/test_client_library.cpp 2014-10-21 16:21:14 +0000 | |||
1405 | +++ tests/acceptance-tests/test_client_library.cpp 2014-10-23 13:30:17 +0000 | |||
1406 | @@ -17,7 +17,6 @@ | |||
1407 | 17 | */ | 17 | */ |
1408 | 18 | 18 | ||
1409 | 19 | #include "mir_toolkit/mir_client_library.h" | 19 | #include "mir_toolkit/mir_client_library.h" |
1410 | 20 | #include "mir_toolkit/mir_client_library_debug.h" | ||
1411 | 21 | 20 | ||
1412 | 22 | #include "mir_test_framework/stubbed_server_configuration.h" | 21 | #include "mir_test_framework/stubbed_server_configuration.h" |
1413 | 23 | #include "mir_test_framework/in_process_server.h" | 22 | #include "mir_test_framework/in_process_server.h" |
1414 | 24 | 23 | ||
1415 | === modified file 'tests/acceptance-tests/test_client_surface_events.cpp' | |||
1416 | --- tests/acceptance-tests/test_client_surface_events.cpp 2014-10-01 06:25:56 +0000 | |||
1417 | +++ tests/acceptance-tests/test_client_surface_events.cpp 2014-10-23 13:30:17 +0000 | |||
1418 | @@ -17,7 +17,7 @@ | |||
1419 | 17 | */ | 17 | */ |
1420 | 18 | 18 | ||
1421 | 19 | #include "mir_toolkit/mir_client_library.h" | 19 | #include "mir_toolkit/mir_client_library.h" |
1423 | 20 | #include "mir_toolkit/mir_client_library_debug.h" | 20 | #include "mir_toolkit/debug/surface.h" |
1424 | 21 | 21 | ||
1425 | 22 | #include "mir/shell/surface_coordinator_wrapper.h" | 22 | #include "mir/shell/surface_coordinator_wrapper.h" |
1426 | 23 | 23 | ||
1427 | 24 | 24 | ||
1428 | === modified file 'tests/acceptance-tests/test_client_surfaces.cpp' | |||
1429 | --- tests/acceptance-tests/test_client_surfaces.cpp 2014-10-01 06:25:56 +0000 | |||
1430 | +++ tests/acceptance-tests/test_client_surfaces.cpp 2014-10-23 13:30:17 +0000 | |||
1431 | @@ -17,7 +17,7 @@ | |||
1432 | 17 | */ | 17 | */ |
1433 | 18 | 18 | ||
1434 | 19 | #include "mir_toolkit/mir_client_library.h" | 19 | #include "mir_toolkit/mir_client_library.h" |
1436 | 20 | #include "mir_toolkit/mir_client_library_debug.h" | 20 | #include "mir_toolkit/debug/surface.h" |
1437 | 21 | 21 | ||
1438 | 22 | #include "mir_test_framework/stubbed_server_configuration.h" | 22 | #include "mir_test_framework/stubbed_server_configuration.h" |
1439 | 23 | #include "mir_test_framework/basic_client_server_fixture.h" | 23 | #include "mir_test_framework/basic_client_server_fixture.h" |
1440 | 24 | 24 | ||
1441 | === modified file 'tests/acceptance-tests/test_custom_input_dispatcher.cpp' | |||
1442 | --- tests/acceptance-tests/test_custom_input_dispatcher.cpp 2014-10-01 06:25:56 +0000 | |||
1443 | +++ tests/acceptance-tests/test_custom_input_dispatcher.cpp 2014-10-23 13:30:17 +0000 | |||
1444 | @@ -133,7 +133,7 @@ | |||
1445 | 133 | // may be stopped before events have been dispatched. | 133 | // may be stopped before events have been dispatched. |
1446 | 134 | run_in_test_process([&] | 134 | run_in_test_process([&] |
1447 | 135 | { | 135 | { |
1449 | 136 | server_config.dispatching_done.wait_for_signal_ready_for(std::chrono::seconds{5}); | 136 | server_config.dispatching_done.wait_for_signal_ready_for(std::chrono::seconds{50}); |
1450 | 137 | }); | 137 | }); |
1451 | 138 | } | 138 | } |
1452 | 139 | 139 | ||
1453 | @@ -179,6 +179,6 @@ | |||
1454 | 179 | launch_client_process(client); | 179 | launch_client_process(client); |
1455 | 180 | run_in_test_process([&] | 180 | run_in_test_process([&] |
1456 | 181 | { | 181 | { |
1458 | 182 | server_config.dispatching_done.wait_for_signal_ready_for(std::chrono::seconds{5}); | 182 | server_config.dispatching_done.wait_for_signal_ready_for(std::chrono::seconds{50}); |
1459 | 183 | }); | 183 | }); |
1460 | 184 | } | 184 | } |
1461 | 185 | 185 | ||
1462 | === added file 'tests/acceptance-tests/test_debug_api.cpp' | |||
1463 | --- tests/acceptance-tests/test_debug_api.cpp 1970-01-01 00:00:00 +0000 | |||
1464 | +++ tests/acceptance-tests/test_debug_api.cpp 2014-10-23 13:30:17 +0000 | |||
1465 | @@ -0,0 +1,231 @@ | |||
1466 | 1 | /* | ||
1467 | 2 | * Copyright © 2014 Canonical Ltd. | ||
1468 | 3 | * | ||
1469 | 4 | * This program is free software: you can redistribute it and/or modify | ||
1470 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
1471 | 6 | * published by the Free Software Foundation. | ||
1472 | 7 | * | ||
1473 | 8 | * This program is distributed in the hope that it will be useful, | ||
1474 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1475 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1476 | 11 | * GNU General Public License for more details. | ||
1477 | 12 | * | ||
1478 | 13 | * You should have received a copy of the GNU General Public License | ||
1479 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1480 | 15 | * | ||
1481 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
1482 | 17 | */ | ||
1483 | 18 | |||
1484 | 19 | #include "mir/options/option.h" | ||
1485 | 20 | #include "mir/scene/surface_creation_parameters.h" | ||
1486 | 21 | #include "mir/scene/placement_strategy.h" | ||
1487 | 22 | #include "mir/scene/surface.h" | ||
1488 | 23 | #include "src/server/scene/session_container.h" | ||
1489 | 24 | #include "mir/shell/surface_coordinator_wrapper.h" | ||
1490 | 25 | |||
1491 | 26 | #include "mir_test/wait_condition.h" | ||
1492 | 27 | #include "mir_test/client_event_matchers.h" | ||
1493 | 28 | #include "mir_test/barrier.h" | ||
1494 | 29 | #include "mir_test_framework/deferred_in_process_server.h" | ||
1495 | 30 | #include "mir_test_framework/stubbed_server_configuration.h" | ||
1496 | 31 | |||
1497 | 32 | #include "mir_toolkit/mir_client_library.h" | ||
1498 | 33 | #include "mir_toolkit/debug/surface.h" | ||
1499 | 34 | |||
1500 | 35 | #include <gtest/gtest.h> | ||
1501 | 36 | #include <gmock/gmock.h> | ||
1502 | 37 | |||
1503 | 38 | namespace ms = mir::scene; | ||
1504 | 39 | |||
1505 | 40 | namespace mtf = mir_test_framework; | ||
1506 | 41 | |||
1507 | 42 | namespace | ||
1508 | 43 | { | ||
1509 | 44 | class SimpleConfigurablePlacementStrategy : public ms::PlacementStrategy | ||
1510 | 45 | { | ||
1511 | 46 | public: | ||
1512 | 47 | ms::SurfaceCreationParameters place(ms::Session const& /*session*/, | ||
1513 | 48 | ms::SurfaceCreationParameters const& request_parameters) override | ||
1514 | 49 | { | ||
1515 | 50 | auto placed = request_parameters; | ||
1516 | 51 | placed.top_left = placement.top_left; | ||
1517 | 52 | placed.size = placement.size; | ||
1518 | 53 | return placed; | ||
1519 | 54 | } | ||
1520 | 55 | |||
1521 | 56 | mir::geometry::Rectangle placement; | ||
1522 | 57 | }; | ||
1523 | 58 | |||
1524 | 59 | class SurfacePlacingConfiguration : public mtf::StubbedServerConfiguration | ||
1525 | 60 | { | ||
1526 | 61 | public: | ||
1527 | 62 | SurfacePlacingConfiguration() | ||
1528 | 63 | : placement_strategy{std::make_shared<SimpleConfigurablePlacementStrategy>()} | ||
1529 | 64 | { | ||
1530 | 65 | } | ||
1531 | 66 | |||
1532 | 67 | std::shared_ptr<ms::PlacementStrategy> the_placement_strategy() override | ||
1533 | 68 | { | ||
1534 | 69 | return placement_strategy; | ||
1535 | 70 | } | ||
1536 | 71 | |||
1537 | 72 | void set_surface_placement(mir::geometry::Rectangle const& where) | ||
1538 | 73 | { | ||
1539 | 74 | placement_strategy->placement = where; | ||
1540 | 75 | } | ||
1541 | 76 | |||
1542 | 77 | bool is_debug_server() | ||
1543 | 78 | { | ||
1544 | 79 | return the_options()->is_set("debug"); | ||
1545 | 80 | } | ||
1546 | 81 | |||
1547 | 82 | private: | ||
1548 | 83 | std::shared_ptr<SimpleConfigurablePlacementStrategy> placement_strategy; | ||
1549 | 84 | }; | ||
1550 | 85 | |||
1551 | 86 | char const* debugenv = "MIR_SERVER_DEBUG"; | ||
1552 | 87 | |||
1553 | 88 | void dont_kill_me_bro(MirConnection* /*unused*/, MirLifecycleState /*unused*/, void* /*unused*/) | ||
1554 | 89 | { | ||
1555 | 90 | } | ||
1556 | 91 | |||
1557 | 92 | class TestDebugAPI : public mtf::DeferredInProcessServer | ||
1558 | 93 | { | ||
1559 | 94 | public: | ||
1560 | 95 | TestDebugAPI() | ||
1561 | 96 | : old_debug_env{::getenv(debugenv)} | ||
1562 | 97 | { | ||
1563 | 98 | mir::geometry::Rectangle surface_location; | ||
1564 | 99 | surface_location.top_left.x = mir::geometry::X{0}; | ||
1565 | 100 | surface_location.top_left.y = mir::geometry::Y{0}; | ||
1566 | 101 | surface_location.size.width = mir::geometry::Width{100}; | ||
1567 | 102 | surface_location.size.height = mir::geometry::Height{100}; | ||
1568 | 103 | |||
1569 | 104 | server_configuration.set_surface_placement(surface_location); | ||
1570 | 105 | } | ||
1571 | 106 | |||
1572 | 107 | ~TestDebugAPI() | ||
1573 | 108 | { | ||
1574 | 109 | ::unsetenv(debugenv); | ||
1575 | 110 | if (old_debug_env) | ||
1576 | 111 | { | ||
1577 | 112 | ::setenv(debugenv, old_debug_env, 1); | ||
1578 | 113 | } | ||
1579 | 114 | } | ||
1580 | 115 | |||
1581 | 116 | void start_server_with_debug(bool debug) | ||
1582 | 117 | { | ||
1583 | 118 | if (debug) | ||
1584 | 119 | { | ||
1585 | 120 | ::setenv(debugenv, "", 1); | ||
1586 | 121 | } | ||
1587 | 122 | else | ||
1588 | 123 | { | ||
1589 | 124 | ::unsetenv(debugenv); | ||
1590 | 125 | } | ||
1591 | 126 | |||
1592 | 127 | if (server_configuration.is_debug_server() != debug) | ||
1593 | 128 | { | ||
1594 | 129 | throw std::runtime_error{"Failed to set the debug flag correctly. Have you overriden this with --debug?"}; | ||
1595 | 130 | } | ||
1596 | 131 | |||
1597 | 132 | start_server(); | ||
1598 | 133 | connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__); | ||
1599 | 134 | if (!mir_connection_is_valid(connection)) | ||
1600 | 135 | { | ||
1601 | 136 | throw std::runtime_error{std::string{"Failed to connect to test server:"} + | ||
1602 | 137 | mir_connection_get_error_message(connection)}; | ||
1603 | 138 | } | ||
1604 | 139 | mir_connection_set_lifecycle_event_callback(connection, dont_kill_me_bro, nullptr); | ||
1605 | 140 | } | ||
1606 | 141 | |||
1607 | 142 | void TearDown() override | ||
1608 | 143 | { | ||
1609 | 144 | if (connection) | ||
1610 | 145 | { | ||
1611 | 146 | mir_connection_release(connection); | ||
1612 | 147 | } | ||
1613 | 148 | DeferredInProcessServer::TearDown(); | ||
1614 | 149 | } | ||
1615 | 150 | |||
1616 | 151 | mir::DefaultServerConfiguration& server_config() override | ||
1617 | 152 | { | ||
1618 | 153 | return server_configuration; | ||
1619 | 154 | } | ||
1620 | 155 | |||
1621 | 156 | SurfacePlacingConfiguration server_configuration; | ||
1622 | 157 | MirConnection* connection{nullptr}; | ||
1623 | 158 | |||
1624 | 159 | private: | ||
1625 | 160 | char const* old_debug_env; | ||
1626 | 161 | }; | ||
1627 | 162 | } | ||
1628 | 163 | |||
1629 | 164 | TEST_F(TestDebugAPI, TranslatesSurfaceCoordinatesToScreenCoordinates) | ||
1630 | 165 | { | ||
1631 | 166 | start_server_with_debug(true); | ||
1632 | 167 | |||
1633 | 168 | mir::geometry::Rectangle surface_location; | ||
1634 | 169 | surface_location.top_left.x = mir::geometry::X{200}; | ||
1635 | 170 | surface_location.top_left.y = mir::geometry::Y{100}; | ||
1636 | 171 | surface_location.size.width = mir::geometry::Width{800}; | ||
1637 | 172 | surface_location.size.height = mir::geometry::Height{600}; | ||
1638 | 173 | |||
1639 | 174 | server_configuration.set_surface_placement(surface_location); | ||
1640 | 175 | |||
1641 | 176 | ASSERT_TRUE(mir_connection_is_valid(connection)); | ||
1642 | 177 | |||
1643 | 178 | MirSurfaceParameters const creation_parameters = { | ||
1644 | 179 | __PRETTY_FUNCTION__, | ||
1645 | 180 | 800, 600, | ||
1646 | 181 | mir_pixel_format_argb_8888, | ||
1647 | 182 | mir_buffer_usage_hardware, | ||
1648 | 183 | mir_display_output_id_invalid | ||
1649 | 184 | }; | ||
1650 | 185 | auto surf = mir_connection_create_surface_sync(connection, &creation_parameters); | ||
1651 | 186 | ASSERT_TRUE(mir_surface_is_valid(surf)); | ||
1652 | 187 | |||
1653 | 188 | int screen_x, screen_y, x, y; | ||
1654 | 189 | x = 35, y = 21; | ||
1655 | 190 | |||
1656 | 191 | ASSERT_TRUE(mir_debug_surface_coords_to_screen(surf, x, y, &screen_x, &screen_y)); | ||
1657 | 192 | EXPECT_EQ(x + surface_location.top_left.x.as_int(), screen_x); | ||
1658 | 193 | EXPECT_EQ(y + surface_location.top_left.y.as_int(), screen_y); | ||
1659 | 194 | |||
1660 | 195 | mir_surface_release_sync(surf); | ||
1661 | 196 | |||
1662 | 197 | surface_location.top_left.x = mir::geometry::X{100}; | ||
1663 | 198 | surface_location.top_left.y = mir::geometry::Y{250}; | ||
1664 | 199 | |||
1665 | 200 | server_configuration.set_surface_placement(surface_location); | ||
1666 | 201 | |||
1667 | 202 | surf = mir_connection_create_surface_sync(connection, &creation_parameters); | ||
1668 | 203 | ASSERT_TRUE(mir_surface_is_valid(surf)); | ||
1669 | 204 | |||
1670 | 205 | ASSERT_TRUE(mir_debug_surface_coords_to_screen(surf, x, y, &screen_x, &screen_y)); | ||
1671 | 206 | EXPECT_EQ(x + surface_location.top_left.x.as_int(), screen_x); | ||
1672 | 207 | EXPECT_EQ(y + surface_location.top_left.y.as_int(), screen_y); | ||
1673 | 208 | |||
1674 | 209 | mir_surface_release_sync(surf); | ||
1675 | 210 | } | ||
1676 | 211 | |||
1677 | 212 | TEST_F(TestDebugAPI, ApiIsUnavaliableWhenServerNotStartedWithDebug) | ||
1678 | 213 | { | ||
1679 | 214 | start_server_with_debug(false); | ||
1680 | 215 | |||
1681 | 216 | MirSurfaceParameters const creation_parameters = { | ||
1682 | 217 | __PRETTY_FUNCTION__, | ||
1683 | 218 | 800, 600, | ||
1684 | 219 | mir_pixel_format_argb_8888, | ||
1685 | 220 | mir_buffer_usage_hardware, | ||
1686 | 221 | mir_display_output_id_invalid | ||
1687 | 222 | }; | ||
1688 | 223 | auto surf = mir_connection_create_surface_sync(connection, &creation_parameters); | ||
1689 | 224 | ASSERT_TRUE(mir_surface_is_valid(surf)); | ||
1690 | 225 | |||
1691 | 226 | int screen_x, screen_y; | ||
1692 | 227 | |||
1693 | 228 | EXPECT_FALSE(mir_debug_surface_coords_to_screen(surf, 0, 0, &screen_x, &screen_y)); | ||
1694 | 229 | |||
1695 | 230 | mir_surface_release_sync(surf); | ||
1696 | 231 | } | ||
1697 | 0 | 232 | ||
1698 | === added file 'tests/include/mir_test_doubles/mock_coordinate_translator.h' | |||
1699 | --- tests/include/mir_test_doubles/mock_coordinate_translator.h 1970-01-01 00:00:00 +0000 | |||
1700 | +++ tests/include/mir_test_doubles/mock_coordinate_translator.h 2014-10-23 13:30:17 +0000 | |||
1701 | @@ -0,0 +1,42 @@ | |||
1702 | 1 | /* | ||
1703 | 2 | * Copyright © 2014 Canonical Ltd. | ||
1704 | 3 | * | ||
1705 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
1706 | 5 | * under the terms of the GNU General Public License version 3, | ||
1707 | 6 | * as published by the Free Software Foundation. | ||
1708 | 7 | * | ||
1709 | 8 | * This program is distributed in the hope that it will be useful, | ||
1710 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1711 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1712 | 11 | * GNU General Public License for more details. | ||
1713 | 12 | * | ||
1714 | 13 | * You should have received a copy of the GNU General Public License | ||
1715 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1716 | 15 | * | ||
1717 | 16 | * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | ||
1718 | 17 | */ | ||
1719 | 18 | |||
1720 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_COORDINATE_TRANSLATOR_H_ | ||
1721 | 20 | #define MIR_TEST_DOUBLES_MOCK_COORDINATE_TRANSLATOR_H_ | ||
1722 | 21 | |||
1723 | 22 | #include "src/server/frontend/coordinate_translator.h" | ||
1724 | 23 | |||
1725 | 24 | #include <gmock/gmock.h> | ||
1726 | 25 | |||
1727 | 26 | namespace mir | ||
1728 | 27 | { | ||
1729 | 28 | namespace test | ||
1730 | 29 | { | ||
1731 | 30 | namespace doubles | ||
1732 | 31 | { | ||
1733 | 32 | class MockCoordinateTranslator : public mir::frontend::CoordinateTranslator | ||
1734 | 33 | { | ||
1735 | 34 | MOCK_METHOD3(surface_to_screen, geometry::Point(std::shared_ptr<frontend::Surface>, uint32_t, uint32_t)); | ||
1736 | 35 | }; | ||
1737 | 36 | |||
1738 | 37 | using StubCoordinateTranslator = testing::NiceMock<MockCoordinateTranslator>; | ||
1739 | 38 | } | ||
1740 | 39 | } | ||
1741 | 40 | } | ||
1742 | 41 | |||
1743 | 42 | #endif /* MIR_TEST_DOUBLES_MOCK_COORDINATE_TRANSLATOR_H_ */ | ||
1744 | 0 | 43 | ||
1745 | === modified file 'tests/include/mir_test_doubles/mock_surface.h' | |||
1746 | --- tests/include/mir_test_doubles/mock_surface.h 2014-10-01 06:25:56 +0000 | |||
1747 | +++ tests/include/mir_test_doubles/mock_surface.h 2014-10-23 13:30:17 +0000 | |||
1748 | @@ -21,6 +21,7 @@ | |||
1749 | 21 | 21 | ||
1750 | 22 | #include "src/server/scene/basic_surface.h" | 22 | #include "src/server/scene/basic_surface.h" |
1751 | 23 | #include "src/server/report/null_report_factory.h" | 23 | #include "src/server/report/null_report_factory.h" |
1752 | 24 | #include "mock_buffer_stream.h" | ||
1753 | 24 | 25 | ||
1754 | 25 | #include <gmock/gmock.h> | 26 | #include <gmock/gmock.h> |
1755 | 26 | 27 | ||
1756 | @@ -38,7 +39,7 @@ | |||
1757 | 38 | {}, | 39 | {}, |
1758 | 39 | {{},{}}, | 40 | {{},{}}, |
1759 | 40 | true, | 41 | true, |
1761 | 41 | {}, | 42 | std::make_shared<testing::NiceMock<MockBufferStream>>(), |
1762 | 42 | {}, | 43 | {}, |
1763 | 43 | {}, | 44 | {}, |
1764 | 44 | {}, | 45 | {}, |
1765 | 45 | 46 | ||
1766 | === modified file 'tests/integration-tests/CMakeLists.txt' | |||
1767 | --- tests/integration-tests/CMakeLists.txt 2014-10-21 16:21:14 +0000 | |||
1768 | +++ tests/integration-tests/CMakeLists.txt 2014-10-23 13:30:17 +0000 | |||
1769 | @@ -82,6 +82,7 @@ | |||
1770 | 82 | mir-test | 82 | mir-test |
1771 | 83 | mir-test-framework | 83 | mir-test-framework |
1772 | 84 | mir-test-doubles | 84 | mir-test-doubles |
1773 | 85 | mirclient-debug-extension | ||
1774 | 85 | 86 | ||
1775 | 86 | mirdraw | 87 | mirdraw |
1776 | 87 | mirtestdraw | 88 | mirtestdraw |
1777 | 88 | 89 | ||
1778 | === modified file 'tests/integration-tests/test_stale_frames.cpp' | |||
1779 | --- tests/integration-tests/test_stale_frames.cpp 2014-10-21 16:21:14 +0000 | |||
1780 | +++ tests/integration-tests/test_stale_frames.cpp 2014-10-23 13:30:17 +0000 | |||
1781 | @@ -17,7 +17,7 @@ | |||
1782 | 17 | */ | 17 | */ |
1783 | 18 | 18 | ||
1784 | 19 | #include "mir_toolkit/mir_client_library.h" | 19 | #include "mir_toolkit/mir_client_library.h" |
1786 | 20 | #include "mir_toolkit/mir_client_library_debug.h" | 20 | #include "mir_toolkit/debug/surface.h" |
1787 | 21 | 21 | ||
1788 | 22 | #include "mir/compositor/compositor.h" | 22 | #include "mir/compositor/compositor.h" |
1789 | 23 | #include "mir/compositor/renderer_factory.h" | 23 | #include "mir/compositor/renderer_factory.h" |
1790 | 24 | 24 | ||
1791 | === modified file 'tests/unit-tests/frontend/test_session_mediator.cpp' | |||
1792 | --- tests/unit-tests/frontend/test_session_mediator.cpp 2014-10-21 16:21:14 +0000 | |||
1793 | +++ tests/unit-tests/frontend/test_session_mediator.cpp 2014-10-23 13:30:17 +0000 | |||
1794 | @@ -259,7 +259,7 @@ | |||
1795 | 259 | shell, graphics_platform, graphics_changer, | 259 | shell, graphics_platform, graphics_changer, |
1796 | 260 | surface_pixel_formats, report, | 260 | surface_pixel_formats, report, |
1797 | 261 | std::make_shared<mtd::NullEventSink>(), | 261 | std::make_shared<mtd::NullEventSink>(), |
1799 | 262 | resource_cache, stub_screencast, &connector, nullptr} | 262 | resource_cache, stub_screencast, &connector, nullptr, nullptr} |
1800 | 263 | { | 263 | { |
1801 | 264 | using namespace ::testing; | 264 | using namespace ::testing; |
1802 | 265 | 265 | ||
1803 | @@ -316,7 +316,7 @@ | |||
1804 | 316 | shell, graphics_platform, graphics_changer, | 316 | shell, graphics_platform, graphics_changer, |
1805 | 317 | surface_pixel_formats, report, | 317 | surface_pixel_formats, report, |
1806 | 318 | std::make_shared<mtd::NullEventSink>(), | 318 | std::make_shared<mtd::NullEventSink>(), |
1808 | 319 | resource_cache, stub_screencast, context, nullptr}; | 319 | resource_cache, stub_screencast, context, nullptr, nullptr}; |
1809 | 320 | 320 | ||
1810 | 321 | EXPECT_THAT(connects_handled_count, Eq(0)); | 321 | EXPECT_THAT(connects_handled_count, Eq(0)); |
1811 | 322 | 322 | ||
1812 | @@ -421,7 +421,7 @@ | |||
1813 | 421 | surface_pixel_formats, report, | 421 | surface_pixel_formats, report, |
1814 | 422 | std::make_shared<mtd::NullEventSink>(), | 422 | std::make_shared<mtd::NullEventSink>(), |
1815 | 423 | resource_cache, std::make_shared<mtd::NullScreencast>(), | 423 | resource_cache, std::make_shared<mtd::NullScreencast>(), |
1817 | 424 | nullptr, nullptr); | 424 | nullptr, nullptr, nullptr); |
1818 | 425 | mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get()); | 425 | mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get()); |
1819 | 426 | 426 | ||
1820 | 427 | EXPECT_THAT(connection.display_configuration(), mt::DisplayConfigMatches(std::cref(config))); | 427 | EXPECT_THAT(connection.display_configuration(), mt::DisplayConfigMatches(std::cref(config))); |
1821 | @@ -629,7 +629,7 @@ | |||
1822 | 629 | surface_pixel_formats, report, | 629 | surface_pixel_formats, report, |
1823 | 630 | std::make_shared<mtd::NullEventSink>(), resource_cache, | 630 | std::make_shared<mtd::NullEventSink>(), resource_cache, |
1824 | 631 | std::make_shared<mtd::NullScreencast>(), | 631 | std::make_shared<mtd::NullScreencast>(), |
1826 | 632 | nullptr, nullptr}; | 632 | nullptr, nullptr, nullptr}; |
1827 | 633 | 633 | ||
1828 | 634 | mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get()); | 634 | mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get()); |
1829 | 635 | 635 | ||
1830 | @@ -876,7 +876,7 @@ | |||
1831 | 876 | shell, graphics_platform, graphics_changer, | 876 | shell, graphics_platform, graphics_changer, |
1832 | 877 | surface_pixel_formats, report, | 877 | surface_pixel_formats, report, |
1833 | 878 | std::make_shared<mtd::NullEventSink>(), | 878 | std::make_shared<mtd::NullEventSink>(), |
1835 | 879 | mt::fake_shared(mock_cache), stub_screencast, nullptr, nullptr}; | 879 | mt::fake_shared(mock_cache), stub_screencast, &connector, nullptr, nullptr}; |
1836 | 880 | 880 | ||
1837 | 881 | mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get()); | 881 | mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get()); |
1838 | 882 | mediator.create_surface(nullptr, &surface_parameters, &surface_response, null_callback.get()); | 882 | mediator.create_surface(nullptr, &surface_parameters, &surface_response, null_callback.get()); |
1839 | 883 | 883 | ||
1840 | === modified file 'tests/unit-tests/frontend/test_session_mediator_android.cpp' | |||
1841 | --- tests/unit-tests/frontend/test_session_mediator_android.cpp 2014-10-01 06:25:56 +0000 | |||
1842 | +++ tests/unit-tests/frontend/test_session_mediator_android.cpp 2014-10-23 13:30:17 +0000 | |||
1843 | @@ -61,7 +61,7 @@ | |||
1844 | 61 | mediator{shell, graphics_platform, display_changer, | 61 | mediator{shell, graphics_platform, display_changer, |
1845 | 62 | surface_pixel_formats, report, | 62 | surface_pixel_formats, report, |
1846 | 63 | std::make_shared<mtd::NullEventSink>(), | 63 | std::make_shared<mtd::NullEventSink>(), |
1848 | 64 | resource_cache, std::make_shared<mtd::NullScreencast>(), nullptr, nullptr}, | 64 | resource_cache, std::make_shared<mtd::NullScreencast>(), nullptr, nullptr, nullptr}, |
1849 | 65 | null_callback{google::protobuf::NewPermanentCallback(google::protobuf::DoNothing)} | 65 | null_callback{google::protobuf::NewPermanentCallback(google::protobuf::DoNothing)} |
1850 | 66 | { | 66 | { |
1851 | 67 | } | 67 | } |
1852 | 68 | 68 | ||
1853 | === modified file 'tests/unit-tests/frontend/test_session_mediator_mesa.cpp' | |||
1854 | --- tests/unit-tests/frontend/test_session_mediator_mesa.cpp 2014-10-21 16:21:14 +0000 | |||
1855 | +++ tests/unit-tests/frontend/test_session_mediator_mesa.cpp 2014-10-23 13:30:17 +0000 | |||
1856 | @@ -74,7 +74,8 @@ | |||
1857 | 74 | mediator{shell, mock_platform, display_changer, | 74 | mediator{shell, mock_platform, display_changer, |
1858 | 75 | surface_pixel_formats, report, | 75 | surface_pixel_formats, report, |
1859 | 76 | std::make_shared<mtd::NullEventSink>(), | 76 | std::make_shared<mtd::NullEventSink>(), |
1861 | 77 | resource_cache, std::make_shared<mtd::NullScreencast>(), nullptr, nullptr}, | 77 | resource_cache, std::make_shared<mtd::NullScreencast>(), nullptr, nullptr, |
1862 | 78 | nullptr}, | ||
1863 | 78 | null_callback{google::protobuf::NewPermanentCallback(google::protobuf::DoNothing)} | 79 | null_callback{google::protobuf::NewPermanentCallback(google::protobuf::DoNothing)} |
1864 | 79 | { | 80 | { |
1865 | 80 | } | 81 | } |
FAILED: Continuous integration, rev:1848 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- ci/2455/ jenkins. qa.ubuntu. com/job/ mir-android- utopic- i386-build/ 1407/console jenkins. qa.ubuntu. com/job/ mir-clang- utopic- amd64-build/ 1413/console jenkins. qa.ubuntu. com/job/ mir-mediumtests -utopic- touch/1390/ console jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- utopic- amd64-ci/ 977 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- utopic- amd64-ci/ 977/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- utopic- armhf/327/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- team-mir- development- branch- ci/2455/ rebuild
http://