Re: [PATCH 1/7] protocol: add linux_dmabuf extension RFCv1

2014-12-18 Thread Daniel Vetter
On Fri, Dec 12, 2014 at 04:51:02PM -0500, Louis-Francis Ratté-Boulianne wrote:
> From: Pekka Paalanen 
> 
> An experimental (hence the 'z' prefix) linux_dmabuf Wayland protocol
> extension for creating dmabuf-based wl_buffers in a generic manner.
> 
> This does not include proper dmabuf metadata negotiation because
> there is no way to communicate all dmabuf constraints from the
> compositor to a client before-hand. The client has to create a
> wl_buffer wrapping one or more dmabuf buffers and then listen at
> the feedback object returned to know if the operation was successful.
> 
> Signed-off-by: Pekka Paalanen 
> Signed-off-by: Louis-Francis Ratté-Boulianne 

So I have no idea about how wayland protos work, so please take that into
account ;-)

Generally I think we should try to follow what the drm addfb2 ioctl does
in drm, since in the end we need to be able to handle pretty much all the
same issues. Well wayland needs to solve a few more since it also must
cope with buffer layouts which can only be used for rendering but not
scanned out.

Wrt tiling layouts and compressed buffers and similar vendor specific
things: The current proposal is to add a new uint64_t layout qualifier to
addfb with opaque #defines (probably a new header), with an 8:56 bit split
between vendor identifier and opaque vendor specified content. It will
also be per-buffer (like pitches/offsets). The abi isn't locked down yet,
but definitely something to keep in mind.

It will definitely complicate the protocol though since the specific
layout modifiers which are acceptable change dynamically at runtime: Some
scanout formats become invalid when we run out of fifo space, some can
only be used on specific planes and ofc this all depends upon whether gl
compositing or hw planes are used to pick the right one.

Some more random comments below.

Cheers, Daniel

> ---
>  Makefile.am   |   7 +-
>  protocol/linux-dmabuf.xml | 224 
> ++
>  2 files changed, 229 insertions(+), 2 deletions(-)
>  create mode 100644 protocol/linux-dmabuf.xml
> 
> diff --git a/Makefile.am b/Makefile.am
> index 494266d..0462fdd 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -91,7 +91,9 @@ nodist_weston_SOURCES = 
> \
>   protocol/presentation_timing-protocol.c \
>   protocol/presentation_timing-server-protocol.h  \
>   protocol/scaler-protocol.c  \
> - protocol/scaler-server-protocol.h
> + protocol/scaler-server-protocol.h   \
> + protocol/linux-dmabuf-protocol.c\
> + protocol/linux-dmabuf-server-protocol.h
>  
>  BUILT_SOURCES += $(nodist_weston_SOURCES)
>  
> @@ -1101,7 +1103,8 @@ EXTRA_DIST +=   \
>   protocol/presentation_timing.xml\
>   protocol/scaler.xml \
>   protocol/ivi-application.xml\
> - protocol/ivi-hmi-controller.xml
> + protocol/ivi-hmi-controller.xml \
> + protocol/linux-dmabuf.xml
>  
>  man_MANS = weston.1 weston.ini.5
>  
> diff --git a/protocol/linux-dmabuf.xml b/protocol/linux-dmabuf.xml
> new file mode 100644
> index 000..c48121c
> --- /dev/null
> +++ b/protocol/linux-dmabuf.xml
> @@ -0,0 +1,224 @@
> +
> +
> +
> +  
> +Copyright © 2014 Collabora, Ltd.
> +
> +Permission to use, copy, modify, distribute, and sell this
> +software and its documentation for any purpose is hereby granted
> +without fee, provided that the above copyright notice appear in
> +all copies and that both that copyright notice and this permission
> +notice appear in supporting documentation, and that the name of
> +the copyright holders not be used in advertising or publicity
> +pertaining to distribution of the software without specific,
> +written prior permission.  The copyright holders make no
> +representations about the suitability of this software for any
> +purpose.  It is provided "as is" without express or implied
> +warranty.
> +
> +THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
> +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
> +FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
> +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
> +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
> +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
> +THIS SOFTWARE.
> +  
> +
> +  
> +
> +  Following the interfaces from:
> +  
> https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
> +
> +  This interface offers a way to create generic dmabuf-based
> +  wl_buffers. Immediately after a client binds to this interface,
> +  the set of supported formats is sent with 'format' events.
> +
> +
> +
> +   

Re: [PATCH 1/7] protocol: add linux_dmabuf extension RFCv1

2014-12-18 Thread Pekka Paalanen
On Thu, 18 Dec 2014 10:25:09 +0100
Daniel Vetter  wrote:

> On Fri, Dec 12, 2014 at 04:51:02PM -0500, Louis-Francis
> Ratté-Boulianne wrote:
> > From: Pekka Paalanen 
> > 
> > An experimental (hence the 'z' prefix) linux_dmabuf Wayland protocol
> > extension for creating dmabuf-based wl_buffers in a generic manner.
> > 
> > This does not include proper dmabuf metadata negotiation because
> > there is no way to communicate all dmabuf constraints from the
> > compositor to a client before-hand. The client has to create a
> > wl_buffer wrapping one or more dmabuf buffers and then listen at
> > the feedback object returned to know if the operation was
> > successful.
> > 
> > Signed-off-by: Pekka Paalanen 
> > Signed-off-by: Louis-Francis Ratté-Boulianne 
> 
> So I have no idea about how wayland protos work, so please take that
> into account ;-)

Hi Daniel,

very much appreciated anyway!

> Generally I think we should try to follow what the drm addfb2 ioctl
> does in drm, since in the end we need to be able to handle pretty
> much all the same issues. Well wayland needs to solve a few more
> since it also must cope with buffer layouts which can only be used
> for rendering but not scanned out.

Yes. The current proposal was written based on
https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
which has some differences compared to addfb2, like having only 3
planes instead of 4.

> Wrt tiling layouts and compressed buffers and similar vendor specific
> things: The current proposal is to add a new uint64_t layout
> qualifier to addfb with opaque #defines (probably a new header), with
> an 8:56 bit split between vendor identifier and opaque vendor
> specified content. It will also be per-buffer (like pitches/offsets).
> The abi isn't locked down yet, but definitely something to keep in
> mind.

Yup, I've seen it.

> It will definitely complicate the protocol though since the specific
> layout modifiers which are acceptable change dynamically at runtime:
> Some scanout formats become invalid when we run out of fifo space,
> some can only be used on specific planes and ofc this all depends
> upon whether gl compositing or hw planes are used to pick the right
> one.

From the Wayland compositor point of view, things would get awfully
hard if an existing wl_buffer (handle to a dmabuf object) could
suddenly become completely unusable. That is why we try to make sure
during the wl_buffer creation phase (when a client initially shares the
dmabuf with the compositor) that the buffer is always usable for at
least compositing (i.e. as a GL texture).

If the buffer is also usable for direct scanout, that's a nice bonus.
It's no problem to fall back to compositing if a buffer suddenly or
temporarily turns out to be not scanout-able.

We just need to guarantee that the compositing path always works. I
don't think we can say to a client "oops, go make a different kind of
buffer, this no longer works".

Do you think these expectations are realistic?

> 
> Some more random comments below.
> 
> Cheers, Daniel
> 
> > ---
> >  Makefile.am   |   7 +-
> >  protocol/linux-dmabuf.xml | 224
> > ++ 2 files changed, 229
> > insertions(+), 2 deletions(-) create mode 100644
> > protocol/linux-dmabuf.xml
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index 494266d..0462fdd 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -91,7 +91,9 @@ nodist_weston_SOURCES
> > =   \
> > protocol/presentation_timing-protocol.c \
> > protocol/presentation_timing-server-protocol.h  \
> > protocol/scaler-protocol.c  \
> > -   protocol/scaler-server-protocol.h
> > +   protocol/scaler-server-protocol.h   \
> > +   protocol/linux-dmabuf-protocol.c\
> > +   protocol/linux-dmabuf-server-protocol.h
> >  
> >  BUILT_SOURCES += $(nodist_weston_SOURCES)
> >  
> > @@ -1101,7 +1103,8 @@ EXTRA_DIST
> > +=  \
> > protocol/presentation_timing.xml\
> > protocol/scaler.xml \
> > protocol/ivi-application.xml\
> > -   protocol/ivi-hmi-controller.xml
> > +   protocol/ivi-hmi-controller.xml \
> > +   protocol/linux-dmabuf.xml
> >  
> >  man_MANS = weston.1 weston.ini.5
> >  
> > diff --git a/protocol/linux-dmabuf.xml b/protocol/linux-dmabuf.xml
> > new file mode 100644
> > index 000..c48121c
> > --- /dev/null
> > +++ b/protocol/linux-dmabuf.xml
> > @@ -0,0 +1,224 @@
> > +
> > +
> > +

> > +  
> > +
> > +  Following the interfaces from:
> > +
> > https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
> > +
> > +  This interface offers a way to create generic dmabuf-based
> > +  wl_buffers. Immediately after a client binds to this
> > interface,
> > +  the set of supported formats is sent with 'format' events.
> > +
> > +
> > +
> > +  
> > +  
> > 

Re: [PATCH v2] doc: two patches

2014-12-18 Thread Pekka Paalanen
On Wed, 17 Dec 2014 12:09:43 -0800
Bryce Harrington  wrote:

> On Tue, Dec 16, 2014 at 07:23:01PM -0800, Bill Spitzak wrote:
> > These supersede my previous patches for this.
> > 
> > The first bug fix has been updated to use macros like $(MKDIR_P)
> > 
> > The second one, which is a makefile cleanup, not a bug fix, has
> > been updated so that make distcheck works.
> 
> Think I may have already reviewed the earlier incarnation, but in any
> case, they still look good.
> 
> Reviewed-by: Bryce Harrington 

After the first patch, I had some build failure if I did:
$ make clean
$ make -j4
on a 4-core machine, but now after the 2nd patch, it no longer fails.
*shrug*

Both pushed, thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] doc: Make it easier to add a new doxygen page

2014-12-18 Thread Pekka Paalanen
On Tue, 16 Dec 2014 19:52:10 -0800
Bill Spitzak  wrote:

> This supersedes the previous one and fixes a typo where a slash was missing.

D'oh, I didn't notice this and pushed the earlier one. I pushed a fixup
as a follow-up.

Thanks,
pq

> The repetitive parts of generating the server and client documentation are
> merged, so it is easier to add another doxygen chapter: add a new line to
> $publican_sources in publican/Makefile.am, and a list of C source files to
> doxygen/Makefile.am.
> ---
>  doc/doxygen/Makefile.am  |   23 ---
>  doc/publican/Makefile.am |   32 
>  doc/publican/doxygen-to-publican.xsl |5 ++---
>  doc/publican/sources/Wayland.xml |4 ++--
>  4 files changed, 24 insertions(+), 40 deletions(-)
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland-web] Fix broken EGL_WL_bind_wayland_display link in architecture.html

2014-12-18 Thread Pekka Paalanen
On Tue, 16 Dec 2014 08:33:38 -0600
Derek Foreman  wrote:

> Signed-off-by: Derek Foreman 
> ---
>  architecture.html | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/architecture.html b/architecture.html
> index 4497674..6f3c554 100644
> --- a/architecture.html
> +++ b/architecture.html
> @@ -241,8 +241,7 @@ point where the change it affects appears on screen.
>hardware overlays if available.  Enabling modesetting, EGL/GLES2 and
>overlays is something that should be part of standard hardware
>bringup.  The extra requirement for Wayland enabling is
> -  the http://cgit.freedesktop.org/mesa/mesa/tree/docs/WL_bind_wayland_display.spec";>EGL_WL_bind_wayland_display
> +  the  href="http://cgit.freedesktop.org/mesa/mesa/tree/docs/specs/WL_bind_wayland_display.spec";>EGL_WL_bind_wayland_display
>extension that lets the compositor create an EGLImage from a generic
>Wayland shared buffer.  It's similar to
>the  href="http://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_image_pixmap.txt";>EGL_KHR_image_pixmap

