Commit Graph

30 Commits

Author SHA1 Message Date
Emmanuele Bassi
f589b6f63a Revert "bind-constraint: Update the preferred size"
This reverts commit fcc67e99bc.

It seems this causes some recursion overflow in GNOME Shell's usage of
constraints, and needs more investigation.
2014-12-16 13:33:16 +00:00
Emmanuele Bassi
fcc67e99bc bind-constraint: Update the preferred size
Bind the preferred size of an actor using a BindConstraint to the
preferred size of the source of the constraint, depending on the
coordinate of the constraint.
2014-12-16 00:37:07 +00:00
Emmanuele Bassi
12370bd4f8 docs: Move to markdown
We're removing docbook tags in favour of the markdown syntax.
2014-03-17 23:07:58 +00:00
Owen W. Taylor
0b536c02f9 Bind constraints: Don't force redraws on source relayout
When the source actor potentially changes size, that shouldn't
necessarily result in the target actor being redrawn - it should
be like when a child of a container is reallocated due to changes
in its siblings or parent - it should redraw only to the extent
that it is moved and resized. Privately export an internal function
from clutter-actor.c to allow getting this right.

https://bugzilla.gnome.org/show_bug.cgi?id=719367
2013-11-26 11:12:12 -05:00
Emmanuele Bassi
0ba2d1df93 constraints: Clamp updated allocation to the nearest pixel
Use Clutter.ActorBox.clamp_to_pixel() to do it properly.
2012-06-27 21:28:01 +01:00
Emmanuele Bassi
ececa27ad0 docs: Fix XInclude path of the BindConstraint example 2012-06-25 23:44:11 +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
Adel Gadllah
851d2a42c4 ClutterBindConstraint: Add CLUTTER_BIND_ALL coordinate
Add a CLUTTER_BIND_ALL that binds both size and position.
2012-02-15 17:57:18 +01:00
Emmanuele Bassi
79e152b7a0 docs: Inline test-constraints.c inside BindConstraint's description 2011-09-02 15:48:27 +01:00
Emmanuele Bassi
66607dec4d bind: Check that the source is not contained inside the actor
Like commit d0439cfb586ca14282c89035119a4acbc0295df7 for
AlignConstraint, let's check that the BindConstraint source is not
a child or a grandchild of the actor attached to the Constraint.
2011-09-02 14:53:55 +01:00
Jasper St. Pierre
0c576c0c33 Remove private helper #define's
Finish off the second half of 09a830d294.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2596
2011-03-03 11:47:49 +00:00
Emmanuele Bassi
5329c98694 bind-constraint: Add BIND_POSITION and BIND_SIZE
CLUTTER_BIND_POSITION and CLUTTER_BIND_SIZE are two convenience
enumeration values for binding x and y, and width and height
respectively, using a single ClutterBindConstraint.
2011-01-25 11:14:37 +00:00
Emmanuele Bassi
ca092477c2 Appease the gods in introspection
Reduce the amount of bogus warnings g-ir-scanner prints out.
2011-01-20 16:35:26 +00:00
Emmanuele Bassi
491bbc226e constraints: Remove signal handlers on dispose
Same as commit 2fa8b3a3ab but done for
AlignConstraint and SnapConstraint as well.
2010-12-18 13:24:54 +00:00
Emmanuele Bassi
2fa8b3a3ab bind-constraint: Remove handlers in dispose
We should remove the signal handlers on the source actor when a
BindConstraint is disposed, to avoid dangling pointers and wrong
invocations.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2493
2010-12-18 13:16:23 +00:00
Emmanuele Bassi
46c597a1f6 Clean up clutter-private.h/6
Move all Actor private API to a separate file.
2010-10-21 12:22:17 +01:00
Emmanuele Bassi
050e775da2 Move more classes to install_properties() 2010-10-18 11:26:45 +01:00
Emmanuele Bassi
e6418a9dec constraints: Remove unused variable 2010-10-12 15:44:57 +01:00
Emmanuele Bassi
4e724aed46 bind-constraint: Use ::queue-relayout
Instead of using the allocation-changed signal, use the queue-relayout
signal on the source to queue a relayout on the actor to which the
BindConstraint has been attached to.

