[RFC] [PATCH 0/3] libwayland-cursor

Kristian Høgsberg hoegsberg at gmail.com
Tue May 22 08:25:57 PDT 2012


On Tue, May 22, 2012 at 03:39:39PM +0300, Ander Conselvan de Oliveira wrote:
> Hi,
> 
> In order to get rid of the X11 dependency that libXcursor brings,
> Kristian suggested that a libwayland-cursor be created. This library
> handles the X cursor theme format, loading the image content straight
> into an shm pool so that the users need just one function call for
> getting a buffer for a cursor image.
> 
> The code for handling the cursor theme is just a stripped down version
> of libXcursor, that is contained on the files cursor/xcursor.[ch].
> 
> The library API is quite similar to the cursor code in libtoytoolkit.

Looks great Ander.  It's a good start, and I want to start using it so
I've committed it all now.  There are a couple of things that we need
to tweak thoguh: I'm not sure we can do enum wl_cursor_type, I think
we should just stick to only loading by name.  Also, in the shm resize
code we should use mremap.  I'd also like to see the wl_cursor_theme
object cache a bit more of the theme and patch lookup libXcursor does
over and over again.  Finally, I was wondering if we should just scan
the cursor dir and load all cursors into a shm object instead of
preloading just that small subset.

Kristian

> Ander Conselvan de Oliveira (2):
>   shm: Add request for resizing pools
>   Introduce libwayland-cursor, a cursor helper library
> 
>  Makefile.am                 |    2 +-
>  configure.ac                |    2 +
>  cursor/Makefile.am          |   14 +
>  cursor/wayland-cursor.c     |  356 ++++++++++++++++++
>  cursor/wayland-cursor.h     |   78 ++++
>  cursor/wayland-cursor.pc.in |   10 +
>  cursor/xcursor.c            |  856 +++++++++++++++++++++++++++++++++++++++++++
>  cursor/xcursor.h            |   58 +++
>  protocol/wayland.xml        |   10 +
>  src/wayland-shm.c           |   33 ++-
>  10 files changed, 1414 insertions(+), 5 deletions(-)
>  create mode 100644 cursor/Makefile.am
>  create mode 100644 cursor/wayland-cursor.c
>  create mode 100644 cursor/wayland-cursor.h
>  create mode 100644 cursor/wayland-cursor.pc.in
>  create mode 100644 cursor/xcursor.c
>  create mode 100644 cursor/xcursor.h
> 
> -- 
> 1.7.4.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list