Pushed, thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH v2] doc: two patches

2014-12-18 Thread Pekka Paalanen
On Tue, 16 Dec 2014 19:23:01 -0800
Bill Spitzak  wrote:

> These supersede my previous patches for this.
> 
> The first bug fix has been updated to use macros like $(MKDIR_P)
> 
> The second one, which is a makefile cleanup, not a bug fix, has
> been updated so that make distcheck works.
> 

Hi,

one of these patches causes one more warning to appear during build:

  GEN  en-US/ClientAPI.xml
warning: failed to load external entity 
"../../doc/doxygen/xml/Client/wayland-client_8h.xml"
warning: failed to load external entity 
"../../doc/doxygen/xml/Client/wayland-util_8h.xml"
  GEN  en-US/ServerAPI.xml
warning: failed to load external entity 
"../../doc/doxygen/xml/Server/wayland-server_8h.xml"
warning: failed to load external entity 
"../../doc/doxygen/xml/Server/wayland-util_8h.xml"


The warnings about wayland-client and wayland-server are old, the
warning about wayland-util is new.

When I diff the resulting (installed) HTML directories, the difference
is that after the patches, wl_list_*() and wl_array_*() functions are
no longer listed (undocumented) in the client or server appendices.
These are the functions that would be listed after wl_log().

We're not really losing anything there, I just wanted to let you know,
since I'm not sure this was intentional.


Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] doc: Reduce the validation errors of the docbook input

2014-12-18 Thread Pekka Paalanen
On Wed, 10 Dec 2014 16:53:01 -0800
Bryce Harrington  wrote:

> On Tue, Dec 09, 2014 at 07:33:51PM -0800, Bill Spitzak wrote:
> > This removes all the validation errors except for missing link
> > targets. You can test this by removing the --skip-validation
> > from doc/publican/Makefile.am.
> > 
> > Main changes are to add  to lists, remove some extra
> >  commands, and prefix all the id's so that collisions
> > between libclient and libserver are avoided.
> 
> I had to look up what a  was.  Still not entirely certain what
> the point of it vs. , but if it gets rid of validation errors, +1
> to that.  I suppose it must solve some layout issues.
> 
> Sounds like places where we are using  for regular text we should
> rather be using .
>  
> > The remaining errors are due to missing links, due to it not
> > copying doxygen's output for struct, union, and a macro. Turning
> > on HIDE_UNDOC in wayland.doxygen.in fixes a lot of these but
> > not all of them.
> > 
> > PS: it would be useful if somebody who actually knows something
> > about xslt would come up with a way to translate a block of text
> > makde of  commands unchanged, but add  around plain
> > text. Most of the difficulty is that doxygen's output is rather
> > inconsistent here.
> 
> Jon Cruz, are you listening?  ;-)
> 
> Anyway, the changes all look good to me.
> 
> Reviewed-by: Bryce Harrington 

The changes to Chapter 4 are nice.

The changes to Appendix A seem to be lacking somewhat, we get things
like:

callback_data
Type: uintrequest-specific data for the wl_callback

There should be some separation between the type and the explanation.
There used to be  tags, but now there is nothing.

In Appendices B and C I did not notice any breakage.

Could you revise this patch to fix that one issue?


I think this patch does too many things in one go, the para changes are
not related for the id namespacing, are they?


Thanks,
pq

> 
> > ---
> >  doc/publican/doxygen-to-publican.xsl|   44 
> > +--
> >  doc/publican/protocol-interfaces-to-docbook.xsl |8 +++--
> >  doc/publican/protocol-to-docbook.xsl|   10 +++---
> >  3 files changed, 27 insertions(+), 35 deletions(-)
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput v3 2/2] Added configure option for documentation build.

2014-12-18 Thread Jon A. Cruz
Added option with fallback of 'auto' to control building of documentation.

Signed-off-by: Jon A. Cruz 
---
 configure.ac| 72 ++---
 doc/Makefile.am |  2 +-
 2 files changed, 55 insertions(+), 19 deletions(-)

diff --git a/configure.ac b/configure.ac
index 329f224..ef26b21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,7 @@ AM_SILENT_RULES([yes])
 # Check for programs
 AC_PROG_CC_C99
 AC_PROG_CXX # Only used by build C++ test
+AC_PROG_GREP
 
 # Initialize libtool
 LT_PREREQ([2.2])
@@ -67,23 +68,58 @@ fi
 AC_SUBST(GCC_CFLAGS)
 AC_SUBST(GCC_CXXFLAGS)
 
