Commit Graph

6355 Commits

Author SHA1 Message Date
Emmanuele Bassi
407d7ca436 Allow overriding the list of Cogl drivers via configuration file
Clutter has a configuration file that can be used to override
various settings, including the ones from environment variables.
2015-12-10 16:52:45 +00:00
Emmanuele Bassi
bb23335b5f Add a configuration option for deciding the Cogl drivers to use
Using environment variables only is not convenient for all platforms,
and in some cases it's beneficial to decide the default driver when
building Clutter. Cogl already has a similar configuration switch, and
since Clutter is overriding the default Cogl behaviour, it should offer
the same mechanism.

https://bugzilla.gnome.org/show_bug.cgi?id=742678
2015-12-10 16:38:46 +00:00
Emmanuele Bassi
2c524fbf73 backend: Allow overriding the Cogl drivers chain
We have an hardcoded list of drivers we have to go through when creating
a Cogl context. Some platforms may expose those drivers, but not be the
preferred ones.

In order to allow users and system integrators to override the list of
drivers, we should crib the same approach used by GDK, and have an
environment variable with a list of drivers to try.

The new environment variable is called `CLUTTER_DRIVER` and accepts a
comma-separated list of driver names, which will be tested in sequence
until one succeeds. There's also an additional '*' token which is used
to ask Clutter to fall back to the internally defined preferred list of
drivers.

https://bugzilla.gnome.org/show_bug.cgi?id=742678
2015-12-10 16:38:46 +00:00
Emmanuele Bassi
b47e1616eb Fix annotation for bind_model()
The (optional) annotation should only be used for (out) arguments; in
arguments that can be NULL should use the (nullable) annotation.
2015-12-09 12:44:20 +00:00
Emmanuele Bassi
a166cc9f35 Fix definition of ClutterEventExtender
The interface vtable structure is missing the GTypeInterface parent, and
GObject is complaining about it, as it should.
2015-12-09 12:42:55 +00:00
Emmanuele Bassi
dd30595084 gdk: Check for both GDK and Cogl winsys support
When using GDK and Cogl API, we need to check that both GDK and Cogl
have been built with support for that API, otherwise the build will
likely fail.
2015-12-08 14:24:36 +00:00
Jonas Ådahl
9c26a98a6f evdev: Drop redundant stage set check
Every path creating a input device in the evdev backend sets a stage,
so the check is unnecessary.

https://bugzilla.gnome.org/show_bug.cgi?id=752752
2015-12-03 15:36:49 +08:00
Emmanuele Bassi
1d53b773fd text: Enforce boolean value
We store the cursor-visible value in a bit field, which means that we
need to enforce the argument for the setter to either 0 or 1 in order to
fit.
2015-11-30 13:47:57 +00:00
Emmanuele Bassi
c8ef4349fe docs: Improve documentation for ClutterText
Ensure that the rule for :cursor-visible are documented.
2015-11-30 13:47:15 +00:00
Emmanuele Bassi
388fe9b542 text: Unify conditions for visible cursor
We have a bunch of similar checks in various places, and they should all
be coalesced into one.
2015-11-30 13:45:45 +00:00
Emmanuele Bassi
78eb07d657 text: Allow selectability without editability
Being able to select text and being able to edit text are two separate
capabilities, but ClutterText only allows the former with the latter.

The ClutterText:selectable property is set to TRUE by default, given
that it depends on the :editable property; this implies that all
ClutterText instances now are going to show a cursor as soon as they get
key focused. Obviously, this would make labels look a bit off — but if
you have a label then you would not give it key focus, either by
explicitly calling clutter_actor_grab_focus(), or by setting it as
reactive and allowing it to be clicked.

If this turns out to be a problem, we have various ways to avoid showing
a cursor — for instance, we could change the default value of the
selectable property, and ensure that setting the :editable property to
TRUE would also set the :selectable property as a side effect. Or we
could hide the cursor until the first button/touch press event. Finally,
we could always back this commit out if it proves to be too much of a
breakage for existing code bases.

