Commit Graph

9274 Commits

Author SHA1 Message Date
Carlos Garnacho
5b8a2a9e15 evdev: Handle libinput touchpad swipe/pinch gesture events
The translation from libinput events is fairly straightforward, as they
map almost 1:1.
2015-07-10 21:47:30 +02:00
Carlos Garnacho
c185a17783 event: Add pinch/swipe gesture event types and structs
We now have ClutterTouchpadPinchEvent and ClutterTouchpadSwipeEvent,
each bringing the necessary info for the specific gesture. Each
of these events is defined by begin/update/end/cancel phases.

These events have been also made to propagate down/up the pointer
position, just like scroll and button events do.
2015-07-10 21:47:01 +02:00
Emmanuele Bassi
a4b79e1cd3 docs: Update all the links in the README
We've been shipping with outdated links for a long while.
2015-07-10 15:48:07 +01:00
Emmanuele Bassi
3e14d87188 actor: Use CLUTTER_NEARBYINT instead of C integer casting
Otherwise we break because of rounding.
2015-07-10 14:33:25 +01:00
Emmanuele Bassi
b0e785c6c2 actor: Add bind_model_with_properties()
When binding models to actors to map items to children we don't often
need the full control of a function; in many cases we just need to
specify the type of the child we want to construct and the properties
on both the item and the child that we want to bind.

We should provide a simple convenience function that does all this for
us.
2015-07-10 11:26:34 +01:00
Emmanuele Bassi
eda436f0c4 examples/actor-model: Add activate transition
Show a simple transition when the current menu item is activated.
2015-07-10 10:42:27 +01:00
Emmanuele Bassi
bf0ca91662 examples/actor-model: Clean up and comment
This is an example so it ought to be a bit more didactic.
2015-07-09 16:53:39 +01:00
Emmanuele Bassi
365bd482fb gdk: Use X11 API only when running under X11
Avoid using GdkX11Screen API when the GDK backend being used is not the
X11 one.

https://bugzilla.gnome.org/show_bug.cgi?id=752143
2015-07-09 14:34:11 +01:00
Emmanuele Bassi
41cd804f10 actor: Rename internal function
Map to the field name and the signal name, so it's clear what it does.
2015-07-09 14:30:26 +01:00
Emmanuele Bassi
b0300a6247 cogl: Pack ClutterStageCogl a bit more
We should rearrange the fields a bit so they get packed without holes,
and aligned with cacheline boundaries.
2015-07-08 11:15:54 +01:00
Emmanuele Bassi
938eea175f backend: Remove unnecessary private data structure
The whole of ClutterBackend is a final/protected type, so having a bunch
of instance fields and an instance private data structure is redundant
at best, and less efficient at worst.
2015-07-08 11:10:45 +01:00
Emmanuele Bassi
19fbbcd358 build: Do not define Wayland support unconditionally
Now that we discover at configure time if Wayland is available, we
should only enable support if we find it.

https://bugzilla.gnome.org/show_bug.cgi?id=752104
2015-07-08 11:05:10 +01:00
Emmanuele Bassi
02b69e4d76 Move header inclusion guard at the top
GCC has some optimization for the inclusion guard, but they only work if
the check is the outermost one.

We're fairly inconsistent because of historical reasons, so we should
ensure that we follow the same pattern in every public header.
2015-07-07 16:03:32 +01:00
Emmanuele Bassi
cffa243fbe Add autocleanup macros for Clutter types
So that people can use the g_auto* macros, as well as the G_DECLARE_*
ones, from GLib 2.44.
2015-07-07 16:03:31 +01:00
Emmanuele Bassi
6cd24faaa5 actor: Clean up transform_stage_point()
Use double precision floats for the intermediate computations, to avoid
loss of precision, and don't convert too integer when unnecessary, to
avoid rounding errors.
2015-07-07 16:03:31 +01:00
Emmanuele Bassi
4b9e672bc1 examples: Add actor-model
A basic example that shows how to build a composite actor starting from
a GListStore of model objects.
2015-07-07 16:03:31 +01:00
Emmanuele Bassi
bf9a71ae23 actor: Allow binding an actor to a GListModel
It can be useful to bind the children list to set of objects inside a
GListModel implementation; the GListModel stores the objects, and every
time the model changes, a function is called that maps each object in
the model to a newly created ClutterActor, which is then added as a
child. This API, along with the property binding one inside GObject,
allows automatic creation of views based on object models that update
themselves without manual intervention.
2015-07-07 16:03:31 +01:00
Emmanuele Bassi
7cde4486aa build: Bump GLib dependency
We need GListModel, in GIO since 2.44.
2015-07-07 16:03:31 +01:00
Emmanuele Bassi
db8bb95817 Move ClutterModel to the deprecated area
And deal with the fallout in the source tree.
2015-07-07 16:03:31 +01:00
Emmanuele Bassi
31c2c57f8b Move clutter-list-model.[ch] to the deprecated area 2015-07-07 16:03:31 +01:00
Emmanuele Bassi
52e8864aa3 conform: Disable deprecation warnings in the model units 2015-07-07 16:03:31 +01:00
Emmanuele Bassi
6376eebd9b Deprecate ClutterModel
Now that we've deprecated the only concrete implementation of
ClutterModel, it's time we deprecate the base abstract class.
2015-07-07 16:03:31 +01:00
Emmanuele Bassi
e1e6f7be48 Deprecate ClutterListModel
The model API was an ad hoc addition to Clutter, back in the 0.6 days,
that was needed because GLib did not offer anything of sort, and the
only model-like storage was inside GTK+. The API design was heavily
based on GtkTreeModel and friends, with column-based collections of
generic data.