-AC_PATH_PROG(DOXYGEN, [doxygen])
-if test "x$DOXYGEN" = "x"; then
-   AC_MSG_WARN([doxygen not found - required for documentation])
-   have_doxygen="no"
-else
-   have_doxygen="yes"
-fi
-AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$have_doxygen" = "xyes"])
-
-AC_PATH_PROG(DOT, dot)
-if test "x$DOT" = "x"; then
-   AC_MSG_WARN([Graphviz's dot not found - required for documentation])
-   have_dot="no"
-else
-   have_dot="yes"
+AC_ARG_ENABLE([documentation],
+ [AC_HELP_STRING([--enable-documentation],
+ [Enable building the documentation 
(default=auto)])],
+ [build_documentation="$enableval"],
+ [build_documentation="auto"])
+
+if test "x$build_documentation" = "xyes" -o "x$build_documentation" = "xauto"; 
then
+   AC_PATH_PROG(DOXYGEN, doxygen)
+   if test "x$DOXYGEN" = "x"; then
+   if test "x$build_documentation" = "xyes"; then
+   AC_MSG_ERROR([Documentation build requested but doxygen 
not found. Install doxygen or disable the documentation using 
--disable-documentation])
+   fi
+   else
+   AC_MSG_CHECKING([for compatible doxygen version])
+   doxygen_version=`$DOXYGEN --version`
+   AS_VERSION_COMPARE([$doxygen_version], [1.6.0],
+  [AC_MSG_RESULT([no])
+   DOXYGEN=""],
+  [AC_MSG_RESULT([yes])],
+  [AC_MSG_RESULT([yes])])
+   if test "x$DOXYGEN" = "x" -a "x$build_documentation" = "xyes"; 
then
+   AC_MSG_ERROR([Doxygen $doxygen_version too old. Doxygen 
1.6+ required for documentation build. Install required doxygen version or 
disable the documentation using --disable-documentation])
+   fi
+   fi
+
+   AC_PATH_PROG(DOT, dot)
+   if test "x$DOT" = "x"; then
+   if test "x$build_documentation" = "xyes"; then
+   AC_MSG_ERROR([Documentation build requested but 
graphviz's dot not found. Install graphviz or disable the documentation using 
--disable-documentation])
+   fi
+   else
+   AC_MSG_CHECKING([for compatible dot version])
+   dot_version=`$DOT -V 2>&1|$GREP -oP 
'(?<=version\W)@<:@0-9.@:>@*(?=\W(.*))'`
+   AS_VERSION_COMPARE([$dot_version], [2.26.0],
+  [AC_MSG_RESULT([no])
+   DOT=""],
+  [AC_MSG_RESULT([yes])],
+  [AC_MSG_RESULT([yes])])
+   if test "x$DOT" = "x" -a "x$build_documentation" = "xyes"; then
+   AC_MSG_ERROR([Graphviz dot $dot_version too old. 
Graphviz 2.26+ required for documentation build. Install required graphviz 
version or disable the documentation using --disable-documentation])
+   fi
+   fi
+
+   if test "x$DOXYGEN" != "x" -a "x$DOT" != "x"; then
+   AC_CONFIG_FILES([
+   doc/libinput.doxygen
+   ])
+   build_documentation="yes"
+   else
+   build_documentation="no"
+   fi
 fi
-AM_CONDITIONAL([HAVE_DOT], [test "x$have_dot" = "xyes"])
 
 AC_ARG_ENABLE(event-gui,
  AS_HELP_STRING([--enable-event-gui], [Build the GUI event viewer 
(default=auto)]),
@@ -120,10 +156,10 @@ fi
 
 AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
 AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"])
+AM_CONDITIONAL(BUILD_DOCS, [test "x$build_documentation" = "xyes"])
 
 AC_CONFIG_FILES([Makefile
 doc/Makefile
-doc/libinput.doxygen
 src/Makefile
 src/libinput.pc
 src/libinput-version.h
@@ -134,7 +170,7 @@ AC_OUTPUT
 AC_MSG_RESULT([
Prefix  ${prefix}
 
-   Build documentation ${have_doxygen}
+   Build documentation ${build_documentation}
Build tests ${build_tests}
Tests use valgrind  ${VALGRIND}
Build GUI event tool${build_eventgui}
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 624326b..30f6089 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,6 @@
 EXTRA_DIST = touchpad-tap-state-machine.svg 
tou

[PATCH libinput v3 1/2] Initial move of some wiki contents into main documentation.

2014-12-18 Thread Jon A. Cruz
This moves some information from the wiki into the main generated doxygen
documenation. It is fairly rought but includes examples for inline and
stand-alone diagrams, linking to external HTML pages, etc.

Among other things, it allows for better cross-referencing into the
main doxygen contents and thus for overall shorter documentation.

Signed-off-by: Jon A. Cruz 
---
 configure.ac |  9 ++
 doc/Makefile.am  | 18 +---
 doc/absolute-axes.dox| 64 ++
 doc/clickpad-softbuttons.dox | 67 
 doc/dot/seats-sketch.gv  | 41 +++
 doc/seats.dox| 10 +++
 doc/t440-support.dox | 66 +++
 7 files changed, 271 insertions(+), 4 deletions(-)
 create mode 100644 doc/absolute-axes.dox
 create mode 100644 doc/clickpad-softbuttons.dox
 create mode 100644 doc/dot/seats-sketch.gv
 create mode 100644 doc/seats.dox
 create mode 100644 doc/t440-support.dox

diff --git a/configure.ac b/configure.ac
index 33e380c..329f224 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,15 @@ else
 fi
 AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$have_doxygen" = "xyes"])
 
+AC_PATH_PROG(DOT, dot)
+if test "x$DOT" = "x"; then
+   AC_MSG_WARN([Graphviz's dot not found - required for documentation])
+   have_dot="no"
+else
+   have_dot="yes"
+fi
+AM_CONDITIONAL([HAVE_DOT], [test "x$have_dot" = "xyes"])
+
 AC_ARG_ENABLE(event-gui,
  AS_HELP_STRING([--enable-event-gui], [Build the GUI event viewer 
(default=auto)]),
  [build_eventgui="$enableval"],
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8f05bd2..624326b 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -6,10 +6,20 @@ noinst_DATA = html/index.html
 
 header_files = \
$(top_srcdir)/src/libinput.h \
-   $(top_srcdir)/README.txt
-
-html/index.html: libinput.doxygen $(header_files)
-   $(AM_V_GEN)$(DOXYGEN) $<
+   $(top_srcdir)/README.txt \
+   $(srcdir)/absolute-axes.dox \
+   $(srcdir)/clickpad-softbuttons.dox \
+   $(srcdir)/seats.dox \
+   $(srcdir)/t440-support.dox
+
+diagram_files = \
+   $(srcdir)/dot/seats-sketch.gv
+
+html/index.html: libinput.doxygen $(header_files) $(diagram_files)
+   $(AM_V_GEN)(cat $<; \
+  echo "INPUT = $(header_files)"; \
+  echo "DOTFILE_DIRS = $(srcdir)/dot"; \
+  ) | $(DOXYGEN) -
 
 clean-local:
$(AM_V_at)rm -rf html
diff --git a/doc/absolute-axes.dox b/doc/absolute-axes.dox
new file mode 100644
index 000..ee04113
--- /dev/null
+++ b/doc/absolute-axes.dox
@@ -0,0 +1,64 @@
+/**
+@page absolute_axes Absolute Axes in libinput
+
+Devices with absolute axes are those that send positioning data for an axis in
+a device-specific coordinate range, defined by a minimum and a maximum value.
+Compare this to relative devices (e.g. a mouse) that can only detect
+directional data, not positional data.
+
+libinput supports three types of devices with absolute axes:
+
+ - multi-touch screens
+ - single-touch screens
+ - graphics tablets (currently WIP)
+
+Touchpads are technically absolute devices, but the axis values are converted
+to directional motion and posted as relative events. Touchpads do not count
+as absolute devices in libinput.
+
+For all absolute devices in libinput, the default unit for x/y coordinates is
+in mm off the top left corner on the device, or more specifically off the
+device's sensor, see @ref index "the API doc"
+
+@section absolute_axes_nonorm Why x/y coordinates are not normalized
+
+x/y are not given in @ref motion_normalization "normalized coordinates"
+([0..1]) for one simple reason: the aspect ratio of virtually all current
+devices is something other than 1:1. A normalized axes thus is only useful to
+determine that the stylus is e.g. at 78% from the left, 34% from the top of
+the device. Without knowing the per-axis resolution, these numbers are
+meaningless. Worse, calculation based on previous coordinates is simply wrong:
+a movement from 0/0 to 50%/50% is not a 45% degree line.
+
+This could be alleviated by providing resolution and information about the
+aspect ratio to the caller. Which shifts processing and likely errors into the
+caller for little benefit. Providing the x/y axes in mm from the outset
+removes these errors.
+
+@section absolute_axes_handling Handling of absolute coordinates
+
+In most use-cases, absolute input devices are mapped to a single screen. For
+direct input devices such as touchscreens the aspect ratio of the screen and
+the device match. Mapping the input device position to the output position is
+thus a simple mapping between two coordinates. libinput provides the API for
+this with
+
+- libinput_event_pointer_get_absolute_x_transformed() for pointer events
+- libinput_event_touch_get_x_transformed() for touch events
+
+See @ref index "the API doc" for more details.

[PATCH libinput v3 0/2] Moving wiki contents into doxygen.

2014-12-18 Thread Jon A. Cruz
Initial round of moving certain wiki contents into doxygen build.

Jon A. Cruz (2):
  Initial move of some wiki contents into main documentation.
  Added configure option for documentation build.

 configure.ac | 63 +++--
 doc/Makefile.am  | 20 +
 doc/absolute-axes.dox| 64 ++
 doc/clickpad-softbuttons.dox | 67 
 doc/dot/seats-sketch.gv  | 41 +++
 doc/seats.dox| 10 +++
 doc/t440-support.dox | 66 +++
 7 files changed, 317 insertions(+), 14 deletions(-)
 create mode 100644 doc/absolute-axes.dox
 create mode 100644 doc/clickpad-softbuttons.dox
 create mode 100644 doc/dot/seats-sketch.gv
 create mode 100644 doc/seats.dox
 create mode 100644 doc/t440-support.dox

-- 
1.9.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH v2 weston] editor: Make editor multi-seat aware

2014-12-18 Thread Jan Arne Petersen
Hey,

On Wed Dec 17 2014 at 4:53:24 PM Derek Foreman 
wrote:

> With multi-seat, multiple entries can occur on the text inputs in the
> editor.  Also, the panel shouldn't be hidden by the editor if either
> text entry is still active.
>
> Signed-off-by: Derek Foreman 
> ---
> Removed the "sibling" stuff
>
>  clients/editor.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
>
Looks good now.

Regards
Jan Arne
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH v2] doc: two patches

2014-12-18 Thread Bill Spitzak



On 12/18/2014 05:56 AM, Pekka Paalanen wrote:

On Tue, 16 Dec 2014 19:23:01 -0800
Bill Spitzak  wrote:


These supersede my previous patches for this.

The first bug fix has been updated to use macros like $(MKDIR_P)

The second one, which is a makefile cleanup, not a bug fix, has
been updated so that make distcheck works.



Hi,

one of these patches causes one more warning to appear during build:

   GEN  en-US/ClientAPI.xml
warning: failed to load external entity 
"../../doc/doxygen/xml/Client/wayland-client_8h.xml"
warning: failed to load external entity 
"../../doc/doxygen/xml/Client/wayland-util_8h.xml"
   GEN  en-US/ServerAPI.xml
warning: failed to load external entity 
"../../doc/doxygen/xml/Server/wayland-server_8h.xml"
warning: failed to load external entity 
"../../doc/doxygen/xml/Server/wayland-util_8h.xml"


The warnings about wayland-client and wayland-server are old, the
warning about wayland-util is new.

When I diff the resulting (installed) HTML directories, the difference
is that after the patches, wl_list_*() and wl_array_*() functions are
no longer listed (undocumented) in the client or server appendices.
These are the functions that would be listed after wl_log().

We're not really losing anything there, I just wanted to let you know,
since I'm not sure this was intentional.


I think you are right, the older version only moved client_8h and 
server_8h out of the way, my version moves *_8h and thus also moves util_8h.


However I did not lose the documentation for the wl_list and wl_array 
functions, and in fact I am working on some more modifications that move 
these next to the objects and I added a lot of \memberof comments to fix 
this. May depend on Doxygen version? I am running 1.7.6, but can test 
1.8.6 as well, I will try this next.

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput v3 2/2] Added configure option for documentation build.

2014-12-18 Thread Peter Hutterer
On Thu, Dec 18, 2014 at 10:49:59AM -0800, Jon A. Cruz wrote:
> Added option with fallback of 'auto' to control building of documentation.
> 
> Signed-off-by: Jon A. Cruz 
> ---
>  configure.ac| 72 
> ++---
>  doc/Makefile.am |  2 +-
>  2 files changed, 55 insertions(+), 19 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 329f224..ef26b21 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -38,6 +38,7 @@ AM_SILENT_RULES([yes])
>  # Check for programs
>  AC_PROG_CC_C99
>  AC_PROG_CXX # Only used by build C++ test
> +AC_PROG_GREP
>  
>  # Initialize libtool
>  LT_PREREQ([2.2])
> @@ -67,23 +68,58 @@ fi
>  AC_SUBST(GCC_CFLAGS)
>  AC_SUBST(GCC_CXXFLAGS)

[...]

> +
> + if test "x$DOXYGEN" != "x" -a "x$DOT" != "x"; then
> + AC_CONFIG_FILES([
> + doc/libinput.doxygen
> + ])

that's quite unusual. libinput.doxygen itself has no dependency on
dot or doxygen, so I don't think moving this here is helpful, it just hides
it away from a known location. ACK to the rest of the patch, I'll just move
this bit back to AC_CONFIG_FILES before pushing.

fwiw, if we had a dependency, I'd still prefer this to be through a variable
so that all AC_CONFIG_FILES are still in a single list:
 AC_CONFIG_FILES([src/Makefile.am
  $someconditionalthing
  doc/Makefile.am])

Thanks for the patch. I'll get to improving the docs asap.

Cheers,
   Peter

> + build_documentation="yes"
> + else
> + build_documentation="no"
> + fi

>  fi
> -AM_CONDITIONAL([HAVE_DOT], [test "x$have_dot" = "xyes"])
>  
>  AC_ARG_ENABLE(event-gui,
> AS_HELP_STRING([--enable-event-gui], [Build the GUI event viewer 
> (default=auto)]),
> @@ -120,10 +156,10 @@ fi
>  
>  AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
>  AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"])
> +AM_CONDITIONAL(BUILD_DOCS, [test "x$build_documentation" = "xyes"])
>  
>  AC_CONFIG_FILES([Makefile
>doc/Makefile
> -  doc/libinput.doxygen
>src/Makefile
>src/libinput.pc
>src/libinput-version.h
> @@ -134,7 +170,7 @@ AC_OUTPUT
>  AC_MSG_RESULT([
>   Prefix  ${prefix}
>  
> - Build documentation ${have_doxygen}
> + Build documentation ${build_documentation}
>   Build tests ${build_tests}
>   Tests use valgrind  ${VALGRIND}
>   Build GUI event tool${build_eventgui}
> diff --git a/doc/Makefile.am b/doc/Makefile.am
> index 624326b..30f6089 100644
> --- a/doc/Makefile.am
> +++ b/doc/Makefile.am
> @@ -1,6 +1,6 @@
>  EXTRA_DIST = touchpad-tap-state-machine.svg 
> touchpad-softbutton-state-machine.svg
>  
> -if HAVE_DOXYGEN
> +if BUILD_DOCS
>  
>  noinst_DATA = html/index.html
>  
> -- 
> 1.9.1
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput v3 2/2] Added configure option for documentation build.

2014-12-18 Thread Jon A. Cruz
On 12/18/2014 02:30 PM, Peter Hutterer wrote:
> 
> that's quite unusual. libinput.doxygen itself has no dependency on
> dot or doxygen, so I don't think moving this here is helpful, it just hides
> it away from a known location. ACK to the rest of the patch, I'll just move
> this bit back to AC_CONFIG_FILES before pushing.
> 
> fwiw, if we had a dependency, I'd still prefer this to be through a variable
> so that all AC_CONFIG_FILES are still in a single list:
>  AC_CONFIG_FILES([src/Makefile.am
>   $someconditionalthing
>   doc/Makefile.am])
> 

No problem. I'd just seen that in a few of the more common examples in
the wild where =auto had been used.

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 1/8] tools: make event-debug's option parsing more flexible

2014-12-18 Thread Peter Hutterer
We need to be able to turn config options on/off for testing, so switch to
something that's a bit more flexible than characters that represent the
options.

Signed-off-by: Peter Hutterer 
---
 tools/event-debug.c | 22 +++---
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/tools/event-debug.c b/tools/event-debug.c
index 3e4981b..1be3e14 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -61,6 +61,13 @@ usage(void)
program_invocation_short_name);
 }
 
+enum options {
+   OPT_DEVICE,
+   OPT_UDEV,
+   OPT_HELP,
+   OPT_VERBOSE,
+};
+
 static int
 parse_args(int argc, char **argv)
 {
@@ -68,10 +75,10 @@ parse_args(int argc, char **argv)
int c;
int option_index = 0;
static struct option opts[] = {
-   { "device", 1, 0, 'd' },
-   { "udev", 0, 0, 'u' },
-   { "help", 0, 0, 'h' },
-   { "verbose", 0, 0, 'v'},
+   { "device", 1, 0, OPT_DEVICE },
+   { "udev", 0, 0, OPT_UDEV },
+   { "help", 0, 0, OPT_HELP },
+   { "verbose", 0, 0, OPT_VERBOSE },
{ 0, 0, 0, 0}
};
 
@@ -81,9 +88,10 @@ parse_args(int argc, char **argv)
 
switch(c) {
case 'h': /* --help */
+   case OPT_HELP:
usage();
exit(0);
-   case 'd': /* --device */
+   case OPT_DEVICE: /* --device */
mode = MODE_DEVICE;
if (!optarg) {
usage();
@@ -91,12 +99,12 @@ parse_args(int argc, char **argv)
}
device = optarg;
break;
-   case 'u': /* --udev */
+   case OPT_UDEV: /* --udev */
mode = MODE_UDEV;
if (optarg)
seat = optarg;
break;
-   case 'v': /* --verbose */
+   case OPT_VERBOSE: /* --verbose */
verbose = 1;
break;
default:
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 5/8] tools: move applying device configuration to shared lib

2014-12-18 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 tools/event-debug.c | 10 ++
 tools/shared.c  |  8 
 tools/shared.h  |  3 ++-
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/tools/event-debug.c b/tools/event-debug.c
index b8be215..ffc9a13 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -261,13 +261,6 @@ print_touch_event_with_coords(struct libinput_event *ev)
   xmm, ymm);
 }
 
-static void
-setup_device(struct libinput_device *device)
-{
-   if (options.tapping != -1)
-   libinput_device_config_tap_set_enabled(device, options.tapping);
-}
-
 static int
 handle_and_print_events(struct libinput *li)
 {
@@ -284,7 +277,8 @@ handle_and_print_events(struct libinput *li)
case LIBINPUT_EVENT_DEVICE_ADDED:
case LIBINPUT_EVENT_DEVICE_REMOVED:
print_device_notify(ev);
-   setup_device(libinput_event_get_device(ev));
+   tools_device_apply_config(libinput_event_get_device(ev),
+ &options);
break;
case LIBINPUT_EVENT_KEYBOARD_KEY:
print_key_event(ev);
diff --git a/tools/shared.c b/tools/shared.c
index f8ceb34..bd8fd11 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -222,3 +222,11 @@ tools_open_backend(struct tools_options *options,
 
return li;
 }
+
+void
+tools_device_apply_config(struct libinput_device *device,
+ struct tools_options *options)
+{
+   if (options->tapping != -1)
+   libinput_device_config_tap_set_enabled(device, 
options->tapping);
+}
diff --git a/tools/shared.h b/tools/shared.h
index 04d1369..71a3b36 100644
--- a/tools/shared.h
+++ b/tools/shared.h
@@ -43,7 +43,8 @@ void tools_init_options(struct tools_options *options);
 int tools_parse_args(int argc, char **argv, struct tools_options *options);
 struct libinput* tools_open_backend(struct tools_options *options,
const struct libinput_interface *interface);
-
+void tools_device_apply_config(struct libinput_device *device,
+  struct tools_options *options);
 void tools_usage();
 
 #endif
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 4/8] tools: move opening the backend to the shared lib too

2014-12-18 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 tools/event-debug.c | 79 ++
 tools/shared.c  | 91 +
 tools/shared.h  |  4 +++
 3 files changed, 98 insertions(+), 76 deletions(-)

diff --git a/tools/event-debug.c b/tools/event-debug.c
index 184c68f..b8be215 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -38,8 +38,6 @@
 
 #include "shared.h"
 
-static const char *device;
-static struct udev *udev;
 uint32_t start_time;
 static const uint32_t screen_width = 100;
 static const uint32_t screen_height = 100;
@@ -64,70 +62,6 @@ static const struct libinput_interface interface = {
 };
 
 static void
-log_handler(struct libinput *li,
-   enum libinput_log_priority priority,
-   const char *format,
-   va_list args)
-{
-   vprintf(format, args);
-}
-
-static int
-open_udev(struct libinput **li)
-{
-   udev = udev_new();
-   if (!udev) {
-   fprintf(stderr, "Failed to initialize udev\n");
-   return 1;
-   }
-
-   *li = libinput_udev_create_context(&interface, NULL, udev);
-   if (!*li) {
-   fprintf(stderr, "Failed to initialize context from udev\n");
-   return 1;
-   }
-
-   if (options.verbose) {
-   libinput_log_set_handler(*li, log_handler);
-   libinput_log_set_priority(*li, LIBINPUT_LOG_PRIORITY_DEBUG);
-   }
-
-   if (libinput_udev_assign_seat(*li, options.seat)) {
-   fprintf(stderr, "Failed to set seat\n");
-   libinput_unref(*li);
-   return 1;
-   }
-
-   return 0;
-}
-
-static int
-open_device(struct libinput **li, const char *path)
-{
-   struct libinput_device *device;
-
-   *li = libinput_path_create_context(&interface, NULL);
-   if (!*li) {
-   fprintf(stderr, "Failed to initialize context from %s\n", path);
-   return 1;
-   }
-
-   if (options.verbose) {
-   libinput_log_set_handler(*li, log_handler);
-   libinput_log_set_priority(*li, LIBINPUT_LOG_PRIORITY_DEBUG);
-   }
-
-   device = libinput_path_add_device(*li, path);
-   if (!device) {
-   fprintf(stderr, "Failed to initialized device %s\n", path);
-   libinput_unref(*li);
-   return 1;
-   }
-
-   return 0;
-}
-
-static void
 print_event_header(struct libinput_event *ev)
 {
struct libinput_device *dev = libinput_event_get_device(ev);
@@ -440,14 +374,9 @@ main(int argc, char **argv)
if (tools_parse_args(argc, argv, &options))
return 1;
 
-   if (options.backend == BACKEND_UDEV) {
-   if (open_udev(&li))
-   return 1;
-   } else if (options.backend == BACKEND_DEVICE) {
-   if (open_device(&li, device))
-   return 1;
-   } else
-   abort();
+   li = tools_open_backend(&options, &interface);
+   if (!li)
+   return 1;
 
clock_gettime(CLOCK_MONOTONIC, &tp);
start_time = tp.tv_sec * 1000 + tp.tv_nsec / 100;
@@ -455,8 +384,6 @@ main(int argc, char **argv)
mainloop(li);
 
libinput_unref(li);
-   if (udev)
-   udev_unref(udev);
 
return 0;
 }
diff --git a/tools/shared.c b/tools/shared.c
index 17a9673..f8ceb34 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "shared.h"
 
@@ -40,6 +41,15 @@ enum options {
OPT_TAP_DISABLE,
 };
 
+static void
+log_handler(struct libinput *li,
+   enum libinput_log_priority priority,
+   const char *format,
+   va_list args)
+{
+   vprintf(format, args);
+}
+
 void
 tools_usage()
 {
@@ -131,3 +141,84 @@ tools_parse_args(int argc, char **argv, struct 
tools_options *options)
 
return 0;
 }
+
+static struct libinput *
+open_udev(const struct libinput_interface *interface,
+ const char *seat,
+ int verbose)
+{
+   struct libinput *li;
+   struct udev *udev = udev_new();
+
+   if (!udev) {
+   fprintf(stderr, "Failed to initialize udev\n");
+   return NULL;
+   }
+
+   li = libinput_udev_create_context(interface, NULL, udev);
+   if (!li) {
+   fprintf(stderr, "Failed to initialize context from udev\n");
+   goto out;
+   }
+
+   if (verbose) {
+   libinput_log_set_handler(li, log_handler);
+   libinput_log_set_priority(li, LIBINPUT_LOG_PRIORITY_DEBUG);
+   }
+
+   if (libinput_udev_assign_seat(li, seat)) {
+   fprintf(stderr, "Failed to set seat\n");
+   libinput_unref(li);
+   li = NULL;
+   goto out;
+   }
+
+out:
+   udev_unref(udev);
+   return li;
+}
+
+static struct libinput *
+open_device(const struct libinput_interfa

[PATCH libinput 2/8] tools: add --enable-tap to event-debug

2014-12-18 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 tools/event-debug.c | 36 
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/tools/event-debug.c b/tools/event-debug.c
index 1be3e14..b6b7140 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -48,16 +48,26 @@ uint32_t start_time;
 static const uint32_t screen_width = 100;
 static const uint32_t screen_height = 100;
 static int verbose = 0;
+static int tapping = -1;
 
 static void
 usage(void)
 {
-   printf("Usage: %s [--verbose] [--udev []|--device 
/dev/input/event0]\n"
-  "--verbose ... Print debugging output.\n"
-  "--help .. Print this help.\n"
+   printf("Usage: %s [options] [--udev []|--device 
/dev/input/event0]\n"
   "--udev  Use udev device discovery (default).\n"
   "  Specifying a seat ID is optional.\n"
-  "--device /path/to/device  open the given device only\n",
+  "--device /path/to/device  open the given device only\n"
+  "\n"
+  "Features:\n"
+  "--enable-tap\n"
+  "--disable-tap enable/disable tapping\n"
+  "\n"
+  "These options apply to all applicable devices, if a feature\n"
+  "is not explicitly specified it is left at each device's 
default.\n"
+  "\n"
+  "Other options:\n"
+  "--verbose ... Print debugging output.\n"
+  "--help .. Print this help.\n",
program_invocation_short_name);
 }
 
@@ -66,6 +76,8 @@ enum options {
OPT_UDEV,
OPT_HELP,
OPT_VERBOSE,
+   OPT_TAP_ENABLE,
+   OPT_TAP_DISABLE,
 };
 
 static int
@@ -79,6 +91,8 @@ parse_args(int argc, char **argv)
{ "udev", 0, 0, OPT_UDEV },
{ "help", 0, 0, OPT_HELP },
{ "verbose", 0, 0, OPT_VERBOSE },
+   { "enable-tap", 0, 0, OPT_TAP_ENABLE },
+   { "disable-tap", 0, 0, OPT_TAP_DISABLE },
{ 0, 0, 0, 0}
};
 
@@ -107,6 +121,12 @@ parse_args(int argc, char **argv)
case OPT_VERBOSE: /* --verbose */
verbose = 1;
break;
+   case OPT_TAP_ENABLE:
+   tapping = 1;
+   break;
+   case OPT_TAP_DISABLE:
+   tapping = 0;
+   break;
default:
usage();
return 1;
@@ -404,6 +424,13 @@ print_touch_event_with_coords(struct libinput_event *ev)
   xmm, ymm);
 }
 
+static void
+setup_device(struct libinput_device *device)
+{
+   if (tapping != -1)
+   libinput_device_config_tap_set_enabled(device, tapping);
+}
+
 static int
 handle_and_print_events(struct libinput *li)
 {
@@ -420,6 +447,7 @@ handle_and_print_events(struct libinput *li)
case LIBINPUT_EVENT_DEVICE_ADDED:
case LIBINPUT_EVENT_DEVICE_REMOVED:
print_device_notify(ev);
+   setup_device(libinput_event_get_device(ev));
break;
case LIBINPUT_EVENT_KEYBOARD_KEY:
print_key_event(ev);
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 6/8] tools: add support to enable/disable natural scrolling

2014-12-18 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 tools/shared.c | 16 
 tools/shared.h |  1 +
 2 files changed, 17 insertions(+)

diff --git a/tools/shared.c b/tools/shared.c
index bd8fd11..623005e 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -39,6 +39,8 @@ enum options {
OPT_VERBOSE,
OPT_TAP_ENABLE,
OPT_TAP_DISABLE,
+   OPT_NATURAL_SCROLL_ENABLE,
+   OPT_NATURAL_SCROLL_DISABLE,
 };
 
 static void
@@ -61,6 +63,8 @@ tools_usage()
   "Features:\n"
   "--enable-tap\n"
   "--disable-tap enable/disable tapping\n"
+  "--enable-natural-scrolling\n"
+  "--disable-natural-scrolling enable/disable natural 
scrolling\n"
   "\n"
   "These options apply to all applicable devices, if a feature\n"
   "is not explicitly specified it is left at each device's 
default.\n"
@@ -76,6 +80,7 @@ tools_init_options(struct tools_options *options)
 {
memset(options, 0, sizeof(*options));
options->tapping = -1;
+   options->natural_scroll = -1;
options->backend = BACKEND_UDEV;
options->seat = "seat0";
 }
@@ -93,6 +98,8 @@ tools_parse_args(int argc, char **argv, struct tools_options 
*options)
{ "verbose", 0, 0, OPT_VERBOSE },
{ "enable-tap", 0, 0, OPT_TAP_ENABLE },
{ "disable-tap", 0, 0, OPT_TAP_DISABLE },
+   { "enable-natural-scrolling", 0, 0, 
OPT_NATURAL_SCROLL_ENABLE },
+   { "disable-natural-scrolling", 0, 0, 
OPT_NATURAL_SCROLL_DISABLE },
{ 0, 0, 0, 0}
};
 
@@ -127,6 +134,12 @@ tools_parse_args(int argc, char **argv, struct 
tools_options *options)
case OPT_TAP_DISABLE:
options->tapping = 0;
break;
+   case OPT_NATURAL_SCROLL_ENABLE:
+   options->natural_scroll = 1;
+   break;
+   case OPT_NATURAL_SCROLL_DISABLE:
+   options->natural_scroll = 0;
+   break;
default:
tools_usage();
return 1;
@@ -229,4 +242,7 @@ tools_device_apply_config(struct libinput_device *device,
 {
if (options->tapping != -1)
libinput_device_config_tap_set_enabled(device, 
options->tapping);
+   if (options->natural_scroll != -1)
+   libinput_device_config_scroll_set_natural_scroll_enabled(device,
+
options->natural_scroll);
 }
diff --git a/tools/shared.h b/tools/shared.h
index 71a3b36..e33fe04 100644
--- a/tools/shared.h
+++ b/tools/shared.h
@@ -37,6 +37,7 @@ struct tools_options {
 
int verbose;
int tapping;
+   int natural_scroll;
 };
 
 void tools_init_options(struct tools_options *options);
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 8/8] tools: use the new shared lib from event-gui

2014-12-18 Thread Peter Hutterer
This gives the event gui the ability to use the path backend, and any
configuration toggles given on the commandline.

Signed-off-by: Peter Hutterer 
---
 tools/Makefile.am |  2 +-
 tools/event-gui.c | 50 ++
 2 files changed, 11 insertions(+), 41 deletions(-)

diff --git a/tools/Makefile.am b/tools/Makefile.am
index 6dd64c9..cebcd72 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -18,7 +18,7 @@ if BUILD_EVENTGUI
 noinst_PROGRAMS += event-gui
 
 event_gui_SOURCES = event-gui.c
-event_gui_LDADD = ../src/libinput.la $(CAIRO_LIBS) $(GTK_LIBS) $(LIBUDEV_LIBS)
+event_gui_LDADD = ../src/libinput.la libshared.la $(CAIRO_LIBS) $(GTK_LIBS) 
$(LIBUDEV_LIBS)
 event_gui_CFLAGS = $(CAIRO_CFLAGS) $(GTK_CFLAGS) $(LIBUDEV_CFLAGS)
 event_gui_LDFLAGS = -no-install
 endif
diff --git a/tools/event-gui.c b/tools/event-gui.c
index b6d21b6..b950f92 100644
--- a/tools/event-gui.c
+++ b/tools/event-gui.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -40,8 +39,12 @@
 #include 
 #include 
 
+#include "shared.h"
+
 #define clip(val_, min_, max_) min((max_), max((min_), (val_)))
 
+struct tools_options options;
+
 struct touch {
int active;
int x, y;
@@ -95,12 +98,6 @@ msg(const char *fmt, ...)
va_end(args);
 }
 
-static void
-usage(void)
-{
-   printf("%s [path/to/device]\n", program_invocation_short_name);
-}
-
 static gboolean
 draw(GtkWidget *widget, cairo_t *cr, gpointer data)
 {
@@ -491,35 +488,6 @@ sockets_init(struct libinput *li)
 }
 
 static int
-parse_opts(int argc, char *argv[])
-{
-   while (1) {
-   static struct option long_options[] = {
-   { "help", no_argument, 0, 'h' },
-   };
-
-   int option_index = 0;
-   int c;
-
-   c = getopt_long(argc, argv, "h", long_options,
-   &option_index);
-   if (c == -1)
-   break;
-
-   switch(c) {
-   case 'h':
-   usage();
-   return 0;
-   default:
-   usage();
-   return 1;
-   }
-   }
-
-   return 0;
-}
-
-static int
 open_restricted(const char *path, int flags, void *user_data)
 {
int fd = open(path, flags);
@@ -546,16 +514,18 @@ main(int argc, char *argv[])
 
gtk_init(&argc, &argv);
 
-   if (parse_opts(argc, argv) != 0)
+   tools_init_options(&options);
+
+   if (tools_parse_args(argc, argv, &options) != 0)
return 1;
 
udev = udev_new();
if (!udev)
error("Failed to initialize udev\n");
 
-   li = libinput_udev_create_context(&interface, &w, udev);
-   if (!li || libinput_udev_assign_seat(li, "seat0") != 0)
-   error("Failed to initialize context from udev\n");
+   li = tools_open_backend(&options, &interface);
+   if (!li)
+   return 1;
 
window_init(&w);
sockets_init(li);
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 3/8] tools: move option parsing to a helper library

2014-12-18 Thread Peter Hutterer
event-debug and event-gui can and should share this

Signed-off-by: Peter Hutterer 
---
 tools/Makefile.am   |   8 +++-
 tools/event-debug.c | 121 +--
 tools/shared.c  | 133 
 tools/shared.h  |  45 ++
 4 files changed, 198 insertions(+), 109 deletions(-)
 create mode 100644 tools/shared.c
 create mode 100644 tools/shared.h

diff --git a/tools/Makefile.am b/tools/Makefile.am
index aadd874..6dd64c9 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,10 +1,16 @@
 noinst_PROGRAMS = event-debug
+noinst_LTLIBRARIES = libshared.la
 
 AM_CPPFLAGS = -I$(top_srcdir)/include \
   -I$(top_srcdir)/src
 
+
+libshared_la_SOURCES = \
+  shared.c \
+  shared.h
+
 event_debug_SOURCES = event-debug.c
-event_debug_LDADD = ../src/libinput.la $(LIBUDEV_LIBS)
+event_debug_LDADD = ../src/libinput.la libshared.la $(LIBUDEV_LIBS)
 event_debug_LDFLAGS = -no-install
 event_debug_CFLAGS = $(LIBUDEV_CFLAGS)
 
diff --git a/tools/event-debug.c b/tools/event-debug.c
index b6b7140..184c68f 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -23,7 +23,6 @@
 #define _GNU_SOURCE
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -37,110 +36,14 @@
 
 #include 
 
-static enum {
-   MODE_UDEV,
-   MODE_DEVICE,
-} mode = MODE_UDEV;
+#include "shared.h"
+
 static const char *device;
-static const char *seat = "seat0";
 static struct udev *udev;
 uint32_t start_time;
 static const uint32_t screen_width = 100;
 static const uint32_t screen_height = 100;
-static int verbose = 0;
-static int tapping = -1;
-
-static void
-usage(void)
-{
-   printf("Usage: %s [options] [--udev []|--device 
/dev/input/event0]\n"
-  "--udev  Use udev device discovery (default).\n"
-  "  Specifying a seat ID is optional.\n"
-  "--device /path/to/device  open the given device only\n"
-  "\n"
-  "Features:\n"
-  "--enable-tap\n"
-  "--disable-tap enable/disable tapping\n"
-  "\n"
-  "These options apply to all applicable devices, if a feature\n"
-  "is not explicitly specified it is left at each device's 
default.\n"
-  "\n"
-  "Other options:\n"
-  "--verbose ... Print debugging output.\n"
-  "--help .. Print this help.\n",
-   program_invocation_short_name);
-}
-
-enum options {
-   OPT_DEVICE,
-   OPT_UDEV,
-   OPT_HELP,
-   OPT_VERBOSE,
-   OPT_TAP_ENABLE,
-   OPT_TAP_DISABLE,
-};
-
-static int
-parse_args(int argc, char **argv)
-{
-   while (1) {
-   int c;
-   int option_index = 0;
-   static struct option opts[] = {
-   { "device", 1, 0, OPT_DEVICE },
-   { "udev", 0, 0, OPT_UDEV },
-   { "help", 0, 0, OPT_HELP },
-   { "verbose", 0, 0, OPT_VERBOSE },
-   { "enable-tap", 0, 0, OPT_TAP_ENABLE },
-   { "disable-tap", 0, 0, OPT_TAP_DISABLE },
-   { 0, 0, 0, 0}
-   };
-
-   c = getopt_long(argc, argv, "h", opts, &option_index);
-   if (c == -1)
-   break;
-
-   switch(c) {
-   case 'h': /* --help */
-   case OPT_HELP:
-   usage();
-   exit(0);
-   case OPT_DEVICE: /* --device */
-   mode = MODE_DEVICE;
-   if (!optarg) {
-   usage();
-   return 1;
-   }
-   device = optarg;
-   break;
-   case OPT_UDEV: /* --udev */
-   mode = MODE_UDEV;
-   if (optarg)
-   seat = optarg;
-   break;
-   case OPT_VERBOSE: /* --verbose */
-   verbose = 1;
-   break;
-   case OPT_TAP_ENABLE:
-   tapping = 1;
-   break;
-   case OPT_TAP_DISABLE:
-   tapping = 0;
-   break;
-   default:
-   usage();
-   return 1;
-   }
-
-   }
-
-   if (optind < argc) {
-   usage();
-   return 1;
-   }
-
-   return 0;
-}
+struct tools_options options;
 
 static int
 open_restricted(const char *path, int

[PATCH libinput 7/8] tools: add support for enabling/disabling left-handed button mappings

2014-12-18 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 tools/shared.c | 15 +++
 tools/shared.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/tools/shared.c b/tools/shared.c
index 623005e..8439cb2 100644
--- a/tools/shared.c
+++ b/tools/shared.c
@@ -41,6 +41,8 @@ enum options {
OPT_TAP_DISABLE,
OPT_NATURAL_SCROLL_ENABLE,
OPT_NATURAL_SCROLL_DISABLE,
+   OPT_LEFT_HANDED_ENABLE,
+   OPT_LEFT_HANDED_DISABLE,
 };
 
 static void
@@ -65,6 +67,8 @@ tools_usage()
   "--disable-tap enable/disable tapping\n"
   "--enable-natural-scrolling\n"
   "--disable-natural-scrolling enable/disable natural 
scrolling\n"
+  "--enable-left-handed\n"
+  "--disable-left-handed enable/disable left-handed button 
configuration\n"
   "\n"
   "These options apply to all applicable devices, if a feature\n"
   "is not explicitly specified it is left at each device's 
default.\n"
@@ -81,6 +85,7 @@ tools_init_options(struct tools_options *options)
memset(options, 0, sizeof(*options));
options->tapping = -1;
options->natural_scroll = -1;
+   options->left_handed = -1;
options->backend = BACKEND_UDEV;
options->seat = "seat0";
 }
@@ -100,6 +105,8 @@ tools_parse_args(int argc, char **argv, struct 
tools_options *options)
{ "disable-tap", 0, 0, OPT_TAP_DISABLE },
{ "enable-natural-scrolling", 0, 0, 
OPT_NATURAL_SCROLL_ENABLE },
{ "disable-natural-scrolling", 0, 0, 
OPT_NATURAL_SCROLL_DISABLE },
+   { "enable-left-handed", 0, 0, OPT_LEFT_HANDED_ENABLE },
+   { "disable-left-handed", 0, 0, OPT_LEFT_HANDED_DISABLE 
},
{ 0, 0, 0, 0}
};
 
@@ -140,6 +147,12 @@ tools_parse_args(int argc, char **argv, struct 
tools_options *options)
case OPT_NATURAL_SCROLL_DISABLE:
options->natural_scroll = 0;
break;
+   case OPT_LEFT_HANDED_ENABLE:
+   options->left_handed = 1;
+   break;
+   case OPT_LEFT_HANDED_DISABLE:
+   options->left_handed = 0;
+   break;
default:
tools_usage();
return 1;
@@ -245,4 +258,6 @@ tools_device_apply_config(struct libinput_device *device,
if (options->natural_scroll != -1)
libinput_device_config_scroll_set_natural_scroll_enabled(device,
 
options->natural_scroll);
+   if (options->left_handed != -1)
+   libinput_device_config_buttons_set_left_handed(device, 
options->left_handed);
 }
diff --git a/tools/shared.h b/tools/shared.h
index e33fe04..9ecd3ad 100644
--- a/tools/shared.h
+++ b/tools/shared.h
@@ -38,6 +38,7 @@ struct tools_options {
int verbose;
int tapping;
int natural_scroll;
+   int left_handed;
 };
 
 void tools_init_options(struct tools_options *options);
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 5/5] touchpad: revert to pointer movement when stopping twofinger scrolling

