<p dir="ltr"><br>
On Mar 7, 2014 7:56 AM, "Nobuhiko Tanibata" <<a href="mailto:NOBUHIKO_TANIBATA@xddp.denso.co.jp">NOBUHIKO_TANIBATA@xddp.denso.co.jp</a>> wrote:<br>
><br>
> Add interface ivi_application, which creates ivi_surface objects tied<br>
> to a given wl_surface with a given id. The given id can be used in a<br>
> shell to identify which application is assigned to a wl_surface and<br>
> layout the surface wherever the shell wants. ivi_surface objects can<br>
> be used to receive status of wl_surface in the scenegraph of the<br>
> compositor.<br>
><br>
> Signed-off-by: Nobuhiko Tanibata <<a href="mailto:NOBUHIKO_TANIBATA@xddp.denso.co.jp">NOBUHIKO_TANIBATA@xddp.denso.co.jp</a>><br>
> ---<br>
><br>
> Changes for v2:<br>
> - Rename "error" to "warning" because meaning of "error" in wayland is fatal.<br>
><br>
> protocol/ivi-application.xml | 88 ++++++++++++++++++++++++++++++++++++++++++++<br>
> 1 file changed, 88 insertions(+)<br>
> create mode 100755 protocol/ivi-application.xml<br>
><br>
> diff --git a/protocol/ivi-application.xml b/protocol/ivi-application.xml<br>
> new file mode 100755<br>
> index 0000000..8659ec6<br>
> --- /dev/null<br>
> +++ b/protocol/ivi-application.xml<br>
> @@ -0,0 +1,88 @@<br>
> +<?xml version="1.0" encoding="UTF-8"?><br>
> +<protocol name="ivi_application"><br>
> +<br>
> + <copyright><br>
> + Copyright (C) 2013 DENSO CORPORATION<br>
> + Copyright (c) 2013 BMW Car IT GmbH<br>
> +<br>
> + Permission is hereby granted, free of charge, to any person obtaining a copy<br>
> + of this software and associated documentation files (the "Software"), to deal<br>
> + in the Software without restriction, including without limitation the rights<br>
> + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
> + copies of the Software, and to permit persons to whom the Software is<br>
> + furnished to do so, subject to the following conditions:<br>
> +<br>
> + The above copyright notice and this permission notice shall be included in<br>
> + all copies or substantial portions of the Software.<br>
> +<br>
> + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
> + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
> + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
> + THE SOFTWARE.<br>
> + </copyright><br>
> +<br>
> + <interface name="ivi_surface" version="1"><br>
> + <description summary="application interface to surface in ivi compositor"/><br>
> +<br>
> + <request name="destroy" type="destructor"><br>
> + <description summary="destroy ivi_surface"/><br>
> + </request><br>
> +<br>
> + <event name="visibility"><br>
> + <description summary="visibility of surface in ivi compositor has changed"><br>
> + The new visibility state is provided in argument visibility.<br>
> + If visibility is 0, the surface has become invisible.<br>
> + If visibility is not 0, the surface has become visible.<br>
> + </description><br>
> + <arg name="visibility" type="int"/><br>
> + </event><br>
> +<br>
> + </interface><br>
> +<br>
> + <interface name="ivi_application" version="1"><br>
> + <description summary="interface for ivi applications to use ivi compositor features"/><br>
> +<br>
> + <request name="surface_create"><br>
> + <description summary="create surface in ivi compositor"><br>
> + surface_create will create a new surface with surface_id in ivi compositor,<br>
> + if it does not yet exists. If the surface with surface_id already exists in<br>
> + ivi compositor, the application content provided in argument surface will<br>
> + be used as surface content. If an other ivi application already registered<br>
> + content for surface with surface_id, an warning event will indicate the problem.<br>
> + </description><br>
> + <arg name="id_surface" type="uint"/><br>
> + <arg name="surface" type="object" interface="wl_surface"/><br>
> + <arg name="id" type="new_id" interface="ivi_surface"/><br>
> + </request><br>
> +<br>
> + <enum name="warning_code"><br>
> + <description summary="possible warning codes returned by ivi compositor"><br>
> + These warning codes define all possible warning codes returned by ivi compositor<br>
> + on server-side warnings.<br>
> + </description><br>
> + <entry name="invalid_wl_surface" value="1" summary="wl_surface is invalid"/><br>
> + <entry name="surface_id_in_use" value="2" summary="surface_id is in use and can not be shared"/><br>
> + </enum></p>
<p dir="ltr">I have a couple more thoughts about these errors/warnings. For one, I think some of these should be errors. For instance, there is no way that the given wl_surface will be invalid unless the client has destroyed it. Honestly, I'm not even sure if it's possible, given how libwayland is written, to get a truely invalid wl_surface. From what you've written in previous e-mails, I can't quite tell but it sounds like you want to prevent a client from attaaching multiple ivi_surface objects (and IVI ID's) to the same surface. If this is the case then doing so should probably also be a fatal error because that means the client was written wrong.</p>
<p dir="ltr">With regards to what happens if a client tries to use an ID that's already in use, I'm not 100% sure what to do there. You know IVI systems better than I do. Is this something that happens with some degree of regularity? Or is this something that only happens if the there is a mistake in the client code? I'll leave that up to you.</p>
<p dir="ltr">That said, if there is an issue, you need to explicitly say what happens to the newly created ivi_surface object. The Wayland protocol has no concept of returning NULL. Whenever a request or event is fired which has a new_id parameter, both client and server-side objects always get created. If surface_create can throw a non-fatal error, we need to decide what happens to the new ivi_surface object. One way to do this would be to have the error/warning event on the ivi_surface itself instead of on ivi_application. Then the client would know that if it recieves the error/warning, that it needs to destroy the corresponding ivi_surface. Otherwise, like you note below, they have to roundtrip after every call to ivi_application.surface_create.</p>
<p dir="ltr">Thanks,<br>
--Jason Ekstrand</p>
<p dir="ltr">> +<br>
> + <event name="warning"><br>
> + <description summary="server-side warning detected"><br>
> + The ivi compositor encountered warning while processing a request by this<br>
> + application. The warning is defined by argument warning_code and optional<br>
> + warning_text.<br>
> + If the application requires to associate this warning event to a request,<br>
> + it can<br>
> + 1. send request<br>
> + 2. force display roundtrip<br>
> + 3. check, if warning event was received<br>
> + but this restricts the application to have only one open request at a time.<br>
> + </description><br>
> + <arg name="warning_code" type="int"/><br>
> + <arg name="warning_text" type="string" allow-null="true"/><br>
> + </event><br>
> +<br>
> + </interface><br>
> +<br>
> +</protocol><br>
> --<br>
> 1.8.3.1<br>
><br>
> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</p>