https://bugzilla.gnome.org/show_bug.cgi?id=757470
2015-11-28 20:20:00 +00:00
Lionel Landwerlin
8c863573fc gdk: take into account scaling on wayland
The X11 part of the GDK backend takes into account the scaling factor of its
window when resizing the underlying X11 objects. We need to do the same for
Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=755245
2015-11-22 21:45:55 +00:00
Carlos Garnacho
a9b0715df1 gdk: Implement ClutterEventExtender
This lifts the responsibility off its ClutterBackend.

https://bugzilla.gnome.org/show_bug.cgi?id=758238
2015-11-18 13:00:53 +01:00
Carlos Garnacho
9215852c32 x11: Implement ClutterEventExtender
This lifts the responsibility off its ClutterBackend.

https://bugzilla.gnome.org/show_bug.cgi?id=758238
2015-11-18 13:00:53 +01:00
Carlos Garnacho
8aeea7fb73 evdev: Set event code on button/key events
This will allow users to know the event code without strange calculations
on event->key.hardware_keycode or event->button.button.

https://bugzilla.gnome.org/show_bug.cgi?id=758238
2015-11-18 13:00:53 +01:00
Carlos Garnacho
f1ad702309 evdev: Allow to retrieve the input.h event code from ClutterEvents
This is now stored as platform data in the ClutterEvent, so can
be retrieved with the clutter_evdev_event_get_event_code() call
that's been added to the evdev backend.

https://bugzilla.gnome.org/show_bug.cgi?id=758238
2015-11-18 13:00:48 +01:00
Carlos Garnacho
dfc749e576 evdev: Implement the ClutterEventExtender interface
This will allow the ClutterDeviceManagerEvdev to define evdev-specific
event data.

https://bugzilla.gnome.org/show_bug.cgi?id=758238
2015-11-18 12:59:05 +01:00
Carlos Garnacho
4115f215ac backend: Bridge platform-dependent event data creation to device managers
Device managers can now implement the ClutterEventExtender interface
that allows them to set their own data to events, make the backend call
those implementations if the device manager implements the interface.

https://bugzilla.gnome.org/show_bug.cgi?id=758238
2015-11-18 12:59:05 +01:00
Carlos Garnacho
5ea70bd102 device-manager: Add private interface to manipulate platform event data
This normally belonged to the ClutterBackend, however there's device
managers (eg. evdev) that are somewhat detached from the backend, so
need to bridge this somehow.

This allows device managers to implement these bits that were usually
responsibility of the ClutterBackend.

https://bugzilla.gnome.org/show_bug.cgi?id=758238
2015-11-18 12:59:05 +01:00
Emmanuele Bassi
89a794ec46 Add version macros for Clutter 1.26 2015-11-18 11:54:26 +00:00
Carlos Garnacho
83b738c0e7 evdev: Move additional pointer buttons after the old 4-7 scrolling ones
On X11 those were skipped, so additional pointer buttons would come up
as button >= 8 events. Do here the same, so we remain compatible across
backends.

https://bugzilla.gnome.org/show_bug.cgi?id=758237
2015-11-17 22:47:20 +01:00
Carlos Garnacho
a9f16c3d1f evdev: Mark either of smooth/discrete scroll events as emulating
We're always emulating one of those, depending on the scrolling
device/source, so mark these as such.
2015-10-23 17:04:49 +02:00
Carlos Garnacho
9753c99382 click-action: Ignore motions/updates from different devices/sequences
Otherwise events from other devices or touch sequences might unintendedly
trigger the thresholds, and a "cancelled" ::long-press with it.