2014-12-18 Thread Peter Hutterer
Add a boolean state machine for two-finger scrolling so we know when we're
currently scrolling. If we were scrolling and it stops, pick the active
touch as pointer touch so we can go back to pointer movement without having to
lift the finger off the touchpad.

https://bugs.freedesktop.org/show_bug.cgi?id=86807

Signed-off-by: Peter Hutterer 
---
 src/evdev-mt-touchpad.c | 40 ++--
 src/evdev-mt-touchpad.h |  6 ++
 test/touchpad.c | 39 +++
 3 files changed, 79 insertions(+), 6 deletions(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 964900d..0f3e72a 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -436,6 +436,33 @@ tp_post_twofinger_scroll(struct tp_dispatch *tp, uint64_t 
time)
tp_filter_motion(tp, &dx, &dy, NULL, NULL, time);
 
evdev_post_scroll(tp->device, time, dx, dy);
+   tp->scroll.twofinger_state = TWOFINGER_SCROLL_STATE_ACTIVE;
+}
+
+static void
+tp_twofinger_stop_scroll(struct tp_dispatch *tp, uint64_t time)
+{
+   struct tp_touch *t, *ptr = NULL;
+   int nfingers_down = 0;
+
+   evdev_stop_scroll(tp->device, time);
+
+   /* If we were scrolling and now there's exactly 1 active finger,
+  switch back to pointer movement */
+   if (tp->scroll.twofinger_state == TWOFINGER_SCROLL_STATE_ACTIVE) {
+   tp_for_each_touch(tp, t) {
+   if (tp_touch_active(tp, t)) {
+   nfingers_down++;
+   if (ptr == NULL)
+   ptr = t;
+   }
+   }
+
+   if (nfingers_down == 1)
+   tp_set_pointer(tp, ptr);
+   }
+
+   tp->scroll.twofinger_state = TWOFINGER_SCROLL_STATE_NONE;
 }
 
 static int