Since then, the model API inside Clutter has not really been integrated
in the core API; on the other hand, GIO has grown a model API, and it's
seeing more use in the platform.

This means that the ClutterModel API should finally be deprecated, and
we should move code to the GListModel API inside GIO.
2015-07-07 16:03:31 +01:00
Emmanuele Bassi
d09c204a26 build: Automatically detect Wayland support
Like we do for X11, GDK, MacOS, and Windows, the Wayland backend can be
autodetected. We should only fail if the Wayland support was explicitly
asked at configure time, but the dependencies were not satisfied.
2015-07-07 16:03:31 +01:00
Peter Hutterer
661078a4f2 x11: don't create the libinput tapping property
If it doesn't exist, we don't have a touchpad. Don't create the property
and potentially confuse other pieces of the stack that do the same check.
2015-07-07 16:03:31 +01:00
Pedro Albuquerque
7668dd1c99 Updated Portuguese translation 2015-07-01 21:58:13 +00:00
Kalev Lember
7c2ac712f7 docs: Fix a typo in ClutterImage example 2015-06-20 18:55:01 +02:00
Emmanuele Bassi
852ba2c089 Post-release version bump to 1.23.3 2015-06-18 16:39:17 +01:00
Emmanuele Bassi
f244d9383a Release Clutter 1.23.2 2015-06-18 16:30:16 +01:00
Emmanuele Bassi
b5fd0fe7fe tests/interactive: Fix compiler warning
Missing type for the closure argument.
2015-06-18 16:29:26 +01:00
Gustavo Noronha Silva
0c75e17814 Add PanAxis mode that automatically pins scroll based on initial movement
This code is inspired by the implementation of the same feature for the
Mx toolkit's MxKineticScrollView. See commit 4d08771.

https://bugzilla.gnome.org/show_bug.cgi?id=707982
2015-06-11 15:47:48 -03:00
Carlos Garnacho
2105055a34 gdk: Enable GDK_TOUCH_MASK on the stage window
This allows touch events to be received and translated.

https://bugzilla.gnome.org/show_bug.cgi?id=750496
2015-06-11 15:06:55 +01:00
Carlos Garnacho
7ed3714a94 gdk: Ignore synthesized leave events out of touch events
Certain crossing modes notify about synthesized events, where
the pointer didn't really leave the window. Unsetting the stage
from the device at that time is incorrect, and will leave all
remaining touches unable to pick coordinates, so silently eaten
away.

https://bugzilla.gnome.org/show_bug.cgi?id=750496
2015-06-11 15:06:55 +01:00
Emmanuele Bassi
2d5b5aa82a gdk: Add function to retrieve the GdkVisual
Straight from Cogl.

This allows us to propagate the GdkVisual Cogl and Clutter use to
embedding toolkits, like GTK+.

The function is annotated as being added to the 1.22 development
cycle because it will be backported to the stable branch, so that
downstream developers can package up a version of Clutter that does
not crash on nVidia.

https://bugzilla.gnome.org/show_bug.cgi?id=747489
2015-06-10 19:09:21 +01:00
Emmanuele Bassi
c91621e8c2 gdk: Use the Cogl visual on Xlib winsys
GDK 3.16 started selecting different visuals, to best comply with the
requirements for OpenGL, and this has broken Clutter on GLX drivers that
are fairly picky in how they select visuals and GLXFBConfig.