https://bugzilla.gnome.org/show_bug.cgi?id=756749
2015-10-17 18:44:25 +02:00
Emmanuele Bassi
b6425bbb15 Use explicit NULL comparison for pointers
Following the coding style.
2015-10-12 19:54:32 +01:00
Carlos Garnacho
1fe21a8fe1 evdev: Emulate discrete scroll events out of smooth scroll ones.
There's handlers around relying on up/down/left/right scroll events,
which won't work as expected if only smooth scroll events are sent.
In order to work properly there, we have to retrofit discrete scroll
events on the evdev backend.

Fix this by implementing emission (on devices with a wheel) and
emulation (on anything else) of discrete scroll events. On the former
both smooth and discrete events are set, for the latter we do accumulate
the dx/dy of the latest scroll events, and emit discrete ones when we
accumulated enough. The ending 0/0 event will reset the accumulators for
the next scrolling batch.

https://bugzilla.gnome.org/show_bug.cgi?id=756284
2015-10-12 19:54:32 +01:00
Owen W. Taylor
2ddec579d6 clutter_actor_update_map_state: Remove a useless warning
A check for priv->parent == NULL was inside the else of a check
for (priv->parent == NULL).

https://bugzilla.gnome.org/show_bug.cgi?id=745517
2015-10-01 13:38:47 -04:00
Owen W. Taylor
4c9443bbd7 _clutter_actor_set_enable_paint_unmapped: don't force an unmap
When enable_paint_unmapped is disabled, we shouldn't force the
source widget to be unmapped if the constraints would keep it
mapped; in practice this shouldn't matter unless a paint handler
is messing with the map state.

https://bugzilla.gnome.org/show_bug.cgi?id=745517
2015-10-01 13:38:47 -04:00
Owen W. Taylor
76c8cd292e Avoid crashing when an actor not parented to a toplevel is cloned
If we can't realize the source actor for a clone, simply skip updating
the map state and painting it.

https://bugzilla.gnome.org/show_bug.cgi?id=745517
2015-09-29 14:15:16 -04:00
Lionel Landwerlin
b9df8524f0 gdk: Enable clock updates when timelines are added to the clock
Enable animation updates from the GdkFrameClock whenever any timeline is
added to the ClutterMasterClockGdk. This may improve animation
smoothness (depending on the GDK backend in use) because it allows GDK
to tweak its frame timing for animation purposes.

https://bugzilla.gnome.org/show_bug.cgi?id=755357
2015-09-22 17:27:42 +01:00
Philip Withnall
3816d5a6bb gdk: Fix frame budget diagnostics
Set the frame budget so that CLUTTER_ENABLE_DIAGNOSTIC correctly outputs
timing diagnostics from the ClutterMasterClockGdk.

https://bugzilla.gnome.org/show_bug.cgi?id=755357
2015-09-21 18:03:04 +01:00
Philip Withnall
9e8da64636 gdk: Use frame time when calculating the tick time for clock updates
This is how GdkFrameClock is meant to be used: the frame time is meant
to be queried from the GdkFrameClock within its frame signals, rather
from the system monotonic time source.

https://bugzilla.gnome.org/show_bug.cgi?id=755357
2015-09-21 18:03:04 +01:00
Philip Withnall
5545b69a8f timeline: Add more debug output
https://bugzilla.gnome.org/show_bug.cgi?id=755357
2015-09-21 17:02:39 +01:00
Philip Withnall
ae1a84853e timeline: Ensure waiting_first_tick is set before adding the timeline
Just in case the timeline starts being prodded by the ClutterMasterClock
before the add function returns. (This has not been verified.)

https://bugzilla.gnome.org/show_bug.cgi?id=755357
2015-09-21 17:02:39 +01:00
Lionel Landwerlin
0e7b18832a cogl: reset pending swaps counter on unrealize
When removing the frame callback on the CoglOnscreen, we loose the ability
to get notified of swap events. This could leave us with a counter != 0
which leads to a deadlock situation after the next realize/draw cycle.

