<p dir="ltr"><br>
On Mar 6, 2014 7:08 PM, "Nobuhiko Tanibata" <<a href="mailto:nobuhiko_tanibata@xddp.denso.co.jp">nobuhiko_tanibata@xddp.denso.co.jp</a>> wrote:<br>
><br>
> 2014-03-07 00:21 に Jason Ekstrand さんは書きました:<br>
><br>
>> On Mar 6, 2014 3:53 AM, "Nobuhiko Tanibata"<br>
>> <<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<br>
>> tied<br>
>> > to a given wl_surface with a given id. The given id can be used in<br>
>> 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<br>
>> can<br>
>> > be used to receive status of wl_surface in the scenegraph of the<br>
>> > compositor.<br>
>><br>
>> In general, I think this looks pretty good. It's nice and simple and<br>
>> only adds what's needed for clients. I do have a couple comments<br>
>> below.<br>
>> --Jason Ekstrand<br>
>><br>
>>><br>
>> > Signed-off-by: Nobuhiko Tanibata<br>
>> <<a href="mailto:NOBUHIKO_TANIBATA@xddp.denso.co.jp">NOBUHIKO_TANIBATA@xddp.denso.co.jp</a>><br>
>> > ---<br>
>> > protocol/ivi-application.xml | 88<br>
>> ++++++++++++++++++++++++++++++++++++++++++++<br>
>> > 1 file changed, 88 insertions(+)<br>
>> > create mode 100644 protocol/ivi-application.xml<br>
>> ><br>
>> > diff --git a/protocol/ivi-application.xml<br>
>> b/protocol/ivi-application.xml<br>
>> > new file mode 100644<br>
>> > index 0000000..e58ad26<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<br>
>> obtaining a copy<br>
>> > + of this software and associated documentation files (the<br>
>> "Software"), to deal<br>
>> > + in the Software without restriction, including without<br>
>> limitation the rights<br>
>> > + to use, copy, modify, merge, publish, distribute,<br>
>> sublicense, and/or sell<br>
>> > + copies of the Software, and to permit persons to whom the<br>
>> Software is<br>
>> > + furnished to do so, subject to the following conditions:<br>
>> > +<br>
>> > + The above copyright notice and this permission notice shall<br>
>> be included in<br>
>> > + all copies or substantial portions of the Software.<br>
>> > +<br>
>> > + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY<br>
>> KIND, EXPRESS OR<br>
>> > + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br>
>> MERCHANTABILITY,<br>
>> > + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO<br>
>> EVENT SHALL THE<br>
>> > + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,<br>
>> DAMAGES OR OTHER<br>
>> > + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR<br>
>> OTHERWISE, ARISING FROM,<br>
>> > + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
>> OTHER DEALINGS IN<br>
>> > + THE SOFTWARE.<br>
>> > + </copyright><br>
>> > +<br>
>> > + <interface name="ivi_surface" version="1"><br>
>> > + <description summary="application interface to surface<br>
>> 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<br>
>> ivi compositor has changed"><br>
>> > + The new visibility state is provided in<br>
>> argument visibility.<br>
>> > + If visibility is 0, the surface has become<br>
>> invisible.<br>
>> > + If visibility is not 0, the surface has<br>
>> 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<br>
>> to use ivi compositor features"/><br>
>> > +<br>
>> > + <request name="surface_create"><br>
>> > + <description summary="create surface in ivi<br>
>> compositor"><br>
>> > + surface_create will create a new surface<br>
>> with surface_id in ivi compositor,<br>
>> > + if it does not yet exists. If the surface<br>
>> with surface_id already exists in<br>
>> > + ivi compositor, the application content<br>
>> provided in argument surface will<br>
>> > + be used as surface content. If an other<br>
>> ivi application already registered<br>
>> > + content for surface with surface_id, an<br>
>> error event will indicate the problem.<br>
>> > + </description><br>
>> > + <arg name="id_surface" type="uint"/><br>
>> > + <arg name="surface" type="object"<br>
>> interface="wl_surface"/><br>
>> > + <arg name="id" type="new_id"<br>
>> interface="ivi_surface"/><br>
>> > + </request><br>
>> > +<br>
>> > + <enum name="error_code"><br>
>> > + <description summary="possible error codes<br>
>> returned by ivi compositor"><br>
>> > + These error codes define all possible<br>
>> error codes returned by ivi compositor<br>
>> > + on server-side errors.<br>
>> > + </description><br>
>> > + <entry name="unknown_error" value="1"<br>
>> summary="unknown error encountered"/><br>
>><br>
>> What kinds of things do you use "unknown error" for? I'm not sure<br>
>> how that's useful to the client.<br>
>><br>
><br>
> Hi Jason,<br>
><br>
> Thank you for reviewing.<br>
><br>
> I see. From this review point, it shall not return no useful value to the client.<br>
> I break down more here.<br>
> - id in use: specified ID for ivi_surface is already used by itself or other client.<br>
> - resource in use: specified ID of wl_surface is already tie to another ID of ivi_surface.<br>
> - invalid resource: specified ID of wl_surface is not valid in server.<br>
><br>
> I think these three is sufficient for client.<br>
><br>
><br>
>>> + <entry name="resource_in_use" value="2"<br>
>><br>
>> summary="resource is in use and can not be shared"/><br>
>><br>
>> What kind of resource does this refer to? It looks like you use it<br>
>> if someone tries to call surface_create twice on the same surface, but<br>
>> you don't specify.<br>
>><br>
>>> + </enum><br>
>><br>
>> > +<br>
>> > + <event name="error"><br>
>> > + <description summary="server-side error<br>
>> detected"><br>
>> > + The ivi compositor encountered error while<br>
>> processing a request by this<br>
>> > + application. The error is defined by<br>
>> argument error_code and optional<br>
>> > + error_text.<br>
>> > + If the application requires to associate<br>
>> this error event to a request,<br>
>> > + it can<br>
>> > + 1. send request<br>
>> > + 2. force display roundtrip<br>
>> > + 3. check, if error event was<br>
>> received<br>
>> > + but this restricts the application to<br>
>> have only one open request at a time.<br>
>> > + </description><br>
>> > + <arg name="error_code" type="int"/><br>
>> > + <arg name="error_text" type="string"<br>
>> allow-null="true"/><br>
>> > + </event><br>
>><br>
>> Why are you using this rather than the built-in wl_display.error? <br>
>> The built-in wl_display.error also terminates the client when an error<br>
>> is sent. Under what error conditions would you want the client to<br>
>> continue?<br>
>><br>
><br>
> Good suggestion!<br>
> According to wayland.xml, error code from 0 to 2 is reserved for global.<br>
> Please teach me there is any manner which number I can use for the above object? In the feature, if wayland.xml updated to add new global error code to 3, the local number may need to be incremented.</p>
<p dir="ltr">The wl_display.error event is a bit confusing. The wl_resource_post_error function takes three arguments. The first argument is an object; the last two are an error code and a human-readable message string. The error code should be interpreted relative to the given object. Therefore, you don't need to worry about colliding with the codes defined in wl_display. If the error is defined in wl_application you should pass the wl_application resource into the error event. </p>
<p dir="ltr">One warning about wl_display.error event: all errors are considered fatal and the client gets automatically disconnected. Given the errors you listed, this is probably OK. If you want a non-fatal error, you should use something else And probably not call it "error" (to avoid confusion).</p>
<p dir="ltr">Hope that helps,<br>
--Jason Ekstrand</p>
<p dir="ltr">><br>
> BR,<br>
> Nobuhiko<br>
>>><br>
>>> +<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> [1]<br>
>><br>
>><br>
>> Links:<br>
>> ------<br>
>> [1] <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</p>