Commit Graph

111 Commits

Author SHA1 Message Date
Emmanuele Bassi
c11c875762 examples/layout-manager: Remove unnecessary easing state save
The actors in the layout are already set up with a non-default easing
state, we can use that.
2013-03-13 15:05:27 -03:00
Emmanuele Bassi
7f5b68eed3 examples/layout-manager: Improve the example
Add an explicit transition, and more comments.
2013-03-13 15:05:27 -03:00
Emmanuele Bassi
9016cba473 examples: Remove clutter_x11_enable_xinput()
It is unnecessary, and deprecated.
2012-12-18 01:27:32 +00:00
Emanuele Aina
04ca3d1af3 examples/pan-action: Enable the xinput backend to test touch events 2012-11-26 13:29:36 +01:00
Emanuele Aina
ccdbd36234 gesture-action: Add clutter_gesture_action_get_last_event()
Export the last event received for each touch point in its entirety,
instead of duplicating ClutterEvent accessors one at a time.

examples/pan-action.c has been updated to show the type of the event
that's causing the panning.

https://bugzilla.gnome.org/show_bug.cgi?id=685737
2012-10-19 14:13:17 +02:00
Emanuele Aina
61f2d751d0 tap-action: Add TapAction, to handle mouse/touch tapping
TapAction is a GestureAction-subclass that handles clicks and
tap gestures. It is meant to provide a replacement for ClickAction
using GestureAction:

• it handles events trasparently without capturing them, so that it
  can coexists with other GestureActions;

• the ::tap signal is not emitted if the drag threshold is exceeded;

• building upon GestureAction the amount of code is greatly reduced.

TapAction provides:

• tap signal, notifying users when a tap has been performed.

The image-content example program has been updated replacing its
ClickAction usage with TapAction.

https://bugzilla.gnome.org/show_bug.cgi?id=683948
2012-10-19 13:41:31 +02:00
Emmanuele Bassi
fb9e0466c0 examples/pan-action: Animate the content reset
We can use the newly added support for implicit animations for the child
transform.
2012-09-03 21:01:24 +01:00
Emanuele Aina
9ca06d2895 pan-action: add PanAction, to handle panning in scrollable actors
PanAction is a GestureAction-subclass that implements the panning
concept for scrollable actors, with the ability to emit interpolated
signals to emulate the kinetic inertia of the panning. PanAction provides:

• pan signal, notifying users of the panning gesture status;

• pan-stopped signal, emitted at the end of the interpolated phase
  of the panning gesture, if enabled;

• pan-axis property, to allow constraining the dragging to a specific
  axis;

• interpolated property, to enable or disable the inertial behaviour;

• deceleration property, to customize the rate at which the momentum
  of the panning will be slowed down;

• acceleration-factor property, applied to the inertial momentum when
  starting the interpolated sequence.

An interactive test is also provided.

https://bugzilla.gnome.org/show_bug.cgi?id=681648
2012-08-28 10:11:16 -03:00
Emmanuele Bassi
c4a0f911b0 examples/box: Allow toggling animations
We need to set the easing duration to a positive value to let the
BoxLayout animate the allocation.
2012-08-20 17:58:30 +01:00
Emmanuele Bassi
41ed9023eb build: Fix out of tree builds 2012-07-30 12:33:24 +01:00
Emmanuele Bassi
3649e5d828 examples/basic: Use the event type and not a flag
In order to identify whether the crossing event is an enter or a leave,
we should use the ClutterEventType enumeration, not attach a value to
the signal handler.
2012-07-30 10:54:18 +01:00
Emmanuele Bassi
28c2eeef95 actor: Add ::transition-stopped
The ::transition-stopped signal can be used to get notification of the
end of a transition.
2012-07-26 14:01:00 +01:00
Emmanuele Bassi
5a43f6b895 examples/easing-modes: Use newly added modes
Step and cubic bezier.
2012-07-19 22:13:28 -04:00
Emmanuele Bassi
b1b3bfb74e Remove usage of ClutterLayoutManager easing API
It is going away.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
20d1d24e38 examples: Use pivot point, not anchor point
https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
4be7ecb836 examples: Use the pivot point for scaling
Instead of scaling with gravity.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
caf199c732 examples: Use rotation angle and pivot point
Instead of the full set_rotation() setter, we can use the pivot point
and set the rotation angle separately.
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
b20e9b78e5 actor: Add :z-position and deprecate :depth
The ClutterActor:depth property has always been a bit of a misnomer:
actors are 2D flat surfaces, so they cannot have "depth"; the property
defines the position on the Z axis.