https://bugzilla.gnome.org/show_bug.cgi?id=755014
2015-09-15 12:29:05 +01:00
Lionel Landwerlin
ff1a5aae7a x11: stage window: reset framebuffer on foreign window unrealize
Similarly to 13dbb74c81, we need to reset the
framebuffer in the x11 for foreign windows.

https://bugzilla.gnome.org/show_bug.cgi?id=755014
2015-09-15 12:29:04 +01:00
Lionel Landwerlin
6c7f624f69 master-clock-default: prevent deadlock with GLX_INTEL_swap_event
If we call _clutter_stage_do_update() on a ClutterStage that isn't
mapped/visible, no GL command will be queued, and the Mesa/DRI2
implementation of SwapBuffers will do nothing. This causes
GLX_INTEL_swap_event to not be emitted by the X server because no swapping
has been requested through DRI2 and it eventually leads to a deadlock
situation in ClutterStageCogl because we're waiting for an event before we
start the next draw cycle.

This patch removes the non mapped stages from the list of stages to process.
This is consistent with a previous patch for the ClutterMasterClockGdk [1].

[1] : 5733ad58e5

https://bugzilla.gnome.org/show_bug.cgi?id=755014
2015-09-15 12:23:08 +01:00
Lionel Landwerlin
ee98a5bbe8 gdk: x11: notify Cogl immediately of a foreign window resize
We want to avoid waiting for the acknowledgement event from the X
server as we might redraw the stage before that happens.

This patch reimplements a bit of logic already in clutter-gtk [1].

[1] : https://git.gnome.org/browse/clutter-gtk/tree/clutter-gtk/gtk-clutter-embed.c#n723

https://bugzilla.gnome.org/show_bug.cgi?id=754993
2015-09-14 13:49:08 +01:00
Lionel Landwerlin
aeb19f2f4d gdk: move sync_to_vblank setup from master clock to backend
Setting up the sync_to_vblank in the MasterClock is a bit too late as
the MasterClock can be created after a StageWindow has been created
and realized (and therefore all of its Cogl/GL state setup already).
So move the setup to the backend, prior to any StageWindow creation.

https://bugzilla.gnome.org/show_bug.cgi?id=754938
2015-09-14 13:46:31 +01:00
Lionel Landwerlin
13dbb74c81 gdk: stage window: reset framebuffer on foreign window unrealize
Clutter still uses part of the deprecated stateful API of Cogl (in
particulart cogl_set_framebuffer). It means Cogl can keep an internal
reference to the onscreen object we rendered to. In the case of
foreign window, we want to avoid this, as we don't know what's going
to happen to that window.

This change sets the current Cogl framebuffer to a dummy 1x1
framebuffer if the current Cogl framebuffer is the one we're
unrealizing.

https://bugzilla.gnome.org/show_bug.cgi?id=754890
2015-09-12 00:39:43 +02:00
Lionel Landwerlin
cb4e88884b gdk: master clock: hook ourselves to the paint signal
We're currently hooked to the "update" signal of the FrameClock. When
embedding Clutter inside GTK+ we want to have the layout phase of GTK+
to notify us the size of our stage.

This patch change to FrameClock signal we're listening to, to the
"paint" signal to make sure we've received the layout information from
GTK+, before painting. Otherwise we paint with a delay of one frame.

https://bugzilla.gnome.org/show_bug.cgi?id=754889
2015-09-12 00:39:43 +02:00
Jonas Ådahl
5d83260b19 actor: Fix transforming stage point when scale is less than 1
The commit 6cd24faaa5 (actor: Clean up
transform_stage_point()) changed the validation of the transformation
matrix to ignore the fraction part of the determinant. This caused
clutter_actor_transform_stage_point() to fail and return FALSE for
actors which scale was less than 1.

Previously the validation was ('det' being a float):
	det = (RQ[0][0] * ST[0][0])
	    + (RQ[0][1] * ST[0][1])
	    + (RQ[0][2] * ST[0][2]);
	if (!det)
		return FALSE;

