Re: history/semantics of uint32_t name
The word "name" strongly implies that the data is a string. It does not help that right next to it is "interface" which *is* a string. Some variation of "server's id" would be clearer. On Fri, Apr 1, 2016 at 12:59 AM, Pekka Paalanenwrote: > On Fri, 1 Apr 2016 09:44:07 +0800 > Jonas Ådahl wrote: > > > On Thu, Mar 31, 2016 at 06:48:06PM -0500, Yong Bakos wrote: > > > Hi, > > > I've been investigating the semantics of the name parameter within > > > the wl_registry interface, prompted by a recent dialog regarding my > > > patch of arg summary attributes in wayland.xml. > > > I can't say for sure the reason behind using "name", but using "id" > > would potentially be confused with the object "id"'s. > > This potential confusion is exactly the reason. Names are not ids. > > > Thanks, > pq > > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/wayland-devel > > ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: history/semantics of uint32_t name
> On Apr 1, 2016, at 12:41 PM, Bill Spitzakwrote: > > On Fri, Apr 1, 2016 at 12:59 AM, Pekka Paalanen wrote: >> On Fri, 1 Apr 2016 09:44:07 +0800 >> Jonas Ådahl wrote: >> >> > On Thu, Mar 31, 2016 at 06:48:06PM -0500, Yong Bakos wrote: >> > > Hi, >> > > I've been investigating the semantics of the name parameter within >> > > the wl_registry interface, prompted by a recent dialog regarding my >> > > patch of arg summary attributes in wayland.xml. >> >> > I can't say for sure the reason behind using "name", but using "id" >> > would potentially be confused with the object "id"'s. >> >> This potential confusion is exactly the reason. Names are not ids. >> >> >> Thanks, >> pq > > The word "name" strongly implies that the data is a string. It does not > help that right next to it is "interface" which *is* a string. > > Some variation of "server's id" would be clearer. I agree. And while I recognize pq's assertion that names are not ids, the fact is that name's value is assigned display->id. I'm digging into this more. yong ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: history/semantics of uint32_t name
On Fri, 1 Apr 2016 09:44:07 +0800 Jonas Ådahlwrote: > On Thu, Mar 31, 2016 at 06:48:06PM -0500, Yong Bakos wrote: > > Hi, > > I've been investigating the semantics of the name parameter within > > the wl_registry interface, prompted by a recent dialog regarding my > > patch of arg summary attributes in wayland.xml. > I can't say for sure the reason behind using "name", but using "id" > would potentially be confused with the object "id"'s. This potential confusion is exactly the reason. Names are not ids. Thanks, pq pgpX0RpD3iDt4.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: history/semantics of uint32_t name
On Thu, 31 Mar 2016 17:00:37 -0700 "Jasper St. Pierre"wrote: > wl_registry and wl_registry.bind are about globals and creating new > instances of globals. > > A compositor can opt to provide a new global interface by using the > wl_global_create API. Immediately, an event is broadcasted to all > clients: the wl_registry.global event, which contains a name (the > uint32_t parameter), an interface (which is a string). If the user > wants to bind such a global, it passes that back to wl_registry.bind, > to get an instance of that global. > > Why wasn't the interface used instead? I'm not sure. I imagine it was > to enforce that binding is done through the global event rather than > allowing a client to attempt to bind random objects through strings. It is because you can have multiple globals with the same interface, e.g. multiple wl_outputs or multiple wl_seats. These are the non-singleton global interfaces. Names tell the globals apart when the interface alone would not. Thanks, pq > On Thu, Mar 31, 2016 at 4:48 PM, Yong Bakos > wrote: > > Hi, > > I've been investigating the semantics of the name parameter within > > the wl_registry interface, prompted by a recent dialog regarding my > > patch of arg summary attributes in wayland.xml. > > > > I've dug around the Weston source to see what values are passed as > > the name argument, and where it goes... and I'm at a bit of a loss. > > This argument is always an integer, and seems like it's just passed > > around and never even used for anything! I feel like I must be > > missing something, hence this question: what is this `name` > > argument in wl_registry_bind, wl_registry_send_global, and > > wl_registry_send_global_remove? Why is it called name when it is > > merely a numeric identifier? Shouldn't it be called `id`? > > > > I'd love to see where this argument is used within the weston > > source, so if you know a file:line you can point me to, I'll add > > one beer to your queue. > > > > Thank you, > > yong pgp27cn366LrM.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: history/semantics of uint32_t name
On Thu, Mar 31, 2016 at 06:48:06PM -0500, Yong Bakos wrote: > Hi, > I've been investigating the semantics of the name parameter within the > wl_registry interface, prompted by a recent dialog regarding my patch of arg > summary attributes in wayland.xml. > > I've dug around the Weston source to see what values are passed as the name > argument, and where it goes... and I'm at a bit of a loss. This argument is > always an integer, and seems like it's just passed around and never even used > for anything! I feel like I must be missing something, hence this question: > what is this `name` argument in wl_registry_bind, wl_registry_send_global, > and wl_registry_send_global_remove? Why is it called name when it is merely a > numeric identifier? Shouldn't it be called `id`? > > I'd love to see where this argument is used within the weston source, so if > you know a file:line you can point me to, I'll add one beer to your queue. > Each global object has a unique "name" used for identifying them. There may be multiple objects of the same interface, but they'll all have unique names. For example there may be multiple wl_output's and multiple wl_seat's, all with different "names". When the client binds a global, it will pass the "name" (the uint32_t identifier) so that the server can know which of the globals it tries to bind. Just an interface name would not be enough because, as I mentioned, there may be multiple globals with the same interface, but the client is binding just one of the advertised globals. You are not finding the use of "name" anywhere in the weston source code because the registry is implemented in libwayland-server.so. See registry_bind() in wayland-server.c. I can't say for sure the reason behind using "name", but using "id" would potentially be confused with the object "id"'s. Jonas > Thank you, > yong > > > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: history/semantics of uint32_t name
wl_registry and wl_registry.bind are about globals and creating new instances of globals. A compositor can opt to provide a new global interface by using the wl_global_create API. Immediately, an event is broadcasted to all clients: the wl_registry.global event, which contains a name (the uint32_t parameter), an interface (which is a string). If the user wants to bind such a global, it passes that back to wl_registry.bind, to get an instance of that global. Why wasn't the interface used instead? I'm not sure. I imagine it was to enforce that binding is done through the global event rather than allowing a client to attempt to bind random objects through strings. On Thu, Mar 31, 2016 at 4:48 PM, Yong Bakoswrote: > Hi, > I've been investigating the semantics of the name parameter within the > wl_registry interface, prompted by a recent dialog regarding my patch of arg > summary attributes in wayland.xml. > > I've dug around the Weston source to see what values are passed as the name > argument, and where it goes... and I'm at a bit of a loss. This argument is > always an integer, and seems like it's just passed around and never even used > for anything! I feel like I must be missing something, hence this question: > what is this `name` argument in wl_registry_bind, wl_registry_send_global, > and wl_registry_send_global_remove? Why is it called name when it is merely a > numeric identifier? Shouldn't it be called `id`? > > I'd love to see where this argument is used within the weston source, so if > you know a file:line you can point me to, I'll add one beer to your queue. > > Thank you, > yong > > > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/wayland-devel -- Jasper ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel