Re: Referencing enums in other protocols

2018-05-01 Thread Auke Booij
On Mon, Apr 23, 2018 at 9:08 AM, Pekka Paalanen wrote: > On Mon, 23 Apr 2018 03:42:31 -0400 > Simon Ser wrote: > >> Hi all, >> >> While writing a protocol, I've been trying to reference symbols from another >> protocol. While it seems to work fine for interfaces, it fails for enums: >> >> err

Re: Skylane - implementation of Wayland in Rust

2017-05-05 Thread Auke Booij
On 5 May 2017 at 09:53, Pekka Paalanen wrote: > What could you do then, if you don't want to wrap the C implementation > of libwayland... > > Borrowing the idea from Daniel Stone from whom I heard it first, the > only other option is to reimplement libwayland *including* its C ABI in > Rust. You n

[RFC wayland] move away from C

2017-04-01 Thread Auke Booij
The C programming language was developed in the early '70s. It was always considered a proof of concept, as it was clear to everyone involved that any serious programming lanugage should have a garbage collector. Indeed, Dennis Ritchie is widely known to have said: "What I would really like is to

Re: array and enum attributes (Was: [PATCH] xdg-shell: add draw states for xdg_surface)

2016-06-02 Thread Auke Booij
On 1 June 2016 at 20:16, Yong Bakos wrote: > On May 30, 2016, at 3:54 AM, Pekka Paalanen wrote: >> >> On Sat, 28 May 2016 08:39:59 -0500 >> Yong Bakos wrote: >> >>> Hi Mike, >>> Regarding the combination of type="array" enum="foo"... >>> On May 27, 2016, at 12:30 PM, Mike Blumenkrantz

Re: [PATCH wayland v3] protocol: add support for cross-interface enum attributes

2016-05-03 Thread Auke Booij
On 3 May 2016 at 13:04, Pekka Paalanen wrote: > On Sat, 5 Dec 2015 12:39:12 + > Auke Booij wrote: > >> The enum attribute, for which scanner support was introduced in >> 1771299, can be used to link message arguments to s. However, >> some arguments refer to s

Re: Recursive dispatch (Re: [PATCH v2] server: Calculate remaining data size after a closure is processed)

2016-02-03 Thread Auke Booij
On 3 February 2016 at 09:34, Jonas Ådahl wrote: > On Wed, Feb 03, 2016 at 11:14:54AM +0200, Pekka Paalanen wrote: >> On Wed, 3 Feb 2016 09:56:20 +0900 >> "Jaeyoon Jung" wrote: >> >> > > -Original Message- >> > > From: Derek Foreman [mailto:der...@osg.samsung.com] >> > > Sent: Wednesday, F

Re: [PATCH wayland v2] client: Fully flush during blocking dispatch

2016-01-14 Thread Auke Booij
On 12 January 2016 at 04:31, Jonas Ådahl wrote: > wl_display_flush() may fail with EAGAIN which means that not all data > waiting in the buffer has been flushed. We later block until there + is > data to read, which could mean that we block on input from the > compositor without having sent out

Re: [PATCH wayland v3] protocol: add support for cross-interface enum attributes

2015-12-14 Thread Auke Booij
Bill, any chance you could review this? Or would you prefer it if this were based on your patch (which I do still support)? On 5 December 2015 at 13:39, Auke Booij wrote: > The enum attribute, for which scanner support was introduced in > 1771299, can be used to link message argument

Re: RFC: idle protocol

2015-12-09 Thread Auke Booij
On 9 December 2015 at 07:43, Peter Hutterer wrote: > On Wed, Dec 09, 2015 at 08:17:40AM +0100, Martin Graesslin wrote: >> On Wednesday, December 9, 2015 4:19:12 PM CET Peter Hutterer wrote: >> > On Tue, Dec 08, 2015 at 02:12:01PM +0100, Martin Graesslin wrote: >> > > Hi Wayland-developers, >> > >

[PATCH wayland v3] protocol: add support for cross-interface enum attributes

2015-12-05 Thread Auke Booij
documentation - fix whitespace in scanner.c - minor code fixup to return early and avoid casts in scanner.c Changes since v1: - several implementation bugs fixed Signed-off-by: Auke Booij --- doc/publican/protocol-to-docbook.xsl | 19 +-- protocol/wayland.xml | 4 +-- src

Re: [PATCH v2 wayland] protocol: add support for cross-interface enum attributes

2015-12-02 Thread Auke Booij
the cross-object ones. > > On Sun, Nov 29, 2015 at 5:54 AM, Auke Booij wrote: >> >> The enum attribute, for which scanner support was introduced in >> 1771299, can be used to link message arguments to s. However, >> some arguments refer to s in a different . >>

[PATCH v2 wayland] protocol: add support for cross-interface enum attributes

2015-11-29 Thread Auke Booij
: Auke Booij --- doc/publican/protocol-to-docbook.xsl | 17 +-- protocol/wayland.xml | 4 +-- src/scanner.c| 59 +++- 3 files changed, 61 insertions(+), 19 deletions(-) diff --git a/doc/publican/protocol-to-docbook.xsl b

Re: [PATCH wayland] Add support for cross-interface enum attributes

2015-11-29 Thread Auke Booij
On 29 November 2015 at 01:27, Auke Booij wrote: > Signed-off-by: Auke Booij I realized this is the wrong search algorithm. I will fix it later today. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.

[PATCH wayland] Add support for cross-interface enum attributes

2015-11-28 Thread Auke Booij
Signed-off-by: Auke Booij --- doc/publican/protocol-to-docbook.xsl | 17 +--- protocol/wayland.xml | 4 +-- src/scanner.c| 51 +++- 3 files changed, 55 insertions(+), 17 deletions(-) diff --git a/doc/publican

Re: [RFC] Declare enumeration wl_output.transform as bitfield.

2015-11-25 Thread Auke Booij
On 25 November 2015 at 13:43, Daniel Stone wrote: > Hi, > > On 25 November 2015 at 12:08, Nils Christopher Brause > wrote: >> 3. The API change is negligible. Every request that accepts this bitfield >>expects a number in the range of zero to seven. These numbers can be >>represented in a

Re: Changing wl_output.transform type to unsigned?

2015-11-24 Thread Auke Booij
On 24 November 2015 at 12:41, Nils Chr. Brause wrote: > On Mon, Nov 16, 2015 at 11:46 AM, Pekka Paalanen wrote: >> On Sun, 15 Nov 2015 22:17:38 +0100 >> "Nils Chr. Brause" wrote: >> >>> On Sun, Nov 15, 2015 at 9:48 PM, Auke Booij wrote: >>> &

Re: [PATCH v5 wayland] protocol: add wl_pointer.frame, axis_source, axis_stop, and axis_discrete

2015-11-16 Thread Auke Booij
On 28 October 2015 at 05:34, Peter Hutterer wrote: > The frame event groups separate pointer events together. The primary use-case > for this at the moment is diagonal scrolling - a vertical/horizontal scroll > event can be grouped together to calculate the correct motion vector. > Frame events gr

Re: [PATCH wayland-protocols] Add the tablet protocol

2015-11-15 Thread Auke Booij
On 6 November 2015 at 04:24, Peter Hutterer wrote: > Signed-off-by: Peter Hutterer > --- > This is the revamped version of the tablet protocol for graphics tablets > (e.g. Wacom tablets). Too many changes from the last version (a year ago or > so), so I won't detail them, best to look at it with

Re: [PATCH] Declare enumeration wl_output.transform as bitfield.

2015-11-15 Thread Auke Booij
On 9 November 2015 at 18:17, Bill Spitzak wrote: > Making the transform into a bitfield allows bitfield tests for useful facts: > it can see if it is a mirror image by testing the flip bit, and check for > transposition of the axes by checking the 90 degree bit. I believe this is > the reason behi

Re: [PATCH 2.5/3 wayland] protocol: add the new bitfields to the dtd

2015-11-09 Thread Auke Booij
On 9 November 2015 at 23:34, Peter Hutterer wrote: > See 851614fa78862499e016c5718e730fefbb8e3b73 > > Signed-off-by: Peter Hutterer Reviewed-by: Auke Booij ___ wayland-devel mailing list wayland-devel@lists.freedesktop

Re: [PATCH] Declare enumeration wl_output.transform as bitfield.

2015-11-09 Thread Auke Booij
On 9 November 2015 at 14:39, Auke Booij wrote: > and it was a mistake Sorry, let me retract this - that was maybe a bit harsh, since I don't know the exact history. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.

Re: [PATCH wayland v2] Remove protocol/wayland.dtd

2015-11-09 Thread Auke Booij
On 9 November 2015 at 11:41, Pekka Paalanen wrote: > I believe comments are enough. I suppose the DTD error message from > wayland-scanner could refer to built-in DTD, that would be a small > change and make it obvious. Just add one word in the warning message. Okay, your reasoning makes sense -

Re: [PATCH] Declare enumeration wl_output.transform as bitfield.

2015-11-09 Thread Auke Booij
On 9 November 2015 at 11:54, Nils Chr. Brause wrote: > Hi, > > On Mon, Nov 9, 2015 at 12:04 PM, Pekka Paalanen wrote: >> On Fri, 6 Nov 2015 16:05:10 +0100 >> "Nils Chr. Brause" wrote: >> >>> Hi, >>> >>> On Fri, Nov 6, 2015 at 3:4

Re: [PATCH wayland v2] Remove protocol/wayland.dtd

2015-11-09 Thread Auke Booij
On 9 November 2015 at 10:54, Peter Hutterer wrote: > On 9/11/2015 20:39 , Auke Booij wrote: >> >> On 6 November 2015 at 11:26, Pekka Paalanen wrote: >>> >>> On Fri, 6 Nov 2015 09:47:03 +1000 >>> Peter Hutterer wrote: >>> >>>>

Re: [PATCH wayland 1/3] Revert "Remove protocol/wayland.dtd"

2015-11-09 Thread Auke Booij
On 9 November 2015 at 04:14, Peter Hutterer wrote: > This reverts commit 06fb8bd371403d43bc192577abd6b0a0c8b29c59. > > Having a DTD hooked up gives an indication of what we expect the protocol to > be, which is a clearer documentation than the current "whatever scanner.c > manages to parse". > > S

Re: [PATCH wayland v2] Remove protocol/wayland.dtd

2015-11-09 Thread Auke Booij
On 6 November 2015 at 11:26, Pekka Paalanen wrote: > On Fri, 6 Nov 2015 09:47:03 +1000 > Peter Hutterer wrote: > >> On Thu, Nov 05, 2015 at 04:58:09PM +0200, Pekka Paalanen wrote: >> > On Mon, 19 Oct 2015 11:30:47 +1000 >> > Peter Hutterer wrote: >> > >> > > On Fri, Oct 16, 2015 at 11:42:21AM +0

Re: [PATCH] doc: Use enum argument type to make links in protocol documentation

2015-11-06 Thread Auke Booij
On 6 November 2015 at 16:27, wrote: > From: Bill Spitzak This is good preparation for when we'll get cross-interface enums. Reviewed-by: Auke Booij ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedes

Re: [PATCH] compositor: Disallow negative geometries in backend output configs

2015-11-06 Thread Auke Booij
On 24 October 2015 at 08:23, Jasper St. Pierre wrote: > I'm struggling to understand the motivation for this patch. > > krh has always said that you need to think of uint and int as two > entirely separate types -- mixing both in math will likely screw up. > You can see this in other places -- wid

Re: [PATCH] Declare enumeration wl_output.transform as bitfield.

2015-11-06 Thread Auke Booij
On 6 November 2015 at 13:03, Nils Christopher Brause wrote: > The enumeration wl_output.transform is clearly a bitfield. > The definition of a bitfield is that each bit has a distinct > meaning. This is clearly the case in the enumeration > wl_output.transform: > > - bit 0: rotate by 90 degree > -

Re: [PATCH wayland v2] Remove protocol/wayland.dtd

