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 <drppub...@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@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/wayland-devel > -- Jasper
_______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel