<div dir="ltr"><div>There can be more than one global object with the same interface, like in the case of wl_seat and wl_output.<br><br></div>For cases like wl_compositor or xdg_shell, there should only be one.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 12, 2014 at 12:05 AM, David Piper <span dir="ltr"><<a href="mailto:drppublic@gmail.com" target="_blank">drppublic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I’m just getting started with Wayland - I’m at the stage where I can start writing my own mini-clients.<br>
I am just wondering if there is a guarantee that all interfaces only ever have a single entry in the registry.<br>
<br>
If there is no guarantee, I would have to change my code from:<br>
-------------------<br>
static void global_registry_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) {<br>
        if (strcmp(interface, “wl_something”) == 0)<br>
                something = wl_registry_bind(registry, id, &wl_something_interface, 1);<br>
        // ...<br>
}<br>
-------------------<br>
to<br>
-------------------<br>
static void global_registry_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) {<br>
        if (strcmp(interface, “wl_something”) == 0)<br>
                vector_of_somethings.push_back(wl_registry_bind(registry, id, &wl_something_interface, 1));<br>
        // …<br>
}<br>
-------------------<br>
<br>
My hunch is that the vectors (arrays, etc) are unnecessary and there is in fact only one instance of every interface string in the registry, at least for wl_* strings, but I haven’t managed to find confirmation as yet - any direction here would be much appreciated :)<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" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>  Jasper<br>
</div>