2015-11-05 Thread Auke Booij
On 5 November 2015 at 14:58, Pekka Paalanen wrote: > On Mon, 19 Oct 2015 11:30:47 +1000 > Peter Hutterer wrote: > >> On Fri, Oct 16, 2015 at 11:42:21AM +0300, Pekka Paalanen wrote: >> > On Fri, 16 Oct 2015 12:29:11 +1000 >> > Peter Hutterer wrote: >> > >> > > On Fri, Oct 09, 2015 at 01:16:49PM +

[PATCH wayland v3 3/4] scanner: enforce correct argument type for enums

2015-10-26 Thread Auke Booij
allow_null check - Switch to using bool - Clearer message on errorous input - Minor formatting fix Signed-off-by: Auke Booij --- src/scanner.c | 69 +++ 1 file changed, 69 insertions(+) diff --git a/src/scanner.c b/src/scanner.c index

Re: [PATCH wayland v3 3/4] scanner: enforce correct argument type for enums

2015-10-26 Thread Auke Booij
On 26 October 2015 at 18:07, Bryce Harrington wrote: > On Sat, Oct 24, 2015 at 12:07:49PM +0100, Auke Booij wrote: >> The scanner now checks whether arguments that have an associated >> have the right type. >> An argument with an enum attribute must be of type int or uint

[PATCH wayland v3 1/4] doc: document the enum and bitfield attributes

2015-10-26 Thread Auke Booij
Introduce the enum and bitfield attributes, which allow you to refer to the enum you are expecting in an argument, and specify which enums are to be thought of as bitfields. Changes since v3: - Fix typo ("description" -> "descriptive") Signed-off-by: Auke Booij Reviewed

[PATCH wayland v3 4/4] doc: output enum and bitfield attributes in the documentation

2015-10-24 Thread Auke Booij
Signed-off-by: Auke Booij --- doc/publican/protocol-to-docbook.xsl | 9 + 1 file changed, 9 insertions(+) diff --git a/doc/publican/protocol-to-docbook.xsl b/doc/publican/protocol-to-docbook.xsl index 7b45969..fad207a 100644 --- a/doc/publican/protocol-to-docbook.xsl +++ b/doc/publican

[PATCH wayland v3 2/4] protocol: specify enum and bitfield attributes

2015-10-24 Thread Auke Booij
Signed-off-by: Auke Booij --- protocol/wayland.xml | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 59819e9..9c22d45 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -367,7

[PATCH wayland v3 3/4] scanner: enforce correct argument type for enums

2015-10-24 Thread Auke Booij
The scanner now checks whether arguments that have an associated have the right type. An argument with an enum attribute must be of type int or uint, and if the with that name has the bitfield attribute set to true, then the argument must be of type uint. Signed-off-by: Auke Booij --- src

[PATCH wayland v3 0/4] Enum and bitfield XML attributes

2015-10-24 Thread Auke Booij
d" on wl_shell_surface::set_fullscreen::method Auke Booij (4): doc: document the enum and bitfield attributes protocol: specify enum and bitfield attributes scanner: enforce correct argument type for enums doc: output enum and bitfield attributes in the documentation doc/publican/p

[PATCH wayland v3 1/4] doc: document the enum and bitfield attributes

2015-10-24 Thread Auke Booij
Introduce the enum and bitfield attributes, which allow you to refer to the enum you are expecting in an argument, and specify which enums are to be thought of as bitfields. Signed-off-by: Auke Booij --- doc/publican/sources/Protocol.xml | 41 +-- 1 file

Re: [PATCH v2 0/4] Enum and bitfield XML attributes

