Commit Graph

5489 Commits

Author SHA1 Message Date
Alexander Larsson
fd8dcfcc56 Ensure that fixed positions always start at 0,0
Fixed positions are defined to be initialized at 0,0 whenever
enabled, by setting fixed_position_enabled to true, or by setting
just one of x/y. This normally happens in the defaults, but we need
to make sure it also happens if a fixed position was once set but
then disabled. We do this by always resetting it back to 0,0 when
fixed_position_set is unset.
2012-06-07 16:32:01 +02:00
Alexander Larsson
962bcb1222 Add _clutter_actor_peek_layout_info
This will be needed later to get a layout_info without creating one
if there is none already.
2012-06-07 16:31:22 +02:00
Emmanuele Bassi
9371029a89 actor: Improve debug message for create_transition()
Add the property and easing state information.
2012-06-07 12:06:56 +01:00
Emmanuele Bassi
42b933eeaf debug: Group debug messages by timestamps
Instead of showing the full timestamp for debugging messages that happen
within a second, showing the delta from the previous full timestamp can
be more useful when debugging; this allows immediately seeing the time
difference, instead of doing the math in our heads.
2012-06-07 11:57:53 +01:00
Emmanuele Bassi
a3a2fbfd5a actor: Improve the debug name
Only for debug builds, the debug name should include a) actor name, b)
type name, and c) pointer address.

For non-debug builds we can live with the actor/type name.
2012-06-07 11:57:53 +01:00
Emmanuele Bassi
008afe80e3 docs: Fix wrong rotation-* properties name
Copy and paste typos from the old documentation.
2012-06-06 11:19:33 +01:00
Danielle Madeley
38724e2639 evdev: Use new xkbcommon include path
Inspired by a similar patch in Wayland.
2012-06-06 11:04:57 +10:00
Emmanuele Bassi
7ed77e98fe symbols: Add missing functions 2012-06-05 19:40:14 +01:00
Emmanuele Bassi
0247d07016 docs: Add ClutterTimelineClass.stopped annotation 2012-06-05 19:27:28 +01:00
Tomeu Vizoso
0ec01a2e42 events: Deliver touch events to actors
https://bugzilla.gnome.org/show_bug.cgi?id=677390
2012-06-05 15:59:52 +02:00
Bastian Winkler
1eb869ec8f Add ClutterGridLayout
ClutterGridLayout is port of GtkGrid to a Clutter layout manager. All
the logic is taken from gtkgrid.c, so all the credits should go to
Matthias Clasen for writing this nice piece of code.

ClutterGridLayout supports adding children with it's own methods
GridLayout.attach() and GridLayout.attach_next_to() as well as
Actor.add_child() and friends. The latter adds children in a similar
fashion to ClutterBoxLayout

https://bugzilla.gnome.org/show_bug.cgi?id=677372
2012-06-05 12:28:25 +02:00
Alexander Larsson
8ef55e4e98 Don't allocate size for invisible BinLayout children 2012-06-05 10:55:17 +02:00
Bastian Winkler
c7c3d85225 box-layout: Deprecate expand/fill/align child properties
These are covered by ClutterActor:[xy]-align and
ClutterActor:[xy]-expand

https://bugzilla.gnome.org/show_bug.cgi?id=677283
2012-06-04 16:16:41 +02:00
Bastian Winkler
157353ec3c box-layout: Honor actor expand and alignment
Check if the actor has needs to expand and use Actor.allocate() instead
of Actor.allocate_align_fill() in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=677283
2012-06-04 16:16:37 +02:00
Bastian Winkler
8e24de86b6 table-layout: Honor actors expand and alignment settings
Check if the actor has needs to expand and use Actor.allocate() instead
of Actor.allocate_align_fill in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=677284
2012-06-04 16:12:47 +02:00
Emmanuele Bassi
65c8b11604 image: Add a data setter using GBytes
The plain C bytes array, while convenient from a C perspective, is not
well handled by language bindings: the length of the array is not
specified, and it's only just implied by the image data size, rowstride,
and pixel format.

