![]() |
![]() |
![]() |
Clutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
enum ClutterSnapEdge; ClutterSnapConstraint; ClutterConstraint * clutter_snap_constraint_new (ClutterActor *source
,ClutterSnapEdge from_edge
,ClutterSnapEdge to_edge
,gfloat offset
); void clutter_snap_constraint_set_source (ClutterSnapConstraint *constraint
,ClutterActor *source
); ClutterActor * clutter_snap_constraint_get_source (ClutterSnapConstraint *constraint
); void clutter_snap_constraint_set_edges (ClutterSnapConstraint *constraint
,ClutterSnapEdge from_edge
,ClutterSnapEdge to_edge
); void clutter_snap_constraint_get_edges (ClutterSnapConstraint *constraint
,ClutterSnapEdge *from_edge
,ClutterSnapEdge *to_edge
); void clutter_snap_constraint_set_offset (ClutterSnapConstraint *constraint
,gfloat offset
); gfloat clutter_snap_constraint_get_offset (ClutterSnapConstraint *constraint
);
GObject +----GInitiallyUnowned +----ClutterActorMeta +----ClutterConstraint +----ClutterSnapConstraint
"from-edge" ClutterSnapEdge : Read / Write / Construct "offset" gfloat : Read / Write / Construct "source" ClutterActor* : Read / Write / Construct "to-edge" ClutterSnapEdge : Read / Write / Construct
ClutterSnapConstraint is a constraint the snaps the edges of two actors together, expanding the actor's allocation if necessary.
An offset can be applied to the constraint, to provide spacing.
ClutterSnapConstraint is available since Clutter 1.6
typedef enum { CLUTTER_SNAP_EDGE_TOP, CLUTTER_SNAP_EDGE_RIGHT, CLUTTER_SNAP_EDGE_BOTTOM, CLUTTER_SNAP_EDGE_LEFT } ClutterSnapEdge;
The edge to snap
the top edge | |
the right edge | |
the bottom edge | |
the left edge |
Since 1.6
typedef struct _ClutterSnapConstraint ClutterSnapConstraint;
ClutterSnapConstraint is an opaque structure whose members cannot be directly accesses
Since 1.6
ClutterConstraint * clutter_snap_constraint_new (ClutterActor *source
,ClutterSnapEdge from_edge
,ClutterSnapEdge to_edge
,gfloat offset
);
Creates a new ClutterSnapConstraint that will snap a ClutterActor
to the edge
of source
, with the given offset
.
|
the ClutterActor to use as the source of
the constraint, or NULL . [allow-none]
|
|
the edge of the actor to use in the constraint |
|
the edge of source to use in the constraint |
|
the offset to apply to the constraint, in pixels |
Returns : |
the newly created ClutterSnapConstraint |
Since 1.6
void clutter_snap_constraint_set_source (ClutterSnapConstraint *constraint
,ClutterActor *source
);
Sets the source ClutterActor for the constraint
|
a ClutterSnapConstraint |
|
a ClutterActor, or NULL to unset the source. [allow-none]
|
Since 1.6
ClutterActor * clutter_snap_constraint_get_source (ClutterSnapConstraint *constraint
);
Retrieves the ClutterActor set using clutter_snap_constraint_set_source()
|
a ClutterSnapConstraint |
Returns : |
a pointer to the source actor. [transfer none] |
Since 1.6
void clutter_snap_constraint_set_edges (ClutterSnapConstraint *constraint
,ClutterSnapEdge from_edge
,ClutterSnapEdge to_edge
);
Sets the edges to be used by the constraint
The from_edge
is the edge on the ClutterActor to which constraint
has been added. The to_edge
is the edge of the ClutterActor inside
the "source" property.
|
a ClutterSnapConstraint |
|
the edge on the actor |
|
the edge on the source |
Since 1.6
void clutter_snap_constraint_get_edges (ClutterSnapConstraint *constraint
,ClutterSnapEdge *from_edge
,ClutterSnapEdge *to_edge
);
Retrieves the edges used by the constraint
|
a ClutterSnapConstraint |
|
return location for the actor's edge, or NULL . [out]
|
|
return location for the source's edge, or NULL . [out]
|
Since 1.6
void clutter_snap_constraint_set_offset (ClutterSnapConstraint *constraint
,gfloat offset
);
Sets the offset to be applied to the constraint
|
a ClutterSnapConstraint |
|
the offset to apply, in pixels |
Since 1.6
gfloat clutter_snap_constraint_get_offset (ClutterSnapConstraint *constraint
);
Retrieves the offset set using clutter_snap_constraint_set_offset()
|
a ClutterSnapConstraint |
Returns : |
the offset, in pixels |
Since 1.6
"from-edge"
property"from-edge" ClutterSnapEdge : Read / Write / Construct
The edge of the ClutterActor that should be snapped
Default value: CLUTTER_SNAP_EDGE_RIGHT
Since 1.6
"offset"
property"offset" gfloat : Read / Write / Construct
The offset, in pixels, between "from-edge" and "to-edge"
Default value: 0
Since 1.6
"source"
property"source" ClutterActor* : Read / Write / Construct
The ClutterActor used as the source for the constraint
Since 1.6
"to-edge"
property"to-edge" ClutterSnapEdge : Read / Write / Construct
The edge of the "source" that should be snapped
Default value: CLUTTER_SNAP_EDGE_RIGHT
Since 1.6