Semantically, the if statement expression '!det' is equivalent to
'det == 0', i.e. 'det == 0.0f'. Post cleanup patches, 'det' was turned
into a double, and the if statement was changed to:

	if (CLUTTER_NEARBYINT (det) == 0)
		return FALSE;

which, different from before, rounds the determinant to the nearest
integer value, meaning determinant in the range (-0.5, 0.5) would be
considered invalid.

This patch reverts this part to the old behavior, while, because of the
inexact nature of floating point arithmetics, allowing a bit more liberal
meaning of "equals to 0" than '== 0.0'.

https://bugzilla.gnome.org/show_bug.cgi?id=754766
2015-09-11 10:36:52 +08:00
Lionel Landwerlin
9432e67ee8 gdk: stage: create subsurface when dealing with foreign windows on wayland
It is safer to create our own wayland surface when rendering into
someone else GdkWindow, otherwise we might draw somewhere we didn't
intend to.

https://bugzilla.gnome.org/show_bug.cgi?id=754697
2015-09-07 18:17:10 +01:00
Lionel Landwerlin
3771ef2f08 gdk: stage: report geometry of the underlying surface for foreign windows
When running on wayland, we might have our own subsurface
desynchronized from the foreign GdkWindow. It is important that we
report the size of the actually surface we're rendering to, otherwise
the logic in ClutterStage might discard resize operation that
resynchronize the subsurface with the stage's size.

https://bugzilla.gnome.org/show_bug.cgi?id=754697
2015-09-07 18:17:10 +01:00
Lionel Landwerlin
55dce70440 gdk: stage: do not ensure native windows are created with foreign windows
For foreign windows this should be dealt with by the embedding
framework. In particular on Wayland with foreign windows, we might
want to create a subsurface and use the foreign window only for events
and frame clock synchronization.

https://bugzilla.gnome.org/show_bug.cgi?id=754697
2015-09-07 18:17:10 +01:00
Lionel Landwerlin
a9b38fefdc gdk: stage: disable some operations for foreign windows
Some operations like :
     * resize
     * show/hide
     * set_title
     * set_user_resizable

should be handled by the embedding framework, so disable them for
foreign windows.

https://bugzilla.gnome.org/show_bug.cgi?id=754671
2015-09-07 18:17:10 +01:00
Lionel Landwerlin
5733ad58e5 gdk: master clock: only process mapped & realized stages
When using Clutter embed inside a Gtk application, a stage might end
up realized but not visible. In this case we might discard doing any
kind of animation processing.

https://bugzilla.gnome.org/show_bug.cgi?id=754671
2015-09-07 18:17:09 +01:00
Lionel Landwerlin
6183eb3632 gdk: master-clock: disable vsync throttling
When running with a master clock based on the GdkFrameClock, we get
synchronized with the compositor, so no need for throttling rendering.

In particular when dealing with foreign windows, we run into deadlocks
in Mesa because of the way the Mesa wayland backend is implemented [1].

[1] : http://cgit.freedesktop.org/mesa/mesa/tree/src/egl/drivers/dri2/platform_wayland.c#n330

https://bugzilla.gnome.org/show_bug.cgi?id=754671
2015-09-07 18:17:09 +01:00
Emmanuele Bassi
dbec3be996 grid-layout: Clarify the scope of the orientation property
Just like GtkGrid, changing the orientation of a ClutterGridLayout does
not change the existing layout; the orientation property is only used as
a hint when adding new children.
2015-09-04 13:53:04 +01:00
Emmanuele Bassi
7ed96aabd8 grid: Use the proper orientation for the request mode
We automatically switch the request mode of the container depending on
the GridLayout's orientation, but we need to keep track of the request
mode during allocation, so that we don't get out of sync if the user
changed the request mode after adding the layout manager.

This change also brings us closer to the code in GtkGrid.
2015-09-03 14:18:33 +01:00
Emmanuele Bassi
dea5057fbd grid: Use the orientation of the request
We use the orientation of the grid to get the preferred size of the
layout, but we should be using the orientation of the request instead.
The preferred width has an orizontal orientation, and the preferred
height has a vertical orientation.