GBytes is a read-only bytes buffer that has an implicit length; we can
use it as the storage medium so that language bindings can actually
function correctly.
2012-06-04 10:34:22 +01:00
Emmanuele Bassi
b1fcc828be osx/backend: Chain up in create_context()
This will ensure that we have a CoglContext, albeit the stub winsys one,
on Mac.

Tested-by: Roland Peffer <gdevel@clixxun.com>
Tested-by: Laszlo Pandy <laszlok2@gmail.com>
2012-05-31 10:06:05 +01:00
Emanuele Aina
7f9c3976a1 Fix width-for-height allocations
https://bugzilla.gnome.org/show_bug.cgi?id=677039
2012-05-31 09:55:26 +01:00
Emmanuele Bassi
de4d70af69 timeline: Add a new "stopped" signal
The ::stopped signal is emitted when the timeline has been completely
exhausted or when the timeline has been programmatically stopped by
using clutter_timeline_stop(); the notification at the end of the
timeline run allows to write handlers without having to check whether
the current repeat is the last one, like we are forced to do when using
the ::completed signal.

Based on the patch by: Jasper St. Pierre <jstpierre@mecheye.net>

https://bugzilla.gnome.org/show_bug.cgi?id=676854
2012-05-31 09:54:23 +01:00
Emmanuele Bassi
4634dde613 actor: Stop transitions on remove_child()
There's no point in having transitions running when removing a child, so
we just stop them.

https://bugzilla.gnome.org/show_bug.cgi?id=677098
2012-05-31 10:28:54 +02:00
Emmanuele Bassi
b9533cb397 actor: Finally fix RESIZE_ASPECT content gravity
Ensure that resizing transitions smoothly when switching between major
axis; the allocation aspect ratio is not important: it's the size of the
allocation that dictates the major axis.
2012-05-30 12:49:11 +01:00
Bastian Winkler
7df4bfcf3b box-layout: Remove unused BoxChild members
These are leftovers from the old animation API an are unused now.

https://bugzilla.gnome.org/show_bug.cgi?id=677086
2012-05-30 12:47:32 +02:00
Bastian Winkler
793bde9143 table-layout: Use the ClutterLayoutManager animation API
ClutterTableLayout now only calls the animation API of
ClutterLayoutManager

https://bugzilla.gnome.org/show_bug.cgi?id=676827
2012-05-28 19:37:11 +02:00
Bastian Winkler
58a1854b57 box-layout: Use the ClutterLayoutManager animation API
ClutterBoxLayout now only calls the animation API of
ClutterLayoutManager

https://bugzilla.gnome.org/show_bug.cgi?id=676827
2012-05-28 19:37:11 +02:00
Bastian Winkler
320fb156b4 flow-layout: Implement layout animations
Allow to animate the child allocation using the ClutterLayoutManager
animation API

https://bugzilla.gnome.org/show_bug.cgi?id=676827
2012-05-28 19:37:10 +02:00
Bastian Winkler
03ec016faa bin-layout: Implement layout animations
Allow to animate the child allocation using the ClutterLayoutManager
animation API

https://bugzilla.gnome.org/show_bug.cgi?id=676827
2012-05-28 19:37:10 +02:00
Bastian Winkler
7f6b17bc50 layout-manager: Add a new animation API
It's similar to to the implicit animation API of ClutterActor and
compatible to deprecated API of ClutterBoxLayout and
ClutterTableLayout.

It adds :use-animations, :easing-mode, :easing-duration and
:easing-delay properties to control animations when allocation of a
child has changed. Layout manager implementers should call

use_animations = clutter_layout_manager_get_easing_state (manager,
                                                          &mode,
                                                          &duration,
                                                          &delay);

from the allocate() virtual function to access these values.