Another side effect of the :depth property is that it decides the
default paint and allocation order on insertion, and that setting it
will call the ClutterContainer.sort_depth_order() method. This has
proven to be a fairly bad design decision that we strung along from the
0.x days, as it gives a false impression of being able to change the
paint and allocation order simply by changing the position on the Z
axis — something that, in reality, requires depth testing to be enabled
during the paint sequence of an actor's parent.

For 2.0 we need a clean break from the side effects, and a better
defined interface.

ClutterActor:z-position is essentially what ClutterActor:depth is, but
doesn't call into ClutterContainer, and has a more apt name.

https://bugzilla.gnome.org/show_bug.cgi?id=679465
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
25be8e86f7 examples: Clean up the threads usage example
• Remove the threads_enter/leave calls; they are not needed, given that
  the code between init() and main() is single threaded.

• Ensure that the idle callbacks are inserted with the right priority,
  to avoid updating the UI after the data has been freed.
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
2ee945b2ca examples/layout-manager: Show transformations inside layouts
Actor transformations do not affect the layout management by default; we
can easily show that a scale animation does not break the layout policy
inside an example.
2012-06-27 21:28:01 +01:00
Emmanuele Bassi
ebb61dea1f examples: Enable maintainer compiler flags
Another step in keeping the example code up to date and correct.
2012-06-06 13:39:50 +01:00
Emmanuele Bassi
a541023795 examples/layout: Initialize variables to avoid warnings 2012-06-06 13:39:47 +01:00
Emmanuele Bassi
75ef676b15 examples: Build with deprecation warnings turned on
We want to ensure that the examples stay valid and idiomatic; thus, we
should build them with deprecation warnings turned on.
2012-06-06 13:37:05 +01:00
Emmanuele Bassi
c13290240c examples/constraints: Do not use deprecated API 2012-06-06 13:37:02 +01:00
Emmanuele Bassi
4db310b127 examples/flow: Do not use deprecated API 2012-06-06 13:36:46 +01:00
Emmanuele Bassi
7381050ab1 examples/threads: Modernize code
Drop the usage of behaviours and alphas, and use transitions and
implicit animations instead.
2012-06-05 18:47:44 +01:00
Bastian Winkler
dae25d839e examples: Add a grid-layout example
A fairly complete example for ClutterGridLayout

https://bugzilla.gnome.org/show_bug.cgi?id=677372
2012-06-05 12:28:40 +02:00
Bastian Winkler
f14c71cd3c examples: Updated box-layout example
Updated test-box-layout to use modern API and move it to examples.

https://bugzilla.gnome.org/show_bug.cgi?id=677283
2012-06-04 16:16:39 +02: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
Bastian Winkler
93627c876d examples: Allow optional animations in flow-layout
Allow animations to demonstrate the LayoutManager animation API

