Are all Wayland registry interfaces unique?

Jasper St. Pierre jstpierre at mecheye.net
Sun Oct 12 00:38:24 PDT 2014


There can be more than one global object with the same interface, like in
the case of wl_seat and wl_output.

For cases like wl_compositor or xdg_shell, there should only be one.

On Sun, Oct 12, 2014 at 12:05 AM, David Piper <drppublic at gmail.com> wrote:

> Hi,
>
> I’m just getting started with Wayland - I’m at the stage where I can start
> writing my own mini-clients.
> I am just wondering if there is a guarantee that all interfaces only ever
> have a single entry in the registry.
>
> If there is no guarantee, I would have to change my code from:
> -------------------
> static void global_registry_handler(void *data, struct wl_registry
> *registry, uint32_t id, const char *interface, uint32_t version) {
>         if (strcmp(interface, “wl_something”) == 0)
>                 something = wl_registry_bind(registry, id,
> &wl_something_interface, 1);
>         // ...
> }
> -------------------
> to
> -------------------
> static void global_registry_handler(void *data, struct wl_registry
> *registry, uint32_t id, const char *interface, uint32_t version) {
>         if (strcmp(interface, “wl_something”) == 0)
>                 vector_of_somethings.push_back(wl_registry_bind(registry,
> id, &wl_something_interface, 1));
>         // …
> }
> -------------------
>
> 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 :)
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>



-- 
  Jasper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20141012/5b809909/attachment.html>


More information about the wayland-devel mailing list