https://bugzilla.gnome.org/show_bug.cgi?id=676827
2012-05-28 19:37:10 +02:00
Bastian Winkler
734720ef0f layout-manager: Add a private struct to hold future properties
In order to allow the abstract ClutterLayoutManager class to have own
GObject properties we'll need a private structure.

https://bugzilla.gnome.org/show_bug.cgi?id=676827
2012-05-28 19:37:10 +02:00
Emmanuele Bassi
8e9992de7c paint-volume: Use the correct coordinate for axis alignment
The z coordinate of the origin should be checked against the same
coordinate of the vertex behind it. Given that most actors are flat
surfaces, this check should always succeed.

https://bugzilla.gnome.org/show_bug.cgi?id=675396
2012-05-28 15:22:54 +01:00
Bastian Winkler
58b13aa412 text: Enable implicit color animations
Implement the ClutterAnimatable interface to enable implicit animations
for :color, :cursor-color, :selected-text-color and :selection-color.

https://bugzilla.gnome.org/show_bug.cgi?id=676963
2012-05-28 15:22:47 +01:00
Emmanuele Bassi
129752e560 event: Add convenience functions for Shift and Ctrl modifiers
Instead of going through clutter_event_get_state() and checking if the
modifier mask is set, we can provide simple convenience functions to do
it for us.
2012-05-25 11:33:57 +01:00
Mike Ruprecht
ee708d1cf8 flow-layout: Check for all positive values
When creating a FlowLayout container, setting a specific size on it, and
adding a child to it, as per the attached testcase, it crashes. The line
on the backtrace doesn't really make sense, but from looking over it, it
appears that it's probably because priv->line_natural is NULL. The
attached patch makes it so in this case, priv->line_natural is
allocated.

https://bugzilla.gnome.org/show_bug.cgi?id=676068

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-05-22 14:25:19 +01:00
Chun-wei Fan
ef1860d71d Bug 676150 GDK: Fix build on Windows
-Don't include unistd.h and stdint.h unconditionally as not all Windows
 compilers have them around.
-Only include cogl/cogl-xlib.h when it is really supported by Cogl and GDK.
-sys/ioctl.h is not available on Windows (MinGW/MSVC).
-Correct the call to cogl_renderer_set_winsys_id:
 (backend_cogl->cogl_renderer, COGL_WINSYS_ID_WGL) ->
 (renderer, COGL_WINSYS_ID_WGL)
2012-05-21 23:01:23 +08:00
Bastian Winkler
aeea9ee778 actor: Add a custom scriptable "margin" property
The property uses an array with the following CSS style syntax

 [ top, right, bottom, left ] or
 [ top, left/right, bottom ] or
 [ top/bottom, left/right ] or
 [ top/right/bottom/left ]

https://bugzilla.gnome.org/show_bug.cgi?id=676367
2012-05-21 15:31:34 +02:00
Dominique Bureau
a2d40fcf8c ClutterText: Cannot pass NULL string to clutter_text_set_text()
Passing a NULL buffer to clutter_text_set_text() does not behave the same
way as passing an empty string "" (as specified in the documentation).
This was working as expected previously, but somehow the behaviour changed
at some point and created 2 new issues:
- Passing a NULL pointer will not reset the string
- If the ClutterText is editable, it will segfault in strcmp

Validations have been added to prevent this.

https://bugzilla.gnome.org/show_bug.cgi?id=675890
2012-05-21 11:30:22 +01:00
Tristan Van Berkom
dd61be7c2e ClutterDropAction: Avoid accessing priv->stage is not yet resolved.
This fixes drop_action_unregister() to not call g_object_get_data()
on priv->stage if not yet resolved. This can happen if the action's
actor was destroyed before ever being mapped.
2012-05-21 08:43:17 +01:00
Emmanuele Bassi
2c5af0c868 scroll-actor: Check for point equality in the internal setter
The public API should just accept any valid value; it's up to the
internal setter to check if we're getting the same value as the one
currently set.
2012-05-18 18:00:30 +01:00
Bastien Nocera
26c1d89d19 scroll-actor: Fix ->transition not being reset
When the transition was removed from the scroll-actor manually,
to cancel a not-finished animation, the transition struct member
wasn't reset to NULL.