2015-10-22 Thread Auke Booij
On 22 October 2015 at 22:51, Nils Chr. Brause wrote: > Hi, > > On Thu, Oct 22, 2015 at 10:18 PM, Bill Spitzak wrote: >> On Wed, Oct 21, 2015 at 5:22 AM, Nils Chr. Brause >> wrote: >>> >>> >>> >> - Support for cross-interface enum referencing (e.g. >>> >> wl_shm_pool::create_buffer::format to wl_

[PATCH] doc: document the enum and bitfield attributes

2015-10-22 Thread Auke Booij
Introduce the enum and bitfield attributes, which allow you to refer to the enum you are expecting in an argument, and specify which enums are to be thought of as bitfields. Signed-off-by: Auke Booij --- doc/publican/sources/Protocol.xml | 41 +-- 1 file

[PATCH] protocol: specify enum and bitfield attributes

2015-10-22 Thread Auke Booij
Signed-off-by: Auke Booij --- protocol/wayland.xml | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 59819e9..9c22d45 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -367,7

Re: [PATCH v2 3/4] scanner: enforce correct argument type for enums

2015-10-22 Thread Auke Booij
On 21 October 2015 at 19:13, Bryce Harrington wrote: > On Wed, Oct 21, 2015 at 02:23:53PM +0100, Auke Booij wrote: >> On 20 October 2015 at 08:57, Bryce Harrington wrote: >> > On Mon, Oct 19, 2015 at 11:21:25PM +0100, Auke Booij wrote: >> >> Signed-off-by: Au

Re: [PATCH v2 1/4] doc: document the enum and bitfield attributes

2015-10-22 Thread Auke Booij
On 22 October 2015 at 02:46, Bill Spitzak wrote: > Sorry if this is a duplicate, I am having trouble with gmail. > > On 10/20/2015 12:38 AM, Bryce Harrington wrote: >> >> On Tue, Oct 20, 2015 at 12:01:14AM -0700, Bryce Harrington wrote: >>> >>> On Mon, Oct 1

Re: [PATCH v2 2/4] protocol: specify enum and bitfield attributes

2015-10-21 Thread Auke Booij
On 21 October 2015 at 18:49, Nils Chr. Brause wrote: > You are missing bitfield="true" for wl_shell_surface::resize and > wl_output::transform. Scanning the weston source code, it seems you would have been right about wl_shell_surface had it not been replaced by xdg_shell_surface. But I am happy

Re: [PATCH v2 1/4] doc: document the enum and bitfield attributes

2015-10-21 Thread Auke Booij
On 21 October 2015 at 13:13, Nils Chr. Brause wrote: > Hi, > > On Tue, Oct 20, 2015 at 9:38 AM, Bryce Harrington > wrote: >> On Tue, Oct 20, 2015 at 12:01:14AM -0700, Bryce Harrington wrote: >>> On Mon, Oct 19, 2015 at 11:21:23PM +0100, Auke Booij wrote: >>&g

Re: [PATCH v2 3/4] scanner: enforce correct argument type for enums

2015-10-21 Thread Auke Booij
On 20 October 2015 at 08:57, Bryce Harrington wrote: > On Mon, Oct 19, 2015 at 11:21:25PM +0100, Auke Booij wrote: >> Signed-off-by: Auke Booij >> --- >> src/scanner.c | 70 >> +++ >> 1 file changed, 70

Re: [PATCH v2 0/4] Enum and bitfield XML attributes

2015-10-20 Thread Auke Booij
On 19 October 2015 at 23:21, Auke Booij wrote: > There has been plenty of discussion regarding the introduction of new XML > attributes. This series of patches improves on my earlier attempt to find > common ground in this. > > Major exclusions from these patches are: > >

[PATCH v2 1/4] doc: document the enum and bitfield attributes

2015-10-19 Thread Auke Booij
Introduce the enum and bitfield attributes, which allow you to refer to the enum you are expecting in an argument, and specify which enums are to be thought of as bitfields. Signed-off-by: Auke Booij --- doc/publican/sources/Protocol.xml | 35 +-- 1 file changed

[PATCH v2 0/4] Enum and bitfield XML attributes

2015-10-19 Thread Auke Booij
values might be listed, others might not be, and some might only be legal sometimes. New values may be added (but not changed or removed) to protocol specifications without introducing any compatibility issues. Auke Booij (4): doc: document the enum and bitfield attributes protocol: specify enum and

[PATCH v2 4/4] doc: output enum and bitfield attributes in the documentation

2015-10-19 Thread Auke Booij
Signed-off-by: Auke Booij --- doc/publican/protocol-to-docbook.xsl | 9 + 1 file changed, 9 insertions(+) diff --git a/doc/publican/protocol-to-docbook.xsl b/doc/publican/protocol-to-docbook.xsl index 7b45969..fad207a 100644 --- a/doc/publican/protocol-to-docbook.xsl +++ b/doc/publican

[PATCH v2 2/4] protocol: specify enum and bitfield attributes

2015-10-19 Thread Auke Booij
Signed-off-by: Auke Booij --- protocol/wayland.xml | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 59819e9..a3e6900 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -367,7

[PATCH v2 3/4] scanner: enforce correct argument type for enums

2015-10-19 Thread Auke Booij
The scanner now checks whether arguments that have an associated have the right type. An argument with an enum attribute must be of type int or uint, and if the with that name has the bitfield attribute set to true, then the argument must be of type uint. Signed-off-by: Auke Booij --- src

Re: Enums, bitfields and wl_arrays

2015-10-15 Thread Auke Booij
;no > compatibility issues" and a set of form specifications eg. "the order of an > enum shall not be changed". This is exactly the kind of specification that I do not intend to make, since it is (ostensibly) caused solely by a broken implementation of enums in Java. It's no

Re: Enums, bitfields and wl_arrays

2015-10-13 Thread Auke Booij
On 13 October 2015 at 16:19, Solerman Kaplon wrote: > Em 13-10-2015 11:35, Nils Chr. Brause escreveu: >> >> In C++ the order doesn't matter either, since each entry has a defined >> value. I wonder why this is different in Java? > > > Java Enums doesn't have "value". It just a class instance. But

Re: [PATCH wayland 0/3] "enum" and "bitfield" attributes for protocol XML files

2015-10-09 Thread Auke Booij
On 5 October 2015 at 14:56, Pekka Paalanen wrote: > On Fri, 26 Jun 2015 16:02:44 +0200 > Auke Booij wrote: > >> As per last April/May's "enum" attribute discussion, these patches >> introduce two new attributes to the protocol XML files. >> The "en

Re: [PATCH wayland v2] Remove protocol/wayland.dtd

2015-10-09 Thread Auke Booij
Yeah, that was a pretty embarrassing mistake by me, for such a simple patch. Thanks to Bryce for catching it. On 8 October 2015 at 15:05, Pekka Paalanen wrote: > On Thu, 8 Oct 2015 14:35:34 +0100 > Auke Booij wrote: > >> The wayland scanner defines the protocol. The DTD speci

[PATCH wayland v2] Remove protocol/wayland.dtd

2015-10-08 Thread Auke Booij
The wayland scanner defines the protocol. The DTD specification is not used. --- Makefile.am | 4 ++-- protocol/wayland.dtd | 29 - 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 protocol/wayland.dtd diff --git a/Makefile.am b/Makefile.

[PATCH] Remove protocol/wayland.dtd

2015-10-06 Thread Auke Booij
The wayland scanner defines the protocol. The DTD specification is not used. --- protocol/wayland.dtd | 29 - 1 file changed, 29 deletions(-) delete mode 100644 protocol/wayland.dtd diff --git a/protocol/wayland.dtd b/protocol/wayland.dtd deleted file mode 100644 inde

Re: Enums, bitfields and wl_arrays

2015-10-04 Thread Auke Booij
ess bugs. It is the "dotless" version that is already supported by my patches. The dotted one requires new code. So apart from a single if statement, this is not really more work. But I guess this is getting into bikeshedding terrain. > Auke Booij wrote: >> The enum and bitfield at

Re: Enums, bitfields and wl_arrays

2015-10-02 Thread Auke Booij
On 2 October 2015 at 14:49, Victor Berger wrote: > Le 2015-10-02 15:16, Pekka Paalanen a écrit : >> >> On Fri, 2 Oct 2015 13:50:42 +0100 >> Auke Booij wrote: >>> >>> >>> [start] >>> The enum and bitfield attributes are in principle f

Re: Enums, bitfields and wl_arrays

2015-10-02 Thread Auke Booij
On 2 October 2015 at 13:12, Auke Booij wrote: > The wayland protocol currently does not specify the enum attribute, > and I see no way how to write an API whose entire purpose is to > *break* when you erroneously mix up enum attribute data, without > breaking API as this data is adde

Re: Enums, bitfields and wl_arrays

2015-10-02 Thread Auke Booij
On 2 October 2015 at 12:31, Pekka Paalanen wrote: >> I know that several people have proposed patches on this - Bill, Nils >> and Auke at least. Since there's a definite need for this, and since >> agreement appears to be not far off, I would like to get this landed >> this release. And ideally

Re: Enums, bitfields and wl_arrays

2015-10-02 Thread Auke Booij
On 1 October 2015 at 20:00, Nils Chr. Brause wrote: >> Since Auke's patchset proposalis the most recent, let's take that one as >> the candidate for landing. Gentlemen, I'd like to ask you to review >> these three patches [5,6,7] and either give your Reviewed-by's or flag >> specific improvements

Re: Enums, bitfields and wl_arrays

2015-10-02 Thread Auke Booij
Thanks for bringing this up again, Bryce. On 1 October 2015 at 18:59, Jasper St. Pierre wrote: > We have a few constraints. First off, not all enums are closed. Some > are intentionally open, like xdg_shell.state. So we definitely need a > distinction between a closed enum and an open enum. I'm n

Re: [PATCH wayland 0/3] "enum" and "bitfield" attributes for protocol XML files

2015-06-26 Thread Auke Booij
field" information to the documentation, and explains the attributes in chapter 4 ("Wayland Protocol and Model of Operation"). I forgot to add my Signed-off-by to these three patches, but it applies, so here you go: Signed-off-by: Auke Booij __

Re: [PATCH wayland 0/3] "enum" and "bitfield" attributes for protocol XML files

2015-06-26 Thread Auke Booij
On 26 June 2015 at 16:02, Auke Booij wrote: > Although arguments can only refer to enums in specific cases (see the > scanner.c changes), this new protocol data should not break the C bindings. > It is thinkable that other bindings *do* use the data in a way that breaks > the proto

[PATCH wayland 1/3] protocol: introduce the enum argument type

2015-06-26 Thread Auke Booij
This improvement to the protocol allows you to refer to the kind of enum you are expecting. It also introduces a distinction between enums that are bitfields, ie that can be OR'ed together. --- protocol/wayland.dtd | 2 ++ protocol/wayland.xml | 32 2 files chang

[PATCH wayland 2/3] scanner: enforce correct argument type for enums

2015-06-26 Thread Auke Booij
The scanner now checks whether arguments that have an associated have the right type. An argument with an enum attribute must be of type int or uint, and if the with that name has the bitfield attribute set to true, then the argument must be of type uint. --- src/scanner.c | 68 +

[PATCH wayland 3/3] doc: document new enum attributes and use such data in generated docs

2015-06-26 Thread Auke Booij
The newly introduced "enum" and "bitfield" protocol XML attributes give additional semantic information, which we can use when generating the documentation. --- doc/publican/protocol-to-docbook.xsl | 9 + doc/publican/sources/Protocol.xml| 23 +-- 2 files changed,

[PATCH wayland 0/3] "enum" and "bitfield" attributes for protocol XML files

2015-06-26 Thread Auke Booij
gs *do* use the data in a way that breaks the protocol; however such usage will be considered nonstandard. Auke Booij (3): protocol: introduce the enum argument type scanner: enforce correct argument type for enums doc: document new enum attributes and use such data in generated docs doc/pub

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-05-02 Thread Auke Booij
On 19 April 2015 at 14:51, Jeroen Bollen wrote: > Hello, > > It seems like this discussion died off. Currently there is no way to tell, > from the Wayland XML specification whether an argument is a bitfield, or > whether the argument takes an enum and what enum this is. > > I am currently in the p

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-04-27 Thread Auke Booij
On 27 April 2015 at 14:49, Pekka Paalanen wrote: > On Mon, 27 Apr 2015 13:26:39 +0200 > Auke Booij wrote: > >> Apologies for my lack of responses, I have been abroad for a few days. >> >> On 23 April 2015 at 10:38, Pekka Paalanen wrote: >> >> This i

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-04-27 Thread Auke Booij
On 21 Apr 2015 09:18, "Pekka Paalanen" wrote: > Two things I came up with in the IRC discussion was that only > types of int an uint are eligible for enums, and only uint for > bitfields. I think wayland-scanner should enforce that. I just realised another aspect of this. Can a (non-bitfield) en

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-04-27 Thread Auke Booij
Apologies for my lack of responses, I have been abroad for a few days. On 23 April 2015 at 10:38, Pekka Paalanen wrote: >> This is a sort of sanity condition on being a bitfield: it does not >> require all combinations are valid, but it also distinguishes it from >> a regular enum. > > Is that an

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-04-23 Thread Auke Booij
On 23 April 2015 at 08:38, Pekka Paalanen wrote: > On Wed, 22 Apr 2015 11:47:51 +0200 > Auke Booij wrote: > >> On 22 April 2015 at 08:34, Pekka Paalanen wrote: >> > I also think this discussion is going off-topic. You wanted to add >> > annotations to the XML,

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-04-22 Thread Auke Booij
On 22 April 2015 at 08:34, Pekka Paalanen wrote: > I also think this discussion is going off-topic. You wanted to add > annotations to the XML, so you could find out about enum and bitfield > arguments, so let's keep to that. There is value in simplicity. > > > How about this: > > Add three new, m

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-04-20 Thread Auke Booij
On 20 April 2015 at 09:03, Pekka Paalanen wrote: > Hi, Thanks for taking the time to respond. I'll address your issues one by one, but the overarching picture is that such typing information should and would not be interpreted by bindings as a promise, but rather as a hint. > I'm starting to thi

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-04-19 Thread Auke Booij
Well clearly gmail does line wrapping, which I did not realize. So while I figure that out, please enjoy the patch which I attached. On 19 April 2015 at 22:30, Auke Booij wrote: > On 19 April 2015 at 14:51, Jeroen Bollen wrote: >> Hello, >> >> It seems like this discussio

Re: [PATCH wayland] Add "enum" attribute to "arg" elements

2015-04-19 Thread Auke Booij
On 19 April 2015 at 14:51, Jeroen Bollen wrote: > Hello, > > It seems like this discussion died off. Currently there is no way to tell, > from the Wayland XML specification whether an argument is a bitfield, or > whether the argument takes an enum and what enum this is. > > I am currently in the p

Re: Protocol (scanner) proposals

2014-08-04 Thread Auke Booij
As discussed in IRC, nevermind this. I misread the header files. On 4 August 2014 01:12, Auke Booij wrote: > On 30 July 2014 20:27, Pekka Paalanen wrote: >> Actually no. Binding writers are expected to write their own code >> generator for their language, like wayland-scanne

Re: Protocol (scanner) proposals

2014-08-03 Thread Auke Booij
On 30 July 2014 20:27, Pekka Paalanen wrote: > Actually no. Binding writers are expected to write their own code > generator for their language, like wayland-scanner is for C. You > are expected to not use the static inline generated C functions. > > All the static inline functions are not part of

Re: Protocol (scanner) proposals

2014-08-03 Thread Auke Booij
On 3 August 2014 09:08, Pekka Paalanen wrote: > It was, hidden in a small paragraph in the documentation... I have to apologize, you are right. >> I guess that this is convention in C? > > [...] Thanks for your perfectly clear explanation, that does clarify it a lot. >> Speaking of which, is t

Re: Protocol (scanner) proposals

2014-08-02 Thread Auke Booij
On 30 July 2014 20:27, Pekka Paalanen wrote: > Actually no. Binding writers are expected to write their own code > generator for their language, like wayland-scanner is for C. You > are expected to not use the static inline generated C functions. Okay, that makes some amount of sense. But in that

Protocol (scanner) proposals

2014-07-30 Thread Auke Booij
I am in the process of writing bindings to Wayland for Haskell, and have run into some issues which I think you may be interested in solving. They all relate to the protocol files. 1. Haskell is a very richly typed language, which means that if two integers have different meaning (e.g. length of

haskell libxkbcommon bindings (also: wayland bindings help request)

2013-08-13 Thread Auke Booij
I wrote haskell bindings for libxkbcommon. https://github.com/tulcod/haskell-xkbcommon I appreciate *any* feedback Announcement in haskell-cafe: http://www.haskell.org/pipermail/haskell-cafe/2013-August/108333.html Once I am happy with these bindings (I would currently call them "alpha") I woul