From a338a95796212a59e36a54d0f33e2740097671b6 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Tue, 22 May 2007 09:31:40 +0000 Subject: [PATCH] removed ClutterReal; added clutter-units --- ChangeLog | 20 ++ Makefile.am | 4 +- clutter.pc.in | 3 +- clutter/Makefile.am | 9 +- clutter/clutter-actor.c | 473 +++++++++++--------------- clutter/clutter-actor.h | 36 +- clutter/clutter-group.c | 18 +- clutter/clutter-label.c | 11 +- clutter/clutter-real.h | 125 ------- clutter/clutter-units.h | 74 ++++ clutter/clutter.h | 1 + clutter/egl/clutter-stage-egl.c | 17 +- clutter/glx/clutter-stage-glx.c | 17 +- clutter/sdl/clutter-stage-sdl.c | 9 +- configure.ac | 4 - doc/reference/ChangeLog | 12 + doc/reference/clutter-docs.sgml | 1 + doc/reference/clutter-sections.txt | 16 + doc/reference/tmpl/clutter-actor.sgml | 3 +- doc/reference/tmpl/clutter-alpha.sgml | 85 +++++ doc/reference/tmpl/clutter-media.sgml | 15 - doc/reference/tmpl/clutter-units.sgml | 107 ++++++ examples/Makefile.am | 2 +- tests/Makefile.am | 2 +- 24 files changed, 572 insertions(+), 492 deletions(-) delete mode 100644 clutter/clutter-real.h create mode 100644 clutter/clutter-units.h create mode 100644 doc/reference/tmpl/clutter-units.sgml diff --git a/ChangeLog b/ChangeLog index 8b3e6aeb6..f36eba1c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2007-05-22 Tomas Frydrych + + * configure.ac: + * Makefile.am: + * clutter.pc.in: + * clutter/Makefile.am: + * clutter/clutter-actor.c: + * clutter/clutter-actor.h: + * clutter/clutter-group.c: + * clutter/clutter-label.c: + * clutter/clutter-real.h: + * clutter/clutter-units.h: + * clutter/clutter.h: + * clutter/egl/clutter-stage-egl.c: + * clutter/glx/clutter-stage-glx.c: + * clutter/sdl/clutter-stage-sdl.c: + * examples/Makefile.am: + * tests/Makefile.am: + Removed ClutterReal; added clutter-units. + 2007-05-18 Tomas Frydrych * configure.ac: diff --git a/Makefile.am b/Makefile.am index f1aac6cdf..ac3d4b209 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,8 @@ SUBDIRS=clutter doc examples tests -pcfiles = clutter@CLUTTER_REAL@-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.pc +pcfiles = clutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.pc -%@CLUTTER_REAL@-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.pc: %.pc +%-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.pc: %.pc cp $< $@ pkgconfig_DATA = $(pcfiles) diff --git a/clutter.pc.in b/clutter.pc.in index 4bee3fd58..8d413cd14 100644 --- a/clutter.pc.in +++ b/clutter.pc.in @@ -3,12 +3,11 @@ exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include backend=@clutterbackend@ -real=@CLUTTER_REAL@ apiversion=@CLUTTER_API_VERSION@ Name: Clutter Description: Clutter Core Library (${backend} backend) Version: @VERSION@ -Libs: -L${libdir} -lclutter${real}-${backend}-${apiversion} +Libs: -L${libdir} -lclutter-${backend}-${apiversion} Cflags: -I${includedir}/clutter-${apiversion} Requires: glib-2.0 >= 2.10 gobject-2.0 gthread-2.0 pangoft2 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 3a75373b1..681b0b480 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -60,6 +60,7 @@ source_h = \ $(srcdir)/clutter-texture.h \ $(srcdir)/clutter-timeline.h \ $(srcdir)/clutter-effect.h \ + $(srcdir)/clutter-units.h \ $(srcdir)/clutter-util.h \ $(srcdir)/clutter-version.h \ $(NULL) @@ -159,19 +160,19 @@ source_h_priv = \ $(NULL) -libclutter@CLUTTER_REAL@_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_LIBADD = \ +libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_LIBADD = \ $(CLUTTER_LIBS) pango/libpangoclutter.la \ @CLUTTER_FLAVOUR@/libclutter-@CLUTTER_FLAVOUR@.la \ cogl/@CLUTTER_COGL@/libclutter-cogl.la -libclutter@CLUTTER_REAL@_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_SOURCES = \ +libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_SOURCES = \ $(source_c) $(source_h) $(source_h_priv) -libclutter@CLUTTER_REAL@_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_LDFLAGS = $(LDADD) +libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_LDFLAGS = $(LDADD) lib_LTLIBRARIES = $(clutterbackendlib) -EXTRA_LTLIBRARIES = libclutter@CLUTTER_REAL@-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la +EXTRA_LTLIBRARIES = libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la clutterdir = $(includedir)/clutter-@CLUTTER_API_VERSION@/clutter diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 132a44730..93d85b77d 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -39,6 +39,7 @@ #include "clutter-marshal.h" #include "clutter-private.h" #include "clutter-debug.h" +#include "clutter-units.h" #include "cogl.h" #include @@ -55,7 +56,7 @@ static guint32 __id = 0; struct _ClutterActorPrivate { - ClutterActorBoxReal coords; + ClutterActorBox coords; ClutterGeometry clip; guint has_clip : 1; @@ -308,8 +309,8 @@ clutter_actor_paint (ClutterActor *self) if (clutter_actor_get_parent (self) != NULL) { - cogl_translate (CLUTTER_REAL_TO_FLOAT (priv->coords.x1), - CLUTTER_REAL_TO_FLOAT (priv->coords.y1), + cogl_translate (CLUTTER_FIXED_TO_FLOAT (priv->coords.x1), + CLUTTER_FIXED_TO_FLOAT (priv->coords.y1), 0); } @@ -383,9 +384,19 @@ clutter_actor_paint (ClutterActor *self) cogl_pop_matrix(); } +/** + * clutter_actor_request_coords: + * @self: A #ClutterActor + * @box: A #ClutterActorBox with requested new co-ordinates. + * + * Requests new co-ordinates for the #ClutterActor ralative to any parent. + * + * This function should not be called directly by applications instead + * the various position/geometry methods should be used. + **/ void -_clutter_actor_request_coords_real (ClutterActor *self, - ClutterActorBoxReal *box) +clutter_actor_request_coords (ClutterActor *self, + ClutterActorBox *box) { ClutterActorClass *klass; gboolean x_change, y_change, width_change, height_change; @@ -395,12 +406,12 @@ _clutter_actor_request_coords_real (ClutterActor *self, if (klass->request_coords) klass->request_coords (self, box); - x_change = CLUTTER_REAL_NE (self->priv->coords.x1, box->x1); - y_change = CLUTTER_REAL_NE (self->priv->coords.y1, box->y1); - width_change = CLUTTER_REAL_NE ((self->priv->coords.x2 - self->priv->coords.x1), - (box->x2 - box->x1)); - height_change = CLUTTER_REAL_NE ((self->priv->coords.y2 - self->priv->coords.y1), - (box->y2 - box->y1)); + x_change = (self->priv->coords.x1 != box->x1); + y_change = (self->priv->coords.y1 != box->y1); + width_change = ((self->priv->coords.x2 - self->priv->coords.x1) != + (box->x2 - box->x1)); + height_change = ((self->priv->coords.y2 - self->priv->coords.y1) != + (box->y2 - box->y1)); if (x_change || y_change || width_change || height_change) { @@ -432,59 +443,6 @@ _clutter_actor_request_coords_real (ClutterActor *self, } } -/** - * clutter_actor_request_coords: - * @self: A #ClutterActor - * @box: A #ClutterActorBox with requested new co-ordinates. - * - * Requests new co-ordinates for the #ClutterActor ralative to any parent. - * - * This function should not be called directly by applications instead - * the various position/geometry methods should be used. - **/ -void -clutter_actor_request_coords (ClutterActor *self, - ClutterActorBox *box) -{ - ClutterActorBoxReal rbox; - - rbox.x1 = CLUTTER_REAL_FROM_INT (box->x1); - rbox.y1 = CLUTTER_REAL_FROM_INT (box->y1); - rbox.x2 = CLUTTER_REAL_FROM_INT (box->x2); - rbox.y2 = CLUTTER_REAL_FROM_INT (box->y2); - - _clutter_actor_request_coords_real (self, &rbox); -} - -void -_clutter_actor_allocate_coords_real (ClutterActor *self, - ClutterActorBoxReal *rbox) -{ - ClutterActorClass *klass; - - klass = CLUTTER_ACTOR_GET_CLASS (self); - - rbox->x1 = self->priv->coords.x1; - rbox->y1 = self->priv->coords.y1; - rbox->x2 = self->priv->coords.x2; - rbox->y2 = self->priv->coords.y2; - - if (klass->allocate_coords) - { - /* FIXME: This is kind of a cludge - we pass out *private* - * co-ords down to any subclasses so they can modify - * we then resync any changes. Needed for group class. - * Need to figure out nicer way. - */ - klass->allocate_coords(self, rbox); - - self->priv->coords.x1 = rbox->x1; - self->priv->coords.y1 = rbox->y1; - self->priv->coords.x2 = rbox->x2; - self->priv->coords.y2 = rbox->y2; - } -} - /** * clutter_actor_allocate_coords: * @self: A #ClutterActor @@ -500,14 +458,29 @@ void clutter_actor_allocate_coords (ClutterActor *self, ClutterActorBox *box) { - ClutterActorBoxReal rbox; - - _clutter_actor_allocate_coords_real (self, &rbox); + ClutterActorClass *klass; - box->x1 = CLUTTER_REAL_TO_INT (rbox.x1); - box->y1 = CLUTTER_REAL_TO_INT (rbox.y1); - box->x2 = CLUTTER_REAL_TO_INT (rbox.x2); - box->y2 = CLUTTER_REAL_TO_INT (rbox.y2); + klass = CLUTTER_ACTOR_GET_CLASS (self); + + box->x1 = self->priv->coords.x1; + box->y1 = self->priv->coords.y1; + box->x2 = self->priv->coords.x2; + box->y2 = self->priv->coords.y2; + + if (klass->allocate_coords) + { + /* FIXME: This is kind of a cludge - we pass out *private* + * co-ords down to any subclasses so they can modify + * we then resync any changes. Needed for group class. + * Need to figure out nicer way. + */ + klass->allocate_coords(self, box); + + self->priv->coords.x1 = box->x1; + self->priv->coords.y1 = box->y1; + self->priv->coords.x2 = box->x2; + self->priv->coords.y2 = box->y2; + } } static void @@ -926,10 +899,10 @@ clutter_actor_set_geometry (ClutterActor *self, { ClutterActorBox box; - box.x1 = geometry->x; - box.y1 = geometry->y; - box.x2 = geometry->x + geometry->width; - box.y2 = geometry->y + geometry->height; + box.x1 = CLUTTER_UNITS_FROM_INT (geometry->x); + box.y1 = CLUTTER_UNITS_FROM_INT (geometry->y); + box.x2 = CLUTTER_UNITS_FROM_INT (geometry->x + geometry->width); + box.y2 = CLUTTER_UNITS_FROM_INT (geometry->y + geometry->height); clutter_actor_request_coords (self, &box); } @@ -951,10 +924,10 @@ clutter_actor_get_geometry (ClutterActor *self, clutter_actor_allocate_coords (self, &box); - geometry->x = box.x1; - geometry->y = box.y1; - geometry->width = box.x2 - box.x1; - geometry->height = box.y2 - box.y1; + geometry->x = CLUTTER_UNITS_TO_INT (box.x1); + geometry->y = CLUTTER_UNITS_TO_INT (box.y1); + geometry->width = CLUTTER_UNITS_TO_INT (box.x2 - box.x1); + geometry->height = CLUTTER_UNITS_TO_INT (box.y2 - box.y1); } /** @@ -975,43 +948,23 @@ clutter_actor_get_coords (ClutterActor *self, gint *x2, gint *y2) { - ClutterActorBoxReal box; + ClutterActorBox box; g_return_if_fail (CLUTTER_IS_ACTOR (self)); - _clutter_actor_allocate_coords_real (self, &box); + clutter_actor_allocate_coords (self, &box); if (x1) - *x1 = CLUTTER_REAL_TO_INT (box.x1); + *x1 = CLUTTER_UNITS_TO_INT (box.x1); if (y1) - *y1 = CLUTTER_REAL_TO_INT (box.y1); + *y1 = CLUTTER_UNITS_TO_INT (box.y1); if (x2) - *x2 = CLUTTER_REAL_TO_INT (box.x2); + *x2 = CLUTTER_UNITS_TO_INT (box.x2); if (y2) - *y2 = CLUTTER_REAL_TO_INT (box.y2); -} - -static void -_clutter_actor_set_position_real (ClutterActor *self, - ClutterReal x, - ClutterReal y) -{ - ClutterActorBoxReal box; - - g_return_if_fail (CLUTTER_IS_ACTOR (self)); - - _clutter_actor_allocate_coords_real (self, &box); - - box.x2 += (x - box.x1); - box.y2 += (y - box.y1); - - box.x1 = x; - box.y1 = y; - - _clutter_actor_request_coords_real (self, &box); + *y2 = CLUTTER_UNITS_TO_INT (box.y2); } /** @@ -1028,10 +981,19 @@ clutter_actor_set_position (ClutterActor *self, gint x, gint y) { - ClutterReal xr = CLUTTER_REAL_FROM_INT (x); - ClutterReal yr = CLUTTER_REAL_FROM_INT (y); - - _clutter_actor_set_position_real (self, xr, yr); + ClutterActorBox box; + + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + clutter_actor_allocate_coords (self, &box); + + box.x2 += (CLUTTER_UNITS_FROM_INT (x) - box.x1); + box.y2 += (CLUTTER_UNITS_FROM_INT (y) - box.y1); + + box.x1 = CLUTTER_UNITS_FROM_INT (x); + box.y1 = CLUTTER_UNITS_FROM_INT (y); + + clutter_actor_request_coords (self, &box); } /** @@ -1050,20 +1012,20 @@ clutter_actor_move_by (ClutterActor *self, gint dx, gint dy) { - ClutterActorBoxReal box; - ClutterReal dxr = CLUTTER_REAL_FROM_INT (dx); - ClutterReal dyr = CLUTTER_REAL_FROM_INT (dy); + ClutterActorBox box; + gint32 dxu = CLUTTER_UNITS_FROM_INT (dx); + gint32 dyu = CLUTTER_UNITS_FROM_INT (dy); g_return_if_fail (CLUTTER_IS_ACTOR (self)); - _clutter_actor_allocate_coords_real (self, &box); + clutter_actor_allocate_coords (self, &box); - box.x2 += dxr; - box.y2 += dyr; - box.x1 += dxr; - box.y1 += dyr; + box.x2 += dxu; + box.y2 += dyu; + box.x1 += dxu; + box.y1 += dyu; - _clutter_actor_request_coords_real (self, &box); + clutter_actor_request_coords (self, &box); } /** @@ -1080,16 +1042,16 @@ clutter_actor_set_size (ClutterActor *self, gint width, gint height) { - ClutterActorBoxReal box; + ClutterActorBox box; g_return_if_fail (CLUTTER_IS_ACTOR (self)); - _clutter_actor_allocate_coords_real (self, &box); + clutter_actor_allocate_coords (self, &box); - box.x2 = CLUTTER_REAL_ADD_INT (box.x1, width); - box.y2 = CLUTTER_REAL_ADD_INT (box.y1, height); + box.x2 = box.x1 + CLUTTER_UNITS_FROM_INT (width); + box.y2 = box.y1 + CLUTTER_UNITS_FROM_INT (height); - _clutter_actor_request_coords_real (self, &box); + clutter_actor_request_coords (self, &box); } /** @@ -1116,52 +1078,6 @@ clutter_actor_get_size (ClutterActor *self, *height = clutter_actor_get_height (self); } -void -_clutter_actor_get_abs_position_real (ClutterActor *self, - ClutterReal *x, - ClutterReal *y) -{ - ClutterActorBoxReal box; - ClutterActor *parent; - ClutterReal px = 0, py = 0; - - g_return_if_fail (CLUTTER_IS_ACTOR (self)); - - _clutter_actor_allocate_coords_real (self, &box); - - parent = self->priv->parent_actor; - - /* FIXME: must be nicer way to get 0,0 for stage ? */ - if (parent) - { - ClutterFixed parent_scale_x, parent_scale_y; - ClutterReal sx, sy; - - clutter_actor_get_scalex (parent, - &parent_scale_x, - &parent_scale_y); - - sx = CLUTTER_REAL_FROM_FIXED (parent_scale_x); - sy = CLUTTER_REAL_FROM_FIXED (parent_scale_y); - - if (parent_scale_x != CFX_ONE || - parent_scale_y != CFX_ONE) - { - box.x1 = CLUTTER_REAL_MUL (box.x1, sx); - box.y1 = CLUTTER_REAL_MUL (box.y1, sy); - } - - if (!CLUTTER_IS_STAGE (parent)) - _clutter_actor_get_abs_position_real (parent, &px, &py); - } - - if (x) - *x = px + box.x1; - - if (y) - *y = py + box.y1; -} - /** * clutter_actor_get_abs_position * @self: A #ClutterActor @@ -1176,14 +1092,64 @@ clutter_actor_get_abs_position (ClutterActor *self, gint *x, gint *y) { - ClutterReal xr, yr; - _clutter_actor_get_abs_position_real (self, &xr, &yr); + gint32 xu, yu; + clutter_actor_get_abs_position_units (self, &xu, &yu); - if (x) - *x = CLUTTER_REAL_TO_INT (xr); + *x = CLUTTER_UNITS_TO_INT (xu); + *y = CLUTTER_UNITS_TO_INT (yu); +} - if (y) - *y = CLUTTER_REAL_TO_INT (yr); +/** + * clutter_actor_get_abs_position_units + * @self: A #ClutterActor + * @x: Location to store x position if non NULL. + * @y: Location to store y position if non NULL. + * + * Gets the absolute position of an actor in clutter units relative + * to the stage. + * + * Since: 0.4 + */ +void +clutter_actor_get_abs_position_units (ClutterActor *self, + gint32 *x, + gint32 *y) +{ + ClutterActorBox box; + ClutterActor *parent; + gint32 px = 0, py = 0; + + g_return_if_fail (CLUTTER_IS_ACTOR (self)); + + clutter_actor_allocate_coords (self, &box); + + parent = self->priv->parent_actor; + + /* FIXME: must be nicer way to get 0,0 for stage ? */ + if (parent) + { + ClutterFixed parent_scale_x, parent_scale_y; + + clutter_actor_get_scalex (parent, + &parent_scale_x, + &parent_scale_y); + + if (parent_scale_x != CFX_ONE || + parent_scale_y != CFX_ONE) + { + box.x1 = CFX_MUL (box.x1, parent_scale_x); + box.y1 = CFX_MUL (box.y1, parent_scale_y); + } + + if (!CLUTTER_IS_STAGE (parent)) + clutter_actor_get_abs_position_units (parent, &px, &py); + } + + if (x) + *x = px + box.x1; + + if (y) + *y = py + box.y1; } /** @@ -1199,6 +1165,29 @@ void clutter_actor_get_abs_size (ClutterActor *self, guint *width, guint *height) +{ + gint32 wu, hu; + clutter_actor_get_abs_size_units (self, &wu, &hu); + + *width = CLUTTER_UNITS_TO_INT (wu); + *height = CLUTTER_UNITS_TO_INT (hu); +} + +/** + * clutter_actor_get_abs_size_units: + * @self: A #ClutterActor + * @width: Location to store width if non NULL. + * @height: Location to store height if non NULL. + * + * Gets the absolute size of an actor in clutter units taking into account + * an scaling factors. + * + * Since: 0.4 + */ +void +clutter_actor_get_abs_size_units (ClutterActor *self, + gint32 *width, + gint32 *height) { ClutterActorBox box; ClutterActor *parent; @@ -1222,56 +1211,16 @@ clutter_actor_get_abs_size (ClutterActor *self, if (width) { - fx = CLUTTER_FIXED_MUL (CLUTTER_INT_TO_FIXED (*width), - parent->priv->scale_x); - *width = CLUTTER_FIXED_INT (fx); + fx = CLUTTER_FIXED_MUL (CLUTTER_UNITS_TO_FIXED (*width), + parent->priv->scale_x); + *width = CLUTTER_UNITS_FROM_FIXED (fx); } if (height) { - fy = CLUTTER_FIXED_MUL (CLUTTER_INT_TO_FIXED (*height), - parent->priv->scale_x); - *height = CLUTTER_FIXED_INT (fy); - } - } - } - while ((parent = clutter_actor_get_parent (parent)) != NULL); -} - -static void -_clutter_actor_get_abs_size_real (ClutterActor *self, - ClutterReal *width, - ClutterReal *height) -{ - ClutterActorBoxReal box; - ClutterActor *parent; - - _clutter_actor_allocate_coords_real (self, &box); - - if (width) - *width = box.x2 - box.x1; - - if (height) - *height = box.y2 - box.y1; - - parent = self; - - do - { - if (parent->priv->scale_x != CFX_ONE || - parent->priv->scale_y != CFX_ONE) - { - - if (width) - { - ClutterReal scale = CLUTTER_REAL_FROM_FIXED (parent->priv->scale_x); - *width = CLUTTER_REAL_MUL (*width, scale); - } - - if (height) - { - ClutterReal scale = CLUTTER_REAL_FROM_FIXED (parent->priv->scale_y); - *height = CLUTTER_REAL_MUL (*height, scale); + fy = CLUTTER_FIXED_MUL (CLUTTER_UNITS_TO_FIXED (*height), + parent->priv->scale_x); + *height = CLUTTER_UNITS_FROM_FIXED (fy); } } } @@ -1296,7 +1245,7 @@ clutter_actor_get_width (ClutterActor *self) clutter_actor_allocate_coords (self, &box); - return box.x2 - box.x1; + return CLUTTER_UNITS_TO_INT (box.x2 - box.x1); } /** @@ -1316,7 +1265,7 @@ clutter_actor_get_height (ClutterActor *self) clutter_actor_allocate_coords (self, &box); - return box.y2 - box.y1; + return CLUTTER_UNITS_TO_INT (box.y2 - box.y1); } /** @@ -1371,19 +1320,7 @@ clutter_actor_get_x (ClutterActor *self) clutter_actor_allocate_coords (self, &box); - return box.x1; -} - -static ClutterReal -_clutter_actor_get_x_real (ClutterActor *self) -{ - ClutterActorBoxReal box; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); - - _clutter_actor_allocate_coords_real (self, &box); - - return box.x1; + return CLUTTER_UNITS_TO_INT (box.x1); } /** @@ -1403,19 +1340,7 @@ clutter_actor_get_y (ClutterActor *self) clutter_actor_allocate_coords (self, &box); - return box.y1; -} - -static ClutterReal -_clutter_actor_get_y_real (ClutterActor *self) -{ - ClutterActorBoxReal box; - - g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); - - _clutter_actor_allocate_coords_real (self, &box); - - return box.y1; + return CLUTTER_UNITS_TO_INT (box.y1); } /** @@ -1524,21 +1449,23 @@ clutter_actor_scalex (ClutterActor *self, ClutterFixed scale_y, ClutterGravity gravity) { - ClutterReal sw, sh, w, h; - ClutterReal x, y; + ClutterActorBox box; + gint32 sw, sh, w, h; + gint32 x, y; - _clutter_actor_get_abs_size_real (self, &w, &h); + clutter_actor_get_abs_size_units (self, &w, &h); clutter_actor_set_scalex (self, scale_x, scale_y); if (gravity == CLUTTER_GRAVITY_NONE || gravity == CLUTTER_GRAVITY_NORTH_WEST) return; - _clutter_actor_get_abs_size_real (self, &sw, &sh); - - x = _clutter_actor_get_x_real (self); - y = _clutter_actor_get_y_real (self); + clutter_actor_get_abs_size_units (self, &sw, &sh); + clutter_actor_allocate_coords (self, &box); + x = box.x1; + y = box.y1; + switch (gravity) { case CLUTTER_GRAVITY_NORTH: @@ -1572,7 +1499,12 @@ clutter_actor_scalex (ClutterActor *self, break; } - _clutter_actor_set_position_real (self, x, y); + box.x2 += (x - box.x1); + box.y2 += (y - box.y1); + box.x1 = x; + box.y1 = y; + + clutter_actor_request_coords (self, &box); } /** @@ -1584,7 +1516,7 @@ clutter_actor_scalex (ClutterActor *self, */ void clutter_actor_set_opacity (ClutterActor *self, - guint8 opacity) + guint8 opacity) { g_return_if_fail (CLUTTER_IS_ACTOR (self)); @@ -2185,28 +2117,3 @@ clutter_actor_box_get_type (void) return our_type; } -/* - * ClutterActorBoxReal - */ -static ClutterActorBoxReal * -clutter_actor_box_real_copy (const ClutterActorBoxReal *box) -{ - ClutterActorBoxReal *result = g_new (ClutterActorBoxReal, 1); - - *result = *box; - - return result; -} - -GType -clutter_actor_box_real_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static ( - g_intern_static_string ("ClutterActorBoxReal"), - (GBoxedCopyFunc) clutter_actor_box_real_copy, - (GBoxedFreeFunc) g_free); - return our_type; -} diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h index d04d1e638..6379ced48 100644 --- a/clutter/clutter-actor.h +++ b/clutter/clutter-actor.h @@ -29,8 +29,7 @@ /* clutter-actor.h */ #include - -#include "clutter-real.h" +#include G_BEGIN_DECLS @@ -74,7 +73,6 @@ typedef enum { /*< prefix=CLUTTER_GRAVITY >*/ typedef struct _ClutterActor ClutterActor; typedef struct _ClutterActorClass ClutterActorClass; typedef struct _ClutterActorBox ClutterActorBox; -typedef struct _ClutterActorBoxReal ClutterActorBoxReal; typedef struct _ClutterActorPrivate ClutterActorPrivate; typedef struct _ClutterGeometry ClutterGeometry; @@ -86,11 +84,13 @@ struct _ClutterGeometry /* FIXME: * It is likely gonna save a load of pain if we make * x,y unsigned... - */ - gint x; - gint y; - guint width; - guint height; + * + * No, no, no, usigned is evil; we should make width and height signed. + */ + gint x; + gint y; + guint width; + guint height; }; GType clutter_geometry_get_type (void) G_GNUC_CONST; @@ -101,8 +101,7 @@ typedef enum CLUTTER_ACTOR_REALIZED = 1 << 2 } ClutterActorFlags; -struct _ClutterActorBox { gint x1, y1, x2, y2; }; -struct _ClutterActorBoxReal { ClutterReal x1, y1, x2, y2; }; +struct _ClutterActorBox { gint32 x1, y1, x2, y2; }; GType clutter_actor_box_get_type (void) G_GNUC_CONST; @@ -130,9 +129,9 @@ struct _ClutterActorClass void (* unrealize) (ClutterActor *actor); void (* paint) (ClutterActor *actor); void (* request_coords) (ClutterActor *actor, - ClutterActorBoxReal *box); + ClutterActorBox *box); void (* allocate_coords) (ClutterActor *actor, - ClutterActorBoxReal *box); + ClutterActorBox *box); void (* set_depth) (ClutterActor *actor, gint depth); gint (* get_depth) (ClutterActor *actor); @@ -185,6 +184,9 @@ void clutter_actor_set_position (ClutterActor *sel void clutter_actor_get_abs_position (ClutterActor *self, gint *x, gint *y); +void clutter_actor_get_abs_position_units (ClutterActor *self, + gint32 *x, + gint32 *y); guint clutter_actor_get_width (ClutterActor *self); guint clutter_actor_get_height (ClutterActor *self); @@ -259,6 +261,9 @@ void clutter_actor_scalex (ClutterActor *sel void clutter_actor_get_abs_size (ClutterActor *self, guint *width, guint *height); +void clutter_actor_get_abs_size_units (ClutterActor *self, + gint32 *width, + gint32 *height); void clutter_actor_get_size (ClutterActor *self, guint *width, guint *height); @@ -266,13 +271,6 @@ void clutter_actor_move_by (ClutterActor *sel gint dx, gint dy); -/*x2) || - CLUTTER_REAL_GT (cbox.x2, box->x2)) + if (box->x2 == 0 || cbox.x2 > box->x2) box->x2 = cbox.x2; - if (CLUTTER_REAL_EZ (box->y2) || - CLUTTER_REAL_GT (cbox.y2, box->y2)) + if (box->y2 == 0 || cbox.y2 > box->y2) box->y2 = cbox.y2; } } diff --git a/clutter/clutter-label.c b/clutter/clutter-label.c index 6594a6367..4455b2b2a 100644 --- a/clutter/clutter-label.c +++ b/clutter/clutter-label.c @@ -37,6 +37,7 @@ #include "clutter-enum-types.h" #include "clutter-private.h" #include "clutter-debug.h" +#include "clutter-units.h" #include "pangoclutter.h" @@ -264,7 +265,7 @@ clutter_label_paint (ClutterActor *self) static void clutter_label_allocate_coords (ClutterActor *self, - ClutterActorBoxReal *box) + ClutterActorBox *box) { ClutterLabel *label = CLUTTER_LABEL(self); ClutterLabelPrivate *priv; @@ -272,19 +273,19 @@ clutter_label_allocate_coords (ClutterActor *self, priv = label->priv; - clutter_label_ensure_layout (label, CLUTTER_REAL_TO_INT (box->x2 - box->x1)); + clutter_label_ensure_layout (label, CLUTTER_UNITS_TO_INT (box->x2 - box->x1)); pango_layout_get_extents (priv->layout, NULL, &logical_rect); - box->x2 = box->x1 + PANGO_PIXELS (logical_rect.width); - box->y2 = box->y1 + PANGO_PIXELS (logical_rect.height); + box->x2 = box->x1 + CLUTTER_UNITS_FROM_PANGO_UNIT (logical_rect.width); + box->y2 = box->y1 + CLUTTER_UNITS_FROM_PANGO_UNIT (logical_rect.height); return; } static void clutter_label_request_coords (ClutterActor *self, - ClutterActorBoxReal *box) + ClutterActorBox *box) { /* do we need to do anything ? */ clutter_label_clear_layout (CLUTTER_LABEL(self)); diff --git a/clutter/clutter-real.h b/clutter/clutter-real.h deleted file mode 100644 index 8168469c4..000000000 --- a/clutter/clutter-real.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- mode:C; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Authored By Tomas Frydrych - * - * Copyright (C) 2007 OpenedHand - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/** - * SECTION:clutter-real - * @short_description: An abstract numeric type encapsulating either float - * or fixed point number, depending whether clutter was configured using - * FPU or not. - * - * Since: 0.4 - */ - -#ifndef _HAVE_CLUTTER_REAL_H -#define _HAVE_CLUTTER_REAL_H - -#include "clutter-fixed.h" - -#if 1 -#if CLUTTER_NO_FPU - -#define CLUTTER_REAL_IS_FIXED() 1 -#define CLUTTER_REAL_IS_FLOAT() 0 - -typedef ClutterFixed ClutterReal; - -#define CLUTTER_REAL_MUL(x,y) CFX_MUL((x),(y)) -#define CLUTTER_REAL_DIV(x,y) CFX_DIV((x),(y)) -#define CLUTTER_REAL_ADD_INT(x,i) ((x) + CLUTTER_INT_TO_FIXED(i)) -#define CLUTTER_REAL_SUB_INT(x,i) ((x) - CLUTTER_INT_TO_FIXED(i)) - -#define CLUTTER_REAL_TO_INT(x) CFX_INT((x) + (CFX_ONE >> 1)) -#define CLUTTER_REAL_FROM_INT(i) CLUTTER_INT_TO_FIXED(i) - -#define CLUTTER_REAL_TO_FLOAT(x) CLUTTER_FIXED_TO_FLOAT(x) -#define CLUTTER_REAL_FROM_FLOAT(f) CLUTTER_FLOAT_TO_FIXED(f) - -#define CLUTTER_REAL_TO_FIXED(x) (x) -#define CLUTTER_REAL_FROM_FIXED(x) (x) - -#define CLUTTER_REAL_ZERO 0 - -#else - -#define CLUTTER_REAL_IS_FIXED() 0 -#define CLUTTER_REAL_IS_FLOAT() 1 - -typedef float ClutterReal; - -#define CLUTTER_REAL_MUL(x,y) ((x)*(y)) -#define CLUTTER_REAL_DIV(x,y) ((x)/(y)) -#define CLUTTER_REAL_ADD_INT(x,i) (x+i) -#define CLUTTER_REAL_SUB_INT(x,i) (x-i) - -#define CLUTTER_REAL_TO_INT(x) CLUTTER_FLOAT_TO_INT(x+0.5) -#define CLUTTER_REAL_FROM_INT(i) ((float)i) - -#define CLUTTER_REAL_TO_FLOAT(x) (x) -#define CLUTTER_REAL_FROM_FLOAT(f) (f) - -#define CLUTTER_REAL_TO_FIXED(x) CLLUTER_FLOAT_TO_FIXED(x) -#define CLUTTER_REAL_FROM_FIXED(x) CLUTTER_FIXED_TO_FLOAT(x) - -#define CLUTTER_REAL_ZERO 0.0 - -#endif - -#else -/* - * This is an int defintion for reference / debugging purposes only - * - * FIXME : remove this when no longer needed. - */ -typedef gint ClutterReal; - -#define CLUTTER_REAL_MUL(x,y) ((x)*(y)) -#define CLUTTER_REAL_DIV(x,y) ((x)/(y)) -#define CLUTTER_REAL_ADD_INT(x,i) (x + i) -#define CLUTTER_REAL_SUB_INT(x,i) (x - i) - -#define CLUTTER_REAL_TO_INT(x) (x) -#define CLUTTER_REAL_FROM_INT(i) (i) - -#define CLUTTER_REAL_TO_FLOAT(x) ((float)(x)) -#define CLUTTER_REAL_FROM_FLOAT(f) ((gint)(f)) - -#define CLUTTER_REAL_TO_FIXED(x) CLUTTER_INT_TO_FIXED(x) -#define CLUTTER_REAL_FROM_FIXED(x) CFX_INT(x) - -#define CLUTTER_REAL_ZERO 0 - -#endif - -#define CLUTTER_REAL_EZ(x) (CLUTTER_REAL_TO_INT(x) == 0) -#define CLUTTER_REAL_NZ(x) (CLUTTER_REAL_TO_INT(x) != 0) -#define CLUTTER_REAL_EQ(x,y) (CLUTTER_REAL_TO_INT(x) == CLUTTER_REAL_TO_INT(y)) -#define CLUTTER_REAL_NE(x,y) (CLUTTER_REAL_TO_INT(x) != CLUTTER_REAL_TO_INT(y)) -#define CLUTTER_REAL_LT(x,y) (CLUTTER_REAL_TO_INT(x) < CLUTTER_REAL_TO_INT(y)) -#define CLUTTER_REAL_GT(x,y) (CLUTTER_REAL_TO_INT(x) > CLUTTER_REAL_TO_INT(y)) -#define CLUTTER_REAL_LE(x,y) (CLUTTER_REAL_TO_INT(x) <= CLUTTER_REAL_TO_INT(y)) -#define CLUTTER_REAL_GE(x,y) (CLUTTER_REAL_TO_INT(x) >= CLUTTER_REAL_TO_INT(y)) - -#endif /* ifndef _HAVE_CLUTTER_REAL_H */ diff --git a/clutter/clutter-units.h b/clutter/clutter-units.h new file mode 100644 index 000000000..799271ede --- /dev/null +++ b/clutter/clutter-units.h @@ -0,0 +1,74 @@ +/* -*- mode:C; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Authored By Tomas Frydrych + * + * Copyright (C) 2007 OpenedHand + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:clutter-units + * @short_description: A logical distance unit. + * + * Clutter units are logical units with granularity greater than that of the + * device units; they are used by #ClutterActorBox and the _units() family of + * ClutterActor functions. To convert between clutter units and device units, + * use #CLUTTER_UNITS_FROM_DEVICE and #CLUTTER_UNITS_TO_DEVICE macros. + * + * Note: It is expected that as of version 0.6 all dimensions in the public + * Clutter API will be given in clutter units. In order to ease the transition, + * two extra macros have been provided, #CLUTTER_UNITS_TMP_TO_DEVICE and + * #CLUTTER_UNITS_TMP_FROM_DEVICE. In version 0.4 these are identity macros, + * but when the API transition happens will map to #CLUTTER_UNITS_TO_DEVICE and + * #CLUTTER_UNITS_FROM_DEVICE respectively. You can use these in newly written + * code as place holders. + * + * Since: 0.4 + */ + +#ifndef _HAVE_CLUTTER_UNITS_H +#define _HAVE_CLUTTER_UNITS_H + +#include + +/* + * Currently CLUTTER_UNIT maps directly onto ClutterFixed. Nevertheless, the + * _FROM_FIXED and _TO_FIXED macros should always be used in case that we + * decide to change this relationship in the future. + */ +#define CLUTTER_UNITS_FROM_DEVICE(x) CLUTTER_UNITS_FROM_INT (x) +#define CLUTTER_UNITS_TO_DEVICE(x) CLUTTER_UNITS_TO_INT (x) + +#define CLUTTER_UNITS_TMP_FROM_DEVICE(x) (x) +#define CLUTTER_UNITS_TMP_TO_DEVICE(x) (x) + +#define CLUTTER_UNITS_FROM_INT(x) CLUTTER_INT_TO_FIXED (x) +#define CLUTTER_UNITS_TO_INT(x) CFX_INT (x) + +#define CLUTTER_UNITS_FROM_FLOAT(x) CLUTTER_FLOAT_TO_FIXED (x) +#define CLUTTER_UNITS_TO_FLOAT(x) CLUTTER_FIXED_TO_FLOAT (x) + +#define CLUTTER_UNITS_FROM_FIXED(x) (x) +#define CLUTTER_UNITS_TO_FIXED(x) (x) + +#define CLUTTER_UNITS_FROM_PANGO_UNIT(x) (x << 6) + +#endif /* _HAVE_CLUTTER_UNITS_H */ diff --git a/clutter/clutter.h b/clutter/clutter.h index c57b44eef..3b0e956d5 100644 --- a/clutter/clutter.h +++ b/clutter/clutter.h @@ -52,5 +52,6 @@ #include "clutter-feature.h" #include "clutter-version.h" #include "clutter-enum-types.h" +#include "clutter-units.h" #endif diff --git a/clutter/egl/clutter-stage-egl.c b/clutter/egl/clutter-stage-egl.c index 1419b46e2..809c71b84 100644 --- a/clutter/egl/clutter-stage-egl.c +++ b/clutter/egl/clutter-stage-egl.c @@ -11,6 +11,7 @@ #include "../clutter-enum-types.h" #include "../clutter-private.h" #include "../clutter-debug.h" +#include "../clutter-units.h" #ifdef HAVE_XFIXES #include @@ -239,25 +240,25 @@ clutter_stage_egl_paint (ClutterActor *self) static void clutter_stage_egl_allocate_coords (ClutterActor *self, - ClutterActorBoxReal *box) + ClutterActorBox *box) { ClutterStageEgl *stage_egl = CLUTTER_STAGE_EGL (self); box->x1 = box->y1 = 0; - box->x2 = CLUTTER_REAL_ADD_INT (box->x1, stage_egl->xwin_width); - box->y2 = CLUTTER_REAL_ADD_INT (box->y1, stage_egl->xwin_height); + box->x2 = box->x1 + CLUTTER_UNITS_FROM_INT (stage_egl->xwin_width); + box->y2 = box->y1 + CLUTTER_UNITS_FROM_INT (stage_egl->xwin_height); } static void clutter_stage_egl_request_coords (ClutterActor *self, - ClutterActorBoxReal *box) + ClutterActorBox *box) { ClutterStageEgl *stage_egl = CLUTTER_STAGE_EGL (self); gint new_width, new_height; /* FIXME: some how have X configure_notfiys call this ? */ - new_width = ABS (CLUTTER_REAL_TO_INT (box->x2 - box->x1)); - new_height = ABS (CLUTTER_REAL_TO_INT (box->y2 - box->y1)); + new_width = ABS (CLUTTER_UNITS_TO_INT (box->x2 - box->x1)); + new_height = ABS (CLUTTER_UNITS_TO_INT (box->y2 - box->y1)); if (new_width != stage_egl->xwin_width || new_height != stage_egl->xwin_height) @@ -277,8 +278,8 @@ clutter_stage_egl_request_coords (ClutterActor *self, if (stage_egl->xwin != None) /* Do we want to bother ? */ XMoveWindow (stage_egl->xdpy, stage_egl->xwin, - CLUTTER_REAL_TO_INT (box->x1), - CLUTTER_REAL_TO_INT (box->y1)); + CLUTTER_UNITS_TO_INT (box->x1), + CLUTTER_UNITS_TO_INT (box->y1)); } static void diff --git a/clutter/glx/clutter-stage-glx.c b/clutter/glx/clutter-stage-glx.c index 816883749..a4a9ef96a 100644 --- a/clutter/glx/clutter-stage-glx.c +++ b/clutter/glx/clutter-stage-glx.c @@ -35,6 +35,7 @@ #include "../clutter-enum-types.h" #include "../clutter-private.h" #include "../clutter-debug.h" +#include "../clutter-units.h" #include "cogl.h" @@ -370,24 +371,24 @@ clutter_stage_glx_paint (ClutterActor *self) static void clutter_stage_glx_allocate_coords (ClutterActor *self, - ClutterActorBoxReal *box) + ClutterActorBox *box) { ClutterStageGlx *stage_glx = CLUTTER_STAGE_GLX (self); box->x1 = box->y1 = 0; - box->x2 = CLUTTER_REAL_ADD_INT (box->x1, stage_glx->xwin_width); - box->y2 = CLUTTER_REAL_ADD_INT (box->y1, stage_glx->xwin_height); + box->x2 = box->x1 + CLUTTER_UNITS_FROM_INT (stage_glx->xwin_width); + box->y2 = box->y1 + CLUTTER_UNITS_FROM_INT (stage_glx->xwin_height); } static void clutter_stage_glx_request_coords (ClutterActor *self, - ClutterActorBoxReal *box) + ClutterActorBox *box) { ClutterStageGlx *stage_glx = CLUTTER_STAGE_GLX (self); gint new_width, new_height; - new_width = ABS (CLUTTER_REAL_TO_INT (box->x2 - box->x1)); - new_height = ABS (CLUTTER_REAL_TO_INT (box->y2 - box->y1)); + new_width = ABS (CLUTTER_UNITS_TO_INT (box->x2 - box->x1)); + new_height = ABS (CLUTTER_UNITS_TO_INT (box->y2 - box->y1)); if (new_width != stage_glx->xwin_width || new_height != stage_glx->xwin_height) @@ -414,8 +415,8 @@ clutter_stage_glx_request_coords (ClutterActor *self, if (stage_glx->xwin != None) /* Do we want to bother ? */ XMoveWindow (stage_glx->xdpy, stage_glx->xwin, - CLUTTER_REAL_TO_INT (box->x1), - CLUTTER_REAL_TO_INT (box->y1)); + CLUTTER_UNITS_TO_INT (box->x1), + CLUTTER_UNITS_TO_INT (box->y1)); } static void diff --git a/clutter/sdl/clutter-stage-sdl.c b/clutter/sdl/clutter-stage-sdl.c index cfa7900fb..b8eeee6d6 100644 --- a/clutter/sdl/clutter-stage-sdl.c +++ b/clutter/sdl/clutter-stage-sdl.c @@ -11,6 +11,7 @@ #include "../clutter-enum-types.h" #include "../clutter-private.h" #include "../clutter-debug.h" +#include "../clutter-units.h" #include "cogl.h" @@ -130,8 +131,8 @@ clutter_stage_sdl_allocate_coords (ClutterActor *self, ClutterStageSDL *stage_sdl = CLUTTER_STAGE_SDL (self); box->x1 = box->y1 = 0; - box->x2 = box->x1 + stage_sdl->win_width; - box->y2 = box->y1 + stage_sdl->win_height; + box->x2 = box->x1 + CLUTTER_UNITS_FROM_INT (stage_sdl->win_width); + box->y2 = box->y1 + CLUTTER_UNITS_FROM_INT (stage_sdl->win_height); } static void @@ -142,8 +143,8 @@ clutter_stage_sdl_request_coords (ClutterActor *self, gint new_width, new_height; /* FIXME: some how have X configure_notfiys call this ? */ - new_width = ABS (box->x2 - box->x1); - new_height = ABS (box->y2 - box->y1); + new_width = ABS (CLUTTER_UNITS_TO_INT (box->x2 - box->x1)); + new_height = ABS (CLUTTER_UNITS_TO_INT (box->y2 - box->y1)); if (new_width != stage_sdl->win_width || new_height != stage_sdl->win_height) diff --git a/configure.ac b/configure.ac index ad7dfa30a..786c4b353 100644 --- a/configure.ac +++ b/configure.ac @@ -93,8 +93,6 @@ if $PKG_CONFIG --exists xfixes ; then fi CLUTTER_NO_FPU="0" -CLUTTER_REAL="" - AC_ARG_WITH(fpu, AS_HELP_STRING([--without-fpu], [Assume target hardware has no fpu]), @@ -103,11 +101,9 @@ AC_ARG_WITH(fpu, if test "x$with_fpu" != "xyes" ; then CLUTTER_NO_FPU="1" - CLUTTER_REAL="-fx" fi AC_SUBST(CLUTTER_NO_FPU) -AC_SUBST(CLUTTER_REAL) clutterbackend=glx AC_ARG_WITH([flavour], diff --git a/doc/reference/ChangeLog b/doc/reference/ChangeLog index 83b09693d..54e7eda09 100644 --- a/doc/reference/ChangeLog +++ b/doc/reference/ChangeLog @@ -1,3 +1,15 @@ +2007-05-22 Tomas Frydrych + + * clutter-sections.txt: + * clutter-docs.sgml: + * tmpl/clutter-units.sgml: + Added clutter-units. + + * tmpl/clutter-alpha.sgml: + * tmpl/clutter-actor.sgml: + * tmpl/clutter-media.sgml: + Updated templates. + 2007-05-17 Emmanuele Bassi * Makefile.am: Ignore the sdl backend. diff --git a/doc/reference/clutter-docs.sgml b/doc/reference/clutter-docs.sgml index ae2c77368..7890cf0e0 100644 --- a/doc/reference/clutter-docs.sgml +++ b/doc/reference/clutter-docs.sgml @@ -94,6 +94,7 @@ + Clutter Backends diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index f79eda137..ce46c5219 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -24,6 +24,22 @@ CLUTTER_MEDIA_GET_INTERFACE clutter_media_get_type +
+clutter-units +clutter-units +CLUTTER_UNITS_FROM_DEVICE +CLUTTER_UNITS_FROM_FIXED +CLUTTER_UNITS_FROM_FLOAT +CLUTTER_UNITS_FROM_INT +CLUTTER_UNITS_FROM_PANGO_UNIT +CLUTTER_UNITS_TMP_FROM_DEVICE +CLUTTER_UNITS_TMP_TO_DEVICE +CLUTTER_UNITS_TO_DEVICE +CLUTTER_UNITS_TO_FIXED +CLUTTER_UNITS_TO_FLOAT +CLUTTER_UNITS_TO_INT +
+
clutter-label ClutterLabel diff --git a/doc/reference/tmpl/clutter-actor.sgml b/doc/reference/tmpl/clutter-actor.sgml index 310730ef5..7b6de46a3 100644 --- a/doc/reference/tmpl/clutter-actor.sgml +++ b/doc/reference/tmpl/clutter-actor.sgml @@ -61,7 +61,8 @@ Evaluates to %TRUE if an actor is visible. -Coordinates (top-left to bottom-right) of a box surrounding an actor. +Coordinates (top-left to bottom-right) of a box surrounding an actor; in +cluttter units. @x1: X coordinate of the top left corner of the box diff --git a/doc/reference/tmpl/clutter-alpha.sgml b/doc/reference/tmpl/clutter-alpha.sgml index 93399958c..d6c12800c 100644 --- a/doc/reference/tmpl/clutter-alpha.sgml +++ b/doc/reference/tmpl/clutter-alpha.sgml @@ -219,6 +219,57 @@ Symbolic name for passing clutter_sine_func(). @Returns: + + + + + + + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + + + + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + + + + + + + + + +@alpha: +@dummy: +@Returns: + + @@ -253,3 +304,37 @@ Symbolic name for passing clutter_sine_func(). @Returns: + + + + + + + + + + + + +@alpha: +@dummy: +@Returns: + + + + + + + + + + + + + + +@alpha: +@dummy: +@Returns: + + diff --git a/doc/reference/tmpl/clutter-media.sgml b/doc/reference/tmpl/clutter-media.sgml index 3d85887af..5330021ec 100644 --- a/doc/reference/tmpl/clutter-media.sgml +++ b/doc/reference/tmpl/clutter-media.sgml @@ -23,21 +23,6 @@ clutter-media - - - - - -@cluttermedia: the object which received the signal. - - - - - - -@cluttermedia: the object which received the signal. -@arg1: - diff --git a/doc/reference/tmpl/clutter-units.sgml b/doc/reference/tmpl/clutter-units.sgml new file mode 100644 index 000000000..fae52512a --- /dev/null +++ b/doc/reference/tmpl/clutter-units.sgml @@ -0,0 +1,107 @@ + +Clutter Units + + + + + + + + + + + + + + + + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + + + + + + +@x: + + diff --git a/examples/Makefile.am b/examples/Makefile.am index 2762dbb69..7efa6d564 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,7 +1,7 @@ noinst_PROGRAMS = test super-oh behave test-text slider INCLUDES = -I$(top_srcdir)/ -LDADD = $(top_builddir)/clutter/libclutter@CLUTTER_REAL@-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la AM_CFLAGS = $(CLUTTER_CFLAGS) LDFLAGS = $(CLUTTER_LIBS) diff --git a/tests/Makefile.am b/tests/Makefile.am index 0ae1f6cef..c92da6b7d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ noinst_PROGRAMS = test-textures test-events INCLUDES = -I$(top_srcdir)/ -LDADD = $(top_builddir)/clutter/libclutter@CLUTTER_REAL@-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_MAJORMINOR@.la AM_CFLAGS = $(CLUTTER_CFLAGS) LDFLAGS = $(CLUTTER_LIBS)