This fixes this problem, and removes the need for the struct member
to be reset manually when animation has completed.

https://bugzilla.gnome.org/show_bug.cgi?id=676334
2012-05-18 17:36:44 +01:00
Emmanuele Bassi
c9028cee48 Move scroll actor test to the examples
Nothing specific to test, and the code is idiomatic enough to be used as
an example.
2012-05-17 10:57:15 +01:00
Bastian Winkler
06d1398592 table-layout: Remove unused animation helpers
They aren't used since ClutterTableLayout switched to the implicit
animations API.

https://bugzilla.gnome.org/show_bug.cgi?id=676158
2012-05-16 14:55:10 +02:00
Bastian Winkler
1f7ff75a5c text: Add missing introspection annotations
Add allow-none annotations where appropriate
2012-05-15 17:41:24 +02:00
Bastian Winkler
0ef4cc3aed keyframe-transition: Create a new interval if necessary
When setting up the transition manually by calling

  clutter_keyframe_transition_set_key_frame (transition, n, keys);
  clutter_keyframe_transition_set_values (transition, n, values);
  clutter_keyframe_transition_set_modes (transition, n, modes);

the frame doesn't have a valid interval when calling set_keys(), so we
need to check its existence and create it if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=676031
2012-05-15 17:41:24 +02:00
Bastian Winkler
8a4489c48e keyframe-transition: Documentation fixes
Update the documentation to use the right symbols

https://bugzilla.gnome.org/show_bug.cgi?id=676032
2012-05-15 17:41:24 +02:00
Emmanuele Bassi
c54c3047f8 scroll-actor: Paint children in pick mode
Chaining up to the parent's implementation of pick() is not enough: we
need to paint our children explicitly because of the compatibility mode
checks we use to avoid breaking custom containers.

https://bugzilla.gnome.org/show_bug.cgi?id=676088
2012-05-15 15:14:04 +01:00
Emmanuele Bassi
39a4929d75 scroll-actor: Implement pick()
We need to clip the children during picking as well as we do when
painting, to avoid reactive children outside of the visible area
receiving events.

This also allows us to refactor some common code into proper functions.
2012-05-14 10:36:30 +01:00
Chun-wei Fan
ee72d9b4af Visual C++ support: Add support to build GDK backend
-Add configuration in Clutter projects to add option to build Clutter with
 the GDK3 backend in addition to the Win32 backend
-Add another preconfigured clutter-config.h.win32_GDK which contains
 backend configs for both GDK3 and Win32 windowing and input.
2012-05-14 16:18:13 +08:00
Emmanuele Bassi
cb4f816840 actor: Include margin in explicit sizes for all cases
When asking for the preferred width and height of an actor, in case
only one of either the minimum or the natural width is set, the margin
offsets should also be applied.
2012-05-09 15:03:51 +01:00
Emmanuele Bassi
4fef7eb689 score: Add deprecation annotations to all docs
A single deprecation to the long-desc is not enough.
2012-05-08 16:13:26 +01:00
Emmanuele Bassi
c91cabdab1 score: Fix version of the deprecation annotations
ClutterScore was deprecated in Clutter 1.8, not 1.10.
2012-05-08 16:06:59 +01:00
Bastien Nocera
2bb84d9169 x11/device-manager-xi2: Fix assertions with touch
When getting touch events, the device manager would try
to pass an invalid device to translate_axes().

clutter_event_set_device() will only update event->touch.device
for touch events, not event->motion.device, as used.

Fixes Totem crashing on mouse motion/button press when using
a touchpad.

https://bugzilla.gnome.org/show_bug.cgi?id=675371
2012-05-03 19:32:07 +02:00