[PATCH weston v2 1/5] protocol: Add _wl_pointer_gestures (swipe/pinch) protocol

Bill Spitzak spitzak at gmail.com
Fri Jul 31 14:13:23 PDT 2015


On Fri, Jul 31, 2015 at 6:53 AM, Carlos Garnacho <carlosg at gnome.org> wrote:

> >> +      <arg name="cancelled" type="int" summary="whether the gesture
> was cancelled"/>
> >
> > Since this is an "int" maybe it should say "1 if the gesture was
> > cancelled, otherwise 0". Or maybe be an enum?
>
> I've been kept thinking about the enum possibility, but I could just
> come up with awkward names
>

Maybe, like the "enum" extra parameter (as proposed in a patch that appears
to not be merged yet), there should be a "bool" one, indicating for some
languages that it should map to their built-in bool type. Like the
enumerations, it can still be an int or uint in the C api so it won't
change anything other than add some documentation and type safety to other
languages.

Or the enum proposal could be enhanced by special-casing the enum named
"bool", if this is considered a simpler change to the syntax.

Note that just making it an actual enum with "true" and "false" keys won't
work for language wrappers, due to a certain language named after a snake
that uses "True" and "False" (ie capitalized)...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150731/fbf82068/attachment-0001.html>


More information about the wayland-devel mailing list