Wednesday, September 5, 2012

Multi-touch gestures in Gnome Shell

I'm keeping this small branch in which touch event support is added to Mutter. Plug-ins can register to get touch events before any other client and then accept or reject touch sequences depending on whether the shell is interested on the gesture or not.

As can be seen in this example of a mutter plug-in, any subclass of ClutterGestureAction can be used, which includes gesture recognizers for pan, zoom and rotate actions, but creating new recognizers is pretty easy.

The mutter branch is up for reviewing in bugzilla and any comments on the approach will be very welcome. And if anybody wants to play with multi-touch gestures in Gnome Shell, please link to your work from the wiki so we can track it.

If anybody from the design team has already started thinking about this, I would be very glad to hear their thoughts on this.

As always, I'm grateful to my employer Collabora for sponsoring this work, and I hope GNOME benefits from it.


Thursday, August 2, 2012

Touch events within Xephyr

As part of my ongoing work on multi-touch, I have been looking at handling touch gestures within Mutter plugins. Developing a X window manager/shell can be quite a hassle because you are likely to want to do that in a separate X display so your testing doesn't disturb the session where you do the actual coding.

In the past I have used Xephyr to run a nested X display so I can run the window manager as I would run any normal application, but this time I found that Xephyr doesn't forward any XInput2 events right now, which is needed for MT. Having a separate machine where to test is an alternative but it has been quite uncomfortable.

My colleague at Collabora Daniel Stone encouraged me to give it a try and it indeed didn't take much work to get something running, though I still haven't tested it much.

So for the code, here is the Xephyr repo: http://cgit.collabora.com/git/user/tomeu/xserver/log/?h=xephyr-touch

And here the Mutter repo: http://cgit.collabora.com/git/user/tomeu/mutter/log/?h=touch-clutter

Remember that these are early proof-of-concepts, but if you give it a try and want to give feedback, it will be welcome.

As usual, thanks to my employee Collabora for sponsoring this work and letting me share it.


Friday, July 13, 2012

Multi-touch in WebKit-Clutter

Following my past work on multi-touch support in Clutter, have been playing lately in implementing the W3C Touch Events API in the Clutter port of WebKit.

A lot of code can be reused from WebCore without problems, but we'll need to do some mildly complex event translation because the W3C API and the one in Clutter (and in XInput and in Gtk+) are very different.

But for now, a quick demo of a web page drawing the touch events that it receives, limited to 2 touch points because that's the maximum supported by the hardware I have here:


This is still early work, but once event translation is done, this should be very close to be feature-complete. And a nice side-effect is that given that the touch API in Clutter is so similar to Gtk+'s, it should be pretty straightforward to port it to WebKitGtk+. You can find the code here, but please keep in mind that this is very preliminary work.

As usual, thanks to my employer Collabora for sponsoring this work.

Tuesday, July 3, 2012

WebGL support in WebKit-Clutter: Part 2

Following up on my work from last december, I have a branch of webkit-clutter that runs most of the WebGL demos that float around the web. The main differences are that the required new API has been accepted into Cogl and that there's a lot more code shared with the other WebKit ports.

Right now bigger applications are not working because of this bug which also affects the Gtk+ port, but hopefully it will be fixed soon.

The code lives in this branch and you will need this Cogl branch with a recent Clutter 1.10 release.

As before, thanks to my employer Collabora for allowing to work on this.

Wednesday, June 27, 2012

Simple OpenGL ES 2.0 demo

It surprised me how hard it is to find a really simple demo that uses OpenGL ES 2.0, and most of those are for Android or iOS.

So for future googlability, here is one that uses EGL on X and fits in a single, independent file:

http://cgit.freedesktop.org/mesa/demos/tree/src/egl/opengles2/es2tri.c

Tuesday, June 5, 2012

Multi-touch support in Clutter

Have been doing some tests regarding multi-touch support on Clutter and everything seems to be working fine:



You will need either a very recent master or clutter-1.10 branch because there was a bit of fixing needed, but hopefully that will get into a release soon.

That example can be find in ./tests/interactive/test-touch-events.c and can be run as:

$ cd clutter
$ ./tests/interactive/test-touch-events

Needless to say, you will need a recent Xorg (1.12) and support in the kernel for your multi-touch hardware.

Hope that soon I will be able to work on gestures support and automated tests for this.

Thanks for my employer Collabora for sponsoring this work.