https://bugzilla.gnome.org/show_bug.cgi?id=677085
2012-05-30 12:47:21 +02:00
Bastian Winkler
1339b39132 examples: Update layout-manager example to use the animations API
https://bugzilla.gnome.org/show_bug.cgi?id=676827
2012-05-28 19:37:19 +02:00
Emmanuele Bassi
2878258fc0 examples: Update drag and drop action code
Use modern API and show idiomatic behaviour.
2012-05-24 13:58:31 +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
Emmanuele Bassi
193bf6123d examples/canvas: Resize the canvas on allocation changes
This should show how to make a Canvas resize whenever the actor that
uses it as content changes size. For good measure, it also shows how to
coalesce multiple allocations into one Canvas resize through a timeout
source.
2012-05-11 17:38:53 +01:00
Emmanuele Bassi
5ad1ec7cca Put bind-constraint back into the interactive tests
The bind-constraint.c example still uses clutter_actor_animate(), and
it'd require some serious reworking to move it to
ClutterPropertyTransition or to implicit animations.
2012-05-08 16:15:33 +01:00
Emmanuele Bassi
4d087f2c0a examples: Add an example of layout manager
The MultiLayout shows how to write a layout manager with two policies,
and to use the easing state of a child to interpolate the allocation.
2012-05-04 17:54:51 +01:00
Emmanuele Bassi
b7c76a45bc Add rounded corners rectangle example using Canvas
An old request: how to create a rectangle with rounded corners with
Clutter; we use ClutterCanvas and Cairo because we want anti-aliased
edges.
2012-05-04 17:54:51 +01:00
Emmanuele Bassi
c6b226e6c7 Move the easing modes test into the examples
It's a pretty simple, self-contained example of how to use different
easing modes, as well as the implicit animations API.
2012-05-02 18:37:36 +01:00
Emmanuele Bassi
46409b4043 Move FlowLayout test into examples
There's nothing really test-worthy in the ClutterFlowLayout interactive
test; it can be lifted pretty much as is, and placed into the examples.
2012-05-02 12:14:45 +01:00
Emmanuele Bassi
07c95ebf0c Move examples from tests/interactive to a new top-level
The example code that is meant to be XIncluded into the API reference
should not be part of the interactive test suite: it's code that it is
meant to be used as a reference implementation - whereas the interactive
test suite should be allowed to be lean and test behaviour even in nasty
ways. In short: the test suite should not be the place where we show off
idiomatic code for educational purposes.
2012-05-01 19:00:35 +01:00
Matthew Allum
c2236bb72a 2007-06-12 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-alpha.c:
        Remove stray g_debug.

        * clutter/clutter-behaviour-rotate.c:
        Register private class member.

        * clutter/clutter-behaviour.c:
        * clutter/clutter-behaviour.h:
        Add applied and removed signals.

        * Makefile.am:
        * configure.ac:
        * examples/Makefile.am:
        * examples/README:
        * examples/behave.c:
        * examples/slider.c:
        * examples/super-oh.c:
        * examples/test-entry.c:
        * examples/test-text.c:
        * examples/test.c:
        * tests/Makefile.am:
        Remove examples, moving applicable code into tests.
2007-06-12 10:36:28 +00:00
Neil J. Patel
3649b4734b Added a 'activate' signal, which is emitted when the 'Enter' key is pressed 2007-06-07 21:23:07 +00:00
Emmanuele Bassi
3c2defee9d 2007-06-07 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-container.[ch]: Add a generic actor container
	interface, for actors to implement without subclassing ClutterGroup.

	* clutter/clutter-group.[ch]: Make ClutterGroup implement the
	ClutterContainer interface, and deprecate the colliding methods.

	* clutter/clutter-layout.[ch]: Add extended layout interface.
	Actors and containers requiring or honouring complex layout
	management should implement this interface and provide at least
	one of the available layout types: width for height, height for
	width, natural size, iterative size request.

	* clutter/clutter-label.c: A ClutterLabel requires height for
	width layout management, so it implements the ClutterLayout
	interface.

	* clutter/Makefile.am: Add new files to the build.

	* tests/*.c:
	* examples/*.c: Update tests and examples code to use the
	new ClutterContainer API instead of ClutterGroup.
2007-06-07 14:41:35 +00:00
Neil J. Patel
acb0772fe0 2007-06-01 Neil J. Patel <njp@o-hand.com>
* clutter/clutter-entry.c: (clutter_entry_set_property),
        (clutter_entry_get_property), (clutter_entry_class_init),
        (clutter_entry_init), (clutter_entry_set_text),
        (clutter_entry_set_max_length):
        * clutter/clutter-entry.h:
        * examples/test-entry.c: (main):
        Added a max-length property whihc limits the length of the text in the
        entry.
2007-06-01 17:18:21 +00:00
Neil J. Patel
f6b675fc7d Added text-visibility, which will allow you to show all entered text
as a nominated charaecter ('*' is default).
2007-06-01 15:58:17 +00:00
Neil J. Patel
71f2e05b9b Add a text-changed signal to the entry 2007-06-01 11:50:18 +00:00
Neil J. Patel
ac530eed12 Added a function to deal with ClutterKeyEvents. Handles the majority
of entry-related keyboard keys. However modifiers still need to be
        implemented.
2007-06-01 11:34:40 +00:00
Neil J. Patel
e725b0c7fa Initial import of ClutterEntry, a text-entry actor 2007-05-31 18:33:42 +00:00
Tomas Frydrych
6e39efb9aa fixed clutter cos functions; fixed tilt calculations in elliptic path 2007-05-29 09:21:18 +00:00
Matthew Allum
a64b6b7ee7 2007-05-25 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-color.c: (clutter_color_parse):
        Handle #rrggbbaa color setting strings (i.e with alpha).
        Set alpha to 0xff if it is not specified.

        * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos)
        Increase select buffer.

        * examples/super-oh.c:
        Fix up use of clutter_group_show_all()
2007-05-25 16:35:57 +00:00