summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippo Argiolas <filippo.argiolas@gmail.com>2009-07-15 08:36:46 +0200
committerFilippo Argiolas <filippo.argiolas@gmail.com>2009-07-15 08:36:46 +0200
commitf6b706685fe067a41af1d31bc5d90b129c1da541 (patch)
tree5bfea0eefd055eb504fa7d70ca577066d1ee46b2
parent1ddfd3df18b6d032ef2dc2aafbbc30e7b07cee2b (diff)
Drop ClutterUnits usage to reflect recent Clutter API changes
-rw-r--r--src/cheese-grid.c69
-rw-r--r--src/cheese-stage.c10
-rw-r--r--src/cheese-texture.c2
3 files changed, 40 insertions, 41 deletions
diff --git a/src/cheese-grid.c b/src/cheese-grid.c
index 97938da..f1a40a4 100644
--- a/src/cheese-grid.c
+++ b/src/cheese-grid.c
@@ -59,15 +59,15 @@ static void cheese_grid_pick (ClutterActor *actor,
static void
cheese_grid_get_preferred_width (ClutterActor *self,
- ClutterUnit for_height,
- ClutterUnit *min_width_p,
- ClutterUnit *natural_width_p);
+ gfloat for_height,
+ gfloat *min_width_p,
+ gfloat *natural_width_p);
static void
cheese_grid_get_preferred_height (ClutterActor *self,
- ClutterUnit for_width,
- ClutterUnit *min_height_p,
- ClutterUnit *natural_height_p);
+ gfloat for_width,
+ gfloat *min_height_p,
+ gfloat *natural_height_p);
static void cheese_grid_allocate (ClutterActor *self,
const ClutterActorBox *box,
@@ -84,16 +84,16 @@ G_DEFINE_TYPE_WITH_CODE (CheeseGrid, cheese_grid,
struct _CheeseGridPrivate
{
- ClutterUnit for_height, for_width;
- ClutterUnit pref_width, pref_height;
- ClutterUnit alloc_width, alloc_height;
+ gfloat for_height, for_width;
+ gfloat pref_width, pref_height;
+ gfloat alloc_width, alloc_height;
gboolean absolute_origin_changed;
GHashTable *hash_table;
GList *list;
- ClutterUnit max_extent_a;
- ClutterUnit max_extent_b;
+ gfloat max_extent_a;
+ gfloat max_extent_b;
};
enum
@@ -104,8 +104,8 @@ enum
struct _CheeseGridActorData
{
gboolean xpos_set, ypos_set;
- ClutterUnit xpos, ypos;
- ClutterUnit pref_width, pref_height;
+ gfloat xpos, ypos;
+ gfloat pref_width, pref_height;
};
static void
@@ -319,17 +319,17 @@ cheese_grid_pick (ClutterActor *actor,
static void
cheese_grid_get_preferred_width (ClutterActor *self,
- ClutterUnit for_height,
- ClutterUnit *min_width_p,
- ClutterUnit *natural_width_p)
+ gfloat for_height,
+ gfloat *min_width_p,
+ gfloat *natural_width_p)
{
CheeseGrid *layout = (CheeseGrid *) self;
CheeseGridPrivate *priv = layout->priv;
- ClutterUnit natural_width;
+ gfloat natural_width;
ClutterActor *parent = clutter_actor_get_parent (self);
// natural_width = clutter_actor_get_width (parent);
- natural_width = CLUTTER_UNITS_FROM_INT (600);
+ natural_width = 600.0;
if (min_width_p)
*min_width_p = natural_width;
@@ -341,17 +341,17 @@ cheese_grid_get_preferred_width (ClutterActor *self,
static void
cheese_grid_get_preferred_height (ClutterActor *self,
- ClutterUnit for_width,
- ClutterUnit *min_height_p,
- ClutterUnit *natural_height_p)
+ gfloat for_width,
+ gfloat *min_height_p,
+ gfloat *natural_height_p)
{
CheeseGrid *layout = (CheeseGrid *) self;
CheeseGridPrivate *priv = layout->priv;
- ClutterUnit natural_height;
+ gfloat natural_height;
ClutterActor *parent = clutter_actor_get_parent (self);
// natural_height = clutter_actor_get_height (parent);
- natural_height = CLUTTER_UNITS_FROM_INT (200);
+ natural_height = 200.0;
priv->for_width = for_width;
priv->pref_height = natural_height;
@@ -390,11 +390,11 @@ cheese_grid_allocate (ClutterActor *self,
CheeseGrid *layout = (CheeseGrid *) self;
CheeseGridPrivate *priv = layout->priv;
- ClutterUnit current_a;
- ClutterUnit current_b;
- ClutterUnit next_b;
- ClutterUnit agap;
- ClutterUnit bgap;
+ gfloat current_a;
+ gfloat current_b;
+ gfloat next_b;
+ gfloat agap;
+ gfloat bgap;
gboolean homogenous_a;
gboolean homogenous_b;
@@ -426,9 +426,8 @@ cheese_grid_allocate (ClutterActor *self,
for (iter = priv->list; iter; iter = iter->next)
{
ClutterActor *child = iter->data;
- ClutterUnit natural_width;
- ClutterUnit natural_height;
-
+ gfloat natural_width;
+ gfloat natural_height;
/* each child will get as much space as they require */
clutter_actor_get_preferred_size (CLUTTER_ACTOR (child),
@@ -439,11 +438,11 @@ cheese_grid_allocate (ClutterActor *self,
if (natural_height > priv->max_extent_b)
priv->max_extent_b = natural_width;
- ClutterUnit ratio = natural_width/natural_height;
- ClutterUnit alloc_ratio = priv->alloc_width/priv->alloc_height;
+ gfloat ratio = natural_width/natural_height;
+ gfloat alloc_ratio = priv->alloc_width/priv->alloc_height;
- ClutterUnit child_width = priv->alloc_width / 3.0;
- ClutterUnit child_height = priv->alloc_height / 3.0;
+ gfloat child_width = priv->alloc_width / 3.0;
+ gfloat child_height = priv->alloc_height / 3.0;
ClutterActorBox child_box;
if (alloc_ratio < ratio) {
diff --git a/src/cheese-stage.c b/src/cheese-stage.c
index d79feb9..50030f6 100644
--- a/src/cheese-stage.c
+++ b/src/cheese-stage.c
@@ -101,9 +101,9 @@ on_leave_animate (ClutterActor *actor, ClutterEvent *event, gpointer data)
static gboolean
on_window_configure (GtkWidget *window, GdkEventConfigure *ev, ClutterActor *layout)
{
- clutter_actor_set_size(layout,
- CLUTTER_UNITS_FROM_INT (ev->width),
- CLUTTER_UNITS_FROM_INT (ev->height));
+ clutter_actor_set_size(layout,
+ (gfloat) ev->width,
+ (gfloat) ev->height);
return FALSE;
}
@@ -115,7 +115,7 @@ on_button_animate (ClutterActor *actor, ClutterEvent *event, gpointer data)
ClutterActor *stage = clutter_actor_get_stage (actor);
CheeseGrid *layout = CHEESE_GRID (data);
ClutterAnimation *previous_animation;
- gint pw, ph, w, h;
+ gfloat pw, ph, w, h;
clutter_actor_get_size (parent, &pw, &ph);
@@ -124,7 +124,7 @@ on_button_animate (ClutterActor *actor, ClutterEvent *event, gpointer data)
clutter_animation_completed (previous_animation);
if (parent == stage) {
- clutter_actor_reparent (actor, layout);
+ clutter_actor_reparent (actor, CLUTTER_ACTOR (layout));
}
else {
diff --git a/src/cheese-texture.c b/src/cheese-texture.c
index 89b08a7..969e288 100644
--- a/src/cheese-texture.c
+++ b/src/cheese-texture.c
@@ -114,7 +114,7 @@ on_stage_realize (ClutterActor *stage, ClutterActor *actor)
CheeseTexture *self = CHEESE_TEXTURE (actor);
CheeseTexturePrivate *priv = self->priv = CHEESE_TEXTURE_GET_PRIVATE (self);
- stage_win = clutter_x11_get_stage_window (stage);
+ stage_win = clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
if (gdk_window_get_parent (priv->gdk_window) != gdk_window_lookup (stage_win))
{