This allows us to refactor the get_preferred_* implementation into a
separate function.
2015-08-29 20:38:29 +01:00
Lionel Landwerlin
0e4d11bcd8 gdk: master clock: fix incorrect symbol use
https://bugzilla.gnome.org/show_bug.cgi?id=754134
2015-08-26 21:40:47 +01:00
Lionel Landwerlin
5b9c31a0ce gdk: fix memory corruption
g_hash_table_replace will free the list pointer we're modifying.
Let's just do memory management ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=754134
2015-08-26 21:40:41 +01:00
Emmanuele Bassi
84c5846aa0 image: Use internal function for the texture node
ClutterActor has a convenience function that removes the need to query
the actor's state and apply it to a ClutterTextureNode, so we should use
it.
2015-08-24 10:01:03 +01:00
Emmanuele Bassi
af010d5e2d canvas: Use internal function for the texture node
ClutterActor has a convenience function that removes the need to query
the actor's state and apply it to a ClutterTextureNode, so we should use
it.
2015-08-24 09:59:53 +01:00
Emmanuele Bassi
cf7e37b53b actor: Add internal "create textute node" function
To avoid excessive copy and paste. We could even consider making it
public before release.
2015-08-24 09:59:16 +01:00
Emmanuele Bassi
38e983b8e9 docs: Fix a typo in the BoxLayout:homogeneous description
https://bugzilla.gnome.org/show_bug.cgi?id=753895
2015-08-21 12:11:05 +01:00
Emmanuele Bassi
fe422ab61c gdk: Use non-deprecated/non-Clutter specific X11 API
We are currently using deprecated/Clutter-specific API in Cogl to
retrieve the XVisualInfo associated with the (E)GLX context. Cogl 1.21.2
added new CoglRenderer API to achieve the same result.
2015-08-21 11:58:52 +01:00
Anders Jonsson
6d649ec6d1 Fix typo (textues)
https://bugzilla.gnome.org/show_bug.cgi?id=746279
2015-08-01 21:55:07 +02:00
Adel Gadllah
9a510c0117 backend: Check for a known set of drivers
We want to use the Cogl GL3 driver, if possible, and then go through a
known list of Cogl drivers, before giving up and using COGL_DRIVER_ANY.

Based on original patch from Emmanuele Bassi.

We have to create and tear down the whole context when trying
out the drivers though because the extension checks do not happen
until cogl_context_init.

https://bugzilla.gnome.org/show_bug.cgi?id=742678
2015-07-26 16:05:07 +02:00
Carlos Garnacho
40f6a0135e evdev: Set missing dx/dy fields on ClutterTouchpadPinchEvents 2015-07-24 19:17:12 +02:00
Emmanuele Bassi
b834503b79 build: Fix for distcheck 2015-07-22 19:12:42 +01:00
Stefan Sauer
8f976cad44 docs: give more hints about how to replace the anchor-point
In addition to pivot-point also mention _set_translation().
2015-07-22 18:41:39 +01:00
Emmanuele Bassi
13c722c026 x11: Remove unused enumeration
The ClutterX11XInputEventTypes enumeration has been unused inside
Clutter for the past 4 years and a half, since we switched to the
XInput 2 API.

The enumeration itself has always been private, and nobody should
have used it in the first place, but if something breaks, we can
revert this commit.
2015-07-20 13:05:06 +01:00
Emmanuele Bassi
9d40fafa2a Do not generate backend-specific enumeration types
They should be part of the backend-specific API.

The only backend that has an enumeration type is the X11 one, and it's
small, so we can simply put it there.