GDK selects GLXFBConfig that do not include depth or stencil buffers;
Cogl, on the other hand, needs both depth and stencil buffers, and keeps
selecting the first available visual, assuming that the GLX driver will
give us the best compliant one, as per specification. Sadly, some
drivers will return incompatible configurations, and then bomb out when
you try to embed Clutter inside GTK+, because of mismatched visuals.

Cogl has an old, deprecated, Clutter-only API that allows us to retrieve
the XVisualInfo mapping to the GLXFBConfig it uses; this means we should
look up the GdkVisual for it when creating our own GdkWindows, instead
of relying on the RGBA and system GdkVisuals exposed by GDK — at least
on X11.

https://bugzilla.gnome.org/show_bug.cgi?id=747489
2015-06-10 19:06:25 +01:00
Emmanuele Bassi
dd9e43e98d build: No need to conditionally include -Wshadow
Cogl is not in tree any more, and compiler warnings are properly
addressed.
2015-06-10 14:01:32 +01:00
Emmanuele Bassi
0eb300e2ee build: Use the same pattern for the manual Mir check
Ensure that the checks are similar and create similar results.
2015-06-10 14:00:05 +01:00
Emmanuele Bassi
2fd47ce08e build: Manually check for Wayland support in Cogl
The Cogl pkg-config file does not specify the supported backends, which
means we need to manually check for the platform, like we do for Mir.
2015-06-10 13:59:18 +01:00
Emmanuele Bassi
e5941ee810 build: Remove unused internal defines
We don't use them any more in the code base.

I swear I keep deleting them, and they keep popping back up.
2015-06-10 12:32:26 +01:00
Emmanuele Bassi
c4fa3514ad Use the public symbol for Wayland compositor support
Instead of using a private one. This way, if things go out of sync,
we'll notice immediately.
2015-06-10 12:31:51 +01:00
Emmanuele Bassi
a1c4acf227 Add missing include
Some X11-related system header is leaking stdlib.h, so when we disable
the X11 backend we get a compiler warning for atol().
2015-06-10 12:28:59 +01:00
Emmanuele Bassi
896e43cbd5 gdk/device: Propagate more device details from GDK
In order to do device matching we need to propagate more information,
like the device_id (only on X11 with the XInput2 extension enabled),
the vendor id, and the product id.

https://bugzilla.gnome.org/show_bug.cgi?id=747951
2015-06-03 13:08:01 +01:00
Dima Ryazanov
71743ef660 Fix a compile error when the X11 backend is disabled
When defining clutter_stage_gdk_update_foreign_event_mask, check for the
same macros as when actually using it.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Emmanuele Bassi <ebassi@gnome.org>
2015-05-29 10:13:03 +01:00
Carlos Garnacho
fbe2c74e19 swipe-action: Fix typo
X coords are meant to compare with distance_x.
2015-05-26 19:05:20 +02:00
Carlos Garnacho
a4962c0336 swipe-action: Prepare for multifinger swipes
Its ::gesture-end implementation used to check the press/release
coordinates for the first touchpoint. On multifinger swipes, we
can receive this vfunc called due to other touch sequence going
first, so we'd get 0/0 as the release coordinates for this still
active sequence, resulting in bogus directions.

Instead, check the last event coordinates, that will be always
correct regardless of whether the touchpoint 0 finished yet or
not.

https://bugzilla.gnome.org/show_bug.cgi?id=749739
2015-05-26 19:02:51 +02:00
Emmanuele Bassi
67bf902022 Move API reference down one level
Since we only have one API reference, we can drop the clutter/
sub-level, and have all the files under doc/reference.
2015-05-19 15:27:30 +01:00
Emmanuele Bassi
c7bbe2a9f6 Remove the separate Cally API reference 2015-05-19 15:27:30 +01:00
Emmanuele Bassi
6088437786 docs: Merge Clutter and Cally API reference
It's pretty much pointless to have two API references:

 • the Cally API reference is fairly small
 • the build system is already complicated as it is
 • GTK-Doc isn't smart enough to ignore sub-directories
 • Cally is not a separate library, just a separate namespace

There are some issues with GTK-Doc not accepting multiple namespaces,
but nothing seriously tragic.
2015-05-19 15:27:30 +01:00
Emmanuele Bassi
c71dfa2162 docs: Remove stray XML element
We moved to Markdown a while ago, but a stray </para> was left in.
2015-05-19 15:27:30 +01:00
Emmanuele Bassi
27ea26cbaf build: Clean up Cally's API reference Makefile 2015-05-19 15:27:29 +01:00