@@ -458,13 +485,14 @@ tp_twofinger_scroll_post_events(struct tp_dispatch *tp, 
uint64_t time)
nfingers_down++;
}
 
-   if (nfingers_down != 2) {
-   evdev_stop_scroll(tp->device, time);
-   return 0;
+   if (nfingers_down == 2) {
+   tp_post_twofinger_scroll(tp, time);
+   return 1;
}
 
-   tp_post_twofinger_scroll(tp, time);
-   return 1;
+   tp_twofinger_stop_scroll(tp, time);
+
+   return 0;
 }
 
 static void
@@ -504,7 +532,7 @@ tp_stop_scroll_events(struct tp_dispatch *tp, uint64_t time)
case LIBINPUT_CONFIG_SCROLL_NO_SCROLL:
break;
case LIBINPUT_CONFIG_SCROLL_2FG:
-   evdev_stop_scroll(tp->device, time);
+   tp_twofinger_stop_scroll(tp, time);
break;
case LIBINPUT_CONFIG_SCROLL_EDGE:
tp_edge_scroll_stop_events(tp, time);
diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
index e284928..5807f08 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -117,6 +117,11 @@ enum tp_edge_scroll_touch_state {
EDGE_SCROLL_TOUCH_STATE_AREA,
 };
 
+enum tp_twofinger_scroll_state {
+   TWOFINGER_SCROLL_STATE_NONE,
+   TWOFINGER_SCROLL_STATE_ACTIVE,
+};
+
 struct tp_motion {
int32_t x;
int32_t y;
@@ -238,6 +243,7 @@ struct tp_dispatch {
enum libinput_config_scroll_method method;
int32_t right_edge;
int32_t bottom_edge;
+   enum tp_twofinger_scroll_state twofinger_state;
} scroll;
 
enum touchpad_event queued;
diff --git a/test/touchpad.c b/test/touchpad.c
index 1a0414c..8602e03 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -1461,6 +1461,44 @@ START_TEST(touchpad_2fg_scroll_slow_distance)
 }
 END_TEST
 
