Commit Graph

22 Commits

Author SHA1 Message Date
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
1e51961f7a align-constraint: Add CLUTTER_ALIGN_BOTH
Just like ClutterBindConstraint has two shorthand enumerations for binding
position and size and avoid using multiple instances, ClutterAlignConstraint
should have a way to align an actor with the same alignment factor on both
axis at the same time; this is especially useful for centering actors.
2011-10-15 18:36:27 +01:00
Emmanuele Bassi
e6dbdb444d align: Check that source is not contained inside the actor
AlignConstraint won't work if the source is a child or a grandchild of
the ClutterActorMeta:actor to which it has been attached to: the
allocation flows from the parent to its children, not the other way
around; in order to avoid weirdness, we better document and check
that when we set the actor and when we set the source.
2011-09-02 14:53:55 +01:00
Emmanuele Bassi
e368538ae0 align-constraint: Fix typo in the vertical align
We're clamping the x1 coordinate to the nearest pixel, instead of doing
so for the y1 coordinate.
2011-04-01 15:36:22 +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
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
Adel Gadllah
850f956d4e ClutterAlignConstraint: Keep pixel aligment
We have to round the values here otherwise we might end up with
misaligned actors.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2508
2011-01-10 18:45:22 +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
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
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
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
9338df438c align-constraint: Offset the position after the alignment factor
Instead of aligning (pos + size), align on size alone, and then offset
by pos.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2168
2010-07-02 11:38:22 +01:00
Emmanuele Bassi
daf19205e0 align-constraint: Follow the position of the source
The AlignConstraint update is using only the width/height of the source,
but it should also take into account the position.

Also, instead of using the ::notify signal, it should follow the
BindConstraint, and switch to the ::allocation-changed signal, since
it's less expensive (one emission instead of four notifications, one for
each property we use).
2010-07-01 14:11:58 +01:00
Emmanuele Bassi
7ca340fade docs: Avoid warnings from the g-ir-scanner
The scanner has some issues when parsing valid gtk-doc annotations; we
should make its (and, in return, ours) life easier.

We still get warnings for code declared in <programlisting> sections,
unfortunately.
2010-06-30 15:51:12 +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
859d1f0792 align-constraint: Publish the properties accessors
The accessor methods for the AlignConstraint properties should be
public.
2010-06-16 12:47:56 +01:00
Emmanuele Bassi
6457f66976 Miscellaneous documentation fixes 2010-05-19 16:10:05 +01:00
Emmanuele Bassi
9f7e4b2b64 docs: Document BindConstraint and AlignConstraint
Add the missing gtk-doc annotations for BindConstraint and
AlignConstraint, plus the licensing blurb.
2010-05-19 14:46:02 +01:00
Emmanuele Bassi
f857457b9d constraints: Add AlignConstraint
AlignConstraint is a simple constraint that keeps an actor's position
aligned to the width or height of another actor, multiplied by an
alignment factor.
2010-05-19 13:02:43 +01:00