Monday, February 20, 2012

Progress on generating Python API docs from introspection

The Docs hackfest in Brno is nearing to an end and I think enough progress has happened on generating API reference from introspection to warrant a report.

To see the current state, check the Telepathy-GLib reference generated here for Python.

Tomorrow morning will work on fixing some issues in the GIR files such as enum docs not making to it and then I will head home.

I'm not likely to work further on this, so if you think it can be of use to you, please consider lending a hand and contribute bugfixes and features. And if you don't like the design or the layout, just change it :)

Hope you have as much fun with this as I have had!

Once more, thanks to the GNOME Foundation, Red Hat and Collabora for sponsoring this work.

Below you can get a glance of what has been progressed on during these days, here is the changelog:
  • Add some more stuff to Enum pages
  • Display the hierarchy tree for classes
  • Install the Mako template files
  • Add AM_CHECK_PYMOD macro and use it to check for Mako
  • Remove stale DocBook files
  • Properly link to property pages
  • Fix names of xref links
  • Move constructor example to follow the class doc body
  • Properly link to signal pages
  • Fix the id of signal pages for Python
  • Qualify the class name in the constructor with the module name
  • Add links to properties in the constructor
  • Fix link
  • Show how to construct instances in the Class page
  • Add details for properties in Python
  • Add param information to signal pages in Python
  • Implement intra-namespace cross references
  • Use instances of MallardFormatter* instead of class methods
  • Remove some occurrences of empty Returns: lines
  • use True and False instead of %TRUE and %FALSE
  • Remove module and class from the function signature
  • Use template caching
  • Use None instead of %NULL
  • Use the ctype for the return type in signatures
  • Display Returns: even if there's no args
  • Update expected, some whitespace was removed
  • Add Since: tag to classes
  • Add Since: tag to mallard docs
  • Add function argument docs to the C template
  • Add argument docs to the Python template
  • Don't instantiate MallardFormatter for unknown languages
  • Update expected mallard for the doc tests

Friday, February 17, 2012

Docs hackfest: starting point

Have spent my trip to Brno undusting and rebasing the branch in gobject-introspection that uses to Mako templates to generate Mallard code from GIR files.

Here you can see how looks like the generated documentation for the Account class in the TelepathyGLib typelib for Python, and here is the one generated with gtk-doc.

As can be seen, there's still a long way to get even close to the gtk-doc level, but it's a very promising start.

Thursday, February 16, 2012

Documentation hackfest in Brno 2012

Tomorrow I'm taking the train to Brno to participate in the documentation hackfest, with plans to continue the work on generating API documentation from the GIR files that are generated by GObject Introspection.

I will be continuing the work that a bunch of us started in Berlin during the GObject Introspection hackfest last year.

Will be giving as well a workshop on GNOME application development with Python and GObject Introspection as part of the Developer Conference 2012 that Red Hat is organizing there.

Thanks to the GNOME Foundation for sponsoring my accommodation, to my employer Collabora for sponsoring my time there and Red Hat for sponsoring the venue and the food.

Friday, February 10, 2012

PyGObject gets a splash of new blood

Things as they are, few hackers get to work on the same project their whole life. No matter how deep one has been involved in a project, and how much effort was put in, there are many reasons why at some point one may decide to distance from it.

For different reasons, the people who have been maintaining PyGObject for the last couple of years (since the move to introspection) aren't currently using it much any more, which isn't ideal because it means they can allocate less time to maintenance and also lack the guidance of their own motivation.

Fortunately for PyGObject, a bunch of heroic hackers have stepped forward to take the responsibility of maintaining it:
  • Martin Pitt
  • Paolo Borelli
  • Ignacio Casal Quintero
  • Sebastian Pölsterl
For now I remain listed in the .doap file, but as I'm not using PyGObject myself any more (even though Collabora sponsors some of my time working on PyGObject), my involvement will be limited to occasional patches and code reviews as I find time.

My thanks and admiration to those who have maintained PyGObject in the past:
  • Johan Dahlin
  • James Henstridge
  • John (J5) Palmieri
  • Simon van der Linden
  • Zach Goldberg
  • Gustavo J Carneiro
  • Paul Pogonyshev
  • Gian Mario Tagliaretti
To end, just note that Martin is using his canonical.com address, so I assume that Canonical is sponsoring his work as maintainer upstream, so kudos to them as well.