+START_TEST(touchpad_2fg_scroll_return_to_motion)
+{
+   struct litest_device *dev = litest_current_device();
+   struct libinput *li = dev->libinput;
+
+   litest_drain_events(li);
+
+   /* start with motion */
+   litest_touch_down(dev, 0, 70, 70);
+   litest_touch_move_to(dev, 0, 70, 70, 47, 50, 10, 0);
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+   /* 2fg scroll */
+   litest_touch_down(dev, 1, 53, 50);
+   litest_touch_move_to(dev, 0, 47, 50, 47, 70, 5, 0);
+   litest_touch_move_to(dev, 1, 53, 50, 53, 70, 5, 0);
+   litest_touch_up(dev, 1);
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS);
+
+   litest_touch_move_to(dev, 0, 47, 70, 47, 50, 10, 0);
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+
+   /* back to 2fg scroll, lifting the other finger */
+   litest_touch_down(dev, 1, 50, 50);
+   litest_touch_move_to(dev, 0, 47, 50, 47, 70, 5, 0);
+   litest_touch_move_to(dev, 1, 53, 50, 53, 70, 5, 0);
+   litest_touch_up(dev, 0);
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS);
+
+   /* move with second finger */
+   litest_touch_move_to(dev, 1, 53, 70

[PATCH libinput 1/5] test: switch touch points around for semi-mt tap-n-drag testing

2014-12-18 Thread Peter Hutterer
The tests ignored it when motion events never happened - but that's mostly
what these tests are about. This only happened for semi-mt devices that use
the bounding box only, not separate touch points. Switching the touch points
around that the bounding box doesn't interfere causes the test to work as
expected.

Signed-off-by: Peter Hutterer 
---
 test/touchpad.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/test/touchpad.c b/test/touchpad.c
index 84b3080..e6f0eb6 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -211,11 +211,11 @@ START_TEST(touchpad_2fg_tap_n_drag)
 
litest_drain_events(li);
 
-   litest_touch_down(dev, 0, 50, 50);
+   litest_touch_down(dev, 0, 30, 70);
litest_touch_up(dev, 0);
-   litest_touch_down(dev, 0, 50, 50);
-   litest_touch_down(dev, 1, 60, 50);
-   litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+   litest_touch_down(dev, 0, 30, 70);
+   litest_touch_down(dev, 1, 80, 70);
+   litest_touch_move_to(dev, 0, 30, 70, 30, 30, 5, 40);
libinput_dispatch(li);
 
litest_assert_button_event(li, BTN_LEFT,
@@ -250,11 +250,11 @@ START_TEST(touchpad_2fg_tap_n_drag_3fg_btntool)
 
litest_drain_events(li);
 
-   litest_touch_down(dev, 0, 50, 50);
+   litest_touch_down(dev, 0, 30, 70);
litest_touch_up(dev, 0);
-   litest_touch_down(dev, 0, 50, 50);
-   litest_touch_down(dev, 1, 60, 50);
-   litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
+   litest_touch_down(dev, 0, 30, 70);
+   litest_touch_down(dev, 1, 80, 90);
+   litest_touch_move_to(dev, 0, 30, 70, 30, 30, 5, 40);
libinput_dispatch(li);
 
litest_assert_button_event(li, BTN_LEFT,
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 2/5] test: add helper function for checking for a specific event type

2014-12-18 Thread Peter Hutterer
In a few tests we care about that a specific set of events are in the queue
but not about the details of the events (usually checked elsewhere). Instead
of manual loops, provide a helper function that also checks that there is at
least one of those events in the queue.

Signed-off-by: Peter Hutterer 
---
 test/litest.c | 21 +
 test/litest.h |  2 ++
 2 files changed, 23 insertions(+)

diff --git a/test/litest.c b/test/litest.c
index befad5a..392ffe2 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -1224,6 +1224,27 @@ litest_assert_scroll(struct libinput *li,
 }
 
 void
+litest_assert_only_typed_events(struct libinput *li,
+   enum libinput_event_type type)
+{
+   struct libinput_event *event;
+
+   assert(type != LIBINPUT_EVENT_NONE);
+
+   libinput_dispatch(li);
+   event = libinput_get_event(li);
+   ck_assert_notnull(event);
+
+   while (event) {
+   ck_assert_int_eq(libinput_event_get_type(event),
+type);
+   libinput_event_destroy(event);
+   libinput_dispatch(li);
+   event = libinput_get_event(li);
+   }
+}
+
+void
 litest_timeout_tap(void)
 {
msleep(200);
diff --git a/test/litest.h b/test/litest.h
index 99c6ae3..31011a2 100644
--- a/test/litest.h
+++ b/test/litest.h
@@ -162,6 +162,8 @@ void litest_assert_button_event(struct libinput *li,
 void litest_assert_scroll(struct libinput *li,
  enum libinput_pointer_axis axis,
  int minimum_movement);
+void litest_assert_only_typed_events(struct libinput *li,
+enum libinput_event_type type);
 
 struct libevdev_uinput * litest_create_uinput_device(const char *name,
 struct input_id *id,
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 3/5] test: switch tests to use the new helper function

2014-12-18 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 test/touchpad.c | 79 ++---
 1 file changed, 8 insertions(+), 71 deletions(-)

diff --git a/test/touchpad.c b/test/touchpad.c
index e6f0eb6..1a0414c 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -121,7 +121,6 @@ START_TEST(touchpad_1fg_tap_n_drag)
 {
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
-   struct libinput_event *event;
 
libinput_device_config_tap_set_enabled(dev->libinput_device,
   LIBINPUT_CONFIG_TAP_ENABLED);
@@ -140,27 +139,15 @@ START_TEST(touchpad_1fg_tap_n_drag)
   LIBINPUT_BUTTON_STATE_PRESSED);
 
libinput_dispatch(li);
-   while (libinput_next_event_type(li) == LIBINPUT_EVENT_POINTER_MOTION) {
-   event = libinput_get_event(li);
-   libinput_event_destroy(event);
-   libinput_dispatch(li);
-   }
 
-   ck_assert_int_eq(libinput_next_event_type(li), LIBINPUT_EVENT_NONE);
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
 
/* lift finger, set down again, should continue dragging */
litest_touch_down(dev, 0, 50, 50);
litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40);
litest_touch_up(dev, 0);
 
-   libinput_dispatch(li);
-   while (libinput_next_event_type(li) == LIBINPUT_EVENT_POINTER_MOTION) {
-   event = libinput_get_event(li);
-   libinput_event_destroy(event);
-   libinput_dispatch(li);
-   }
-
-   ck_assert_int_eq(libinput_next_event_type(li), LIBINPUT_EVENT_NONE);
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
 
litest_timeout_tap();
 
@@ -204,7 +191,6 @@ START_TEST(touchpad_2fg_tap_n_drag)
 {
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
-   struct libinput_event *event;
 
libinput_device_config_tap_set_enabled(dev->libinput_device,
   LIBINPUT_CONFIG_TAP_ENABLED);
@@ -221,12 +207,7 @@ START_TEST(touchpad_2fg_tap_n_drag)
litest_assert_button_event(li, BTN_LEFT,
   LIBINPUT_BUTTON_STATE_PRESSED);
 
-   while (libinput_next_event_type(li) == LIBINPUT_EVENT_POINTER_MOTION) {
-   event = libinput_get_event(li);
-   libinput_event_destroy(event);
-   libinput_dispatch(li);
-   }
-   litest_assert_empty_queue(li);
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
 
litest_touch_up(dev, 0);
litest_touch_up(dev, 1);
@@ -243,7 +224,6 @@ START_TEST(touchpad_2fg_tap_n_drag_3fg_btntool)
 {
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
-   struct libinput_event *event;
 
libinput_device_config_tap_set_enabled(dev->libinput_device,
   LIBINPUT_CONFIG_TAP_ENABLED);
@@ -260,12 +240,7 @@ START_TEST(touchpad_2fg_tap_n_drag_3fg_btntool)
litest_assert_button_event(li, BTN_LEFT,
   LIBINPUT_BUTTON_STATE_PRESSED);
 
-   while (libinput_next_event_type(li) == LIBINPUT_EVENT_POINTER_MOTION) {
-   event = libinput_get_event(li);
-   libinput_event_destroy(event);
-   libinput_dispatch(li);
-   }
-   litest_assert_empty_queue(li);
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
 
/* Putting down a third finger should end the drag */
litest_event(dev, EV_KEY, BTN_TOOL_TRIPLETAP, 1);
@@ -591,7 +566,6 @@ START_TEST(touchpad_1fg_tap_n_drag_click)
 {
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
-   struct libinput_event *event;
 
libinput_device_config_tap_set_enabled(dev->libinput_device,
   LIBINPUT_CONFIG_TAP_ENABLED);
@@ -608,15 +582,7 @@ START_TEST(touchpad_1fg_tap_n_drag_click)
litest_assert_button_event(li, BTN_LEFT,
   LIBINPUT_BUTTON_STATE_PRESSED);
 
-   libinput_dispatch(li);
-
-   ck_assert_int_eq(libinput_next_event_type(li),
-LIBINPUT_EVENT_POINTER_MOTION);
-   while (libinput_next_event_type(li) == LIBINPUT_EVENT_POINTER_MOTION) {
-   event = libinput_get_event(li);
-   libinput_event_destroy(event);
-   libinput_dispatch(li);
-   }
+   litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
 
litest_event(dev, EV_KEY, BTN_LEFT, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
@@ -873,7 +839,6 @@ START_TEST(clickpad_click_n_drag)
 {
struct litest_device *dev = litest_current_device();
struct libinput *l

[PATCH libinput 4/5] touchpad: rename scroll.state to scroll.edge_state

2014-12-18 Thread Peter Hutterer
In preparation for a twofinger_state field, to avoid confusion.

Signed-off-by: Peter Hutterer 
---
 src/evdev-mt-touchpad-edge-scroll.c | 6 +++---
 src/evdev-mt-touchpad.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/evdev-mt-touchpad-edge-scroll.c 
b/src/evdev-mt-touchpad-edge-scroll.c
index 616080f..bc6831d 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -69,7 +69,7 @@ tp_edge_scroll_set_state(struct tp_dispatch *tp,
 {
libinput_timer_cancel(&t->scroll.timer);
 
-   t->scroll.state = state;
+   t->scroll.edge_state = state;
 
switch (state) {
case EDGE_SCROLL_TOUCH_STATE_NONE:
@@ -207,7 +207,7 @@ tp_edge_scroll_handle_event(struct tp_dispatch *tp,
struct tp_touch *t,
enum scroll_event event)
 {
-   switch (t->scroll.state) {
+   switch (t->scroll.edge_state) {
case EDGE_SCROLL_TOUCH_STATE_NONE:
tp_edge_scroll_handle_none(tp, t, event);
break;
@@ -374,5 +374,5 @@ tp_edge_scroll_stop_events(struct tp_dispatch *tp, uint64_t 
time)
 int
 tp_edge_scroll_touch_active(struct tp_dispatch *tp, struct tp_touch *t)
 {
-   return t->scroll.state == EDGE_SCROLL_TOUCH_STATE_AREA;
+   return t->scroll.edge_state == EDGE_SCROLL_TOUCH_STATE_AREA;
 }
diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
index 1450288..e284928 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -165,7 +165,7 @@ struct tp_touch {
} tap;
 
struct {
-   enum tp_edge_scroll_touch_state state;
+   enum tp_edge_scroll_touch_state edge_state;
uint32_t edge;
int direction;
double threshold;
-- 
2.1.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 5/7] doc: added \memberof and \cond commands

2014-12-18 Thread Bill Spitzak
\memberof added to undocumented functions that belong to classes, such
as all the wl_list_* functions. This makes doxygen produce them as a
single block.

\cond added to hide the non-public map implementation.
---
 src/wayland-client.c |7 ---
 src/wayland-server.c |   39 ++-
 src/wayland-shm.c|7 +++
 src/wayland-util.c   |   12 
 4 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/src/wayland-client.c b/src/wayland-client.c
index 9e8bdfe..1ace1da 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -1336,6 +1336,7 @@ err:
return -1;
 }
 
+/** \memberof wl_display */
 WL_EXPORT int
 wl_display_prepare_read_queue(struct wl_display *display,
  struct wl_event_queue *queue)
@@ -1689,8 +1690,7 @@ wl_display_get_error(struct wl_display *display)
return ret;
 }
 
-/**
- * Retrieves the information about a protocol error:
+/** Retrieves the information about a protocol error:
  *
  * \param displayThe Wayland display
  * \param interface  if not NULL, stores the interface where the error occurred
@@ -1709,7 +1709,8 @@ wl_display_get_error(struct wl_display *display)
  *
  * ...
  *
- *  \endcode
+ * \endcode
+ * \memberof wl_display
  */
 WL_EXPORT uint32_t
 wl_display_get_protocol_error(struct wl_display *display,
diff --git a/src/wayland-server.c b/src/wayland-server.c
index c845dd6..e03ce4f 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -120,6 +120,7 @@ struct wl_resource {
 
 static int debug_server = 0;
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_post_event_array(struct wl_resource *resource, uint32_t opcode,
 union wl_argument *args)
@@ -144,6 +145,7 @@ wl_resource_post_event_array(struct wl_resource *resource, 
uint32_t opcode,
wl_closure_destroy(closure);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_post_event(struct wl_resource *resource, uint32_t opcode, ...)
 {
@@ -160,6 +162,7 @@ wl_resource_post_event(struct wl_resource *resource, 
uint32_t opcode, ...)
 }
 
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_queue_event_array(struct wl_resource *resource, uint32_t opcode,
  union wl_argument *args)
@@ -184,6 +187,7 @@ wl_resource_queue_event_array(struct wl_resource *resource, 
uint32_t opcode,
wl_closure_destroy(closure);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_queue_event(struct wl_resource *resource, uint32_t opcode, ...)
 {
@@ -199,6 +203,7 @@ wl_resource_queue_event(struct wl_resource *resource, 
uint32_t opcode, ...)
wl_resource_queue_event_array(resource, opcode, args);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_post_error(struct wl_resource *resource,
   uint32_t code, const char *msg, ...)
@@ -504,6 +509,7 @@ wl_client_get_object(struct wl_client *client, uint32_t id)
return wl_map_lookup(&client->objects, id);
 }
 
+/** \memberof wl_client */
 WL_EXPORT void
 wl_client_post_no_memory(struct wl_client *client)
 {
@@ -511,6 +517,7 @@ wl_client_post_no_memory(struct wl_client *client)
   WL_DISPLAY_ERROR_NO_MEMORY, "no memory");
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_post_no_memory(struct wl_resource *resource)
 {
@@ -535,6 +542,7 @@ destroy_resource(void *element, void *data)
free(resource);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_destroy(struct wl_resource *resource)
 {
@@ -555,18 +563,21 @@ wl_resource_destroy(struct wl_resource *resource)
}
 }
 
+/** \memberof wl_resource */
 WL_EXPORT uint32_t
 wl_resource_get_id(struct wl_resource *resource)
 {
return resource->object.id;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_list *
 wl_resource_get_link(struct wl_resource *resource)
 {
return &resource->link;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_resource *
 wl_resource_from_link(struct wl_list *link)
 {
@@ -575,6 +586,7 @@ wl_resource_from_link(struct wl_list *link)
return wl_container_of(link, resource, link);
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_resource *
 wl_resource_find_for_client(struct wl_list *list, struct wl_client *client)
 {
@@ -591,30 +603,35 @@ wl_resource_find_for_client(struct wl_list *list, struct 
wl_client *client)
 return NULL;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT struct wl_client *
 wl_resource_get_client(struct wl_resource *resource)
 {
return resource->client;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void
 wl_resource_set_user_data(struct wl_resource *resource, void *data)
 {
resource->data = data;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT void *
 wl_resource_get_user_data(struct wl_resource *resource)
 {
return resource->data;
 }
 
+/** \memberof wl_resource */
 WL_EXPORT int
 wl_resource_get_version(struc

[PATCH 1/7] doc: Reduce the validation errors of the docbook input

2014-12-18 Thread Bill Spitzak
(this is different from previous version as it removes some
broken and irrelevant changes to the protocol appendix).

This removes all the validation errors except for missing link
targets. You can test this by removing the --skip-validation
from doc/publican/Makefile.am.

Main changes are to avoid nesting  commands. I also used
 in some places to reduce the amount of blank space.
And the reference id's are prefixed with the chapter name to
avoid collisions between libclient and libserver.

PS: it would be useful if somebody who actually knows something
about xslt would come up with a way to translate a block of text
makde of  commands unchanged, but add  around plain
text. Most of the difficulty is that doxygen's output is rather
inconsistent here.
---
 doc/publican/doxygen-to-publican.xsl|   44 +--
 doc/publican/protocol-interfaces-to-docbook.xsl |8 +++--
 doc/publican/protocol-to-docbook.xsl|4 +--
 3 files changed, 23 insertions(+), 33 deletions(-)

diff --git a/doc/publican/doxygen-to-publican.xsl 
b/doc/publican/doxygen-to-publican.xsl
index 47bdc5a..5adbfa6 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -37,20 +37,16 @@
 
 
 
-  
-
-  
-
-  
+  
+
+  
 
 
 Methods for the respective classes.
 
-
 
-
+  
 
-
   
 
 
@@ -60,7 +56,7 @@
   
 
   
-
+
   
 
 
@@ -74,7 +70,7 @@
 
 
 
-  
+  
 
 
 
@@ -82,22 +78,18 @@
 
   Returns:
   
-
+
   
 
   
 
 
 
-  
-See also: 
-  
+  See also: 
 
 
 
-  
-Since: 
-  
+  Since: 
 
 
 
@@ -131,7 +123,7 @@
 
 
   
-
+
 
   
   
@@ -139,21 +131,19 @@
   
 
 
-  
-
-  
-
-  
+  
+
+  
   
 
 
-
+  
 
 
 
 
-
-
+  
+
 
 
 
@@ -165,6 +155,6 @@
   
 
 
-
+  
 
 
diff --git a/doc/publican/protocol-interfaces-to-docbook.xsl 
b/doc/publican/protocol-interfaces-to-docbook.xsl
index fb1a816..57b3139 100644
--- a/doc/publican/protocol-interfaces-to-docbook.xsl
+++ b/doc/publican/protocol-interfaces-to-docbook.xsl
@@ -37,11 +37,13 @@
   
 
   
-  
-- 
-  
 
   
+  
+
+  
+
+  
 
 
 
diff --git a/doc/publican/protocol-to-docbook.xsl 
b/doc/publican/protocol-to-docbook.xsl
index 443228d..a43c9fa 100644
--- a/doc/publican/protocol-to-docbook.xsl
+++ b/doc/publican/protocol-to-docbook.xsl
@@ -95,9 +95,7 @@
   Value: 
 
 
-  
-
-  
+  
 
 
   
-- 
1.7.9.5

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 7/7] doc: Intro text for doxygen output in it's own file

2014-12-18 Thread Bill Spitzak
Removed this text from the doxygen->publican converter. This makes it possible
to customize the text. This versions produce the same text as before
except I changed "server" to "compositor". Somebody with more understanding
of Wayland may want to improve the text.
---
 doc/publican/Makefile.am |4 ++-
 doc/publican/doxygen-to-publican.xsl |   51 ++
 doc/publican/sources/Client.xml  |   25 +
 doc/publican/sources/Server.xml  |   25 +
 doc/publican/sources/Wayland.xml |4 +--
 5 files changed, 64 insertions(+), 45 deletions(-)
 create mode 100644 doc/publican/sources/Client.xml
 create mode 100644 doc/publican/sources/Server.xml

diff --git a/doc/publican/Makefile.am b/doc/publican/Makefile.am
index 278da12..42bfb73 100644
--- a/doc/publican/Makefile.am
+++ b/doc/publican/Makefile.am
@@ -27,7 +27,9 @@ publican_sources = \
$(srcdir)/sources/images/icon.svg  \
$(srcdir)/sources/images/wayland-architecture.png \
$(srcdir)/sources/images/wayland.png  \
-   $(srcdir)/sources/images/x-architecture.png
+   $(srcdir)/sources/images/x-architecture.png \
+   $(srcdir)/sources/Client.xml \
+   $(srcdir)/sources/Server.xml
 
 css_sources = \
$(srcdir)/sources/css/brand.css \
diff --git a/doc/publican/doxygen-to-publican.xsl 
b/doc/publican/doxygen-to-publican.xsl
index a151628..ee57374 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -4,49 +4,16 @@
 
 
 
-  
-
-
-  
-sect-Library-
- API
-
-
-  The open-source reference implementation of Wayland protocol is
-  split in two C libraries, libwayland-client and libwayland-server. Their
-  main responsibility is to handle the Inter-process communication
-  (IPC) with each other, therefore
-  guaranteeing the protocol objects marshaling and messages
-  synchronization.
-
-
-
-  Following is the Wayland library classes for the
-  libwayland-.  This appendix describes in detail
-  the library's methods and their helpers, aiming implementors who
-  are building a Wayland .
-
-
-
-
-
-  Functions
-  
-  
-
-  
-
+  
+
+  
+Functions
+
+
+  
+
+  
 
-  
 
 
 
diff --git a/doc/publican/sources/Client.xml b/doc/publican/sources/Client.xml
new file mode 100644
index 000..07cfe06
--- /dev/null
+++ b/doc/publican/sources/Client.xml
@@ -0,0 +1,25 @@
+
+http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [
+  
+  
+%BOOK_ENTITIES;
+]>
+
+  Client API
+  
+The open-source reference implementation of Wayland protocol is
+split in two C libraries, libwayland-client and libwayland-server. Their main
+responsibility is to handle the Inter-process communication
+(IPC) with each other, therefore guaranteeing
+the protocol objects marshaling and messages synchronization.
+  
+  
+This appendix describes in detail the client library's methods and
+their helpers, aiming implementors who are building a Wayland
+client.
+  
+  &doxygen;
+
+
diff --git a/doc/publican/sources/Server.xml b/doc/publican/sources/Server.xml
new file mode 100644
index 000..d9117e6
--- /dev/null
+++ b/doc/publican/sources/Server.xml
@@ -0,0 +1,25 @@
+
+http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [
+  
+  
+%BOOK_ENTITIES;
+]>
+
+  Server API
+  
+The open-source reference implementation of Wayland protocol is
+split in two C libraries, libwayland-client and libwayland-server. Their main
+responsibility is to handle the Inter-process communication
+(IPC) with each other, therefore guaranteeing
+the protocol objects marshaling and messages synchronization.
+  
+  
+This appendix describes in detail the server library's methods and
+their helpers, aiming implementors who are building a Wayland
+compositor.
+  
+  &doxygen;
+
+
diff --git a/doc/publican/sources/Wayland.xml b/doc/publican/sources/Wayland.xml
index 5ae90bb..d789b43 100644
--- a/doc/publican/sources/Wayland.xml
+++ b/doc/publican/sources/Wayland.xml
@@ -12,7 +12,7 @@
   http://www.w3.org/2001/XInclude"; />
   http://www.w3.org/2001/XInclude"; />
   http://www.w3.org/2001/XInclude"; />
-  http://www.w3.org/2001/XInclude"/>
-  http://www.w3.org/2001/XInclude"/>
+  http://www.w3.org/2001/XInclude"/>
+  http://www.w3.org/2001/XInclude"/>
 
 
-- 
1.7.9.5

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 3/7] doc: Each class in doxygen output is a section

2014-12-18 Thread Bill Spitzak
All the methods belonging to the class are listed with it, making
it much easier to find them.

I dumped all other functions into a section called "Functions" at
the end.
---
 doc/publican/doxygen-to-publican.xsl |   36 --
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/doc/publican/doxygen-to-publican.xsl 
b/doc/publican/doxygen-to-publican.xsl
index 0ed7030..08a71e7 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -36,17 +36,16 @@
   'SC', 'sc')"/>.
 
 
-
+
+
+
+  Functions
+  
   
-
+
   
-
-
-Methods for the respective classes.
+
 
-
-  
-
   
 
 
@@ -104,6 +103,11 @@
   
 
 
+
+
+  
+
+
 
 
   
-
-
+
+
 
 
 - 
 
-
+
 
-
-  
-
-
+
+
+
+  
+
+
   
 
 
-- 
1.7.9.5

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 2/7] doc: removed the word "interface" from the link names

2014-12-18 Thread Bill Spitzak
Just to make it slightly shorter.

Also add a dash to the doxygen links to make them look a bit more alike.
---
 doc/publican/doxygen-to-publican.xsl|6 +++---
 doc/publican/protocol-interfaces-to-docbook.xsl |   10 +-
 doc/publican/protocol-to-docbook.xsl|7 ++-
 doc/publican/sources/Protocol.xml   |   16 
 4 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/doc/publican/doxygen-to-publican.xsl 
b/doc/publican/doxygen-to-publican.xsl
index 5adbfa6..0ed7030 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -70,7 +70,7 @@
 
 
 
-  
+  
 
 
 
@@ -123,7 +123,7 @@
 
 
   
-
+
 
   
   
@@ -143,7 +143,7 @@
 
 
   
-
+
 
 
 
diff --git a/doc/publican/protocol-interfaces-to-docbook.xsl 
b/doc/publican/protocol-interfaces-to-docbook.xsl
index 57b3139..f68216d 100644
--- a/doc/publican/protocol-interfaces-to-docbook.xsl
+++ b/doc/publican/protocol-interfaces-to-docbook.xsl
@@ -23,10 +23,10 @@
 
 
 
-Core interfaces:
-
-
-
+  Core interfaces:
+  
+
+  
 
   
 
@@ -35,7 +35,7 @@
 
 
   
-
+
   
 
   
diff --git a/doc/publican/protocol-to-docbook.xsl 
b/doc/publican/protocol-to-docbook.xsl
index a43c9fa..354ff3a 100644
--- a/doc/publican/protocol-to-docbook.xsl
+++ b/doc/publican/protocol-to-docbook.xsl
@@ -49,9 +49,7 @@
 
 
 
-  
-protocol-spec--
-
+  
 
   
   
@@ -103,8 +101,7 @@
 
 
 
-  
-protocol-spec-interface---
+  
 
   ::
   
diff --git a/doc/publican/sources/Protocol.xml 
b/doc/publican/sources/Protocol.xml
index b79b6be..5f3e852 100644
--- a/doc/publican/sources/Protocol.xml
+++ b/doc/publican/sources/Protocol.xml
@@ -275,7 +275,7 @@
   The compositor is a global object, advertised at connect time.
 
 
-  See  for the
+  See  for the
   protocol description.
 
   
@@ -287,7 +287,7 @@
   cannot access other clients surfaces.
 
 
-  See  for the protocol
+  See  for the protocol
   description.
 
   
@@ -324,7 +324,7 @@
   or triple clicks.
 
 
-  See  for the
+  See  for the
   protocol description.
 
 
@@ -383,7 +383,7 @@
   comes and goes.
 
 
-  See  for the protocol
+  See  for the protocol
   description.
 
 
@@ -432,10 +432,10 @@
   that implements copy-paste and drag-and-drop support.
 
 
-  See ,
-  ,
-   and
-   for
+  See ,
+  ,
+   and
+   for
   protocol descriptions.
 
 
-- 
1.7.9.5

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 6/7] doc: make itemized lists from doxygen work

2014-12-18 Thread Bill Spitzak
Not actually used currently but probably a good idea.
---
 doc/publican/doxygen-to-publican.xsl |8 
 1 file changed, 8 insertions(+)

diff --git a/doc/publican/doxygen-to-publican.xsl 
b/doc/publican/doxygen-to-publican.xsl
index dfd47ee..a151628 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -103,6 +103,14 @@
   
 
 
+
+  
+
+
+
+  
+
+
 
 
   
-- 
1.7.9.5

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 4/7] doc: Document structures and unions in addition to classes

2014-12-18 Thread Bill Spitzak
This provides targets for some of the doxygen links, and some of
them have useful memberof function lists.

Added some if/else statements to reduce validation errors.
---
 doc/publican/doxygen-to-publican.xsl |   25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/doc/publican/doxygen-to-publican.xsl 
b/doc/publican/doxygen-to-publican.xsl
index 08a71e7..dfd47ee 100644
--- a/doc/publican/doxygen-to-publican.xsl
+++ b/doc/publican/doxygen-to-publican.xsl
@@ -36,13 +36,13 @@
   'SC', 'sc')"/>.
 
 
-
+
 
 
   Functions
   
   
-
+
   
 
 
@@ -146,7 +146,6 @@
 
 
 
-  
 
 
 
@@ -154,13 +153,19 @@
 - 
 
 
-
-
-
-
-  
-
+
+  
+
+  
+  
+
+  
+
+
+  
+
+  
+
 
-  
 
 
-- 
1.7.9.5

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] doc: Improve doxygen conversion

2014-12-18 Thread Bill Spitzak
The first patch supersedes one of my previous ones, the change is
to remove some irrelevant and broken changes to the protocol docs.

Other changes fix the doxygen conversion so that each class/struct is
a section, with all the related functions in that section. This makes
it a lot easier to read the documentation.

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput 1/8] tools: make event-debug's option parsing more flexible

2014-12-18 Thread Bill Spitzak

On 12/18/2014 03:16 PM, Peter Hutterer wrote:

We need to be able to turn config options on/off for testing, so switch to
something that's a bit more flexible than characters that represent the
options.



+enum options {
+   OPT_DEVICE,
+   OPT_UDEV,
+   OPT_HELP,
+   OPT_VERBOSE,
+};


Should these perhaps be set to 'd', 'u', 'h', and 'v'?
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput 1/8] tools: make event-debug's option parsing more flexible

2014-12-18 Thread Peter Hutterer
On Thu, Dec 18, 2014 at 08:24:24PM -0800, Bill Spitzak wrote:
> On 12/18/2014 03:16 PM, Peter Hutterer wrote:
> >We need to be able to turn config options on/off for testing, so switch to
> >something that's a bit more flexible than characters that represent the
> >options.
> 
> >+enum options {
> >+OPT_DEVICE,
> >+OPT_UDEV,
> >+OPT_HELP,
> >+OPT_VERBOSE,
> >+};
> 
> Should these perhaps be set to 'd', 'u', 'h', and 'v'?

no, the whole point of those is that the actual value doesn't matter.

Cheers,
   Peter
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel