mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
actor: Deprecate Geometry-related API
We cannot fully deprecate Geometry, because ClutterActor and ClutterText are actually using the type in signals and properties; but we can deprecate the API that uses this type, so that 2.0 will be able to avoid it entirely.
This commit is contained in:
parent
ef1bb42a86
commit
5b7c61a026
@ -9376,39 +9376,6 @@ clutter_actor_get_allocation_box (ClutterActor *self,
|
|||||||
*box = self->priv->allocation;
|
*box = self->priv->allocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_get_allocation_geometry:
|
|
||||||
* @self: A #ClutterActor
|
|
||||||
* @geom: (out): allocation geometry in pixels
|
|
||||||
*
|
|
||||||
* Gets the layout box an actor has been assigned. The allocation can
|
|
||||||
* only be assumed valid inside a paint() method; anywhere else, it
|
|
||||||
* may be out-of-date.
|
|
||||||
*
|
|
||||||
* An allocation does not incorporate the actor's scale or anchor point;
|
|
||||||
* those transformations do not affect layout, only rendering.
|
|
||||||
*
|
|
||||||
* The returned rectangle is in pixels.
|
|
||||||
*
|
|
||||||
* Since: 0.8
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_get_allocation_geometry (ClutterActor *self,
|
|
||||||
ClutterGeometry *geom)
|
|
||||||
{
|
|
||||||
ClutterActorBox box;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
|
||||||
g_return_if_fail (geom != NULL);
|
|
||||||
|
|
||||||
clutter_actor_get_allocation_box (self, &box);
|
|
||||||
|
|
||||||
geom->x = CLUTTER_NEARBYINT (clutter_actor_box_get_x (&box));
|
|
||||||
geom->y = CLUTTER_NEARBYINT (clutter_actor_box_get_y (&box));
|
|
||||||
geom->width = CLUTTER_NEARBYINT (clutter_actor_box_get_width (&box));
|
|
||||||
geom->height = CLUTTER_NEARBYINT (clutter_actor_box_get_height (&box));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_actor_update_constraints (ClutterActor *self,
|
clutter_actor_update_constraints (ClutterActor *self,
|
||||||
ClutterActorBox *allocation)
|
ClutterActorBox *allocation)
|
||||||
@ -9810,63 +9777,6 @@ clutter_actor_set_allocation (ClutterActor *self,
|
|||||||
g_object_thaw_notify (G_OBJECT (self));
|
g_object_thaw_notify (G_OBJECT (self));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_set_geometry:
|
|
||||||
* @self: A #ClutterActor
|
|
||||||
* @geometry: A #ClutterGeometry
|
|
||||||
*
|
|
||||||
* Sets the actor's fixed position and forces its minimum and natural
|
|
||||||
* size, in pixels. This means the untransformed actor will have the
|
|
||||||
* given geometry. This is the same as calling clutter_actor_set_position()
|
|
||||||
* and clutter_actor_set_size().
|
|
||||||
*
|
|
||||||
* Deprecated: 1.10: Use clutter_actor_set_position() and
|
|
||||||
* clutter_actor_set_size() instead.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_set_geometry (ClutterActor *self,
|
|
||||||
const ClutterGeometry *geometry)
|
|
||||||
{
|
|
||||||
g_object_freeze_notify (G_OBJECT (self));
|
|
||||||
|
|
||||||
clutter_actor_set_position (self, geometry->x, geometry->y);
|
|
||||||
clutter_actor_set_size (self, geometry->width, geometry->height);
|
|
||||||
|
|
||||||
g_object_thaw_notify (G_OBJECT (self));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_actor_get_geometry:
|
|
||||||
* @self: A #ClutterActor
|
|
||||||
* @geometry: (out caller-allocates): A location to store actors #ClutterGeometry
|
|
||||||
*
|
|
||||||
* Gets the size and position of an actor relative to its parent
|
|
||||||
* actor. This is the same as calling clutter_actor_get_position() and
|
|
||||||
* clutter_actor_get_size(). It tries to "do what you mean" and get the
|
|
||||||
* requested size and position if the actor's allocation is invalid.
|
|
||||||
*
|
|
||||||
* Deprecated: 1.10: Use clutter_actor_get_position() and
|
|
||||||
* clutter_actor_get_size(), or clutter_actor_get_allocation_geometry()
|
|
||||||
* instead.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_actor_get_geometry (ClutterActor *self,
|
|
||||||
ClutterGeometry *geometry)
|
|
||||||
{
|
|
||||||
gfloat x, y, width, height;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
|
||||||
g_return_if_fail (geometry != NULL);
|
|
||||||
|
|
||||||
clutter_actor_get_position (self, &x, &y);
|
|
||||||
clutter_actor_get_size (self, &width, &height);
|
|
||||||
|
|
||||||
geometry->x = (int) x;
|
|
||||||
geometry->y = (int) y;
|
|
||||||
geometry->width = (int) width;
|
|
||||||
geometry->height = (int) height;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_actor_set_position:
|
* clutter_actor_set_position:
|
||||||
* @self: A #ClutterActor
|
* @self: A #ClutterActor
|
||||||
|
@ -361,8 +361,6 @@ void clutter_actor_set_allocation
|
|||||||
ClutterAllocationFlags flags);
|
ClutterAllocationFlags flags);
|
||||||
void clutter_actor_get_allocation_box (ClutterActor *self,
|
void clutter_actor_get_allocation_box (ClutterActor *self,
|
||||||
ClutterActorBox *box);
|
ClutterActorBox *box);
|
||||||
void clutter_actor_get_allocation_geometry (ClutterActor *self,
|
|
||||||
ClutterGeometry *geom);
|
|
||||||
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
void clutter_actor_get_allocation_vertices (ClutterActor *self,
|
||||||
ClutterActor *ancestor,
|
ClutterActor *ancestor,
|
||||||
ClutterVertex verts[]);
|
ClutterVertex verts[]);
|
||||||
|
@ -734,7 +734,7 @@ _clutter_paint_volume_complete (ClutterPaintVolume *pv)
|
|||||||
/*<private>
|
/*<private>
|
||||||
* _clutter_paint_volume_get_box:
|
* _clutter_paint_volume_get_box:
|
||||||
* @pv: a #ClutterPaintVolume
|
* @pv: a #ClutterPaintVolume
|
||||||
* @box: a pixel aligned #ClutterGeometry
|
* @box: a pixel aligned #ClutterActorBox
|
||||||
*
|
*
|
||||||
* Transforms a 3D paint volume into a 2D bounding box in the
|
* Transforms a 3D paint volume into a 2D bounding box in the
|
||||||
* same coordinate space as the 3D paint volume.
|
* same coordinate space as the 3D paint volume.
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
#include "deprecated/clutter-actor.h"
|
||||||
|
|
||||||
#include "clutter-actor-private.h"
|
#include "clutter-actor-private.h"
|
||||||
#include "clutter-private.h"
|
#include "clutter-private.h"
|
||||||
@ -316,3 +317,95 @@ clutter_actor_set_shader_param_int (ClutterActor *self,
|
|||||||
|
|
||||||
g_value_unset (&var);
|
g_value_unset (&var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_set_geometry:
|
||||||
|
* @self: A #ClutterActor
|
||||||
|
* @geometry: A #ClutterGeometry
|
||||||
|
*
|
||||||
|
* Sets the actor's fixed position and forces its minimum and natural
|
||||||
|
* size, in pixels. This means the untransformed actor will have the
|
||||||
|
* given geometry. This is the same as calling clutter_actor_set_position()
|
||||||
|
* and clutter_actor_set_size().
|
||||||
|
*
|
||||||
|
* Deprecated: 1.10: Use clutter_actor_set_position() and
|
||||||
|
* clutter_actor_set_size() instead.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_set_geometry (ClutterActor *self,
|
||||||
|
const ClutterGeometry *geometry)
|
||||||
|
{
|
||||||
|
g_object_freeze_notify (G_OBJECT (self));
|
||||||
|
|
||||||
|
clutter_actor_set_position (self, geometry->x, geometry->y);
|
||||||
|
clutter_actor_set_size (self, geometry->width, geometry->height);
|
||||||
|
|
||||||
|
g_object_thaw_notify (G_OBJECT (self));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_get_geometry:
|
||||||
|
* @self: A #ClutterActor
|
||||||
|
* @geometry: (out caller-allocates): A location to store actors #ClutterGeometry
|
||||||
|
*
|
||||||
|
* Gets the size and position of an actor relative to its parent
|
||||||
|
* actor. This is the same as calling clutter_actor_get_position() and
|
||||||
|
* clutter_actor_get_size(). It tries to "do what you mean" and get the
|
||||||
|
* requested size and position if the actor's allocation is invalid.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.10: Use clutter_actor_get_position() and
|
||||||
|
* clutter_actor_get_size(), or clutter_actor_get_allocation_geometry()
|
||||||
|
* instead.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_get_geometry (ClutterActor *self,
|
||||||
|
ClutterGeometry *geometry)
|
||||||
|
{
|
||||||
|
gfloat x, y, width, height;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
g_return_if_fail (geometry != NULL);
|
||||||
|
|
||||||
|
clutter_actor_get_position (self, &x, &y);
|
||||||
|
clutter_actor_get_size (self, &width, &height);
|
||||||
|
|
||||||
|
geometry->x = (int) x;
|
||||||
|
geometry->y = (int) y;
|
||||||
|
geometry->width = (int) width;
|
||||||
|
geometry->height = (int) height;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_get_allocation_geometry:
|
||||||
|
* @self: A #ClutterActor
|
||||||
|
* @geom: (out): allocation geometry in pixels
|
||||||
|
*
|
||||||
|
* Gets the layout box an actor has been assigned. The allocation can
|
||||||
|
* only be assumed valid inside a paint() method; anywhere else, it
|
||||||
|
* may be out-of-date.
|
||||||
|
*
|
||||||
|
* An allocation does not incorporate the actor's scale or anchor point;
|
||||||
|
* those transformations do not affect layout, only rendering.
|
||||||
|
*
|
||||||
|
* The returned rectangle is in pixels.
|
||||||
|
*
|
||||||
|
* Since: 0.8
|
||||||
|
*
|
||||||
|
* Deprecated: 1.12: Use clutter_actor_get_allocation_box() instead.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_get_allocation_geometry (ClutterActor *self,
|
||||||
|
ClutterGeometry *geom)
|
||||||
|
{
|
||||||
|
ClutterActorBox box;
|
||||||
|
|
||||||
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
g_return_if_fail (geom != NULL);
|
||||||
|
|
||||||
|
clutter_actor_get_allocation_box (self, &box);
|
||||||
|
|
||||||
|
geom->x = CLUTTER_NEARBYINT (clutter_actor_box_get_x (&box));
|
||||||
|
geom->y = CLUTTER_NEARBYINT (clutter_actor_box_get_y (&box));
|
||||||
|
geom->width = CLUTTER_NEARBYINT (clutter_actor_box_get_width (&box));
|
||||||
|
geom->height = CLUTTER_NEARBYINT (clutter_actor_box_get_height (&box));
|
||||||
|
}
|
||||||
|
@ -152,6 +152,10 @@ CLUTTER_DEPRECATED_IN_1_12
|
|||||||
void clutter_actor_get_transformation_matrix (ClutterActor *self,
|
void clutter_actor_get_transformation_matrix (ClutterActor *self,
|
||||||
ClutterMatrix *matrix);
|
ClutterMatrix *matrix);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_IN_1_12_FOR (clutter_actor_get_allocation_box)
|
||||||
|
void clutter_actor_get_allocation_geometry (ClutterActor *self,
|
||||||
|
ClutterGeometry *geom);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_ACTOR_DEPRECATED_H__ */
|
#endif /* __CLUTTER_ACTOR_DEPRECATED_H__ */
|
||||||
|
@ -37,7 +37,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||||
#include "clutter-rectangle.h"
|
#include "deprecated/clutter-rectangle.h"
|
||||||
|
#include "deprecated/clutter-actor.h"
|
||||||
|
|
||||||
#include "clutter-actor-private.h"
|
#include "clutter-actor-private.h"
|
||||||
#include "clutter-color.h"
|
#include "clutter-color.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user