This is not an ABI change: the backend-specific symbols are still in
the same SO. You'll be required to import clutter-x11.h to have access
to the GType method at the source level, whereas before just importing
clutter.h would have sufficed. The only user of that enumeration was a
function declared in clutter-x11.h, anyway.
2015-07-20 13:00:12 +01:00
Emmanuele Bassi
c2e63cf16b build: Use the appropriate NAMESPACE variable everywhere
We're inconsistently using the NAMESPACE variable instead of passing
the --identifier-prefix and --symbol-prefix command line arguments to
the introspection scanner.
2015-07-19 13:17:49 +01:00
Emmanuele Bassi
e474684f2b deprecated: Regenerate the compatibility key symbols
Now with the appropriate compiler warning that points to the replacement
key symbol.
2015-07-17 13:16:53 +01:00
Emmanuele Bassi
1506ec4a54 keysyms-update: Add deprecation notice for compat symbols
Now that we can warn about deprecated macros, we should finally do it
for the old, non-namespaced key symbol macros that we've been stringing
along since the 1.0 days.
2015-07-17 13:15:32 +01:00
Ting-Wei Lan
ad690c61b1 macros: Clang 3.4 and later versions can use deprecation macros for GCC
https://bugzilla.gnome.org/show_bug.cgi?id=752272
2015-07-14 02:39:40 +08:00
Nitin Sharma
4dfa4de5d0 actor: Check for NULL pointer for pspec
In function clutter_actor_set_final_state, the pspec pointer returned by calling
g_object_class_find_property is not checked for NULL.
2015-07-13 13:15:52 +01:00
Emmanuele Bassi
332aa3cf21 macros: Add fallback defines for non-GCC compilers
I forgot to add the fallback definitions in case we're not using GCC;
without them, anybody using non-GCC compilers will get a build error.

https://bugzilla.gnome.org/show_bug.cgi?id=752272
2015-07-11 23:58:12 +01:00
Ting-Wei Lan
7e0f588c91 trivial: Fix return value error in clutter_event_get_gesture_motion_delta 2015-07-11 18:09:45 +08:00
Emmanuele Bassi
a722cbebef actor: Fully deprecate the state access macros
Now that we can warn without breaking the build, we should deprecate the
state access macros for ClutterActor.
2015-07-11 10:18:18 +01:00
Emmanuele Bassi
4040f2d556 gdk: Do not use deprecated macros
Use the replacement functions instead.
2015-07-11 10:18:18 +01:00
Emmanuele Bassi
eefbb88675 backend: Do not use deprecated macros
Use the replacement functions instead.
2015-07-11 10:18:18 +01:00
Emmanuele Bassi
02b44fcc60 cally: Drop use of deprecated macros
Use the equivalent functions instead.
2015-07-11 10:18:18 +01:00
Emmanuele Bassi
8a24ad83c9 Add macros for deprecating macros
We want to be able to deprecate macros, but right now the best we can do
is to wrap them with things like:

  #ifndef CLUTTER_DISABLE_DEPRECATED
  # define A_MACRO_I_WANT_TO_DEPRECATE ...
  #endif

Which requires adding a new symbol to the build, and will cause a build
error instead of a compiler/pre-processor warning.

Fortunately, we can use the _Pragma() keyword introduced by C99 and
supported by GCC to add a warning to the output, while leaving the macro
itself intact.

GCC does not have a "deprecated" pragma, so we have to use a generic
warning; this also means we cannot do nifty things like concatenating
strings and the like, as we do for the "deprecated" attribute.

The macro deprecation symbol should have the same affordances as the
function deprecation one, and evaluate to nothing if the required
version is lower than the current version; or if the global toggle for
deprecation warnings is in effect.
2015-07-11 10:18:18 +01:00
Carlos Garnacho
b151898534 clutter-event: Add API around touchpad gesture events
These are needed in order to make these events binding friendly
2015-07-10 21:47:30 +02:00
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
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
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
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
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
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
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
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
Kalev Lember
7c2ac712f7 docs: Fix a typo in ClutterImage example 2015-06-20 18:55:01 +02: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