The ::allocation-changed signal is not always enough, given that a
BindConstraint can use the position as well as the size of an actor to
drive the allocation of another; in this regard, it's much similar
to a ClutterClone, which requires a notification on every change, even
potential, and not just real ones, given the short-circuiting done
inside ClutterActor.
2010-10-12 14:09:47 +01:00
Emmanuele Bassi
5c82b2551c constraints: Do not check for :enabled
ClutterActor will do it for us.
2010-10-12 14:09:17 +01:00
Emmanuele Bassi
cdff2a9e7a constraint: Re-implement using update_allocation()
Instead of using the fixed position and size API, use the newly added
update_allocation() virtual function in ClutterConstraint to change the
allocation of a ClutterActor. This allows using constraints inside
layout managers, and also allows Constraints to react to changes in the
size of an actor without causing relayout cycles.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2319
2010-09-17 12:17:50 +01:00
Neil Roberts
8d51617979 Conditionally use g_object_notify_by_pspec
This adds a wrapper macro to clutter-private that will use
g_object_notify_by_pspec if it's compiled against a version of GLib
that is sufficiently new. Otherwise it will notify by the property
name as before by extracting the name from the pspec. The objects can
then store a static array of GParamSpecs and notify using those as
suggested in the documentation for g_object_notify_by_pspec.

Note that the name of the variable used for storing the array of
GParamSpecs is obj_props instead of properties as used in the
documentation because some places in Clutter uses 'properties' as the
name of a local variable.

Mose of the classes in Clutter have been converted using the script in
the bug report. Some classes have not been modified even though the
script picked them up as described here:

json-generator:

 We probably don't want to modify the internal copy of JSON

behaviour-depth:
rectangle:
score:
stage-manager:

 These aren't using the separate GParamSpec* variable style.

blur-effect:
win32/device-manager:

 Don't actually define any properties even though it has the enum.

box-layout:
flow-layout:

  Have some per-child properties that don't work automatically with
  the script.

clutter-model:

  The script gets confused with ClutterModelIter

stage:

  Script gets confused because PROP_USER_RESIZE doesn't match
  "user-resizable"

test-layout:

  Don't really want to modify the tests

http://bugzilla.clutter-project.org/show_bug.cgi?id=2150
2010-08-10 17:12:06 +01:00
Emmanuele Bassi
c65c0f08d8 docs: Fix the BindConstraint example
A constraint was created but not added to the actor.
2010-07-31 10:39:53 +01:00
Emmanuele Bassi
fd27ca7398 Mark property strings for translation
Both the nick and the blurb fields should be translatable, for UI
builders and other introspection-based tools.
2010-07-15 14:07:07 +01:00
Emmanuele Bassi
32ad63efef bind-constraint: Add width and height binding
Allow using the BindConstraint to bind width and height of a source
actor.

Also, add a test for the BindConstraint showing all types of usages
for this constraint class.
2010-06-28 18:06:23 +01:00
Emmanuele Bassi
a75c02a5d6 constraints: Allow Align and Bind sources to be NULL
Since constructing AlignConstraint and BindConstraint instances could be
deferred (think ClutterScript) we need to make their :source properties
setters accept NULL. This does not break the constraints because they
need to handle that condition in case they actor to which they are
applied is destroyed and somebody is holding a reference on them anyway.
2010-06-17 17:33:10 +01:00
Emmanuele Bassi
77c63e0237 bind-constraint: Add accessor methods
ClutterBindConstraint should have accessor methods for its properties,
to allow direct manipulation instead of going through GObject's API.
2010-06-17 12:02:28 +01:00
Emmanuele Bassi
6457f66976 Miscellaneous documentation fixes 2010-05-19 16:10:05 +01:00
Emmanuele Bassi
e9b93d5676 constraint: Rename BindConstraint:bind-axis
We're not binding an axis: we're really binding a coordinate of an actor
to the coordinate of another one.
2010-05-19 14:34:18 +01:00
Emmanuele Bassi
769e964424 constraint: Add BindConstraint
The BindConstraint object is a constraint that binds the current
position of an actor on a given axis to the actor that has the
constraint applied.
2010-05-19 12:28:35 +01:00