From abd6832dd9c7a9b752aec398e4786aecfb201917 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Fri, 12 Oct 2007 08:17:00 +0000 Subject: [PATCH] 2007-10-12 Tomas Frydrych * clutter/clutter-actor.c: * clutter/clutter-backend.c: * clutter/clutter-behaviour-depth.c: * clutter/clutter-box.c: * clutter/clutter-clone-texture.c: * clutter/clutter-container.c: * clutter/clutter-entry.c: * clutter/clutter-feature.c: * clutter/clutter-fixed.c: * clutter/clutter-group.c: * clutter/clutter-hbox.c: * clutter/clutter-label.c: * clutter/clutter-layout.c: * clutter/clutter-media.c: * clutter/clutter-rectangle.c: * clutter/clutter-score.c: * clutter/clutter-script.c: * clutter/clutter-stage.c: * clutter/clutter-texture.c: * clutter/clutter-timeline.c: * clutter/clutter-timeout-pool.c: * clutter/clutter-vbox.c: * clutter/cogl/gl/cogl.c: * clutter/cogl/gles/cogl.c: * clutter/eglnative/clutter-backend-egl.c: * clutter/eglnative/clutter-event-egl.c: * clutter/eglnative/clutter-stage-egl.c: * clutter/eglx/clutter-backend-egl.c: * clutter/eglx/clutter-event-egl.c: * clutter/eglx/clutter-stage-egl.c: * clutter/glx/clutter-event-glx.c: * clutter/json/json-array.c: * clutter/json/json-generator.c: * clutter/json/json-node.c: * clutter/json/json-object.c: * clutter/json/json-parser.c: * clutter/sdl/clutter-backend-sdl.c: * clutter/sdl/clutter-event-sdl.c: * clutter/sdl/clutter-stage-sdl.c: Fixedup config.h inclusion (must always be bracketed with #ifdef HAVE_CONFIG_H). --- ChangeLog | 45 ++++ clutter/clutter-actor.c | 332 ++++++++++++------------ clutter/clutter-backend.c | 2 +- clutter/clutter-behaviour-depth.c | 2 + clutter/clutter-box.c | 2 + clutter/clutter-clone-texture.c | 2 + clutter/clutter-container.c | 10 +- clutter/clutter-entry.c | 326 +++++++++++------------ clutter/clutter-feature.c | 10 +- clutter/clutter-fixed.c | 218 ++++++++-------- clutter/clutter-group.c | 75 +++--- clutter/clutter-hbox.c | 14 +- clutter/clutter-label.c | 2 + clutter/clutter-layout.c | 12 +- clutter/clutter-media.c | 28 +- clutter/clutter-rectangle.c | 38 +-- clutter/clutter-score.c | 62 ++--- clutter/clutter-script.c | 2 + clutter/clutter-stage.c | 76 +++--- clutter/clutter-texture.c | 274 +++++++++---------- clutter/clutter-timeline.c | 70 ++--- clutter/clutter-timeout-pool.c | 14 +- clutter/clutter-vbox.c | 12 +- clutter/cogl/gl/cogl.c | 67 ++--- clutter/cogl/gles/cogl.c | 3 + clutter/eglnative/clutter-backend-egl.c | 2 + clutter/eglnative/clutter-event-egl.c | 22 +- clutter/eglnative/clutter-stage-egl.c | 2 + clutter/eglx/clutter-backend-egl.c | 22 +- clutter/eglx/clutter-event-egl.c | 14 +- clutter/eglx/clutter-stage-egl.c | 82 +++--- clutter/glx/clutter-event-glx.c | 2 + clutter/json/json-array.c | 2 + clutter/json/json-generator.c | 2 + clutter/json/json-node.c | 2 + clutter/json/json-object.c | 2 + clutter/json/json-parser.c | 2 + clutter/sdl/clutter-backend-sdl.c | 2 + clutter/sdl/clutter-event-sdl.c | 28 +- clutter/sdl/clutter-stage-sdl.c | 2 + 40 files changed, 1003 insertions(+), 883 deletions(-) diff --git a/ChangeLog b/ChangeLog index 065bf290a..f0765fce7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,48 @@ +2007-10-12 Tomas Frydrych + + * clutter/clutter-actor.c: + * clutter/clutter-backend.c: + * clutter/clutter-behaviour-depth.c: + * clutter/clutter-box.c: + * clutter/clutter-clone-texture.c: + * clutter/clutter-container.c: + * clutter/clutter-entry.c: + * clutter/clutter-feature.c: + * clutter/clutter-fixed.c: + * clutter/clutter-group.c: + * clutter/clutter-hbox.c: + * clutter/clutter-label.c: + * clutter/clutter-layout.c: + * clutter/clutter-media.c: + * clutter/clutter-rectangle.c: + * clutter/clutter-score.c: + * clutter/clutter-script.c: + * clutter/clutter-stage.c: + * clutter/clutter-texture.c: + * clutter/clutter-timeline.c: + * clutter/clutter-timeout-pool.c: + * clutter/clutter-vbox.c: + * clutter/cogl/gl/cogl.c: + * clutter/cogl/gles/cogl.c: + * clutter/eglnative/clutter-backend-egl.c: + * clutter/eglnative/clutter-event-egl.c: + * clutter/eglnative/clutter-stage-egl.c: + * clutter/eglx/clutter-backend-egl.c: + * clutter/eglx/clutter-event-egl.c: + * clutter/eglx/clutter-stage-egl.c: + * clutter/glx/clutter-event-glx.c: + * clutter/json/json-array.c: + * clutter/json/json-generator.c: + * clutter/json/json-node.c: + * clutter/json/json-object.c: + * clutter/json/json-parser.c: + * clutter/sdl/clutter-backend-sdl.c: + * clutter/sdl/clutter-event-sdl.c: + * clutter/sdl/clutter-stage-sdl.c: + + Fixedup config.h inclusion (must always be bracketed with #ifdef + HAVE_CONFIG_H). + 2007-10-11 Tomas Frydrych * clutter/clutter-entry.c: diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index da128f61a..27313de83 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -25,8 +25,8 @@ /** * SECTION:clutter-actor - * @short_description: Base abstract class for all visual stage actors. - * + * @short_description: Base abstract class for all visual stage actors. + * * #ClutterActor is a base abstract class for all visual elements on the * stage. Every object that must appear on the main #ClutterStage must also * be a #ClutterActor, either by using one of the classes provided by @@ -52,7 +52,9 @@ * */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-actor.h" #include "clutter-container.h" @@ -78,7 +80,7 @@ struct _ClutterActorPrivate { ClutterActorBox coords; - ClutterGeometry clip; /* FIXME: Should be Units */ + ClutterGeometry clip; /* FIXME: Should be Units */ guint has_clip : 1; ClutterFixed rxang, ryang, rzang; /* Rotation*/ gint rzx, rzy, rxy, rxz, ryx, ryz; /* FIXME: Should be Units */ @@ -130,7 +132,7 @@ enum static guint actor_signals[LAST_SIGNAL] = { 0, }; -static +static void _clutter_actor_apply_modelview_transform (ClutterActor * self); static @@ -171,7 +173,7 @@ clutter_actor_real_show (ClutterActor *self) * clutter_actor_show * @self: A #ClutterActor * - * Flags a clutter actor to be displayed. An actor not shown will not + * Flags a clutter actor to be displayed. An actor not shown will not * appear on the display. **/ void @@ -180,7 +182,7 @@ clutter_actor_show (ClutterActor *self) if (!CLUTTER_ACTOR_IS_VISIBLE (self)) { g_object_ref (self); - + g_signal_emit (self, actor_signals[SHOW], 0); g_object_notify (G_OBJECT (self), "visible"); @@ -192,7 +194,7 @@ clutter_actor_show (ClutterActor *self) * clutter_actor_show_all: * @self: a #ClutterActor * - * Call show() on all children of a actor (if any). + * Call show() on all children of a actor (if any). * * Since: 0.2 */ @@ -222,7 +224,7 @@ clutter_actor_real_hide (ClutterActor *self) * clutter_actor_hide * @self: A #ClutterActor * - * Flags a clutter actor to be hidden. An actor not shown will not + * Flags a clutter actor to be hidden. An actor not shown will not * appear on the display. **/ void @@ -239,7 +241,7 @@ clutter_actor_hide (ClutterActor *self) g_object_notify (G_OBJECT (self), "visible"); g_object_unref (self); - } + } } /** @@ -267,7 +269,7 @@ clutter_actor_hide_all (ClutterActor *self) * @self: A #ClutterActor * * Creates any underlying graphics resources needed by the actor to be - * displayed. + * displayed. **/ void clutter_actor_realize (ClutterActor *self) @@ -290,7 +292,7 @@ clutter_actor_realize (ClutterActor *self) * @self: A #ClutterActor * * Frees up any underlying graphics resources needed by the actor to be - * displayed. + * displayed. **/ void clutter_actor_unrealize (ClutterActor *self) @@ -315,10 +317,10 @@ clutter_actor_unrealize (ClutterActor *self) * * Renders a silhouette of the actor in supplied color. * - * This function should not never be called directly by applications. + * This function should not never be called directly by applications. **/ -void -clutter_actor_pick (ClutterActor *self, +void +clutter_actor_pick (ClutterActor *self, const ClutterColor *color) { ClutterActorClass *klass; @@ -327,7 +329,7 @@ clutter_actor_pick (ClutterActor *self, if (G_UNLIKELY(klass->pick)) { - /* Its pretty unlikely anything other than a container actor + /* Its pretty unlikely anything other than a container actor * would need to supply its own pick method. */ (klass->pick) (self, color); @@ -335,9 +337,9 @@ clutter_actor_pick (ClutterActor *self, else { cogl_color (color); - cogl_rectangle (0, - 0, - clutter_actor_get_width(self), + cogl_rectangle (0, + 0, + clutter_actor_get_width(self), clutter_actor_get_height(self)); } } @@ -384,7 +386,7 @@ mtx_transform (ClutterFixed m[16], * to transform the supplied point */ static void -clutter_actor_transform_point (ClutterActor *actor, +clutter_actor_transform_point (ClutterActor *actor, ClutterUnit *x, ClutterUnit *y, ClutterUnit *z, @@ -392,7 +394,7 @@ clutter_actor_transform_point (ClutterActor *actor, { ClutterFixed mtx[16]; ClutterActorPrivate *priv; - + g_return_if_fail (CLUTTER_IS_ACTOR (actor)); priv = actor->priv; @@ -401,7 +403,7 @@ clutter_actor_transform_point (ClutterActor *actor, _clutter_actor_apply_modelview_transform_recursive (actor); cogl_get_modelview_matrix (mtx); - + mtx_transform (mtx, x, y, z, w); cogl_pop_matrix(); @@ -427,7 +429,7 @@ clutter_actor_transform_point (ClutterActor *actor, * @vertex: The translated #ClutterVertex * * Transforms point in coordinates relative to the actor - * into screen coordiances with the current actor tranform + * into screen coordiances with the current actor tranform * (i.e. scale, rotation etc) * * Since: 0.4 @@ -440,7 +442,7 @@ clutter_actor_apply_transform_to_point (ClutterActor *self, ClutterFixed mtx_p[16]; ClutterFixed v[4]; ClutterFixed w = CFX_ONE; - + g_return_if_fail (CLUTTER_IS_ACTOR (self)); /* First we tranform the point using the OpenGL modelview matrix */ @@ -470,7 +472,7 @@ clutter_actor_transform_vertices (ClutterActor * self, ClutterFixed mtx[16]; ClutterFixed _x, _y, _z, _w; ClutterActorPrivate *priv; - + g_return_if_fail (CLUTTER_IS_ACTOR (self)); priv = self->priv; @@ -484,7 +486,7 @@ clutter_actor_transform_vertices (ClutterActor * self, _y = 0; _z = 0; _w = CFX_ONE; - + mtx_transform (mtx, &_x, &_y, &_z, &_w); verts[0].x = _x; @@ -496,9 +498,9 @@ clutter_actor_transform_vertices (ClutterActor * self, _y = 0; _z = 0; _w = CFX_ONE; - + mtx_transform (mtx, &_x, &_y, &_z, &_w); - + verts[1].x = _x; verts[1].y = _y; verts[1].z = _z; @@ -508,21 +510,21 @@ clutter_actor_transform_vertices (ClutterActor * self, _y = priv->coords.y2 - priv->coords.y1; _z = 0; _w = CFX_ONE; - + mtx_transform (mtx, &_x, &_y, &_z, &_w); - + verts[2].x = _x; verts[2].y = _y; verts[2].z = _z; w[2] = _w; - + _x = priv->coords.x2 - priv->coords.x1; _y = priv->coords.y2 - priv->coords.y1; _z = 0; _w = CFX_ONE; - + mtx_transform (mtx, &_x, &_y, &_z, &_w); - + verts[3].x = _x; verts[3].y = _y; verts[3].z = _z; @@ -536,7 +538,7 @@ clutter_actor_transform_vertices (ClutterActor * self, * @self: A #ClutterActor * @verts: Pointer to a location of an array of 4 #ClutterVertex where to * store the result. - * + * * Calculates the tranformed screen coordinaces of the four corners of * the actor; the returned vertices relate to the ClutterActoBox * coordinances as follows: @@ -556,7 +558,7 @@ clutter_actor_get_vertices (ClutterActor *self, ClutterFixed v[4]; ClutterFixed w[4]; ClutterActorPrivate *priv; - + g_return_if_fail (CLUTTER_IS_ACTOR (self)); priv = self->priv; @@ -565,7 +567,7 @@ clutter_actor_get_vertices (ClutterActor *self, cogl_get_projection_matrix (mtx_p); cogl_get_viewport (v); - + mtx_transform (mtx_p, &verts[0].x, &verts[0].y, @@ -575,7 +577,7 @@ clutter_actor_get_vertices (ClutterActor *self, verts[0].x = MTX_GL_SCALE_X (verts[0].x, w[0], v[2], v[0]); verts[0].y = MTX_GL_SCALE_Y (verts[0].y, w[0], v[3], v[1]); verts[0].z = MTX_GL_SCALE_Z (verts[0].z, w[0], v[2], v[0]); - + mtx_transform (mtx_p, &verts[1].x, &verts[1].y, @@ -595,7 +597,7 @@ clutter_actor_get_vertices (ClutterActor *self, verts[2].x = MTX_GL_SCALE_X (verts[2].x, w[2], v[2], v[0]); verts[2].y = MTX_GL_SCALE_Y (verts[2].y, w[2], v[3], v[1]); verts[2].z = MTX_GL_SCALE_Z (verts[2].z, w[2], v[2], v[0]); - + mtx_transform (mtx_p, &verts[3].x, &verts[3].y, @@ -620,8 +622,8 @@ _clutter_actor_apply_modelview_transform (ClutterActor * self) if (clutter_actor_get_parent (self) != NULL) { - cogl_translate (CLUTTER_UNITS_TO_INT (priv->coords.x1), - CLUTTER_UNITS_TO_INT (priv->coords.y1), + cogl_translate (CLUTTER_UNITS_TO_INT (priv->coords.x1), + CLUTTER_UNITS_TO_INT (priv->coords.y1), 0); } @@ -636,7 +638,7 @@ _clutter_actor_apply_modelview_transform (ClutterActor * self) { cogl_scale (priv->scale_x, priv->scale_y); } - + if (priv->rzang) { cogl_translate (priv->rzx, priv->rzy, 0); @@ -675,9 +677,9 @@ static void _clutter_actor_apply_modelview_transform_recursive (ClutterActor * self) { ClutterActor * parent; - + parent = clutter_actor_get_parent (self); - + if (parent) _clutter_actor_apply_modelview_transform_recursive (parent); @@ -690,8 +692,8 @@ _clutter_actor_apply_modelview_transform_recursive (ClutterActor * self) * * Renders the actor to display. * - * This function should not be called directly by applications instead - * #clutter_actor_queue_redraw should be used to queue paints. + * This function should not be called directly by applications instead + * #clutter_actor_queue_redraw should be used to queue paints. **/ void clutter_actor_paint (ClutterActor *self) @@ -720,7 +722,7 @@ clutter_actor_paint (ClutterActor *self) cogl_push_matrix(); _clutter_actor_apply_modelview_transform (self); - + if (G_UNLIKELY(context->pick_mode != CLUTTER_PICK_NONE)) { gint r, g, b; @@ -732,7 +734,7 @@ clutter_actor_paint (ClutterActor *self) && CLUTTER_ACTOR_IS_REACTIVE(self))) { id = clutter_actor_get_id (self); - + cogl_get_bitmasks (&r, &g, &b, NULL); /* Encode the actor id into a color, taking into account bpp */ @@ -770,7 +772,7 @@ clutter_actor_paint (ClutterActor *self) * Requests new untransformed co-ordinates for the #ClutterActor * ralative to any parent. * - * This function should not be called directly by applications instead + * This function should not be called directly by applications instead * the various position/geometry methods should be used. **/ void @@ -779,15 +781,15 @@ clutter_actor_request_coords (ClutterActor *self, { ClutterActorClass *klass; gboolean x_change, y_change, width_change, height_change; - + klass = CLUTTER_ACTOR_GET_CLASS (self); if (klass->request_coords) klass->request_coords (self, box); - + 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) != + 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)); @@ -795,25 +797,25 @@ clutter_actor_request_coords (ClutterActor *self, if (x_change || y_change || width_change || height_change) { self->priv->coords.x1 = box->x1; - self->priv->coords.y1 = box->y1; - self->priv->coords.x2 = box->x2; - self->priv->coords.y2 = box->y2; - + self->priv->coords.y1 = box->y1; + self->priv->coords.x2 = box->x2; + self->priv->coords.y2 = box->y2; + if (CLUTTER_ACTOR_IS_VISIBLE (self)) clutter_actor_queue_redraw (self); - + g_object_ref (self); g_object_freeze_notify (G_OBJECT (self)); - + if (x_change) g_object_notify (G_OBJECT (self), "x"); - + if (y_change) g_object_notify (G_OBJECT (self), "y"); - + if (width_change) g_object_notify (G_OBJECT (self), "width"); - + if (height_change) g_object_notify (G_OBJECT (self), "height"); @@ -830,7 +832,7 @@ clutter_actor_request_coords (ClutterActor *self, * Requests the untransformed co-ordinates (in ClutterUnits) for the * #ClutterActor relative to any parent. * - * This function should not be called directly by applications instead + * This function should not be called directly by applications instead * the various position/geometry methods should be used. **/ void @@ -848,7 +850,7 @@ clutter_actor_query_coords (ClutterActor *self, if (klass->query_coords) { - /* FIXME: This is kind of a cludge - we pass out *private* + /* 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. @@ -856,16 +858,16 @@ clutter_actor_query_coords (ClutterActor *self, klass->query_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; + self->priv->coords.y1 = box->y1; + self->priv->coords.x2 = box->x2; + self->priv->coords.y2 = box->y2; } } -static void -clutter_actor_set_property (GObject *object, +static void +clutter_actor_set_property (GObject *object, guint prop_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { @@ -875,25 +877,25 @@ clutter_actor_set_property (GObject *object, actor = CLUTTER_ACTOR(object); priv = actor->priv; - switch (prop_id) + switch (prop_id) { case PROP_X: - clutter_actor_set_position (actor, - g_value_get_int (value), + clutter_actor_set_position (actor, + g_value_get_int (value), clutter_actor_get_y (actor)); break; case PROP_Y: - clutter_actor_set_position (actor, + clutter_actor_set_position (actor, clutter_actor_get_x (actor), g_value_get_int (value)); break; case PROP_WIDTH: - clutter_actor_set_size (actor, + clutter_actor_set_size (actor, g_value_get_int (value), clutter_actor_get_height (actor)); break; case PROP_HEIGHT: - clutter_actor_set_size (actor, + clutter_actor_set_size (actor, clutter_actor_get_width (actor), g_value_get_int (value)); break; @@ -910,13 +912,13 @@ clutter_actor_set_property (GObject *object, clutter_actor_hide (actor); break; case PROP_SCALE_X: - clutter_actor_set_scalex + clutter_actor_set_scalex (actor, CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value)), priv->scale_y); break; case PROP_SCALE_Y: - clutter_actor_set_scalex + clutter_actor_set_scalex (actor, priv->scale_x, CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value))); @@ -924,7 +926,7 @@ clutter_actor_set_property (GObject *object, case PROP_CLIP: { ClutterGeometry *geom = g_value_get_boxed (value); - + clutter_actor_set_clip (actor, geom->x, geom->y, geom->width, geom->height); @@ -936,10 +938,10 @@ clutter_actor_set_property (GObject *object, } } -static void -clutter_actor_get_property (GObject *object, +static void +clutter_actor_get_property (GObject *object, guint prop_id, - GValue *value, + GValue *value, GParamSpec *pspec) { ClutterActor *actor; @@ -948,7 +950,7 @@ clutter_actor_get_property (GObject *object, actor = CLUTTER_ACTOR(object); priv = actor->priv; - switch (prop_id) + switch (prop_id) { case PROP_X: g_value_set_int (value, clutter_actor_get_x (actor)); @@ -990,7 +992,7 @@ clutter_actor_get_property (GObject *object, } } -static void +static void clutter_actor_dispose (GObject *object) { ClutterActor *self = CLUTTER_ACTOR (object); @@ -998,7 +1000,7 @@ clutter_actor_dispose (GObject *object) CLUTTER_NOTE (MISC, "Disposing of object (id=%d) of type `%s'", self->priv->id, g_type_name (G_OBJECT_TYPE (self))); - + if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION)) { CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_DESTRUCTION); @@ -1007,17 +1009,17 @@ clutter_actor_dispose (GObject *object) CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_DESTRUCTION); } - + G_OBJECT_CLASS (clutter_actor_parent_class)->dispose (object); } -static void +static void clutter_actor_finalize (GObject *object) { ClutterActor *actor = CLUTTER_ACTOR (object); g_free (actor->priv->name); - + G_OBJECT_CLASS (clutter_actor_parent_class)->finalize (object); } @@ -1156,7 +1158,7 @@ clutter_actor_class_init (ClutterActorClass *klass) * * Since: 0.6 */ - g_object_class_install_property + g_object_class_install_property (object_class, PROP_SCALE_X, g_param_spec_double ("scale-x", @@ -1174,7 +1176,7 @@ clutter_actor_class_init (ClutterActorClass *klass) * * Since: 0.6 */ - g_object_class_install_property + g_object_class_install_property (object_class, PROP_SCALE_Y, g_param_spec_double ("scale-y", @@ -1185,7 +1187,7 @@ clutter_actor_class_init (ClutterActorClass *klass) 1.0, CLUTTER_PARAM_READWRITE)); - + /** * ClutterActor::destroy: * @actor: the object which received the signal @@ -1209,7 +1211,7 @@ clutter_actor_class_init (ClutterActorClass *klass) * @actor: the object which received the signal * * The ::show signal is emitted when an actor becomes visible. - * + * * Since: 0.2 */ actor_signals[SHOW] = @@ -1448,7 +1450,7 @@ clutter_actor_class_init (ClutterActorClass *klass) * ClutterActor::enter-event: * @actor: the actor which the pointer has entered. * - * The ::enter-event signal is emitted when the pointer enters the @actor + * The ::enter-event signal is emitted when the pointer enters the @actor * * Since: 0.6 */ @@ -1511,7 +1513,7 @@ clutter_actor_init (ClutterActor *self) ClutterActorPrivate *priv; ClutterActorBox box = { 0, }; - self->priv = priv = CLUTTER_ACTOR_GET_PRIVATE (self); + self->priv = priv = CLUTTER_ACTOR_GET_PRIVATE (self); priv->parent_actor = NULL; priv->has_clip = FALSE; @@ -1546,12 +1548,12 @@ clutter_actor_destroy (ClutterActor *self) * clutter_actor_queue_redraw: * @self: A #ClutterActor * - * Queues up a redraw of an actor and any children. The redraw occurs - * once the main loop becomes idle (after the current batch of events + * Queues up a redraw of an actor and any children. The redraw occurs + * once the main loop becomes idle (after the current batch of events * has been processed, roughly). * * Applications rarely need to call this as redraws are handled automatically - * by modification functions. + * by modification functions. */ void clutter_actor_queue_redraw (ClutterActor *self) @@ -1564,7 +1566,7 @@ clutter_actor_queue_redraw (ClutterActor *self) ctx->update_idle = clutter_threads_add_idle_full (G_PRIORITY_DEFAULT + 10, - redraw_update_idle, + redraw_update_idle, NULL, NULL); } } @@ -1587,7 +1589,7 @@ clutter_actor_set_geometry (ClutterActor *self, 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); } @@ -1606,7 +1608,7 @@ clutter_actor_get_geometry (ClutterActor *self, ClutterActorBox box; g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + clutter_actor_query_coords (self, &box); geometry->x = CLUTTER_UNITS_TO_INT (box.x1); @@ -1623,8 +1625,8 @@ clutter_actor_get_geometry (ClutterActor *self, * @x_2: A location to store actors right position, or %NULL. * @y_2: A location to store actors bottom position, or %NULL. * - * Gets the actors untransformed bounding rectangle co-ordinates in pixels - * relative to any parent actor. + * Gets the actors untransformed bounding rectangle co-ordinates in pixels + * relative to any parent actor. */ void clutter_actor_get_coords (ClutterActor *self, @@ -1636,18 +1638,18 @@ clutter_actor_get_coords (ClutterActor *self, ClutterActorBox box; g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + clutter_actor_query_coords (self, &box); if (x_1) *x_1 = CLUTTER_UNITS_TO_INT (box.x1); - + if (y_1) *y_1 = CLUTTER_UNITS_TO_INT (box.y1); - + if (x_2) *x_2 = CLUTTER_UNITS_TO_INT (box.x2); - + if (y_2) *y_2 = CLUTTER_UNITS_TO_INT (box.y2); } @@ -1659,7 +1661,7 @@ clutter_actor_get_coords (ClutterActor *self, * @y: New top position of actor in pixels. * * Sets the actors position in pixels relative to any - * parent actor. + * parent actor. */ void clutter_actor_set_position (ClutterActor *self, @@ -1687,7 +1689,7 @@ clutter_actor_set_position (ClutterActor *self, * @dx: Distance to move Actor on X axis. * @dy: Distance to move Actor on Y axis. * - * Moves an actor by specified distance relative to + * Moves an actor by specified distance relative to * current position in pixels. * * Since: 0.2 @@ -1700,7 +1702,7 @@ clutter_actor_move_by (ClutterActor *self, 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_query_coords (self, &box); @@ -1716,7 +1718,7 @@ clutter_actor_move_by (ClutterActor *self, /** * clutter_actor_set_size * @self: A #ClutterActor - * @width: New width of actor in pixels + * @width: New width of actor in pixels * @height: New height of actor in pixels * * Sets the actors size in pixels. @@ -1786,7 +1788,7 @@ clutter_actor_get_abs_position_units (ClutterActor *self, ClutterVertex v2; g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + v1.x = v1.y = v1.z = 0; clutter_actor_apply_transform_to_point (self, &v1, &v2); @@ -1852,7 +1854,7 @@ clutter_actor_get_abs_size_units (ClutterActor *self, ClutterVertex v[4]; ClutterFixed x_min, x_max, y_min, y_max; gint i; - + clutter_actor_get_vertices (self, v); x_min = x_max = v[0].x; @@ -1862,13 +1864,13 @@ clutter_actor_get_abs_size_units (ClutterActor *self, { if (v[i].x < x_min) x_min = v[i].x; - + if (v[i].x > x_max) x_max = v[i].x; - + if (v[i].y < y_min) y_min = v[i].y; - + if (v[i].y > y_max) y_max = v[i].y; } @@ -1893,7 +1895,7 @@ clutter_actor_get_abs_size (ClutterActor *self, { gint32 wu, hu; clutter_actor_get_abs_size_units (self, &wu, &hu); - + *width = CLUTTER_UNITS_TO_INT (wu); *height = CLUTTER_UNITS_TO_INT (hu); } @@ -1913,7 +1915,7 @@ clutter_actor_get_width (ClutterActor *self) ClutterActorBox box; g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); - + clutter_actor_query_coords (self, &box); return CLUTTER_UNITS_TO_INT (box.x2 - box.x1); @@ -1924,7 +1926,7 @@ clutter_actor_get_width (ClutterActor *self) * @self: A #ClutterActor * * Retrieves the actors height ignoring any scaling factors. - * + * * Return value: The actor height in pixels **/ guint @@ -1933,7 +1935,7 @@ clutter_actor_get_height (ClutterActor *self) ClutterActorBox box; g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); - + clutter_actor_query_coords (self, &box); return CLUTTER_UNITS_TO_INT (box.y2 - box.y1); @@ -1943,7 +1945,7 @@ clutter_actor_get_height (ClutterActor *self) * clutter_actor_set_width * @self: A #ClutterActor * @width: Requested new width for actor - * + * * Requests a new width for actor * * since: 2.0 @@ -1951,7 +1953,7 @@ clutter_actor_get_height (ClutterActor *self) void clutter_actor_set_width (ClutterActor *self, guint width) { - clutter_actor_set_size (self, + clutter_actor_set_size (self, width, clutter_actor_get_height (self)); } @@ -1960,7 +1962,7 @@ clutter_actor_set_width (ClutterActor *self, guint width) * clutter_actor_set_height * @self: A #ClutterActor * @height: Requested new height for actor - * + * * Requests a new height for actor * * since: 2.0 @@ -1968,7 +1970,7 @@ clutter_actor_set_width (ClutterActor *self, guint width) void clutter_actor_set_height (ClutterActor *self, guint height) { - clutter_actor_set_size (self, + clutter_actor_set_size (self, clutter_actor_get_width (self), height); } @@ -1987,7 +1989,7 @@ gint clutter_actor_get_x (ClutterActor *self) { ClutterActorBox box; - + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); clutter_actor_query_coords (self, &box); @@ -2036,7 +2038,7 @@ clutter_actor_set_scalex (ClutterActor *self, self->priv->scale_x = scale_x; g_object_notify (G_OBJECT (self), "scale-x"); - + self->priv->scale_y = scale_y; g_object_notify (G_OBJECT (self), "scale-y"); @@ -2173,10 +2175,10 @@ clutter_actor_set_scale_with_gravityx (ClutterActor *self, sw = CFX_QMUL (box.x2 - box.x1, scale_x); sh = CFX_QMUL (box.y2 - box.y1, scale_y); - + x = box.x1; y = box.y1; - + switch (gravity) { case CLUTTER_GRAVITY_NORTH: @@ -2230,7 +2232,7 @@ clutter_actor_set_opacity (ClutterActor *self, guint8 opacity) { g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + self->priv->opacity = opacity; if (CLUTTER_ACTOR_IS_VISIBLE (self)) @@ -2249,11 +2251,11 @@ guint8 clutter_actor_get_opacity (ClutterActor *self) { ClutterActor *parent; - + g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); parent = self->priv->parent_actor; - + /* Factor in the actual actors opacity with parents */ if (parent && clutter_actor_get_opacity (parent) != 0xff) return (clutter_actor_get_opacity(parent) * self->priv->opacity) / 0xff; @@ -2273,11 +2275,11 @@ clutter_actor_set_name (ClutterActor *self, const gchar *name) { g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + g_object_ref (self); g_free (self->priv->name); - + if (name && name[0] != '\0') self->priv->name = g_strdup(name); @@ -2299,7 +2301,7 @@ G_CONST_RETURN gchar * clutter_actor_get_name (ClutterActor *self) { g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL); - + return self->priv->name; } @@ -2308,14 +2310,14 @@ clutter_actor_get_name (ClutterActor *self) * @self: A #ClutterActor * * Retrieves the unique id for @self. - * + * * Return value: Globally unique value for object instance. */ guint32 clutter_actor_get_id (ClutterActor *self) { g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0); - + return self->priv->id; } @@ -2325,7 +2327,7 @@ clutter_actor_get_id (ClutterActor *self) * @depth: Z co-ord * * Sets the Z co-ordinate of @self to @depth. The Units of which are dependant - * on the perspective setup. + * on the perspective setup. */ void clutter_actor_set_depth (ClutterActor *self, @@ -2343,10 +2345,10 @@ clutter_actor_set_depth (ClutterActor *self, if (priv->parent_actor && CLUTTER_IS_CONTAINER (priv->parent_actor)) { /* We need to resort the container stacking order as to - * correctly render alpha values. + * correctly render alpha values. * - * FIXME: This is sub optimal. maybe queue the the sort - * before stacking + * FIXME: This is sub optimal. maybe queue the the sort + * before stacking */ clutter_container_sort_depth_order (CLUTTER_CONTAINER (priv->parent_actor)); } @@ -2367,7 +2369,7 @@ gint clutter_actor_get_depth (ClutterActor *self) { g_return_val_if_fail (CLUTTER_IS_ACTOR (self), -1); - + return self->priv->z; } @@ -2412,7 +2414,7 @@ clutter_actor_rotate_x (ClutterActor *self, gint z) { g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + self->priv->rxang = CLUTTER_FLOAT_TO_FIXED(angle); self->priv->rxy = y; self->priv->rxz = z; @@ -2488,7 +2490,7 @@ clutter_actor_rotate_xx (ClutterActor *self, gint z) { g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + self->priv->rxang = angle; self->priv->rxy = y; self->priv->rxz = z; @@ -2641,17 +2643,17 @@ clutter_actor_get_rzang (ClutterActor *self) */ void clutter_actor_set_clip (ClutterActor *self, - gint xoff, - gint yoff, - gint width, + gint xoff, + gint yoff, + gint width, gint height) { ClutterGeometry *clip; - + g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + clip = &(self->priv->clip); - + clip->x = xoff; clip->y = yoff; clip->width = width; @@ -2661,7 +2663,7 @@ clutter_actor_set_clip (ClutterActor *self, g_object_notify (G_OBJECT (self), "has-clip"); g_object_notify (G_OBJECT (self), "clip"); -} +} /** * clutter_actor_remove_clip @@ -2673,18 +2675,18 @@ void clutter_actor_remove_clip (ClutterActor *self) { g_return_if_fail (CLUTTER_IS_ACTOR (self)); - + self->priv->has_clip = FALSE; - + g_object_notify (G_OBJECT (self), "has-clip"); -} +} /** * clutter_actor_has_clip: * @self: a #ClutterActor * * Gets whether the actor has a clip set or not. - * + * * Return value: %TRUE if the actor has a clip set. * * Since: 0.1.1 @@ -2704,7 +2706,7 @@ clutter_actor_has_clip (ClutterActor *self) * * Sets the parent of @self to @parent. The opposite function is * clutter_actor_unparent(). - * + * * This function should not be used by applications but by custom * 'composite' actor sub classes. */ @@ -2736,7 +2738,7 @@ clutter_actor_set_parent (ClutterActor *self, return; } - g_hash_table_insert (clutter_context->actor_hash, + g_hash_table_insert (clutter_context->actor_hash, (gpointer)clutter_actor_get_id(self), (gpointer)self); @@ -2766,7 +2768,7 @@ ClutterActor * clutter_actor_get_parent (ClutterActor *self) { g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL); - + return self->priv->parent_actor; } @@ -2807,7 +2809,7 @@ clutter_actor_unparent (ClutterActor *self) self->priv->parent_actor = NULL; g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent); - g_hash_table_remove (clutter_context->actor_hash, + g_hash_table_remove (clutter_context->actor_hash, GUINT_TO_POINTER (clutter_actor_get_id(self))); g_object_unref (self); @@ -2833,7 +2835,7 @@ clutter_actor_reparent (ClutterActor *self, g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (new_parent)); g_return_if_fail (self != new_parent); - + if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) { g_warning ("Cannot set a parent on a toplevel actor\n"); @@ -2861,7 +2863,7 @@ clutter_actor_reparent (ClutterActor *self, g_object_ref (self); /* FIXME: below assumes only containers can reparent */ - clutter_container_remove_actor (CLUTTER_CONTAINER (priv->parent_actor), + clutter_container_remove_actor (CLUTTER_CONTAINER (priv->parent_actor), self); clutter_container_add_actor (CLUTTER_CONTAINER (new_parent), self); @@ -2977,7 +2979,7 @@ clutter_actor_lower_bottom (ClutterActor *self) clutter_actor_lower (self, NULL); } -/* +/* * Event handling */ @@ -3012,12 +3014,12 @@ clutter_actor_event (ClutterActor *actor, if (capture) { - g_signal_emit (actor, actor_signals[EVENT_CAPTURED], 0, + g_signal_emit (actor, actor_signals[EVENT_CAPTURED], 0, event, &retval); goto out; } - + g_signal_emit (actor, actor_signals[EVENT], 0, event, &retval); if (!retval) @@ -3059,7 +3061,7 @@ clutter_actor_event (ClutterActor *actor, } if (signal_num != -1) - g_signal_emit (actor, actor_signals[signal_num], 0, + g_signal_emit (actor, actor_signals[signal_num], 0, event, &retval); } @@ -3097,7 +3099,7 @@ void clutter_actor_unset_reactive (ClutterActor *actor) { g_return_if_fail (CLUTTER_IS_ACTOR (actor)); - + CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE); } @@ -3115,7 +3117,7 @@ gboolean clutter_actor_is_reactive (ClutterActor *actor) { g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE); - + return CLUTTER_ACTOR_IS_REACTIVE (actor); } @@ -3139,7 +3141,7 @@ clutter_geometry_get_type (void) static GType our_type = 0; if (our_type == 0) - our_type = g_boxed_type_register_static + our_type = g_boxed_type_register_static (g_intern_static_string ("ClutterGeometry"), (GBoxedCopyFunc) clutter_geometry_copy, (GBoxedFreeFunc) g_free); @@ -3167,7 +3169,7 @@ clutter_vertex_get_type (void) static GType our_type = 0; if (our_type == 0) - our_type = g_boxed_type_register_static + our_type = g_boxed_type_register_static (g_intern_static_string ("ClutterVertex"), (GBoxedCopyFunc) clutter_vertex_copy, (GBoxedFreeFunc) g_free); @@ -3194,7 +3196,7 @@ clutter_actor_box_get_type (void) static GType our_type = 0; if (our_type == 0) - our_type = g_boxed_type_register_static + our_type = g_boxed_type_register_static (g_intern_static_string ("ClutterActorBox"), (GBoxedCopyFunc) clutter_actor_box_copy, (GBoxedFreeFunc) g_free); diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c index 064e9fee4..0b83081bc 100644 --- a/clutter/clutter-backend.c +++ b/clutter/clutter-backend.c @@ -37,7 +37,7 @@ * #ClutterBackend is available since Clutter 0.4 */ -#ifndef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/clutter/clutter-behaviour-depth.c b/clutter/clutter-behaviour-depth.c index 1533fa892..e279bc8b4 100644 --- a/clutter/clutter-behaviour-depth.c +++ b/clutter/clutter-behaviour-depth.c @@ -25,7 +25,9 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-behaviour-depth.h" diff --git a/clutter/clutter-box.c b/clutter/clutter-box.c index 84acc0a1f..ddaa67db2 100644 --- a/clutter/clutter-box.c +++ b/clutter/clutter-box.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "cogl.h" diff --git a/clutter/clutter-clone-texture.c b/clutter/clutter-clone-texture.c index ebf0390db..423b2755b 100644 --- a/clutter/clutter-clone-texture.c +++ b/clutter/clutter-clone-texture.c @@ -31,7 +31,9 @@ * #ClutterCloneTexture allows the cloning of existing #ClutterTexture based * actors whilst saving underlying graphics resources. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-clone-texture.h" #include "clutter-main.h" diff --git a/clutter/clutter-container.c b/clutter/clutter-container.c index 17c167433..a56cad1f7 100644 --- a/clutter/clutter-container.c +++ b/clutter/clutter-container.c @@ -26,7 +26,9 @@ * Author: Emmanuele Bassi */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -70,7 +72,7 @@ clutter_container_base_init (gpointer g_iface) if (!initialised) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); - + initialised = TRUE; /** @@ -440,7 +442,7 @@ clutter_container_raise_child (ClutterContainer *container, g_type_name (G_OBJECT_TYPE (container))); return; } - + CLUTTER_CONTAINER_GET_IFACE (container)->raise (container, actor, sibling); } @@ -484,7 +486,7 @@ clutter_container_lower_child (ClutterContainer *container, g_type_name (G_OBJECT_TYPE (container))); return; } - + CLUTTER_CONTAINER_GET_IFACE (container)->raise (container, actor, sibling); } @@ -508,7 +510,7 @@ clutter_container_sort_depth_order (ClutterContainer *container) /** * clutter_container_find_child_by_name: * @container: a #ClutterContainer - * @child_name: the name of the requested child. + * @child_name: the name of the requested child. * * Finds a child actor of a container by its name. Search recurses * into any child container. diff --git a/clutter/clutter-entry.c b/clutter/clutter-entry.c index 7340daa8f..846bad831 100644 --- a/clutter/clutter-entry.c +++ b/clutter/clutter-entry.c @@ -38,7 +38,9 @@ * #ClutterEntry is available since Clutter 0.4. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-entry.h" @@ -82,7 +84,7 @@ enum TEXT_CHANGED, CURSOR_EVENT, ACTIVATE, - + LAST_SIGNAL }; @@ -95,14 +97,14 @@ struct _ClutterEntryPrivate { PangoContext *context; PangoFontDescription *desc; - + ClutterColor fgcol; - + gchar *text; gchar *font_name; gboolean text_visible; gunichar priv_char; - + gint extents_width; gint extents_height; @@ -122,7 +124,7 @@ struct _ClutterEntryPrivate PangoAttrList *effective_attrs; PangoLayout *layout; gint width_chars; - + ClutterGeometry cursor_pos; ClutterActor *cursor; gboolean show_cursor; @@ -146,9 +148,9 @@ clutter_entry_set_entry_padding (ClutterEntry *entry, } static void -clutter_entry_set_property (GObject *object, +clutter_entry_set_property (GObject *object, guint prop_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { ClutterEntry *entry; @@ -157,7 +159,7 @@ clutter_entry_set_property (GObject *object, entry = CLUTTER_ENTRY (object); priv = entry->priv; - switch (prop_id) + switch (prop_id) { case PROP_FONT_NAME: clutter_entry_set_font_name (entry, g_value_get_string (value)); @@ -193,9 +195,9 @@ clutter_entry_set_property (GObject *object, } static void -clutter_entry_get_property (GObject *object, +clutter_entry_get_property (GObject *object, guint prop_id, - GValue *value, + GValue *value, GParamSpec *pspec) { ClutterEntry *entry; @@ -205,7 +207,7 @@ clutter_entry_get_property (GObject *object, entry = CLUTTER_ENTRY(object); priv = entry->priv; - switch (prop_id) + switch (prop_id) { case PROP_FONT_NAME: g_value_set_string (value, priv->font_name); @@ -238,7 +240,7 @@ clutter_entry_get_property (GObject *object, default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; - } + } } static void @@ -254,14 +256,14 @@ clutter_entry_ensure_layout (ClutterEntry *entry, gint width) if (priv->effective_attrs) pango_layout_set_attributes (priv->layout, priv->effective_attrs); - + pango_layout_set_alignment (priv->layout, priv->alignment); pango_layout_set_ellipsize (priv->layout, priv->ellipsize); - pango_layout_set_single_paragraph_mode (priv->layout, + pango_layout_set_single_paragraph_mode (priv->layout, priv->single_line_mode); - + pango_layout_set_font_description (priv->layout, priv->desc); - + if (priv->text_visible) pango_layout_set_text (priv->layout, priv->text, -1); else @@ -273,7 +275,7 @@ clutter_entry_ensure_layout (ClutterEntry *entry, gint width) } if (priv->wrap) pango_layout_set_wrap (priv->layout, priv->wrap_mode); - + if (priv->wrap && width > 0) pango_layout_set_width (priv->layout, width * PANGO_SCALE); else @@ -327,20 +329,20 @@ clutter_entry_ensure_cursor_position (ClutterEntry *entry) ClutterEntryPrivate *priv; gint index_; PangoRectangle rect; - + priv = entry->priv; - + if (priv->position == -1) index_ = strlen (priv->text); else index_ = offset_to_bytes (priv->text, priv->position); - + pango_layout_get_cursor_pos (priv->layout, index_, &rect, NULL); priv->cursor_pos.x = rect.x / PANGO_SCALE; priv->cursor_pos.y = rect.y / PANGO_SCALE; priv->cursor_pos.width = ENTRY_CURSOR_WIDTH; priv->cursor_pos.height = rect.height / PANGO_SCALE; - + g_signal_emit (entry, entry_signals[CURSOR_EVENT], 0, &priv->cursor_pos); } @@ -356,19 +358,19 @@ clutter_entry_paint_cursor (ClutterEntry *entry) ClutterEntryPrivate *priv; priv = entry->priv; - + if (priv->show_cursor) { - clutter_actor_set_size (CLUTTER_ACTOR (priv->cursor), + clutter_actor_set_size (CLUTTER_ACTOR (priv->cursor), priv->cursor_pos.width, priv->cursor_pos.height); - + clutter_actor_set_position (priv->cursor, priv->cursor_pos.x, priv->cursor_pos.y); - + clutter_actor_paint (priv->cursor); - } + } } static void @@ -380,7 +382,7 @@ clutter_entry_paint (ClutterActor *self) gint actor_width; gint text_width; gint cursor_x; - + entry = CLUTTER_ENTRY(self); priv = entry->priv; @@ -392,29 +394,29 @@ clutter_entry_paint (ClutterActor *self) priv->text); return; } - + clutter_actor_set_clip (self, 0, 0, clutter_actor_get_width (self), clutter_actor_get_height (self)); - + actor_width = clutter_actor_get_width (self) - (2 * priv->entry_padding); clutter_entry_ensure_layout (entry, actor_width); clutter_entry_ensure_cursor_position (entry); pango_layout_get_extents (priv->layout, NULL, &logical); text_width = logical.width / PANGO_SCALE; - + if (actor_width < text_width) { /* We need to do some scrolling */ cursor_x = priv->cursor_pos.x; - + /* If the cursor is at the begining or the end of the text, the placement * is easy, however, if the cursor is in the middle somewhere, we need to - * make sure the text doesn't move until the cursor is either in the + * make sure the text doesn't move until the cursor is either in the * far left or far right */ - + if (priv->position == 0) priv->text_x = 0; else if (priv->position == -1) @@ -422,7 +424,7 @@ clutter_entry_paint (ClutterActor *self) priv->text_x = actor_width - text_width; priv->cursor_pos.x += priv->text_x + priv->entry_padding; } - else + else { if (priv->text_x < 0) { @@ -436,19 +438,19 @@ clutter_entry_paint (ClutterActor *self) priv->cursor_pos.x += priv->text_x + priv->entry_padding; } - - } + + } else { priv->text_x = 0; priv->cursor_pos.x += priv->entry_padding; } - + priv->fgcol.alpha = clutter_actor_get_opacity (self); - pango_clutter_render_layout (priv->layout, - priv->text_x + priv->entry_padding, + pango_clutter_render_layout (priv->layout, + priv->text_x + priv->entry_padding, 0, &priv->fgcol, 0); - + if (CLUTTER_ENTRY_GET_CLASS (entry)->paint_cursor) CLUTTER_ENTRY_GET_CLASS (entry)->paint_cursor (entry); } @@ -461,14 +463,14 @@ clutter_entry_request_coords (ClutterActor *self, clutter_entry_clear_layout (CLUTTER_ENTRY (self)); } -static void +static void clutter_entry_dispose (GObject *object) { ClutterEntry *self = CLUTTER_ENTRY(object); - ClutterEntryPrivate *priv; + ClutterEntryPrivate *priv; priv = self->priv; - + if (priv->layout) { g_object_unref (priv->layout); @@ -484,13 +486,13 @@ clutter_entry_dispose (GObject *object) G_OBJECT_CLASS (clutter_entry_parent_class)->dispose (object); } -static void +static void clutter_entry_finalize (GObject *object) { ClutterEntryPrivate *priv = CLUTTER_ENTRY (object)->priv; if (priv->desc) - pango_font_description_free (priv->desc); + pango_font_description_free (priv->desc); g_free (priv->text); g_free (priv->font_name); @@ -503,12 +505,12 @@ clutter_entry_class_init (ClutterEntryClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); - + klass->paint_cursor = clutter_entry_paint_cursor; actor_class->paint = clutter_entry_paint; actor_class->request_coords = clutter_entry_request_coords; - + gobject_class->finalize = clutter_entry_finalize; gobject_class->dispose = clutter_entry_dispose; gobject_class->set_property = clutter_entry_set_property; @@ -564,7 +566,7 @@ clutter_entry_class_init (ClutterEntryClass *klass) * * Since: 0.4 */ - g_object_class_install_property + g_object_class_install_property (gobject_class, PROP_ALIGNMENT, g_param_spec_enum ("alignment", "Alignment", @@ -578,8 +580,8 @@ clutter_entry_class_init (ClutterEntryClass *klass) * The current input cursor position. -1 is taken to be the end of the text * * Since: 0.4 - */ - g_object_class_install_property + */ + g_object_class_install_property (gobject_class, PROP_POSITION, g_param_spec_int ("position", "Position", @@ -594,15 +596,15 @@ clutter_entry_class_init (ClutterEntryClass *klass) * Whether the input cursor is visible or not. * * Since: 0.4 - */ - g_object_class_install_property + */ + g_object_class_install_property (gobject_class, PROP_CURSOR, g_param_spec_boolean ( "cursor-visible", "Cursor Visible", "Whether the input cursor is visible", TRUE, CLUTTER_PARAM_READWRITE)); - + /** * ClutterEntry:text-visible: * @@ -610,8 +612,8 @@ clutter_entry_class_init (ClutterEntryClass *klass) * character set by clutter_entry_set_invisible_char(). * * Since: 0.4 - */ - g_object_class_install_property + */ + g_object_class_install_property (gobject_class, PROP_TEXT_VISIBLE, g_param_spec_boolean ("text-visible", "Text Visible", @@ -625,8 +627,8 @@ clutter_entry_class_init (ClutterEntryClass *klass) * The maximum length of the entry text. * * Since: 0.4 - */ - g_object_class_install_property + */ + g_object_class_install_property (gobject_class, PROP_MAX_LENGTH, g_param_spec_int ("max-length", "Max Length", @@ -673,7 +675,7 @@ clutter_entry_class_init (ClutterEntryClass *klass) * * The ::cursor-event signal is emitted each time the input cursors geometry * changes, this could be a positional or size change. If you would like to - * implement your own input cursor, set the cursor-visible property to FALSE, + * implement your own input cursor, set the cursor-visible property to FALSE, * and connect to this signal to position and size your own cursor. * * Since: 0.4 @@ -687,14 +689,14 @@ clutter_entry_class_init (ClutterEntryClass *klass) clutter_marshal_VOID__BOXED, G_TYPE_NONE, 1, CLUTTER_TYPE_GEOMETRY | G_SIGNAL_TYPE_STATIC_SCOPE); - + /** * ClutterEntry::activate: * @entry: the actor which received the event * * The ::activate signal is emitted each time the netry is 'activated' * by the user, normally by pressing the 'Enter' key. This signal will - * only be emitted when your are adding text to the entry via + * only be emitted when your are adding text to the entry via * #clutter_entry_handle_key_event(). * * Since: 0.4 @@ -717,7 +719,7 @@ clutter_entry_init (ClutterEntry *self) ClutterEntryPrivate *priv; gdouble resolution; gint font_size; - + self->priv = priv = CLUTTER_ENTRY_GET_PRIVATE (self); resolution = clutter_backend_get_resolution (clutter_get_default_backend ()); @@ -799,7 +801,7 @@ clutter_entry_new_with_text (const gchar *font_name, * @text: the text to be displayed * @color: #ClutterColor for text * - * Creates a new #ClutterEntry displaying @text with color @color + * Creates a new #ClutterEntry displaying @text with color @color * using @font_name. * * Return value: the newly created #ClutterEntry @@ -829,7 +831,7 @@ clutter_entry_new_full (const gchar *font_name, ClutterActor * clutter_entry_new (void) { - ClutterActor *entry = g_object_new (CLUTTER_TYPE_ENTRY, + ClutterActor *entry = g_object_new (CLUTTER_TYPE_ENTRY, NULL); clutter_actor_set_size (entry, 50, 50); @@ -876,13 +878,13 @@ clutter_entry_set_text (ClutterEntry *entry, priv = entry->priv; g_object_ref (entry); - + if (priv->max_length > 0) { gint len = g_utf8_strlen (text, -1); if (len < priv->max_length) - { + { g_free (priv->text); priv->text = g_strdup (text); } @@ -892,7 +894,7 @@ clutter_entry_set_text (ClutterEntry *entry, g_utf8_strncpy (n, text, priv->max_length); g_free (priv->text); - + priv->text = n; } } @@ -902,14 +904,14 @@ clutter_entry_set_text (ClutterEntry *entry, priv->text = g_strdup (text); } - clutter_entry_clear_layout (entry); - clutter_entry_clear_cursor_position (entry); + clutter_entry_clear_layout (entry); + clutter_entry_clear_cursor_position (entry); if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR(entry))) clutter_actor_queue_redraw (CLUTTER_ACTOR(entry)); - g_signal_emit (G_OBJECT (entry), entry_signals[TEXT_CHANGED], 0); - + g_signal_emit (G_OBJECT (entry), entry_signals[TEXT_CHANGED], 0); + g_object_notify (G_OBJECT (entry), "text"); g_object_unref (entry); } @@ -931,7 +933,7 @@ G_CONST_RETURN gchar * clutter_entry_get_font_name (ClutterEntry *entry) { g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), NULL); - + return entry->priv->font_name; } @@ -956,7 +958,7 @@ clutter_entry_set_font_name (ClutterEntry *entry, PangoFontDescription *desc; g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - + if (!font_name || font_name[0] == '\0') font_name = DEFAULT_FONT_NAME; @@ -978,7 +980,7 @@ clutter_entry_set_font_name (ClutterEntry *entry, g_free (priv->font_name); priv->font_name = g_strdup (font_name); - + if (priv->desc) pango_font_description_free (priv->desc); @@ -986,12 +988,12 @@ clutter_entry_set_font_name (ClutterEntry *entry, if (entry->priv->text && entry->priv->text[0] != '\0') { - clutter_entry_clear_layout (entry); + clutter_entry_clear_layout (entry); if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (entry))) clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); } - + g_object_notify (G_OBJECT (entry), "font-name"); g_object_unref (entry); } @@ -1028,7 +1030,7 @@ clutter_entry_set_color (ClutterEntry *entry, actor = CLUTTER_ACTOR (entry); clutter_actor_set_opacity (actor, priv->fgcol.alpha); - + clutter_rectangle_set_color (CLUTTER_RECTANGLE (priv->cursor), &priv->fgcol); if (CLUTTER_ACTOR_IS_VISIBLE (actor)) @@ -1067,13 +1069,13 @@ clutter_entry_get_color (ClutterEntry *entry, /** * clutter_entry_get_layout: * @entry: a #ClutterEntry - * + * * Gets the #PangoLayout used to display the entry. * The layout is useful to e.g. convert text positions to * pixel positions. * The returned layout is owned by the entry so need not be * freed by the caller. - * + * * Return value: the #PangoLayout for this entry * * Since: 0.4 @@ -1136,7 +1138,7 @@ PangoAlignment clutter_entry_get_alignment (ClutterEntry *entry) { g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), FALSE); - + return entry->priv->alignment; } @@ -1147,7 +1149,7 @@ clutter_entry_get_alignment (ClutterEntry *entry) * * Sets the position of the cursor. The @position must be less than or * equal to the number of characters in the entry. A value of -1 indicates - * that the position should be set after the last character in the entry. + * that the position should be set after the last character in the entry. * Note that this position is in characters, not in bytes. * * Since: 0.4 @@ -1157,23 +1159,23 @@ clutter_entry_set_position (ClutterEntry *entry, gint position) { ClutterEntryPrivate *priv; gint len; - + g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - + priv = entry->priv; - + if (priv->text == NULL) return; - + len = g_utf8_strlen (priv->text, -1); - + if (position < 0 || position >= len) priv->position = -1; else priv->position = position; clutter_entry_clear_cursor_position (entry); - + if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (entry))) clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); } @@ -1196,7 +1198,7 @@ clutter_entry_get_position (ClutterEntry *entry) g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), 0); priv = entry->priv; - + return priv->position; } @@ -1205,7 +1207,7 @@ clutter_entry_get_position (ClutterEntry *entry) * @entry: a #ClutterEntry * @kev: a #ClutterKeyEvent * - * This function will handle a #ClutterKeyEvent, like those returned in a + * This function will handle a #ClutterKeyEvent, like those returned in a * key-press/release-event, and will translate it for the @entry. This includes * non-alphanumeric keys, such as the arrows keys, which will move the * input cursor. You should use this function inside a handler for the @@ -1224,19 +1226,19 @@ clutter_entry_handle_key_event (ClutterEntry *entry, g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - priv = entry->priv; - + priv = entry->priv; + pos = priv->position; if (priv->text) len = g_utf8_strlen (priv->text, -1); - + switch (keyval) { case CLUTTER_Return: case CLUTTER_KP_Enter: case CLUTTER_ISO_Enter: - g_signal_emit (entry, entry_signals[ACTIVATE], 0); + g_signal_emit (entry, entry_signals[ACTIVATE], 0); break; case CLUTTER_Escape: case CLUTTER_Up: @@ -1271,11 +1273,11 @@ clutter_entry_handle_key_event (ClutterEntry *entry, { if (pos != len) clutter_entry_set_position (entry, pos + 1); - } + } break; case CLUTTER_End: case CLUTTER_KP_End: - clutter_entry_set_position (entry, -1); + clutter_entry_set_position (entry, -1); break; case CLUTTER_Begin: case CLUTTER_Home: @@ -1296,7 +1298,7 @@ clutter_entry_handle_key_event (ClutterEntry *entry, * * Insert a character to the right of the current position of the cursor, * and updates the position of the cursor. - * + * * Since: 0.4 */ void @@ -1316,18 +1318,18 @@ clutter_entry_insert_unichar (ClutterEntry *entry, priv = entry->priv; g_object_ref (entry); - + new = g_string_new (priv->text); pos = offset_to_bytes (priv->text, priv->position); new = g_string_insert_unichar (new, pos, wc); - + clutter_entry_set_text (entry, new->str); - if (priv->position >= 0) - clutter_entry_set_position (entry, priv->position + 1); - + if (priv->position >= 0) + clutter_entry_set_position (entry, priv->position + 1); + g_string_free (new, TRUE); - + g_object_notify (G_OBJECT (entry), "text"); g_object_unref (entry); } @@ -1338,7 +1340,7 @@ clutter_entry_insert_unichar (ClutterEntry *entry, * @len: the number of characters to remove. * * Characters are removed from before the current postion of the cursor. - * + * * Since: 0.4 */ void @@ -1350,19 +1352,19 @@ clutter_entry_delete_chars (ClutterEntry *entry, gint len; gint pos; gint num_pos; - + g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - + priv = entry->priv; if (!priv->text) return; - + g_object_ref (entry); len = g_utf8_strlen (priv->text, -1); new = g_string_new (priv->text); - + if (priv->position == -1) { num_pos = offset_to_bytes (priv->text, len - num); @@ -1396,35 +1398,35 @@ clutter_entry_delete_chars (ClutterEntry *entry, * A value of 0 indicates that the text will be inserted before the first * character in the entrys text, and a value of -1 indicates that the text * will be inserted after the last character in the entrys text. - * + * * Since: 0.4 */ void -clutter_entry_insert_text (ClutterEntry *entry, +clutter_entry_insert_text (ClutterEntry *entry, const gchar *text, gssize position) { ClutterEntryPrivate *priv; GString *new = NULL; - + g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - + priv = entry->priv; new = g_string_new (priv->text); new = g_string_insert (new, position, text); - + clutter_entry_set_text (entry, new->str); - + g_string_free (new, TRUE); } /** * clutter_entry_delete_text: * @entry: a #ClutterEntry - * @start_pos: the starting position. - * @end_pos: the end position. - * + * @start_pos: the starting position. + * @end_pos: the end position. + * * Deletes a sequence of characters. The characters that are deleted are * those characters at positions from @start_pos up to, but not including, * @end_pos. If @end_pos is negative, then the characters deleted will be @@ -1443,7 +1445,7 @@ clutter_entry_delete_text (ClutterEntry *entry, gint end_bytes; g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - + priv = entry->priv; if (!priv->text) @@ -1451,12 +1453,12 @@ clutter_entry_delete_text (ClutterEntry *entry, start_bytes = offset_to_bytes (priv->text, start_pos); end_bytes = offset_to_bytes (priv->text, end_pos); - + new = g_string_new (priv->text); new = g_string_erase (new, start_bytes, end_bytes - start_bytes); - + clutter_entry_set_text (entry, new->str); - + g_string_free (new, TRUE); } @@ -1464,7 +1466,7 @@ clutter_entry_delete_text (ClutterEntry *entry, * clutter_entry_set_visible_cursor: * @entry: a #ClutterEntry * @visible: whether the input cursor should be visible - * + * * Sets the visibility of the input cursor. * * Since: 0.4 @@ -1474,11 +1476,11 @@ clutter_entry_set_visible_cursor (ClutterEntry *entry, gboolean visible) { ClutterEntryPrivate *priv; - + g_return_if_fail (CLUTTER_IS_ENTRY (entry)); priv = entry->priv; - + if (priv->show_cursor != visible) { priv->show_cursor = visible; @@ -1497,47 +1499,47 @@ clutter_entry_set_visible_cursor (ClutterEntry *entry, * Returns the input cursors visiblity * * Return value: whether the input cursor is visible - * + * * Since: 0.4 */ gboolean clutter_entry_get_visible_cursor (ClutterEntry *entry) { g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), FALSE); - + return entry->priv->show_cursor; } /** * clutter_entry_set_visibility: * @entry: a #ClutterEntry - * @visible: TRUE if the contents of the entry are displayed as plaintext. + * @visible: TRUE if the contents of the entry are displayed as plaintext. * - * Sets whether the contents of the entry are visible or not. When visibility - * is set to FALSE, characters are displayed as the invisible char, and will + * Sets whether the contents of the entry are visible or not. When visibility + * is set to FALSE, characters are displayed as the invisible char, and will * also appear that way when the text in the entry widget is copied elsewhere. - * - * The default invisible char is the asterisk '*', but it can be changed with - * #clutter_entry_set_invisible_char(). - * + * + * The default invisible char is the asterisk '*', but it can be changed with + * #clutter_entry_set_invisible_char(). + * * Since: 0.4 */ void clutter_entry_set_visibility (ClutterEntry *entry, gboolean visible) { ClutterEntryPrivate *priv; - + g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - + priv = entry->priv; - + priv->text_visible = visible; - + clutter_entry_clear_layout (entry); clutter_entry_clear_cursor_position (entry); - + if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (entry))) - clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); + clutter_actor_queue_redraw (CLUTTER_ACTOR (entry)); } /** @@ -1546,29 +1548,29 @@ clutter_entry_set_visibility (ClutterEntry *entry, gboolean visible) * * Returns the entry text visiblity * - * Return value: TRUE if the contents of the entry are displayed as plaintext. - * + * Return value: TRUE if the contents of the entry are displayed as plaintext. + * * Since: 0.4 */ gboolean clutter_entry_get_visibility (ClutterEntry *entry) { g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), TRUE); - + return entry->priv->text_visible; } /** * clutter_entry_set_invisible_char: * @entry: a #ClutterEntry - * @wc: a Unicode character + * @wc: a Unicode character * - * Sets the character to use in place of the actual text when - * #clutter_entry_set_visibility() has been called to set text visibility - * to FALSE. i.e. this is the character used in "password mode" to show the + * Sets the character to use in place of the actual text when + * #clutter_entry_set_visibility() has been called to set text visibility + * to FALSE. i.e. this is the character used in "password mode" to show the * user how many characters have been typed. The default invisible char is an * asterisk ('*'). If you set the invisible char to 0, then the user will get - * no feedback at all; there will be no text on the screen as they type. + * no feedback at all; there will be no text on the screen as they type. * * Since: 0.4 */ @@ -1576,21 +1578,21 @@ void clutter_entry_set_invisible_char (ClutterEntry *entry, gunichar wc) { ClutterEntryPrivate *priv; - + g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - + priv = entry->priv; - + priv->priv_char = wc; - + if (!priv->text_visible) return; - + clutter_entry_clear_layout (entry); clutter_entry_clear_cursor_position (entry); - + if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR(entry))) - clutter_actor_queue_redraw (CLUTTER_ACTOR(entry)); + clutter_actor_queue_redraw (CLUTTER_ACTOR(entry)); } /** @@ -1600,18 +1602,18 @@ clutter_entry_set_invisible_char (ClutterEntry *entry, gunichar wc) * Returns the character to use in place of the actual text when text-visibility * is set to FALSE * - * Return value: a Unicode character - * + * Return value: a Unicode character + * **/ gunichar clutter_entry_get_invisible_char (ClutterEntry *entry) { ClutterEntryPrivate *priv; - + g_return_val_if_fail (CLUTTER_IS_ENTRY (entry), TRUE); - + priv = entry->priv; - + return priv->priv_char; } @@ -1623,8 +1625,8 @@ clutter_entry_get_invisible_char (ClutterEntry *entry) * * Sets the maximum allowed length of the contents of the actor. If the * current contents are longer than the given length, then they will be - * truncated to fit. - * + * truncated to fit. + * * Since: 0.4 */ void @@ -1633,9 +1635,9 @@ clutter_entry_set_max_length (ClutterEntry *entry, { ClutterEntryPrivate *priv; gchar *new = NULL; - + g_return_if_fail (CLUTTER_IS_ENTRY (entry)); - + priv = entry->priv; if (priv->max_length != max) @@ -1646,7 +1648,7 @@ clutter_entry_set_max_length (ClutterEntry *entry, max = g_utf8_strlen (priv->text, -1); priv->max_length = max; - + new = g_strdup (priv->text); clutter_entry_set_text (entry, new); g_free (new); diff --git a/clutter/clutter-feature.c b/clutter/clutter-feature.c index 75e83b6f6..a3a2883b5 100644 --- a/clutter/clutter-feature.c +++ b/clutter/clutter-feature.c @@ -25,12 +25,14 @@ /** * SECTION:clutter-feature - * @short_description: Query GL features at runtime + * @short_description: Query GL features at runtime * - * Functions to query available GL features ay runtime + * Functions to query available GL features ay runtime */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -55,7 +57,7 @@ void _clutter_feature_init (void) { ClutterMainContext *context; - + CLUTTER_NOTE (MISC, "checking features"); if (!__features) @@ -84,7 +86,7 @@ _clutter_feature_init (void) * * Checks whether @feature is available. @feature can be a logical * OR of #ClutterFeatureFlags. - * + * * Return value: %TRUE if a feature is available * * Since: 0.1.1 diff --git a/clutter/clutter-fixed.c b/clutter/clutter-fixed.c index e8c0da482..87f75dc21 100644 --- a/clutter/clutter-fixed.c +++ b/clutter/clutter-fixed.c @@ -23,10 +23,12 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include -#include +#include /** * SECTION:clutter-fixed @@ -39,7 +41,7 @@ * math for fixed-to-floating and floating-to-fixed conversion. * * It is no recommened for use on platforms with a floating point unit - * (eg desktop systems) nor for use in bindings. + * (eg desktop systems) nor for use in bindings. * * Basic rules of Fixed Point arithmethic: * @@ -152,7 +154,7 @@ static ClutterFixed sin_tbl [] = * @angle: a #ClutterFixed angle in radians * * Fixed point implementation of sine function - * + * * Return value: #ClutterFixed sine value. * * Since: 0.2 @@ -169,7 +171,7 @@ clutter_sinx (ClutterFixed angle) sign = 1 + ~sign; angle = 1 + ~angle; } - + /* reduce to <0, 2*pi) */ if (angle >= CFX_2PI) { @@ -218,7 +220,7 @@ clutter_sinx (ClutterFixed angle) { indx2 = indx1 + 1; } - + low = sin_tbl[indx1]; high = sin_tbl[indx2]; @@ -229,7 +231,7 @@ clutter_sinx (ClutterFixed angle) if (sign < 0) angle = (1 + ~angle); - + return angle; } @@ -241,7 +243,7 @@ clutter_sinx (ClutterFixed angle) * * ClutterAngle is an integer such that 1024 represents * full circle. - * + * * Return value: #ClutterFixed sine value. * * Since: 0.2 @@ -258,10 +260,10 @@ clutter_sini (ClutterAngle angle) sign = 1 + ~sign; angle = 1 + ~angle; } - + /* reduce to <0, 2*pi) */ angle &= 0x3ff; - + /* reduce to first quadrant and sign */ if (angle > 512) { @@ -287,10 +289,10 @@ clutter_sini (ClutterAngle angle) } result = sin_tbl[angle]; - + if (sign < 0) result = (1 + ~result); - + return result; } @@ -301,71 +303,71 @@ clutter_sini (ClutterAngle angle) */ static ClutterFixed tan_tbl [] = { - 0x00000000L, 0x00000192L, 0x00000324L, 0x000004b7L, - 0x00000649L, 0x000007dbL, 0x0000096eL, 0x00000b01L, - 0x00000c94L, 0x00000e27L, 0x00000fbaL, 0x0000114eL, - 0x000012e2L, 0x00001477L, 0x0000160cL, 0x000017a1L, - 0x00001937L, 0x00001acdL, 0x00001c64L, 0x00001dfbL, - 0x00001f93L, 0x0000212cL, 0x000022c5L, 0x0000245fL, - 0x000025f9L, 0x00002795L, 0x00002931L, 0x00002aceL, - 0x00002c6cL, 0x00002e0aL, 0x00002faaL, 0x0000314aL, - 0x000032ecL, 0x0000348eL, 0x00003632L, 0x000037d7L, - 0x0000397dL, 0x00003b24L, 0x00003cccL, 0x00003e75L, - 0x00004020L, 0x000041ccL, 0x00004379L, 0x00004528L, - 0x000046d8L, 0x0000488aL, 0x00004a3dL, 0x00004bf2L, - 0x00004da8L, 0x00004f60L, 0x0000511aL, 0x000052d5L, - 0x00005492L, 0x00005651L, 0x00005812L, 0x000059d5L, - 0x00005b99L, 0x00005d60L, 0x00005f28L, 0x000060f3L, - 0x000062c0L, 0x0000648fL, 0x00006660L, 0x00006834L, - 0x00006a0aL, 0x00006be2L, 0x00006dbdL, 0x00006f9aL, - 0x0000717aL, 0x0000735dL, 0x00007542L, 0x0000772aL, - 0x00007914L, 0x00007b02L, 0x00007cf2L, 0x00007ee6L, - 0x000080dcL, 0x000082d6L, 0x000084d2L, 0x000086d2L, - 0x000088d6L, 0x00008adcL, 0x00008ce7L, 0x00008ef4L, - 0x00009106L, 0x0000931bL, 0x00009534L, 0x00009750L, - 0x00009971L, 0x00009b95L, 0x00009dbeL, 0x00009febL, - 0x0000a21cL, 0x0000a452L, 0x0000a68cL, 0x0000a8caL, - 0x0000ab0eL, 0x0000ad56L, 0x0000afa3L, 0x0000b1f5L, - 0x0000b44cL, 0x0000b6a8L, 0x0000b909L, 0x0000bb70L, - 0x0000bdddL, 0x0000c04fL, 0x0000c2c7L, 0x0000c545L, - 0x0000c7c9L, 0x0000ca53L, 0x0000cce3L, 0x0000cf7aL, - 0x0000d218L, 0x0000d4bcL, 0x0000d768L, 0x0000da1aL, - 0x0000dcd4L, 0x0000df95L, 0x0000e25eL, 0x0000e52eL, - 0x0000e806L, 0x0000eae7L, 0x0000edd0L, 0x0000f0c1L, - 0x0000f3bbL, 0x0000f6bfL, 0x0000f9cbL, 0x0000fce1L, - 0x00010000L, 0x00010329L, 0x0001065dL, 0x0001099aL, - 0x00010ce3L, 0x00011036L, 0x00011394L, 0x000116feL, - 0x00011a74L, 0x00011df6L, 0x00012184L, 0x0001251fL, - 0x000128c6L, 0x00012c7cL, 0x0001303fL, 0x00013410L, - 0x000137f0L, 0x00013bdfL, 0x00013fddL, 0x000143ebL, - 0x00014809L, 0x00014c37L, 0x00015077L, 0x000154c9L, - 0x0001592dL, 0x00015da4L, 0x0001622eL, 0x000166ccL, - 0x00016b7eL, 0x00017045L, 0x00017523L, 0x00017a17L, - 0x00017f22L, 0x00018444L, 0x00018980L, 0x00018ed5L, - 0x00019445L, 0x000199cfL, 0x00019f76L, 0x0001a53aL, - 0x0001ab1cL, 0x0001b11dL, 0x0001b73fL, 0x0001bd82L, - 0x0001c3e7L, 0x0001ca71L, 0x0001d11fL, 0x0001d7f4L, - 0x0001def1L, 0x0001e618L, 0x0001ed6aL, 0x0001f4e8L, - 0x0001fc96L, 0x00020473L, 0x00020c84L, 0x000214c9L, - 0x00021d44L, 0x000225f9L, 0x00022ee9L, 0x00023818L, - 0x00024187L, 0x00024b3aL, 0x00025534L, 0x00025f78L, - 0x00026a0aL, 0x000274edL, 0x00028026L, 0x00028bb8L, - 0x000297a8L, 0x0002a3fbL, 0x0002b0b5L, 0x0002bdddL, - 0x0002cb79L, 0x0002d98eL, 0x0002e823L, 0x0002f740L, - 0x000306ecL, 0x00031730L, 0x00032816L, 0x000339a6L, - 0x00034bebL, 0x00035ef2L, 0x000372c6L, 0x00038776L, - 0x00039d11L, 0x0003b3a6L, 0x0003cb48L, 0x0003e40aL, - 0x0003fe02L, 0x00041949L, 0x000435f7L, 0x0004542bL, - 0x00047405L, 0x000495a9L, 0x0004b940L, 0x0004def6L, - 0x00050700L, 0x00053196L, 0x00055ef9L, 0x00058f75L, - 0x0005c35dL, 0x0005fb14L, 0x00063709L, 0x000677c0L, - 0x0006bdd0L, 0x000709ecL, 0x00075ce6L, 0x0007b7bbL, - 0x00081b98L, 0x000889e9L, 0x0009046eL, 0x00098d4dL, - 0x000a2736L, 0x000ad593L, 0x000b9cc6L, 0x000c828aL, - 0x000d8e82L, 0x000ecb1bL, 0x001046eaL, 0x00121703L, - 0x00145b00L, 0x0017448dL, 0x001b2672L, 0x002095afL, - 0x0028bc49L, 0x0036519aL, 0x00517bb6L, 0x00a2f8fdL, - 0x46d3eab2L, + 0x00000000L, 0x00000192L, 0x00000324L, 0x000004b7L, + 0x00000649L, 0x000007dbL, 0x0000096eL, 0x00000b01L, + 0x00000c94L, 0x00000e27L, 0x00000fbaL, 0x0000114eL, + 0x000012e2L, 0x00001477L, 0x0000160cL, 0x000017a1L, + 0x00001937L, 0x00001acdL, 0x00001c64L, 0x00001dfbL, + 0x00001f93L, 0x0000212cL, 0x000022c5L, 0x0000245fL, + 0x000025f9L, 0x00002795L, 0x00002931L, 0x00002aceL, + 0x00002c6cL, 0x00002e0aL, 0x00002faaL, 0x0000314aL, + 0x000032ecL, 0x0000348eL, 0x00003632L, 0x000037d7L, + 0x0000397dL, 0x00003b24L, 0x00003cccL, 0x00003e75L, + 0x00004020L, 0x000041ccL, 0x00004379L, 0x00004528L, + 0x000046d8L, 0x0000488aL, 0x00004a3dL, 0x00004bf2L, + 0x00004da8L, 0x00004f60L, 0x0000511aL, 0x000052d5L, + 0x00005492L, 0x00005651L, 0x00005812L, 0x000059d5L, + 0x00005b99L, 0x00005d60L, 0x00005f28L, 0x000060f3L, + 0x000062c0L, 0x0000648fL, 0x00006660L, 0x00006834L, + 0x00006a0aL, 0x00006be2L, 0x00006dbdL, 0x00006f9aL, + 0x0000717aL, 0x0000735dL, 0x00007542L, 0x0000772aL, + 0x00007914L, 0x00007b02L, 0x00007cf2L, 0x00007ee6L, + 0x000080dcL, 0x000082d6L, 0x000084d2L, 0x000086d2L, + 0x000088d6L, 0x00008adcL, 0x00008ce7L, 0x00008ef4L, + 0x00009106L, 0x0000931bL, 0x00009534L, 0x00009750L, + 0x00009971L, 0x00009b95L, 0x00009dbeL, 0x00009febL, + 0x0000a21cL, 0x0000a452L, 0x0000a68cL, 0x0000a8caL, + 0x0000ab0eL, 0x0000ad56L, 0x0000afa3L, 0x0000b1f5L, + 0x0000b44cL, 0x0000b6a8L, 0x0000b909L, 0x0000bb70L, + 0x0000bdddL, 0x0000c04fL, 0x0000c2c7L, 0x0000c545L, + 0x0000c7c9L, 0x0000ca53L, 0x0000cce3L, 0x0000cf7aL, + 0x0000d218L, 0x0000d4bcL, 0x0000d768L, 0x0000da1aL, + 0x0000dcd4L, 0x0000df95L, 0x0000e25eL, 0x0000e52eL, + 0x0000e806L, 0x0000eae7L, 0x0000edd0L, 0x0000f0c1L, + 0x0000f3bbL, 0x0000f6bfL, 0x0000f9cbL, 0x0000fce1L, + 0x00010000L, 0x00010329L, 0x0001065dL, 0x0001099aL, + 0x00010ce3L, 0x00011036L, 0x00011394L, 0x000116feL, + 0x00011a74L, 0x00011df6L, 0x00012184L, 0x0001251fL, + 0x000128c6L, 0x00012c7cL, 0x0001303fL, 0x00013410L, + 0x000137f0L, 0x00013bdfL, 0x00013fddL, 0x000143ebL, + 0x00014809L, 0x00014c37L, 0x00015077L, 0x000154c9L, + 0x0001592dL, 0x00015da4L, 0x0001622eL, 0x000166ccL, + 0x00016b7eL, 0x00017045L, 0x00017523L, 0x00017a17L, + 0x00017f22L, 0x00018444L, 0x00018980L, 0x00018ed5L, + 0x00019445L, 0x000199cfL, 0x00019f76L, 0x0001a53aL, + 0x0001ab1cL, 0x0001b11dL, 0x0001b73fL, 0x0001bd82L, + 0x0001c3e7L, 0x0001ca71L, 0x0001d11fL, 0x0001d7f4L, + 0x0001def1L, 0x0001e618L, 0x0001ed6aL, 0x0001f4e8L, + 0x0001fc96L, 0x00020473L, 0x00020c84L, 0x000214c9L, + 0x00021d44L, 0x000225f9L, 0x00022ee9L, 0x00023818L, + 0x00024187L, 0x00024b3aL, 0x00025534L, 0x00025f78L, + 0x00026a0aL, 0x000274edL, 0x00028026L, 0x00028bb8L, + 0x000297a8L, 0x0002a3fbL, 0x0002b0b5L, 0x0002bdddL, + 0x0002cb79L, 0x0002d98eL, 0x0002e823L, 0x0002f740L, + 0x000306ecL, 0x00031730L, 0x00032816L, 0x000339a6L, + 0x00034bebL, 0x00035ef2L, 0x000372c6L, 0x00038776L, + 0x00039d11L, 0x0003b3a6L, 0x0003cb48L, 0x0003e40aL, + 0x0003fe02L, 0x00041949L, 0x000435f7L, 0x0004542bL, + 0x00047405L, 0x000495a9L, 0x0004b940L, 0x0004def6L, + 0x00050700L, 0x00053196L, 0x00055ef9L, 0x00058f75L, + 0x0005c35dL, 0x0005fb14L, 0x00063709L, 0x000677c0L, + 0x0006bdd0L, 0x000709ecL, 0x00075ce6L, 0x0007b7bbL, + 0x00081b98L, 0x000889e9L, 0x0009046eL, 0x00098d4dL, + 0x000a2736L, 0x000ad593L, 0x000b9cc6L, 0x000c828aL, + 0x000d8e82L, 0x000ecb1bL, 0x001046eaL, 0x00121703L, + 0x00145b00L, 0x0017448dL, 0x001b2672L, 0x002095afL, + 0x0028bc49L, 0x0036519aL, 0x00517bb6L, 0x00a2f8fdL, + 0x46d3eab2L, }; /** @@ -376,7 +378,7 @@ static ClutterFixed tan_tbl [] = * * ClutterAngle is an integer such that 1024 represents * full circle. - * + * * Return value: #ClutterFixed sine value. * * Since: 0.3 @@ -393,10 +395,10 @@ clutter_tani (ClutterAngle angle) sign = 1 + ~sign; angle = 1 + ~angle; } - + /* reduce to <0, pi) */ angle &= 0x1ff; - + /* reduce to first quadrant and sign */ if (angle > 256) { @@ -405,10 +407,10 @@ clutter_tani (ClutterAngle angle) } result = tan_tbl[angle]; - + if (sign < 0) result = (1 + ~result); - + return result; } @@ -515,7 +517,7 @@ clutter_sqrtx (ClutterFixed x) unsigned int mask = 0x40000000; unsigned fract = x & 0x0000ffff; unsigned int d1, d2; - + if (x <= 0) return 0; @@ -555,9 +557,9 @@ clutter_sqrtx (ClutterFixed x) bit -= 2; } #endif - + /* now bit indicates the highest bit set; there are two scenarios - * + * * 1) bit < 23: Our number is smaller so we shift it left to maximase * precision (< 16 really, since <16,23> never goes * through here. @@ -586,14 +588,14 @@ clutter_sqrtx (ClutterFixed x) */ d1 = (unsigned)(fract) >> 12; d2 = ((unsigned)CFX_ONE >> 12) - d1; - + x = ((v1*d2) + (v2*d1))/(CFX_ONE >> 12); - + if (sh > 0) x = x << sh; else if (sh < 0) x = (x >> (1 + ~sh)); - + return x; } @@ -602,7 +604,7 @@ clutter_sqrtx (ClutterFixed x) * @x: integer value * * Very fast fixed point implementation of square root for integers. - * + * * This function is about 10x faster than clib sqrt() on x86, and (this is * not a typo!) more than 800x faster on ARM without FPU. It's error is < 5% * for arguments < 132 and < 10% for arguments < 5591. @@ -645,9 +647,9 @@ clutter_sqrti (gint number) float f; guint32 i; } flt, flt2; - + flt.f = number; - + x = CLUTTER_INT_TO_FIXED (number) / 2; /* The QIII initial estimate */ @@ -655,11 +657,11 @@ clutter_sqrti (gint number) /* Now, we convert the float to 10.22 fixed. We exploit the mechanism * described at http://www.d6.com/users/checker/pdfs/gdmfp.pdf. - * + * * We want 22 bit fraction; a single precission float uses 23 bit * mantisa, so we only need to add 2^(23-22) (no need for the 1.5 * multiplier as we are only dealing with positive numbers). - * + * * Note: we have to use two separate variables here -- for some reason, * if we try to use just the flt variable, gcc on ARM optimises the whole * addition out, and it all goes pear shape, since without it, the bits @@ -708,13 +710,13 @@ clutter_qmulx (ClutterFixed op1, ClutterFixed op2) * http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2006-August/014405.html */ int res_low, res_hi; - + __asm__ ("smull %0, %1, %2, %3 \n" "mov %0, %0, lsr %4 \n" "add %1, %0, %1, lsl %5 \n" : "=r"(res_hi), "=r"(res_low)\ : "r"(op1), "r"(op2), "i"(CFX_Q), "i"(32-CFX_Q)); - + return (ClutterFixed) res_low; #else long long r = (long long) op1 * (long long) op2; @@ -730,7 +732,7 @@ clutter_qmulx (ClutterFixed op1, ClutterFixed op2) * The implementation of the log2x() and pow2x() exploits the well-documented * fact that the exponent part of IEEE floating number provides a good estimate * of log2 of that number, while the mantisa serves as a good error-correction. - * + * * The implemenation here uses a quadratic error correction as described by * Ian Stephenson at http://www.dctsystems.co.uk/Software/power.html. */ @@ -754,26 +756,26 @@ clutter_log2x (guint x) /* Note: we could easily have a version for ClutterFixed x, but the int * precission is enough for the current purposes. */ - union + union { float f; ClutterFixed i; } flt; - + ClutterFixed magic = 0x58bb; ClutterFixed y; - + /* * Convert x to float, then extract exponent. * * We want the result to be 16.16 fixed, so we shift (23-16) bits only */ flt.f = x; - flt.i >>= 7; + flt.i >>= 7; flt.i -= CLUTTER_INT_TO_FIXED (127); y = CLUTTER_FIXED_FRACTION (flt.i); - + y = CFX_MUL ((y - CFX_MUL (y, y)), magic); return flt.i + y; @@ -799,13 +801,13 @@ clutter_pow2x (ClutterFixed x) * but the the range would be limited to x < 15, and the int precission * is enough for the current purposes. */ - - union + + union { float f; guint32 i; } flt; - + ClutterFixed magic = 0x56f7; ClutterFixed y; @@ -835,7 +837,7 @@ clutter_pow2x (ClutterFixed x) * @x: base * @y: #ClutterFixed exponent * - * Calculates x to y power. (Note, if x is a constant it will be faster to + * Calculates x to y power. (Note, if x is a constant it will be faster to * calculate the power as clutter_pow2x (CLUTTER_FIXED_MUL(y, log2 (x))) * * Return value: x in y power. @@ -861,7 +863,7 @@ const double _magic = 68719476736.0*1.5; #define CFX_NO_FAST_CONVERSIONS #endif -/* +/* * clutter_double_to_fixed : * @value: value to be converted * @@ -877,7 +879,7 @@ _clutter_double_to_fixed (double val) #ifdef CFX_NO_FAST_CONVERSIONS return (ClutterFixed)(val * (double)CFX_ONE); #else - union + union { double d; unsigned int i[2]; @@ -906,7 +908,7 @@ _clutter_double_to_int (double val) #ifdef CFX_NO_FAST_CONVERSIONS return (gint)(val); #else - union + union { double d; unsigned int i[2]; @@ -924,7 +926,7 @@ _clutter_double_to_uint (double val) #ifdef CFX_NO_FAST_CONVERSIONS return (guint)(val); #else - union + union { double d; unsigned int i[2]; diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c index 5071116f7..89df11e66 100644 --- a/clutter/clutter-group.c +++ b/clutter/clutter-group.c @@ -29,7 +29,7 @@ * actors. * * A #ClutterGroup is an Actor which contains multiple child actors positioned - * relative to the #ClutterGroup position. Other operations such as scaling, + * relative to the #ClutterGroup position. Other operations such as scaling, * rotating and clipping of the group will child actors. * * A #ClutterGroup's size is defined by the size and position of it @@ -37,7 +37,10 @@ * ignored. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif + #include #include "clutter-group.h" @@ -101,18 +104,18 @@ clutter_group_paint (ClutterActor *actor) } cogl_pop_matrix(); - + CLUTTER_NOTE (PAINT, "ClutterGroup paint leave"); } -static void -clutter_group_pick (ClutterActor *actor, +static void +clutter_group_pick (ClutterActor *actor, const ClutterColor *color) { - /* Just forward to the paint call which in turn will trigger + /* Just forward to the paint call which in turn will trigger * the child actors also getting 'picked'. To make ourselves * 'sensitive' to clicks we could also paint a bounding rect - * but this is not currently done. + * but this is not currently done. */ clutter_group_paint (actor); } @@ -127,7 +130,7 @@ clutter_group_request_coords (ClutterActor *self, clutter_actor_query_coords (self, &cbox); /* Only positioning works. - * Sizing requests fail, use scale() instead + * Sizing requests fail, use scale() instead */ box->x2 = box->x1 + (cbox.x2 - cbox.x1); box->y2 = box->y1 + (cbox.y2 - cbox.y1); @@ -147,10 +150,10 @@ clutter_group_query_coords (ClutterActor *self, /* FIXME: Cache these values */ box->x2 = box->x1; box->y2 = box->y1; - + if (child_item) { - do + do { ClutterActor *child = CLUTTER_ACTOR(child_item->data); @@ -158,9 +161,9 @@ clutter_group_query_coords (ClutterActor *self, /* if (CLUTTER_ACTOR_IS_VISIBLE (child)) */ { ClutterActorBox cbox; - + clutter_actor_query_coords (child, &cbox); - + /* Ignore any children with offscreen ( negaive ) * positions. * @@ -179,7 +182,7 @@ clutter_group_query_coords (ClutterActor *self, } } -static void +static void clutter_group_dispose (GObject *object) { ClutterGroup *self = CLUTTER_GROUP (object); @@ -190,7 +193,7 @@ clutter_group_dispose (GObject *object) g_list_foreach (priv->children, (GFunc) clutter_actor_destroy, NULL); priv->children = NULL; } - + G_OBJECT_CLASS (clutter_group_parent_class)->dispose (object); } @@ -220,7 +223,7 @@ clutter_group_real_add (ClutterContainer *container, ClutterGroupPrivate *priv = group->priv; g_object_ref (actor); - + /* the old ClutterGroup::add signal was emitted before the * actor was added to the group, so that the class handler * would actually add it. we need to emit the ::add signal @@ -232,8 +235,8 @@ clutter_group_real_add (ClutterContainer *container, clutter_actor_set_parent (actor, CLUTTER_ACTOR (group)); g_signal_emit_by_name (container, "actor-added", actor); - - clutter_group_sort_depth_order (group); + + clutter_group_sort_depth_order (group); g_object_unref (actor); } @@ -246,7 +249,7 @@ clutter_group_real_remove (ClutterContainer *container, ClutterGroupPrivate *priv = group->priv; g_object_ref (actor); - + /* the old ClutterGroup::remove signal was emitted before the * actor was removed from the group. see the comment in * clutter_group_real_add() above for why we need to emit ::remove @@ -262,7 +265,7 @@ clutter_group_real_remove (ClutterContainer *container, * are holding a reference on it, it's still valid */ g_signal_emit_by_name (container, "actor-removed", actor); - + if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (group))) clutter_actor_queue_redraw (CLUTTER_ACTOR (group)); @@ -325,7 +328,7 @@ clutter_group_real_raise (ClutterContainer *container, ClutterGroup *self = CLUTTER_GROUP (container); ClutterGroupPrivate *priv = self->priv; - priv->children = g_list_remove (priv->children, actor); + priv->children = g_list_remove (priv->children, actor); /* Raise at the top */ if (!sibling) @@ -336,7 +339,7 @@ clutter_group_real_raise (ClutterContainer *container, if (last_item) sibling = last_item->data; - + priv->children = g_list_append (priv->children, actor); } else @@ -369,7 +372,7 @@ clutter_group_real_lower (ClutterContainer *container, ClutterGroup *self = CLUTTER_GROUP (container); ClutterGroupPrivate *priv = self->priv; - priv->children = g_list_remove (priv->children, actor); + priv->children = g_list_remove (priv->children, actor); /* Push to bottom */ if (!sibling) @@ -400,7 +403,7 @@ clutter_group_real_lower (ClutterContainer *container, } } -static gint +static gint sort_z_order (gconstpointer a, gconstpointer b) { @@ -409,7 +412,7 @@ sort_z_order (gconstpointer a, depth_a = clutter_actor_get_depth (CLUTTER_ACTOR(a)); depth_b = clutter_actor_get_depth (CLUTTER_ACTOR(b)); - if (depth_a == depth_b) + if (depth_a == depth_b) return 0; if (depth_a > depth_b) @@ -450,7 +453,7 @@ clutter_group_class_init (ClutterGroupClass *klass) ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); object_class->dispose = clutter_group_dispose; - + actor_class->paint = clutter_group_paint; actor_class->pick = clutter_group_pick; actor_class->show_all = clutter_group_real_show_all; @@ -524,7 +527,7 @@ clutter_group_new (void) /** * clutter_group_add: * @group: A #ClutterGroup - * @actor: A #ClutterActor + * @actor: A #ClutterActor * * Adds a new child #ClutterActor to the #ClutterGroup. * @@ -585,7 +588,7 @@ clutter_group_add_many (ClutterGroup *group, /** * clutter_group_remove * @group: A #ClutterGroup - * @actor: A #ClutterActor + * @actor: A #ClutterActor * * Removes a child #ClutterActor from the parent #ClutterGroup. * @@ -625,9 +628,9 @@ clutter_group_remove_all (ClutterGroup *group) /** * clutter_group_get_children: * @self: A #ClutterGroup - * + * * Get a list containing all actors contained in the group. - * + * * Return value: A list of #ClutterActors. You should free the returned * list using g_list_free() when finished using it. * @@ -645,9 +648,9 @@ clutter_group_get_children (ClutterGroup *self) * @self: A #ClutterGroup * * Gets the number of actors held in the group. - * + * * Return value: The number of child actors held in the group. - * + * * Since: 0.2 **/ gint @@ -661,8 +664,8 @@ clutter_group_get_n_children (ClutterGroup *self) /** * clutter_group_get_nth_child: * @self: A #ClutterGroup - * @index_: the position of the requested actor. - * + * @index_: the position of the requested actor. + * * Gets a groups child held at @index_ in stack. * * Return value: A Clutter actor or NULL if @index_ is invalid. @@ -711,7 +714,7 @@ clutter_group_find_child_by_id (ClutterGroup *self, */ void clutter_group_raise (ClutterGroup *self, - ClutterActor *actor, + ClutterActor *actor, ClutterActor *sibling) { g_return_if_fail (CLUTTER_IS_GROUP (self)); @@ -736,7 +739,7 @@ clutter_group_raise (ClutterGroup *self, */ void clutter_group_lower (ClutterGroup *self, - ClutterActor *actor, + ClutterActor *actor, ClutterActor *sibling) { g_return_if_fail (CLUTTER_IS_GROUP (self)); @@ -753,8 +756,8 @@ clutter_group_lower (ClutterGroup *self, * clutter_group_sort_depth_order: * @self: A #ClutterGroup * - * Sorts a #ClutterGroup's children by there depth value. - * This function should not be used by applications. + * Sorts a #ClutterGroup's children by there depth value. + * This function should not be used by applications. * * Deprecated: 0.6: Use clutter_container_sort_depth_order() instead. */ diff --git a/clutter/clutter-hbox.c b/clutter/clutter-hbox.c index 452d3a63b..166046429 100644 --- a/clutter/clutter-hbox.c +++ b/clutter/clutter-hbox.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-hbox.h" @@ -52,7 +54,7 @@ clutter_hbox_query_coords (ClutterActor *actor, coords->y2 = box->allocation.y2; return; } - + clutter_box_get_margin (box, &box_margin); width = CLUTTER_UNITS_TO_INT (box_margin.left); @@ -61,7 +63,7 @@ clutter_hbox_query_coords (ClutterActor *actor, for (l = box->children; l; l = l->next) { ClutterBoxChild *child = l->data; - + if (CLUTTER_ACTOR_IS_VISIBLE (child->actor)) { guint child_width, child_height; @@ -83,9 +85,9 @@ clutter_hbox_query_coords (ClutterActor *actor, width += CLUTTER_UNITS_TO_INT (box_margin.right); height += CLUTTER_UNITS_TO_INT (box_margin.bottom); - box->allocation.x2 = coords->x2 = + box->allocation.x2 = coords->x2 = coords->x1 + CLUTTER_UNITS_FROM_INT (width); - box->allocation.y2 = coords->y2 = + box->allocation.y2 = coords->y2 = coords->y1 + CLUTTER_UNITS_FROM_INT (height); } @@ -116,7 +118,7 @@ clutter_hbox_pack_child (ClutterBox *box, clutter_actor_get_geometry (child->actor, &child_geom); clutter_box_get_margin (box, &box_margin); - + if (child->pack_type == CLUTTER_PACK_START) { child_geom.x = box_geom.width @@ -125,7 +127,7 @@ clutter_hbox_pack_child (ClutterBox *box, } else if (child->pack_type == CLUTTER_PACK_END) { - child_geom.x = box_geom.width - child_geom.width + child_geom.x = box_geom.width - child_geom.width - CLUTTER_UNITS_TO_INT (child->padding.right); child_geom.y = CLUTTER_UNITS_TO_INT (child->padding.top); } diff --git a/clutter/clutter-label.c b/clutter/clutter-label.c index c49b136ae..d5bece809 100644 --- a/clutter/clutter-label.c +++ b/clutter/clutter-label.c @@ -30,7 +30,9 @@ * #ClutterLabel is a #ClutterTexture that displays text. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-label.h" #include "clutter-layout.h" diff --git a/clutter/clutter-layout.c b/clutter/clutter-layout.c index cbd1e280f..8da620aab 100644 --- a/clutter/clutter-layout.c +++ b/clutter/clutter-layout.c @@ -28,7 +28,9 @@ * Author: Emmanuele Bassi */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-layout.h" #include "clutter-main.h" @@ -127,7 +129,7 @@ clutter_layout_get_type (void) clutter_layout_base_init, NULL, }; - + layout_type = g_type_register_static (G_TYPE_INTERFACE, "ClutterLayout", &layout_info, 0); g_type_interface_add_prerequisite (layout_type, CLUTTER_TYPE_ACTOR); @@ -189,7 +191,7 @@ clutter_layout_width_for_height (ClutterLayout *layout, CLUTTER_LAYOUT_GET_IFACE (layout)->width_for_height (layout, &u_width, u_height); - + if (width) *width = CLUTTER_UNITS_TO_INT (u_width); } @@ -233,7 +235,7 @@ clutter_layout_height_for_width (ClutterLayout *layout, CLUTTER_LAYOUT_GET_IFACE (layout)->height_for_width (layout, u_width, &u_height); - + if (height) *height = CLUTTER_UNITS_TO_INT (u_height); } @@ -277,7 +279,7 @@ clutter_layout_natural_request (ClutterLayout *layout, CLUTTER_LAYOUT_GET_IFACE (layout)->natural_request (layout, &u_width, &u_height); - + if (width) *width = CLUTTER_UNITS_TO_INT (u_width); @@ -330,7 +332,7 @@ clutter_layout_tune_request (ClutterLayout *layout, g_warning ("Actor queried for tunable size size but actors of " "type `%s' do not support tunable layouts.", g_type_name (G_OBJECT_TYPE (layout))); - + if (width) *width = -1; diff --git a/clutter/clutter-media.c b/clutter/clutter-media.c index 52b83c6ef..47b6a4bc4 100644 --- a/clutter/clutter-media.c +++ b/clutter/clutter-media.c @@ -30,7 +30,9 @@ * #ClutterMedia is an interface for controlling playback of media data. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-media.h" #include "clutter-main.h" @@ -60,7 +62,7 @@ clutter_media_get_type (void) { sizeof (ClutterMediaInterface), clutter_media_base_init, - NULL, + NULL, }; media_type = g_type_register_static (G_TYPE_INTERFACE, "ClutterMedia", @@ -81,9 +83,9 @@ clutter_media_base_init (gpointer g_iface) /* props */ - g_object_interface_install_property + g_object_interface_install_property (g_iface, - g_param_spec_string + g_param_spec_string ("uri", "URI", "The loaded URI.", @@ -92,7 +94,7 @@ clutter_media_base_init (gpointer g_iface) G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); - g_object_interface_install_property + g_object_interface_install_property (g_iface, g_param_spec_boolean ("playing", @@ -103,7 +105,7 @@ clutter_media_base_init (gpointer g_iface) G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); - g_object_interface_install_property + g_object_interface_install_property (g_iface, g_param_spec_int ("position", @@ -114,7 +116,7 @@ clutter_media_base_init (gpointer g_iface) G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); - g_object_interface_install_property + g_object_interface_install_property (g_iface, g_param_spec_double ("volume", @@ -125,7 +127,7 @@ clutter_media_base_init (gpointer g_iface) G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); - g_object_interface_install_property + g_object_interface_install_property (g_iface, g_param_spec_boolean ("can-seek", @@ -135,8 +137,8 @@ clutter_media_base_init (gpointer g_iface) G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); - - g_object_interface_install_property + + g_object_interface_install_property (g_iface, g_param_spec_int ("buffer-percent", @@ -146,8 +148,8 @@ clutter_media_base_init (gpointer g_iface) G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); - - g_object_interface_install_property + + g_object_interface_install_property (g_iface, g_param_spec_int ("duration", @@ -307,10 +309,10 @@ clutter_media_set_volume (ClutterMedia *media, CLUTTER_MEDIA_GET_INTERFACE (media)->set_volume (media, volume); } -/** +/** * clutter_media_get_volume: * @media: A #ClutterMedia object - * + * * Retrieves the playback volume of @media. * * Return value: The playback volume between 0.0 and 1.0 diff --git a/clutter/clutter-rectangle.c b/clutter/clutter-rectangle.c index c31ed3698..97daf0f5c 100644 --- a/clutter/clutter-rectangle.c +++ b/clutter/clutter-rectangle.c @@ -29,11 +29,13 @@ * * #ClutterRectangle is an Actor which draws simple filled rectangles. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-rectangle.h" #include "clutter-main.h" -#include "clutter-private.h" +#include "clutter-private.h" #include "clutter-debug.h" #include "cogl.h" @@ -86,7 +88,7 @@ clutter_rectangle_paint (ClutterActor *self) clutter_actor_get_geometry (self, &geom); - /* parent paint call will have translated us into position so + /* parent paint call will have translated us into position so * paint from 0, 0 */ if (priv->has_border) @@ -103,17 +105,17 @@ clutter_rectangle_paint (ClutterActor *self) geom.width - priv->border_width, priv->border_width); - cogl_rectangle (geom.width - priv->border_width, + cogl_rectangle (geom.width - priv->border_width, priv->border_width, priv->border_width, geom.height - priv->border_width); cogl_rectangle (0, geom.height - priv->border_width, - geom.width - priv->border_width, + geom.width - priv->border_width, priv->border_width); cogl_rectangle (0, 0, - priv->border_width, + priv->border_width, geom.height - priv->border_width); tmp_col.red = priv->color.red; @@ -143,17 +145,17 @@ clutter_rectangle_paint (ClutterActor *self) } static void -clutter_rectangle_set_property (GObject *object, +clutter_rectangle_set_property (GObject *object, guint prop_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { ClutterRectangle *rectangle = CLUTTER_RECTANGLE(object); - switch (prop_id) + switch (prop_id) { case PROP_COLOR: - clutter_rectangle_set_color (rectangle, g_value_get_boxed (value)); + clutter_rectangle_set_color (rectangle, g_value_get_boxed (value)); break; case PROP_BORDER_COLOR: clutter_rectangle_set_border_color (rectangle, @@ -173,15 +175,15 @@ clutter_rectangle_set_property (GObject *object, } static void -clutter_rectangle_get_property (GObject *object, +clutter_rectangle_get_property (GObject *object, guint prop_id, - GValue *value, + GValue *value, GParamSpec *pspec) { ClutterRectangle *rectangle = CLUTTER_RECTANGLE(object); ClutterColor color; - switch (prop_id) + switch (prop_id) { case PROP_COLOR: clutter_rectangle_get_color (rectangle, &color); @@ -200,17 +202,17 @@ clutter_rectangle_get_property (GObject *object, default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; - } + } } -static void +static void clutter_rectangle_finalize (GObject *object) { G_OBJECT_CLASS (clutter_rectangle_parent_class)->finalize (object); } -static void +static void clutter_rectangle_dispose (GObject *object) { G_OBJECT_CLASS (clutter_rectangle_parent_class)->dispose (object); @@ -260,7 +262,7 @@ clutter_rectangle_class_init (ClutterRectangleClass *klass) * ClutterRectangle:border-width: * * The width of the border of the rectangle, in pixels. - * + * * Since: 0.2 */ g_object_class_install_property (gobject_class, @@ -353,7 +355,7 @@ clutter_rectangle_get_color (ClutterRectangle *rectangle, ClutterColor *color) { ClutterRectanglePrivate *priv; - + g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); g_return_if_fail (color != NULL); @@ -377,7 +379,7 @@ clutter_rectangle_set_color (ClutterRectangle *rectangle, const ClutterColor *color) { ClutterRectanglePrivate *priv; - + g_return_if_fail (CLUTTER_IS_RECTANGLE (rectangle)); g_return_if_fail (color != NULL); diff --git a/clutter/clutter-score.c b/clutter/clutter-score.c index b12134730..45a0526a9 100644 --- a/clutter/clutter-score.c +++ b/clutter/clutter-score.c @@ -23,15 +23,15 @@ * Boston, MA 02111-1307, USA. */ -/* +/* * IDEAS: * API; - * - add() + * - add() * + an new timeline to beginning of score * - append (timeline_existing, timeline_new, delay) - * + appends a new timeline to an existing one + * + appends a new timeline to an existing one * - * ScoreEntry + * ScoreEntry * { * Timeline *base; * GList *next_timelines; - to start on completion of base, @@ -40,7 +40,7 @@ * delay * } * - * start()/stop(),remove(),remove_all() ? + * start()/stop(),remove(),remove_all() ? */ /** @@ -50,7 +50,7 @@ * #ClutterScore is a base class for sequencing multiple timelines in order. */ -#ifndef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -100,10 +100,10 @@ static void start_entry (ClutterScoreEntry *entry); /* Object */ -static void -clutter_score_set_property (GObject *object, +static void +clutter_score_set_property (GObject *object, guint prop_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { ClutterScore *score; @@ -112,7 +112,7 @@ clutter_score_set_property (GObject *object, score = CLUTTER_SCORE(object); priv = score->priv; - switch (prop_id) + switch (prop_id) { case PROP_LOOP: priv->loop = g_value_get_boolean (value); @@ -123,10 +123,10 @@ clutter_score_set_property (GObject *object, } } -static void -clutter_score_get_property (GObject *object, +static void +clutter_score_get_property (GObject *object, guint prop_id, - GValue *value, + GValue *value, GParamSpec *pspec) { ClutterScore *score; @@ -135,7 +135,7 @@ clutter_score_get_property (GObject *object, score = CLUTTER_SCORE(object); priv = score->priv; - switch (prop_id) + switch (prop_id) { case PROP_LOOP: g_value_set_boolean (value, priv->loop); @@ -146,13 +146,13 @@ clutter_score_get_property (GObject *object, } } -static void +static void clutter_score_finalize (GObject *object) { G_OBJECT_CLASS (clutter_score_parent_class)->finalize (object); } -static void +static void clutter_score_dispose (GObject *object) { ClutterScore *self = CLUTTER_SCORE(object); @@ -200,7 +200,7 @@ clutter_score_class_init (ClutterScoreClass *klass) G_STRUCT_OFFSET (ClutterScoreClass, new_frame), NULL, NULL, clutter_marshal_VOID__OBJECT, - G_TYPE_NONE, + G_TYPE_NONE, 1, CLUTTER_TYPE_TIMELINE); score_signals[COMPLETED] = g_signal_new ("completed", @@ -251,7 +251,7 @@ clutter_score_set_loop (ClutterScore *score, gboolean loop) { g_return_if_fail (CLUTTER_IS_SCORE (score)); - + if (score->priv->loop != loop) { g_object_ref (score); @@ -289,7 +289,7 @@ void clutter_score_rewind (ClutterScore *score) { g_return_if_fail (CLUTTER_IS_SCORE (score)); - + } /** @@ -304,21 +304,21 @@ gboolean clutter_score_is_playing (ClutterScore *score) { g_return_val_if_fail (CLUTTER_IS_SCORE (score), FALSE); - + return !!g_hash_table_size(score->priv->running_timelines); } static void -on_timeline_finish (ClutterTimeline *timeline, +on_timeline_finish (ClutterTimeline *timeline, ClutterScoreEntry *entry) { GSList *item; - g_hash_table_remove (entry->score->priv->running_timelines, + g_hash_table_remove (entry->score->priv->running_timelines, GINT_TO_POINTER(entry->handler_id)); g_signal_handler_disconnect (timeline, entry->handler_id); - printf("completed %li\n", entry->handler_id); + printf("completed %li\n", entry->handler_id); for (item = entry->child_entries; item != NULL; item = item->next) { @@ -338,14 +338,14 @@ static void start_entry (ClutterScoreEntry *entry) { entry->handler_id = g_signal_connect (entry->timeline, - "completed", + "completed", G_CALLBACK (on_timeline_finish), entry); - printf("started %li\n", entry->handler_id); + printf("started %li\n", entry->handler_id); g_hash_table_insert (entry->score->priv->running_timelines, - GINT_TO_POINTER(entry->handler_id), + GINT_TO_POINTER(entry->handler_id), entry); clutter_timeline_start (entry->timeline); @@ -367,7 +367,7 @@ clutter_score_start (ClutterScore *score) g_return_if_fail (CLUTTER_IS_SCORE (score)); - priv = score->priv; + priv = score->priv; for (item = priv->entries; item != NULL; item = item->next) { @@ -422,21 +422,21 @@ find_entry (GSList *list, ClutterTimeline *timeline) * clutter_score_append: * @score: A #ClutterScore * @timeline_existing: A #ClutterTimeline in the score - * @timeline_new: A new #ClutterTimeline to start when #timeline_existing has + * @timeline_new: A new #ClutterTimeline to start when #timeline_existing has * completed, * * Appends a new timeline to an one existing in the score. * */ void -clutter_score_append (ClutterScore *score, +clutter_score_append (ClutterScore *score, ClutterTimeline *timeline_existing, ClutterTimeline *timeline_new) { ClutterScorePrivate *priv; ClutterScoreEntry *entry, *entry_new; - priv = score->priv; + priv = score->priv; /* Appends a timeline to the end of another */ if ((entry = find_entry (priv->entries, timeline_existing)) != NULL) @@ -457,7 +457,7 @@ clutter_score_append (ClutterScore *score, * */ void -clutter_score_add (ClutterScore *score, +clutter_score_add (ClutterScore *score, ClutterTimeline *timeline) { ClutterScorePrivate *priv; diff --git a/clutter/clutter-script.c b/clutter/clutter-script.c index 9d3c42a7d..94e7e40da 100644 --- a/clutter/clutter-script.c +++ b/clutter/clutter-script.c @@ -110,7 +110,9 @@ * #ClutterScript is available since Clutter 0.6 */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 63682dd0b..e0da549ac 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -26,12 +26,14 @@ /** * SECTION:clutter-stage * @short_description: Top level visual element to which actors are placed. - * + * * #ClutterStage is a top level 'window' on which child actors are placed * and manipulated. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-backend.h" #include "clutter-stage.h" @@ -68,7 +70,7 @@ struct _ClutterStagePrivate enum { PROP_0, - + PROP_COLOR, PROP_FULLSCREEN, PROP_OFFSCREEN, @@ -94,15 +96,15 @@ clutter_stage_paint (ClutterActor *self) { ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; - cogl_paint_init (&priv->color); + cogl_paint_init (&priv->color); CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint (self); } static void -clutter_stage_set_property (GObject *object, +clutter_stage_set_property (GObject *object, guint prop_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { ClutterStage *stage; @@ -113,7 +115,7 @@ clutter_stage_set_property (GObject *object, actor = CLUTTER_ACTOR (stage); priv = stage->priv; - switch (prop_id) + switch (prop_id) { case PROP_COLOR: clutter_stage_set_color (stage, g_value_get_boxed (value)); @@ -147,10 +149,10 @@ clutter_stage_set_property (GObject *object, clutter_stage_hide_cursor (stage); break; case PROP_PERSPECTIVE: - clutter_stage_set_perspectivex (stage, g_value_get_boxed (value)); + clutter_stage_set_perspectivex (stage, g_value_get_boxed (value)); break; case PROP_TITLE: - clutter_stage_set_title (stage, g_value_get_string (value)); + clutter_stage_set_title (stage, g_value_get_string (value)); break; case PROP_USER_RESIZE: clutter_stage_set_user_resizable (stage, g_value_get_boolean (value)); @@ -162,9 +164,9 @@ clutter_stage_set_property (GObject *object, } static void -clutter_stage_get_property (GObject *object, +clutter_stage_get_property (GObject *object, guint prop_id, - GValue *value, + GValue *value, GParamSpec *pspec) { ClutterStage *stage; @@ -175,7 +177,7 @@ clutter_stage_get_property (GObject *object, stage = CLUTTER_STAGE(object); priv = stage->priv; - switch (prop_id) + switch (prop_id) { case PROP_COLOR: clutter_stage_get_color (stage, &color); @@ -203,7 +205,7 @@ clutter_stage_get_property (GObject *object, default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; - } + } } static void @@ -287,7 +289,7 @@ clutter_stage_class_init (ClutterStageClass *klass) * * Since: 0.4 */ - g_object_class_install_property + g_object_class_install_property (gobject_class, PROP_TITLE, g_param_spec_string ("title", "Title", @@ -366,7 +368,7 @@ clutter_stage_class_init (ClutterStageClass *klass) NULL, NULL, clutter_marshal_VOID__VOID, G_TYPE_NONE, 0); - + g_type_class_add_private (gobject_class, sizeof (ClutterStagePrivate)); } @@ -377,7 +379,7 @@ clutter_stage_init (ClutterStage *self) /* a stage is a top-level object */ CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IS_TOPLEVEL); - + self->priv = priv = CLUTTER_STAGE_GET_PRIVATE (self); priv->is_offscreen = FALSE; @@ -427,7 +429,7 @@ clutter_stage_get_default (void) * clutter_stage_set_color * @stage: A #ClutterStage * @color: A #ClutterColor - * + * * Set the stage color. **/ void @@ -438,7 +440,7 @@ clutter_stage_set_color (ClutterStage *stage, g_return_if_fail (CLUTTER_IS_STAGE (stage)); g_return_if_fail (color != NULL); - + priv = stage->priv; priv->color.red = color->red; priv->color.green = color->green; @@ -447,7 +449,7 @@ clutter_stage_set_color (ClutterStage *stage, if (CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (stage))) clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - + g_object_notify (G_OBJECT (stage), "color"); } @@ -455,7 +457,7 @@ clutter_stage_set_color (ClutterStage *stage, * clutter_stage_get_color * @stage: A #ClutterStage * @color: return location for a #ClutterColor - * + * * Retrieves the stage color. */ void @@ -463,12 +465,12 @@ clutter_stage_get_color (ClutterStage *stage, ClutterColor *color) { ClutterStagePrivate *priv; - + g_return_if_fail (CLUTTER_IS_STAGE (stage)); g_return_if_fail (color != NULL); priv = stage->priv; - + color->red = priv->color.red; color->green = priv->color.green; color->blue = priv->color.blue; @@ -479,7 +481,7 @@ clutter_stage_get_color (ClutterStage *stage, * clutter_stage_set_perspectivex * @stage: A #ClutterStage * @perspective: A #ClutterPerspective - * + * * Set the stage perspective. **/ void @@ -503,7 +505,7 @@ clutter_stage_set_perspectivex (ClutterStage *stage, * clutter_stage_get_perspectivex * @stage: A #ClutterStage * @perspective: return location for a #ClutterPerspective - * + * * Retrieves the stage perspective. */ void @@ -528,7 +530,7 @@ clutter_stage_get_perspectivex (ClutterStage *stage, * @aspect: FIXME * @z_near: FIXME * @z_far: FIXME - * + * * Set the stage perspective. * * Since: 0.4 @@ -560,7 +562,7 @@ clutter_stage_set_perspective (ClutterStage *stage, * @aspect: FIXME * @z_near: FIXME * @z_far: FIXME - * + * * Retrieves the stage perspective. */ void @@ -608,9 +610,9 @@ clutter_stage_fullscreen (ClutterStage *stage) priv = stage->priv; if (!priv->is_fullscreen) { - /* Only set if backend implements. + /* Only set if backend implements. * Also see clutter_stage_event() for setting priv->is_fullscreen - * on state change event. + * on state change event. */ if (CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen) CLUTTER_STAGE_GET_CLASS (stage)->set_fullscreen (stage, TRUE); @@ -844,11 +846,11 @@ clutter_stage_event (ClutterStage *stage, { priv->is_fullscreen = FALSE; g_signal_emit (stage, stage_signals[UNFULLSCREEN], 0); - + g_object_notify (G_OBJECT (stage), "fullscreen"); } } - + if (event->stage_state.changed_mask & CLUTTER_STAGE_STATE_ACTIVATED) { if (event->stage_state.new_state & CLUTTER_STAGE_STATE_ACTIVATED) @@ -864,12 +866,12 @@ clutter_stage_event (ClutterStage *stage, * clutter_stage_set_title * @stage: A #ClutterStage * @title: A utf8 string for the stage windows title. - * + * * Sets the stage title. * * Since 0.4 **/ -void +void clutter_stage_set_title (ClutterStage *stage, const gchar *title) { @@ -891,7 +893,7 @@ clutter_stage_set_title (ClutterStage *stage, /** * clutter_stage_get_title * @stage: A #ClutterStage - * + * * Gets the stage title. * * Return value: pointer to the title string for the stage. The @@ -920,7 +922,7 @@ on_key_focused_weak_notify (gpointer data, priv = stage->priv; priv->key_focused_actor = NULL; - /* focused actor has dissapeared - fall back to stage + /* focused actor has dissapeared - fall back to stage * FIXME: need some kind of signal dance/block here. */ clutter_stage_set_key_focus (stage, NULL); @@ -946,7 +948,7 @@ clutter_stage_set_key_focus (ClutterStage *stage, on_key_focused_weak_notify, stage); g_signal_emit_by_name (priv->key_focused_actor, "focus-out"); - + priv->key_focused_actor = NULL; } else @@ -994,7 +996,7 @@ ClutterPerspective * clutter_perspective_copy (const ClutterPerspective *perspective) { ClutterPerspective *result; - + g_return_val_if_fail (perspective != NULL, NULL); result = g_slice_new (ClutterPerspective); @@ -1023,9 +1025,9 @@ GType clutter_perspective_get_type (void) { static GType our_type = 0; - + if (!our_type) - our_type = g_boxed_type_register_static + our_type = g_boxed_type_register_static ("ClutterPerspective", (GBoxedCopyFunc) clutter_perspective_copy, (GBoxedFreeFunc) clutter_perspective_free); diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index 8626c7533..98effc743 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -32,16 +32,18 @@ * * The clutter_texture_set_from_rgb_data() and clutter_texture_set_pixbuf() * functions are used to copy image data into texture memory and subsequently - * realize the the texture. + * realize the the texture. * * If texture reads are supported by underlying GL implementation, - * unrealizing/hiding frees image data from texture memory moving to main - * system memory. Re-realizing then performs the opposite operation. - * This process allows basic management of commonly limited available texture - * memory. + * unrealizing/hiding frees image data from texture memory moving to main + * system memory. Re-realizing then performs the opposite operation. + * This process allows basic management of commonly limited available texture + * memory. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-texture.h" #include "clutter-main.h" @@ -76,7 +78,7 @@ struct _ClutterTexturePrivate gint height; COGLenum pixel_format; COGLenum pixel_type; - COGLenum target_type; + COGLenum target_type; GdkPixbuf *local_pixbuf; /* non video memory copy */ guint sync_actor_size : 1; gint max_tile_waste; @@ -135,7 +137,7 @@ un_pre_multiply_alpha (const guchar *data, for (y = 0; y < height; y++) { src = (guchar*)data + y * rowstride; - for (x = 0; x < width; x++) + for (x = 0; x < width; x++) { guchar alpha = src[3]; if (alpha == 0) @@ -145,7 +147,7 @@ un_pre_multiply_alpha (const guchar *data, else { dst[0] = (((src[0] >> 16) & 0xff) * 255 ) / alpha; - dst[1] = (((src[1] >> 8) & 0xff) * 255 ) / alpha; + dst[1] = (((src[1] >> 8) & 0xff) * 255 ) / alpha; dst[2] = (((src[2] >> 0) & 0xff) * 255 ) / alpha; dst[3] = alpha; } @@ -177,7 +179,7 @@ rgb_to_bgr (const guchar *data, for (y = 0; y < height; y++) { src = (guchar*)data + y * rowstride; - for (x = 0; x < width; x++) + for (x = 0; x < width; x++) { dst[0] = src[2]; dst[1] = src[1]; @@ -213,7 +215,7 @@ tile_dimension (int to_fill, } n_tiles++; - + if (to_fill <= size) { if (tiles) @@ -243,22 +245,22 @@ texture_init_tiles (ClutterTexture *texture) y_pot = clutter_util_next_p2 (priv->height); while (!(cogl_texture_can_size (CGL_TEXTURE_2D, - priv->pixel_format, + priv->pixel_format, priv->pixel_type, x_pot, y_pot) - && (x_pot - priv->width < priv->max_tile_waste) + && (x_pot - priv->width < priv->max_tile_waste) && (y_pot - priv->height < priv->max_tile_waste))) { CLUTTER_NOTE (TEXTURE, "x_pot:%i - width:%i < max_waste:%i", x_pot, priv->width, priv->max_tile_waste); - + CLUTTER_NOTE (TEXTURE, "y_pot:%i - height:%i < max_waste:%i", y_pot, priv->height, priv->max_tile_waste); - + if (x_pot > y_pot) x_pot /= 2; else @@ -266,11 +268,11 @@ texture_init_tiles (ClutterTexture *texture) g_return_if_fail (x_pot != 0 || y_pot != 0); } - + if (priv->x_tiles) g_free (priv->x_tiles); - priv->n_x_tiles = tile_dimension (priv->width, x_pot, + priv->n_x_tiles = tile_dimension (priv->width, x_pot, priv->max_tile_waste, NULL); priv->x_tiles = g_new (ClutterTextureTileDimension, priv->n_x_tiles); tile_dimension (priv->width, x_pot, priv->max_tile_waste, priv->x_tiles); @@ -278,7 +280,7 @@ texture_init_tiles (ClutterTexture *texture) if (priv->y_tiles) g_free (priv->y_tiles); - priv->n_y_tiles = tile_dimension (priv->height, y_pot, + priv->n_y_tiles = tile_dimension (priv->height, y_pot, priv->max_tile_waste, NULL); priv->y_tiles = g_new (ClutterTextureTileDimension, priv->n_y_tiles); tile_dimension (priv->height, y_pot, priv->max_tile_waste, priv->y_tiles); @@ -293,10 +295,10 @@ texture_init_tiles (ClutterTexture *texture) } static void -texture_render_to_gl_quad (ClutterTexture *texture, - int x_1, - int y_1, - int x_2, +texture_render_to_gl_quad (ClutterTexture *texture, + int x_1, + int y_1, + int x_2, int y_2) { int qx1 = 0, qx2 = 0, qy1 = 0, qy2 = 0; @@ -317,7 +319,7 @@ texture_render_to_gl_quad (ClutterTexture *texture, if (priv->target_type == CGL_TEXTURE_2D) /* POT */ { - tx = (float) priv->width / clutter_util_next_p2 (priv->width); + tx = (float) priv->width / clutter_util_next_p2 (priv->width); ty = (float) priv->height / clutter_util_next_p2 (priv->height); } else @@ -330,12 +332,12 @@ texture_render_to_gl_quad (ClutterTexture *texture, qx1 = x_1; qx2 = x_2; qy1 = y_1; qy2 = y_2; - cogl_texture_quad (x_1, x_2, y_1, y_2, + cogl_texture_quad (x_1, x_2, y_1, y_2, 0, 0, CLUTTER_FLOAT_TO_FIXED (tx), CLUTTER_FLOAT_TO_FIXED (ty)); - + return; } @@ -348,7 +350,7 @@ texture_render_to_gl_quad (ClutterTexture *texture, int actual_w, actual_h; cogl_texture_bind (priv->target_type, priv->tiles[i]); - + actual_w = priv->x_tiles[x].size - priv->x_tiles[x].waste; actual_h = priv->y_tiles[y].size - priv->y_tiles[y].waste; @@ -361,17 +363,17 @@ texture_render_to_gl_quad (ClutterTexture *texture, qx1 = x_1 + lastx; qx2 = qx1 + ((qwidth * actual_w ) / priv->width ); - + qy1 = y_1 + lasty; qy2 = qy1 + ((qheight * actual_h) / priv->height ); - cogl_texture_quad (qx1, qx2, qy1, qy2, + cogl_texture_quad (qx1, qx2, qy1, qy2, 0, 0, CLUTTER_FLOAT_TO_FIXED (tx), CLUTTER_FLOAT_TO_FIXED (ty)); - lasty += (qy2 - qy1) ; + lasty += (qy2 - qy1) ; i++; } @@ -448,17 +450,17 @@ texture_upload_data (ClutterTexture *texture, cogl_texture_bind (priv->target_type, priv->tiles[0]); cogl_texture_set_alignment (priv->target_type, 4, priv->width); - cogl_texture_set_filters - (priv->target_type, + cogl_texture_set_filters + (priv->target_type, priv->filter_quality ? CGL_LINEAR : CGL_NEAREST, priv->filter_quality ? CGL_LINEAR : CGL_NEAREST); - cogl_texture_set_wrap (priv->target_type, + cogl_texture_set_wrap (priv->target_type, priv->repeat_x ? CGL_REPEAT : CGL_CLAMP_TO_EDGE, priv->repeat_y ? CGL_REPEAT : CGL_CLAMP_TO_EDGE); priv->filter_quality = 1; - + if (create_textures) { gint tex_width, tex_height; @@ -474,8 +476,8 @@ texture_upload_data (ClutterTexture *texture, cogl_texture_image_2d (priv->target_type, CGL_RGBA, - tex_width, - tex_height, + tex_width, + tex_height, priv->pixel_format, priv->pixel_type, NULL); @@ -493,7 +495,7 @@ texture_upload_data (ClutterTexture *texture, } /* Multiple tiled texture */ - + CLUTTER_NOTE (TEXTURE, "syncing for multiple tiles for %ix%i pixbuf", priv->width, priv->height); @@ -506,7 +508,7 @@ texture_upload_data (ClutterTexture *texture, 8, width, height, rowstride, NULL, NULL); - + if (priv->tiles == NULL) { priv->tiles = g_new (guint, priv->n_x_tiles * priv->n_y_tiles); @@ -519,7 +521,7 @@ texture_upload_data (ClutterTexture *texture, { GdkPixbuf *pixtmp; gint src_h, src_w; - + src_w = priv->x_tiles[x].size; src_h = priv->y_tiles[y].size; @@ -547,7 +549,7 @@ texture_upload_data (ClutterTexture *texture, gchar *filename; filename = g_strdup_printf("/tmp/%i-%i-%i.png", - clutter_actor_get_id(CLUTTER_ACTOR(texture)), + clutter_actor_get_id(CLUTTER_ACTOR(texture)), x, y); printf("saving %s\n", filename); gdk_pixbuf_save (pixtmp, filename , "png", NULL, NULL); @@ -555,31 +557,31 @@ texture_upload_data (ClutterTexture *texture, #endif cogl_texture_bind (priv->target_type, priv->tiles[i]); - - cogl_texture_set_alignment (priv->target_type, + + cogl_texture_set_alignment (priv->target_type, 4, priv->x_tiles[x].size); - cogl_texture_set_filters - (priv->target_type, + cogl_texture_set_filters + (priv->target_type, priv->filter_quality ? CGL_LINEAR : CGL_NEAREST, priv->filter_quality ? CGL_LINEAR : CGL_NEAREST); - cogl_texture_set_wrap (priv->target_type, + cogl_texture_set_wrap (priv->target_type, priv->repeat_x ? CGL_REPEAT : CGL_CLAMP_TO_EDGE, priv->repeat_y ? CGL_REPEAT : CGL_CLAMP_TO_EDGE); if (create_textures) { cogl_texture_image_2d (priv->target_type, CGL_RGBA, - gdk_pixbuf_get_width (pixtmp), - gdk_pixbuf_get_height (pixtmp), + gdk_pixbuf_get_width (pixtmp), + gdk_pixbuf_get_height (pixtmp), priv->pixel_format, priv->pixel_type, gdk_pixbuf_get_pixels (pixtmp)); } - else + else { - /* Textures already created, so just update whats inside + /* Textures already created, so just update whats inside */ cogl_texture_sub_image_2d (priv->target_type, 0, @@ -615,8 +617,8 @@ clutter_texture_unrealize (ClutterActor *actor) if (clutter_feature_available (CLUTTER_FEATURE_TEXTURE_READ_PIXELS)) { - /* Move image data from video to main memory. - * GL/ES cant do this - it probably makes sense + /* Move image data from video to main memory. + * GL/ES cant do this - it probably makes sense * to move this kind of thing into a ClutterProxyTexture * where this behaviour can be better controlled. * @@ -647,11 +649,11 @@ clutter_texture_realize (ClutterActor *actor) if (priv->local_pixbuf != NULL) { - /* Move any local image data we have from unrealization - * back into video memory. + /* Move any local image data we have from unrealization + * back into video memory. */ if (priv->is_tiled) - texture_init_tiles (texture); + texture_init_tiles (texture); clutter_texture_set_pixbuf (texture, priv->local_pixbuf, NULL); g_object_unref (priv->local_pixbuf); priv->local_pixbuf = NULL; @@ -660,12 +662,12 @@ clutter_texture_realize (ClutterActor *actor) { if (clutter_feature_available (CLUTTER_FEATURE_TEXTURE_READ_PIXELS)) { - /* Dont allow realization with no pixbuf - note set_pixbuf/data - * will set realize flags. + /* Dont allow realization with no pixbuf - note set_pixbuf/data + * will set realize flags. */ CLUTTER_NOTE (TEXTURE, "Texture has no image data cannot realize"); - + CLUTTER_NOTE (TEXTURE, "flags %i", actor->flags); CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); CLUTTER_NOTE (TEXTURE, "flags %i", actor->flags); @@ -715,9 +717,9 @@ clutter_texture_paint (ClutterActor *self) if (priv->tiles == NULL) { - /* We just need do debug this state, it doesn't really need to + /* We just need do debug this state, it doesn't really need to * throw a an error as what previously happened. Sub classes - * quite likely may not be able to realize. + * quite likely may not be able to realize. */ CLUTTER_NOTE (PAINT, "unable to paint texture '%s', contains no tiles", clutter_actor_get_name (self) @@ -761,7 +763,7 @@ clutter_texture_paint (ClutterActor *self) cogl_pop_matrix (); } -static void +static void clutter_texture_dispose (GObject *object) { ClutterTexture *texture = CLUTTER_TEXTURE (object); @@ -781,9 +783,9 @@ clutter_texture_dispose (GObject *object) } static void -clutter_texture_set_property (GObject *object, +clutter_texture_set_property (GObject *object, guint prop_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { ClutterTexture *texture; @@ -792,10 +794,10 @@ clutter_texture_set_property (GObject *object, texture = CLUTTER_TEXTURE(object); priv = texture->priv; - switch (prop_id) + switch (prop_id) { case PROP_PIXBUF: - clutter_texture_set_pixbuf (texture, + clutter_texture_set_pixbuf (texture, GDK_PIXBUF (g_value_get_object (value)), NULL); break; @@ -830,9 +832,9 @@ clutter_texture_set_property (GObject *object, } static void -clutter_texture_get_property (GObject *object, +clutter_texture_get_property (GObject *object, guint prop_id, - GValue *value, + GValue *value, GParamSpec *pspec) { ClutterTexture *texture; @@ -841,7 +843,7 @@ clutter_texture_get_property (GObject *object, texture = CLUTTER_TEXTURE(object); priv = texture->priv; - switch (prop_id) + switch (prop_id) { case PROP_PIXBUF: { @@ -877,7 +879,7 @@ clutter_texture_get_property (GObject *object, default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; - } + } } @@ -916,11 +918,11 @@ clutter_texture_class_init (ClutterTextureClass *klass) "Enable use of tiled textures", "Enables the use of tiled GL textures to more " "efficiently use available texture memory", - /* FIXME: This default set at runtime :/ + /* FIXME: This default set at runtime :/ * As tiling depends on what GL features available. * Need to figure out better solution */ - (clutter_feature_available + (clutter_feature_available (CLUTTER_FEATURE_TEXTURE_RECTANGLE) == FALSE), G_PARAM_CONSTRUCT_ONLY | CLUTTER_PARAM_READWRITE)); @@ -937,7 +939,7 @@ clutter_texture_class_init (ClutterTextureClass *klass) (gobject_class, PROP_REPEAT_X, g_param_spec_boolean ("repeat-x", "Tile underlying pixbuf in x direction", - "Reapeat underlying pixbuf rather than scale" + "Reapeat underlying pixbuf rather than scale" "in x direction. Currently UNWORKING", FALSE, G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE)); @@ -946,7 +948,7 @@ clutter_texture_class_init (ClutterTextureClass *klass) (gobject_class, PROP_REPEAT_Y, g_param_spec_boolean ("repeat-y", "Tile underlying pixbuf in y direction", - "Reapeat underlying pixbuf rather than scale" + "Reapeat underlying pixbuf rather than scale" "in y direction. Currently UNWORKING", FALSE, G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE)); @@ -1016,12 +1018,12 @@ clutter_texture_class_init (ClutterTextureClass *klass) G_STRUCT_OFFSET (ClutterTextureClass, size_change), NULL, NULL, clutter_marshal_VOID__INT_INT, - G_TYPE_NONE, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); /** * ClutterTexture::pixbuf-change: * @texture: the texture which received the signal - * + * * The ::pixbuf-change signal is emitted each time the pixbuf * used by @texture changes. */ @@ -1032,8 +1034,8 @@ clutter_texture_class_init (ClutterTextureClass *klass) G_STRUCT_OFFSET (ClutterTextureClass, pixbuf_change), NULL, NULL, g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, - 0); + G_TYPE_NONE, + 0); } static void @@ -1041,7 +1043,7 @@ clutter_texture_init (ClutterTexture *self) { ClutterTexturePrivate *priv; - self->priv = priv = CLUTTER_TEXTURE_GET_PRIVATE (self); + self->priv = priv = CLUTTER_TEXTURE_GET_PRIVATE (self); priv->max_tile_waste = 64; priv->filter_quality = 0; @@ -1070,8 +1072,8 @@ pixbuf_destroy_notify (guchar *pixels, gpointer data) * clutter_texture_get_pixbuf: * @texture: A #ClutterTexture * - * Gets a #GdkPixbuf representation of the #ClutterTexture data. - * The created #GdkPixbuf is not owned by the texture but the caller. + * Gets a #GdkPixbuf representation of the #ClutterTexture data. + * The created #GdkPixbuf is not owned by the texture but the caller. * * Return value: A #GdkPixbuf **/ @@ -1087,7 +1089,7 @@ clutter_texture_get_pixbuf (ClutterTexture* texture) priv = texture->priv; if (priv->tiles == NULL) - return NULL; + return NULL; if (priv->pixel_format == CGL_YCBCR_MESA) return NULL; /* FIXME: convert YUV */ @@ -1098,7 +1100,7 @@ clutter_texture_get_pixbuf (ClutterTexture* texture) if (!priv->is_tiled) { pixels = g_malloc (((priv->width * bpp + 3) &~ 3) * priv->height); - + if (!pixels) return NULL; @@ -1111,9 +1113,9 @@ clutter_texture_get_pixbuf (ClutterTexture* texture) /* No such func in gles... */ glGetTexImage (priv->target_type, 0, - (priv->pixel_format == CGL_RGBA - || priv->pixel_format == CGL_BGRA) ? - CGL_RGBA : CGL_RGB, + (priv->pixel_format == CGL_RGBA + || priv->pixel_format == CGL_BGRA) ? + CGL_RGBA : CGL_RGB, PIXEL_TYPE, (GLvoid*)pixels); @@ -1146,22 +1148,22 @@ clutter_texture_get_pixbuf (ClutterTexture* texture) { GdkPixbuf *tmp_pixb; gint src_h, src_w; - + src_w = priv->x_tiles[x].size; src_h = priv->y_tiles[y].size; pixels = g_malloc (((src_w * bpp + 3) &~ 3) * src_h); glBindTexture(priv->target_type, priv->tiles[i]); - + glPixelStorei (GL_UNPACK_ROW_LENGTH, src_w); glPixelStorei (GL_UNPACK_ALIGNMENT, 4); glGetTexImage (priv->target_type, 0, - (priv->pixel_format == CGL_RGBA - || priv->pixel_format == CGL_BGRA) ? - CGL_RGBA : CGL_RGB, + (priv->pixel_format == CGL_RGBA + || priv->pixel_format == CGL_BGRA) ? + CGL_RGBA : CGL_RGB, PIXEL_TYPE, (GLvoid *) pixels); @@ -1183,7 +1185,7 @@ clutter_texture_get_pixbuf (ClutterTexture* texture) if (priv->y_tiles[y].pos + src_h > priv->height) src_h = priv->height - priv->y_tiles[y].pos; - + gdk_pixbuf_copy_area (tmp_pixb, 0, 0, @@ -1203,7 +1205,7 @@ clutter_texture_get_pixbuf (ClutterTexture* texture) return pixbuf; #else - /* FIXME: func call wont work for GLES... + /* FIXME: func call wont work for GLES... * features need to reflect this. */ return NULL; @@ -1224,11 +1226,11 @@ clutter_texture_get_pixbuf (ClutterTexture* texture) * * Sets #ClutterTexture image data. * - * Return value: TRUE on success, FALSE on failure. + * Return value: TRUE on success, FALSE on failure. * * Since 0.4. This function is likely to change in future versions. **/ -gboolean +gboolean clutter_texture_set_from_rgb_data (ClutterTexture *texture, const guchar *data, gboolean has_alpha, @@ -1249,13 +1251,13 @@ clutter_texture_set_from_rgb_data (ClutterTexture *texture, g_return_val_if_fail (data != NULL, FALSE); /* Needed for GL_RGBA (internal format) and gdk pixbuf usage */ - g_return_val_if_fail (bpp == 4, FALSE); - + g_return_val_if_fail (bpp == 4, FALSE); + texture_dirty = size_change = (width != priv->width || height != priv->height) ; prev_format = priv->pixel_format; - + if (has_alpha) priv->pixel_format = CGL_RGBA; else @@ -1294,11 +1296,11 @@ clutter_texture_set_from_rgb_data (ClutterTexture *texture, !cogl_texture_can_size (CGL_TEXTURE_RECTANGLE_ARB, priv->pixel_format, priv->pixel_type, - priv->width, + priv->width, priv->height)) { /* If we cant create NPOT tex of this size fall back to tiles */ - CLUTTER_NOTE (TEXTURE, + CLUTTER_NOTE (TEXTURE, "Cannot make npots of size %ix%i " "falling back to tiled", priv->width, @@ -1306,21 +1308,21 @@ clutter_texture_set_from_rgb_data (ClutterTexture *texture, priv->target_type = CGL_TEXTURE_2D; } - + if (priv->target_type == CGL_TEXTURE_2D && !cogl_texture_can_size (CGL_TEXTURE_2D, - priv->pixel_format, + priv->pixel_format, priv->pixel_type, - clutter_util_next_p2 (priv->width), + clutter_util_next_p2 (priv->width), clutter_util_next_p2 (priv->height))) - { - priv->is_tiled = TRUE; + { + priv->is_tiled = TRUE; } } /* Figure our tiling etc */ if (priv->is_tiled) - texture_init_tiles (texture); + texture_init_tiles (texture); } CLUTTER_NOTE (TEXTURE, "set size %ix%i\n", @@ -1328,29 +1330,29 @@ clutter_texture_set_from_rgb_data (ClutterTexture *texture, priv->height); /* Set Error from this */ - texture_upload_data (texture, - copy_data != NULL ? copy_data : data, - has_alpha, - width, - height, - rowstride, + texture_upload_data (texture, + copy_data != NULL ? copy_data : data, + has_alpha, + width, + height, + rowstride, bpp); CLUTTER_ACTOR_SET_FLAGS (CLUTTER_ACTOR (texture), CLUTTER_ACTOR_REALIZED); if (size_change) { - g_signal_emit (texture, texture_signals[SIZE_CHANGE], + g_signal_emit (texture, texture_signals[SIZE_CHANGE], 0, priv->width, priv->height); if (priv->sync_actor_size) - clutter_actor_set_size (CLUTTER_ACTOR(texture), - priv->width, + clutter_actor_set_size (CLUTTER_ACTOR(texture), + priv->width, priv->height); } - + /* rename signal */ - g_signal_emit (texture, texture_signals[PIXBUF_CHANGE], 0); + g_signal_emit (texture, texture_signals[PIXBUF_CHANGE], 0); /* If resized actor may need resizing but paint() will do this */ if (CLUTTER_ACTOR_IS_MAPPED (CLUTTER_ACTOR(texture))) @@ -1380,7 +1382,7 @@ clutter_texture_set_from_rgb_data (ClutterTexture *texture, * * Since 0.4. **/ -gboolean +gboolean clutter_texture_set_from_yuv_data (ClutterTexture *texture, const guchar *data, gint width, @@ -1410,12 +1412,12 @@ clutter_texture_set_from_yuv_data (ClutterTexture *texture, priv->width = width; priv->height = height; priv->pixel_type = (flags & CLUTTER_TEXTURE_YUV_FLAG_YUV2) ? - CGL_UNSIGNED_SHORT_8_8_REV_MESA : + CGL_UNSIGNED_SHORT_8_8_REV_MESA : CGL_UNSIGNED_SHORT_8_8_MESA; priv->pixel_format = CGL_YCBCR_MESA; priv->target_type = CGL_TEXTURE_2D; - if (texture_dirty) + if (texture_dirty) texture_free_gl_resources (texture); if (!priv->tiles) @@ -1426,7 +1428,7 @@ clutter_texture_set_from_yuv_data (ClutterTexture *texture, cogl_texture_bind (priv->target_type, priv->tiles[0]); - cogl_texture_set_filters (priv->target_type, + cogl_texture_set_filters (priv->target_type, priv->filter_quality ? CGL_LINEAR : CGL_NEAREST, priv->filter_quality ? CGL_LINEAR : CGL_NEAREST); @@ -1442,7 +1444,7 @@ clutter_texture_set_from_yuv_data (ClutterTexture *texture, * this is really a guess... */ if (cogl_texture_can_size (CGL_TEXTURE_2D, - CGL_RGBA, + CGL_RGBA, CGL_UNSIGNED_BYTE, new_width, new_height)) { @@ -1478,16 +1480,16 @@ clutter_texture_set_from_yuv_data (ClutterTexture *texture, if (size_change) { - g_signal_emit (texture, texture_signals[SIZE_CHANGE], + g_signal_emit (texture, texture_signals[SIZE_CHANGE], 0, priv->width, priv->height); if (priv->sync_actor_size) - clutter_actor_set_size (CLUTTER_ACTOR(texture), - priv->width, + clutter_actor_set_size (CLUTTER_ACTOR(texture), + priv->width, priv->height); } - g_signal_emit (texture, texture_signals[PIXBUF_CHANGE], 0); + g_signal_emit (texture, texture_signals[PIXBUF_CHANGE], 0); if (CLUTTER_ACTOR_IS_MAPPED (CLUTTER_ACTOR(texture))) clutter_actor_queue_redraw (CLUTTER_ACTOR(texture)); @@ -1571,7 +1573,7 @@ clutter_texture_new (void) * **/ void /* FIXME: rename to get_image_size */ -clutter_texture_get_base_size (ClutterTexture *texture, +clutter_texture_get_base_size (ClutterTexture *texture, gint *width, gint *height) { @@ -1595,9 +1597,9 @@ clutter_texture_get_base_size (ClutterTexture *texture, * @texture: A #ClutterTexture * @index_: Tile index to bind * - * Proxys a call to glBindTexture a to bind an internal 'tile'. + * Proxys a call to glBindTexture a to bind an internal 'tile'. * - * This function is only useful for sub class implementations + * This function is only useful for sub class implementations * and never should be called by an application. **/ void @@ -1621,11 +1623,11 @@ clutter_texture_bind_tile (ClutterTexture *texture, * * Retreives internal tile dimentioning. * - * This function is only useful for sub class implementations + * This function is only useful for sub class implementations * and never should be called by an application. **/ void -clutter_texture_get_n_tiles (ClutterTexture *texture, +clutter_texture_get_n_tiles (ClutterTexture *texture, gint *n_x_tiles, gint *n_y_tiles) { @@ -1642,16 +1644,16 @@ clutter_texture_get_n_tiles (ClutterTexture *texture, * @texture: A #ClutterTexture * @x_index: X index of tile to query * @pos: Location to store tiles X position - * @size: Location to store tiles horizontal size in pixels + * @size: Location to store tiles horizontal size in pixels * @waste: Location to store tiles horizontal wastage in pixels * * Retreives details of a tile on x axis. * - * This function is only useful for sub class implementations + * This function is only useful for sub class implementations * and never should be called by an application. **/ void -clutter_texture_get_x_tile_detail (ClutterTexture *texture, +clutter_texture_get_x_tile_detail (ClutterTexture *texture, gint x_index, gint *pos, gint *size, @@ -1674,16 +1676,16 @@ clutter_texture_get_x_tile_detail (ClutterTexture *texture, * @texture: A #ClutterTexture * @y_index: Y index of tile to query * @pos: Location to store tiles Y position - * @size: Location to store tiles vertical size in pixels + * @size: Location to store tiles vertical size in pixels * @waste: Location to store tiles vertical wastage in pixels * * Retreives details of a tile on y axis. * - * This function is only useful for sub class implementations + * This function is only useful for sub class implementations * and never should be called by an application. **/ void -clutter_texture_get_y_tile_detail (ClutterTexture *texture, +clutter_texture_get_y_tile_detail (ClutterTexture *texture, gint y_index, gint *pos, gint *size, @@ -1692,7 +1694,7 @@ clutter_texture_get_y_tile_detail (ClutterTexture *texture, ClutterTexturePrivate *priv; g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); - + priv = texture->priv; g_return_if_fail (y_index < priv->n_y_tiles); @@ -1713,7 +1715,7 @@ clutter_texture_get_y_tile_detail (ClutterTexture *texture, * * Checks if #ClutterTexture has generated underlying GL texture tiles. * - * This function is only useful for sub class implementations + * This function is only useful for sub class implementations * and never should be called by an application. * * Return value: TRUE if texture has pregenerated GL tiles. @@ -1732,7 +1734,7 @@ clutter_texture_has_generated_tiles (ClutterTexture *texture) * * Checks if #ClutterTexture is tiled. * - * This function is only useful for sub class implementations + * This function is only useful for sub class implementations * and never should be called by an application. * * Return value: TRUE if texture is tiled diff --git a/clutter/clutter-timeline.c b/clutter/clutter-timeline.c index 634959a62..adc9ed265 100644 --- a/clutter/clutter-timeline.c +++ b/clutter/clutter-timeline.c @@ -39,7 +39,7 @@ * your application. */ -#ifndef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -59,7 +59,7 @@ struct _ClutterTimelinePrivate { guint timeout_id; guint delay_id; - + guint fps; guint n_frames; guint current_frame_num; @@ -74,7 +74,7 @@ struct _ClutterTimelinePrivate enum { PROP_0, - + PROP_FPS, PROP_NUM_FRAMES, PROP_LOOP, @@ -155,10 +155,10 @@ timeout_remove (guint tag) /* Object */ -static void -clutter_timeline_set_property (GObject *object, +static void +clutter_timeline_set_property (GObject *object, guint prop_id, - const GValue *value, + const GValue *value, GParamSpec *pspec) { ClutterTimeline *timeline; @@ -167,7 +167,7 @@ clutter_timeline_set_property (GObject *object, timeline = CLUTTER_TIMELINE(object); priv = timeline->priv; - switch (prop_id) + switch (prop_id) { case PROP_FPS: clutter_timeline_set_speed (timeline, g_value_get_uint (value)); @@ -187,10 +187,10 @@ clutter_timeline_set_property (GObject *object, } } -static void -clutter_timeline_get_property (GObject *object, +static void +clutter_timeline_get_property (GObject *object, guint prop_id, - GValue *value, + GValue *value, GParamSpec *pspec) { ClutterTimeline *timeline; @@ -199,7 +199,7 @@ clutter_timeline_get_property (GObject *object, timeline = CLUTTER_TIMELINE(object); priv = timeline->priv; - switch (prop_id) + switch (prop_id) { case PROP_FPS: g_value_set_uint (value, priv->fps); @@ -219,13 +219,13 @@ clutter_timeline_get_property (GObject *object, } } -static void +static void clutter_timeline_finalize (GObject *object) { G_OBJECT_CLASS (clutter_timeline_parent_class)->finalize (object); } -static void +static void clutter_timeline_dispose (GObject *object) { ClutterTimeline *self = CLUTTER_TIMELINE(object); @@ -333,7 +333,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass) G_STRUCT_OFFSET (ClutterTimelineClass, new_frame), NULL, NULL, clutter_marshal_VOID__INT, - G_TYPE_NONE, + G_TYPE_NONE, 1, G_TYPE_INT); /** * ClutterTimeline::completed: @@ -421,7 +421,7 @@ timeline_timeout_func (gpointer data) } g_object_ref (timeline); - + /* Figure out potential frame skips */ g_get_current_time (&timeval); @@ -439,37 +439,37 @@ timeline_timeout_func (gpointer data) g_object_unref (timeline); return FALSE; } - + if (priv->last_frame_msecs) { - /* Check time diff from out last call and adjust number - * of frames to advance accordingly. + /* Check time diff from out last call and adjust number + * of frames to advance accordingly. */ - msecs = ((timeval.tv_sec - priv->start_frame_secs) * 1000) + msecs = ((timeval.tv_sec - priv->start_frame_secs) * 1000) + (timeval.tv_usec / 1000); n_frames = (msecs - priv->last_frame_msecs) / (1000 / priv->fps); - + if (n_frames <= 0) n_frames = 1; else if (n_frames > 1) { - CLUTTER_TIMESTAMP (SCHEDULER, - "Timeline [%p], skipping %d frames\n", + CLUTTER_TIMESTAMP (SCHEDULER, + "Timeline [%p], skipping %d frames\n", timeline, n_frames); } } - else + else { /* First frame, set up timings.*/ priv->start_frame_secs = timeval.tv_sec; - + msecs = timeval.tv_usec / 1000; n_frames = 1; } - priv->last_frame_msecs = msecs; + priv->last_frame_msecs = msecs; /* Advance frames */ priv->current_frame_num += n_frames;; @@ -517,7 +517,7 @@ timeline_timeout_func (gpointer data) g_signal_emit (timeline, timeline_signals[COMPLETED], 0); clutter_timeline_rewind (timeline); - + retval = FALSE; } } @@ -538,7 +538,7 @@ delay_timeout_func (gpointer data) priv->timeout_id = timeout_add (FPS_TO_INTERVAL (priv->fps), timeline_timeout_func, timeline, NULL); - + g_signal_emit (timeline, timeline_signals[STARTED], 0); return FALSE; @@ -556,7 +556,7 @@ clutter_timeline_start (ClutterTimeline *timeline) ClutterTimelinePrivate *priv; g_return_if_fail (CLUTTER_IS_TIMELINE (timeline)); - + priv = timeline->priv; if (priv->delay_id || priv->timeout_id) @@ -635,7 +635,7 @@ clutter_timeline_set_loop (ClutterTimeline *timeline, gboolean loop) { g_return_if_fail (CLUTTER_IS_TIMELINE (timeline)); - + if (timeline->priv->loop != loop) { timeline->priv->loop = loop; @@ -670,7 +670,7 @@ void clutter_timeline_rewind (ClutterTimeline *timeline) { g_return_if_fail (CLUTTER_IS_TIMELINE (timeline)); - + clutter_timeline_advance (timeline, 0); } @@ -807,7 +807,7 @@ clutter_timeline_set_speed (ClutterTimeline *timeline, if (priv->timeout_id) { timeout_remove (priv->timeout_id); - + priv->timeout_id = timeout_add (FPS_TO_INTERVAL (priv->fps), timeline_timeout_func, timeline, NULL); @@ -846,7 +846,7 @@ gboolean clutter_timeline_is_playing (ClutterTimeline *timeline) { g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE); - + return (timeline->priv->timeout_id != 0); } @@ -896,9 +896,9 @@ clutter_timeline_new (guint n_frames, g_return_val_if_fail (n_frames > 0, NULL); g_return_val_if_fail (fps > 0, NULL); - return g_object_new (CLUTTER_TYPE_TIMELINE, - "fps", fps, - "num-frames", n_frames, + return g_object_new (CLUTTER_TYPE_TIMELINE, + "fps", fps, + "num-frames", n_frames, NULL); } diff --git a/clutter/clutter-timeout-pool.c b/clutter/clutter-timeout-pool.c index 8e2b5902f..261a0520d 100644 --- a/clutter/clutter-timeout-pool.c +++ b/clutter/clutter-timeout-pool.c @@ -30,7 +30,9 @@ * Based on similar code by Tristan van Berkom */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-debug.h" #include "clutter-timeout-pool.h" @@ -46,7 +48,7 @@ struct _ClutterTimeout guint id; ClutterTimeoutFlags flags; gint refcount; - + guint interval; GSourceFunc func; @@ -100,7 +102,7 @@ clutter_timeout_sort (gconstpointer a, if (TIMEOUT_READY (t_b)) return 1; - + /* Otherwise sort by expiration time */ comparison = t_a->expiration.tv_sec - t_b->expiration.tv_sec; if (comparison < 0) @@ -213,7 +215,7 @@ clutter_timeout_dispatch (GSource *source, retval = TRUE; } - + return retval; } @@ -344,7 +346,7 @@ clutter_timeout_pool_dispatch (GSource *source, clutter_timeout_pool_check (source); clutter_threads_enter (); - + /* Iterate by moving the actual start of the list along so that it * can cope with adds and removes while a timeout is being dispatched */ @@ -377,7 +379,7 @@ clutter_timeout_pool_dispatch (GSource *source, if (pool->dispatched_timeouts) pool->dispatched_timeouts->prev = l; - + l->prev = NULL; l->next = pool->dispatched_timeouts; pool->dispatched_timeouts = l; @@ -499,7 +501,7 @@ clutter_timeout_pool_new (gint priority) * After each call to the timeout function, the time of the next * timeout is recalculated based on the current time and the given interval * (it does not try to 'catch up' time lost in delays). - * + * * Return value: the ID (greater than 0) of the timeout inside the pool. * Use clutter_timeout_pool_remove() to stop the timeout. * diff --git a/clutter/clutter-vbox.c b/clutter/clutter-vbox.c index f5e365f37..19797ad2f 100644 --- a/clutter/clutter-vbox.c +++ b/clutter/clutter-vbox.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-vbox.h" @@ -52,7 +54,7 @@ clutter_vbox_query_coords (ClutterActor *actor, coords->y2 = box->allocation.y2; return; } - + clutter_box_get_margin (box, &box_margin); width = CLUTTER_UNITS_TO_INT (box_margin.left); @@ -61,7 +63,7 @@ clutter_vbox_query_coords (ClutterActor *actor, for (l = box->children; l; l = l->next) { ClutterBoxChild *child = l->data; - + if (CLUTTER_ACTOR_IS_VISIBLE (child->actor)) { guint child_width, child_height; @@ -83,9 +85,9 @@ clutter_vbox_query_coords (ClutterActor *actor, width += CLUTTER_UNITS_TO_INT (box_margin.right); height += CLUTTER_UNITS_TO_INT (box_margin.bottom); - box->allocation.x2 = coords->x2 = + box->allocation.x2 = coords->x2 = coords->x1 + CLUTTER_UNITS_FROM_INT (width); - box->allocation.y2 = coords->y2 = + box->allocation.y2 = coords->y2 = coords->y1 + CLUTTER_UNITS_FROM_INT (height); } @@ -116,7 +118,7 @@ clutter_vbox_pack_child (ClutterBox *box, clutter_actor_get_geometry (child->actor, &child_geom); clutter_box_get_margin (box, &box_margin); - + if (child->pack_type == CLUTTER_PACK_START) { child_geom.x = CLUTTER_UNITS_TO_INT (child->padding.left); diff --git a/clutter/cogl/gl/cogl.c b/clutter/cogl/gl/cogl.c index 72d557256..ce89bb273 100644 --- a/clutter/cogl/gl/cogl.c +++ b/clutter/cogl/gl/cogl.c @@ -23,7 +23,10 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif + #include "cogl.h" #include @@ -89,7 +92,7 @@ CoglFuncPtr cogl_get_proc_address (const gchar* name) { /* Sucks to ifdef here but not other option..? would be nice to - * split the code up for more reuse (once more backends use this + * split the code up for more reuse (once more backends use this */ #ifdef HAVE_CLUTTER_GLX static GLXGetProcAddressProc get_proc_func = NULL; @@ -128,7 +131,7 @@ cogl_get_proc_address (const gchar* name) return NULL; } -gboolean +gboolean cogl_check_extension (const gchar *name, const gchar *ext) { gchar *end; @@ -141,7 +144,7 @@ cogl_check_extension (const gchar *name, const gchar *ext) name_len = strlen(name); - while (ext < end) + while (ext < end) { n = strcspn(ext, " "); @@ -162,7 +165,7 @@ cogl_paint_init (const ClutterColor *color) 0.0) ); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - glDisable (GL_LIGHTING); + glDisable (GL_LIGHTING); glDisable (GL_DEPTH_TEST); cogl_enable (CGL_ENABLE_BLEND); @@ -284,7 +287,7 @@ cogl_enable (gulong flags) void cogl_color (const ClutterColor *color) { - glColor4ub (color->red, color->green, color->blue, color->alpha); + glColor4ub (color->red, color->green, color->blue, color->alpha); } void @@ -300,11 +303,11 @@ cogl_clip_set (const ClutterGeometry *clip) GE( glColor3f (1.0f, 1.0f, 1.0f) ); - GE( glRecti (clip->x, + GE( glRecti (clip->x, clip->y, clip->x + clip->width, clip->y + clip->height) ); - + GE( glStencilFunc (GL_EQUAL, 0x1, 0x1) ); ; GE( glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP) ); } @@ -319,7 +322,7 @@ gboolean cogl_texture_can_size (COGLenum target, COGLenum pixel_format, COGLenum pixel_type, - int width, + int width, int height) { #ifdef GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB @@ -349,8 +352,8 @@ cogl_texture_can_size (COGLenum target, void cogl_texture_quad (gint x1, - gint x2, - gint y1, + gint x2, + gint y1, gint y2, ClutterFixed tx1, ClutterFixed ty1, @@ -369,7 +372,7 @@ cogl_texture_quad (gint x1, glTexCoord2f (txf1, tyf2); glVertex2i (x1, y2); glTexCoord2f (txf1, tyf1); glVertex2i (x1, y1); glTexCoord2f (txf2, tyf1); glVertex2i (x2, y1); - glEnd (); + glEnd (); } void @@ -391,7 +394,7 @@ cogl_texture_bind (COGLenum target, guint texture) } void -cogl_texture_set_alignment (COGLenum target, +cogl_texture_set_alignment (COGLenum target, guint alignment, guint row_length) { @@ -400,7 +403,7 @@ cogl_texture_set_alignment (COGLenum target, } void -cogl_texture_set_filters (COGLenum target, +cogl_texture_set_filters (COGLenum target, COGLenum min_filter, COGLenum max_filter) { @@ -409,7 +412,7 @@ cogl_texture_set_filters (COGLenum target, } void -cogl_texture_set_wrap (COGLenum target, +cogl_texture_set_wrap (COGLenum target, COGLenum wrap_s, COGLenum wrap_t) { @@ -420,8 +423,8 @@ cogl_texture_set_wrap (COGLenum target, void cogl_texture_image_2d (COGLenum target, COGLint internal_format, - gint width, - gint height, + gint width, + gint height, COGLenum format, COGLenum type, const guchar* pixels) @@ -441,9 +444,9 @@ void cogl_texture_sub_image_2d (COGLenum target, gint xoff, gint yoff, - gint width, + gint width, gint height, - COGLenum format, + COGLenum format, COGLenum type, const guchar* pixels) { @@ -482,7 +485,7 @@ cogl_trapezoid (gint y1, } void -cogl_alpha_func (COGLenum func, +cogl_alpha_func (COGLenum func, ClutterFixed ref) { GE( glAlphaFunc (func, CLUTTER_FIXED_TO_FLOAT(ref)) ); @@ -499,12 +502,12 @@ cogl_perspective (ClutterFixed fovy, ClutterFixed fovy_rad_half = CLUTTER_FIXED_MUL (fovy, CFX_PI) / 360; GLfloat m[16]; - + memset (&m[0], 0, sizeof (m)); /* * Based on the original algorithm in perspective(): - * + * * 1) xmin = -xmax => xmax + xmin == 0 && xmax - xmin == 2 * xmax * same true for y, hence: a == 0 && b == 0; * @@ -540,14 +543,14 @@ cogl_setup_viewport (guint width, ClutterFixed z_far) { GLfloat z_camera; - + GE( glViewport (0, 0, width, height) ); - + GE( glMatrixMode (GL_PROJECTION) ); GE( glLoadIdentity () ); cogl_perspective (fovy, aspect, z_near, z_far); - + GE( glMatrixMode (GL_MODELVIEW) ); GE( glLoadIdentity () ); @@ -579,8 +582,8 @@ cogl_setup_viewport (guint width, } GE( glTranslatef (-0.5f, -0.5f, -z_camera) ); - GE( glScalef ( 1.0f / width, - -1.0f / height, + GE( glScalef ( 1.0f / width, + -1.0f / height, 1.0f / width) ); GE( glTranslatef (0.0f, -1.0 * height, 0.0f) ); } @@ -590,7 +593,7 @@ cogl_get_features () { ClutterFeatureFlags flags = 0; const gchar *gl_extensions; - + flags = CLUTTER_FEATURE_TEXTURE_READ_PIXELS; gl_extensions = (const gchar*) glGetString (GL_EXTENSIONS); @@ -609,7 +612,7 @@ cogl_get_features () flags |= CLUTTER_FEATURE_TEXTURE_YUV; } #endif - + return flags; } @@ -630,7 +633,7 @@ cogl_get_modelview_matrix (ClutterFixed m[16]) M(m,1,1) = CLUTTER_FLOAT_TO_FIXED (M(md,1,1)); M(m,1,2) = CLUTTER_FLOAT_TO_FIXED (M(md,1,2)); M(m,1,3) = CLUTTER_FLOAT_TO_FIXED (M(md,1,3)); - + M(m,2,0) = CLUTTER_FLOAT_TO_FIXED (M(md,2,0)); M(m,2,1) = CLUTTER_FLOAT_TO_FIXED (M(md,2,1)); M(m,2,2) = CLUTTER_FLOAT_TO_FIXED (M(md,2,2)); @@ -647,9 +650,9 @@ void cogl_get_projection_matrix (ClutterFixed m[16]) { GLdouble md[16]; - + glGetDoublev(GL_PROJECTION_MATRIX, &md[0]); - + #define M(m,row,col) m[col*4+row] M(m,0,0) = CLUTTER_FLOAT_TO_FIXED (M(md,0,0)); M(m,0,1) = CLUTTER_FLOAT_TO_FIXED (M(md,0,1)); @@ -660,7 +663,7 @@ cogl_get_projection_matrix (ClutterFixed m[16]) M(m,1,1) = CLUTTER_FLOAT_TO_FIXED (M(md,1,1)); M(m,1,2) = CLUTTER_FLOAT_TO_FIXED (M(md,1,2)); M(m,1,3) = CLUTTER_FLOAT_TO_FIXED (M(md,1,3)); - + M(m,2,0) = CLUTTER_FLOAT_TO_FIXED (M(md,2,0)); M(m,2,1) = CLUTTER_FLOAT_TO_FIXED (M(md,2,1)); M(m,2,2) = CLUTTER_FLOAT_TO_FIXED (M(md,2,2)); diff --git a/clutter/cogl/gles/cogl.c b/clutter/cogl/gles/cogl.c index 6725975f3..8a64d4c62 100644 --- a/clutter/cogl/gles/cogl.c +++ b/clutter/cogl/gles/cogl.c @@ -23,7 +23,10 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif + #include "cogl.h" #include diff --git a/clutter/eglnative/clutter-backend-egl.c b/clutter/eglnative/clutter-backend-egl.c index 2e019bfc0..7ff879627 100644 --- a/clutter/eglnative/clutter-backend-egl.c +++ b/clutter/eglnative/clutter-backend-egl.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-backend-egl.h" #include "clutter-stage-egl.h" diff --git a/clutter/eglnative/clutter-event-egl.c b/clutter/eglnative/clutter-event-egl.c index a8a9d7c24..7fda04a41 100644 --- a/clutter/eglnative/clutter-event-egl.c +++ b/clutter/eglnative/clutter-event-egl.c @@ -19,7 +19,9 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-stage-egl.h" #include "clutter-backend-egl.h" @@ -98,9 +100,9 @@ _clutter_events_init (ClutterBackend *backend) CLUTTER_NOTE (EVENT, "Opened '%s'", g_getenv("TSLIB_TSDEVICE")); - if (ts_config(event_source->ts_device)) + if (ts_config(event_source->ts_device)) { - g_warning ("ts_config() failed"); + g_warning ("ts_config() failed"); ts_close (event_source->ts_device); return; } @@ -116,9 +118,9 @@ _clutter_events_init (ClutterBackend *backend) g_source_attach (source, NULL); } else - g_warning ("ts_open() failed opening %s'", - g_getenv("TSLIB_TSDEVICE") ? - g_getenv("TSLIB_TSDEVICE") : "None, TSLIB_TSDEVICE not set"); + g_warning ("ts_open() failed opening %s'", + g_getenv("TSLIB_TSDEVICE") ? + g_getenv("TSLIB_TSDEVICE") : "None, TSLIB_TSDEVICE not set"); #endif } @@ -131,7 +133,7 @@ _clutter_events_uninit (ClutterBackend *backend) { CLUTTER_NOTE (EVENT, "Destroying the event source"); - ClutterEventSource *event_source = + ClutterEventSource *event_source = (ClutterEventSource *) backend_egl->event_source; #ifdef HAVE_TSLIB @@ -200,13 +202,13 @@ clutter_event_dispatch (GSource *source, #ifdef HAVE_TSLIB /* FIXME while would be better here but need to deal with lockups */ - if ((!clutter_events_pending()) && + if ((!clutter_events_pending()) && (ts_read(event_source->ts_device, &tsevent, 1) == 1)) { - /* Avoid sending too many events which are just pressure changes. - * We dont current handle pressure in events (FIXME) and thus + /* Avoid sending too many events which are just pressure changes. + * We dont current handle pressure in events (FIXME) and thus * event_button_generate gets confused generating lots of double - * and triple clicks. + * and triple clicks. */ if (tsevent.pressure && last_x == tsevent.x && last_y == tsevent.y) goto out; diff --git a/clutter/eglnative/clutter-stage-egl.c b/clutter/eglnative/clutter-stage-egl.c index 071065977..35b54f3a8 100644 --- a/clutter/eglnative/clutter-stage-egl.c +++ b/clutter/eglnative/clutter-stage-egl.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-stage-egl.h" #include "clutter-egl.h" diff --git a/clutter/eglx/clutter-backend-egl.c b/clutter/eglx/clutter-backend-egl.c index 29158d513..106497de3 100644 --- a/clutter/eglx/clutter-backend-egl.c +++ b/clutter/eglx/clutter-backend-egl.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-backend-egl.h" #include "clutter-stage-egl.h" @@ -73,7 +75,7 @@ clutter_backend_egl_post_parse (ClutterBackend *backend, backend_egl->xscreen_num = XScreenNumberOfScreen (backend_egl->xscreen); backend_egl->xwin_root = RootWindow (backend_egl->xdpy, backend_egl->xscreen_num); - + backend_egl->display_name = g_strdup (clutter_display_name); backend_egl->edpy = eglGetDisplay((NativeDisplayType)backend_egl->xdpy); @@ -82,8 +84,8 @@ clutter_backend_egl_post_parse (ClutterBackend *backend, / (double) DisplayHeightMM (backend_egl->xdpy, backend_egl->xscreen_num)); clutter_backend_set_resolution (backend, dpi); - status = eglInitialize(backend_egl->edpy, - &backend_egl->egl_version_major, + status = eglInitialize(backend_egl->edpy, + &backend_egl->egl_version_major, &backend_egl->egl_version_minor); if (status != EGL_TRUE) @@ -97,7 +99,7 @@ clutter_backend_egl_post_parse (ClutterBackend *backend, } g_free (clutter_display_name); - + CLUTTER_NOTE (BACKEND, "X Display `%s' [%p] opened (screen:%d, root:%u)", backend_egl->display_name, backend_egl->xdpy, @@ -105,7 +107,7 @@ clutter_backend_egl_post_parse (ClutterBackend *backend, (unsigned int) backend_egl->xwin_root); CLUTTER_NOTE (BACKEND, "EGL Reports version %i.%i", - backend_egl->egl_version_major, + backend_egl->egl_version_major, backend_egl->egl_version_minor); return TRUE; @@ -262,7 +264,7 @@ clutter_backend_egl_constructor (GType gtype, g_warning ("Attempting to create a new backend object. This should " "never happen, so we return the singleton instance."); - + return g_object_ref (backend_singleton); } @@ -351,7 +353,7 @@ clutter_eglx_untrap_x_errors (void) /** * clutter_eglx_get_default_xdisplay: - * + * * Returns the default X Display * * Return value: A Display pointer @@ -372,7 +374,7 @@ clutter_eglx_get_default_xdisplay (void) /** * clutter_eglx_get_default_screen: - * + * * FIXME * * Return value: FIXME @@ -393,7 +395,7 @@ clutter_eglx_get_default_screen (void) /** * clutter_eglx_get_default_root_window: - * + * * FIXME * * Return value: FIXME @@ -414,7 +416,7 @@ clutter_eglx_get_default_root_window (void) /** * clutter_egl_display - * + * * Gets the current EGLDisplay. * * Return value: an EGLDisplay diff --git a/clutter/eglx/clutter-event-egl.c b/clutter/eglx/clutter-event-egl.c index 52757c034..403975a8e 100644 --- a/clutter/eglx/clutter-event-egl.c +++ b/clutter/eglx/clutter-event-egl.c @@ -19,7 +19,9 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-stage-egl.h" #include "clutter-backend-egl.h" @@ -92,7 +94,7 @@ _clutter_events_init (ClutterBackend *backend) ClutterEventSource *event_source; ClutterBackendEGL *backend_egl = CLUTTER_BACKEND_EGL (backend); int connection_number; - + connection_number = ConnectionNumber (backend_egl->xdpy); CLUTTER_NOTE (EVENT, "Connection number: %d", connection_number); @@ -161,7 +163,7 @@ translate_key_event (ClutterBackend *backend, event->key.time = xevent->xkey.time; event->key.modifier_state = xevent->xkey.state; /* FIXME: handle modifiers */ event->key.hardware_keycode = xevent->xkey.keycode; - event->key.keyval = XKeycodeToKeysym (xevent->xkey.display, + event->key.keyval = XKeycodeToKeysym (xevent->xkey.display, xevent->xkey.keycode, 0); /* FIXME: index with modifiers */ } @@ -193,9 +195,9 @@ clutter_event_translate (ClutterBackend *backend, XEvent foo_xev; /* Cheap compress */ - while (XCheckTypedWindowEvent (backend_egl->xdpy, + while (XCheckTypedWindowEvent (backend_egl->xdpy, xevent->xexpose.window, - Expose, + Expose, &foo_xev)); /* FIXME: need to make stage an 'actor' so can que @@ -231,7 +233,7 @@ clutter_event_translate (ClutterBackend *backend, event->scroll.direction = CLUTTER_SCROLL_LEFT; else event->scroll.direction = CLUTTER_SCROLL_RIGHT; - + event->scroll.time = xevent->xbutton.time; event->scroll.x = xevent->xbutton.x; event->scroll.y = xevent->xbutton.y; @@ -348,7 +350,7 @@ clutter_event_check (GSource *source) retval = (clutter_events_pending () || clutter_check_xpending (backend)); else retval = FALSE; - + clutter_threads_leave (); return retval; diff --git a/clutter/eglx/clutter-stage-egl.c b/clutter/eglx/clutter-stage-egl.c index c0ac8018d..7bcb210c9 100644 --- a/clutter/eglx/clutter-stage-egl.c +++ b/clutter/eglx/clutter-stage-egl.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-stage-egl.h" #include "clutter-eglx.h" @@ -19,7 +21,7 @@ G_DEFINE_TYPE (ClutterStageEGL, clutter_stage_egl, CLUTTER_TYPE_STAGE); -/* This is currently an EGL on X implementation (eg for use with vincent) +/* This is currently an EGL on X implementation (eg for use with vincent) * * */ @@ -75,7 +77,7 @@ clutter_stage_egl_unrealize (ClutterActor *actor) eglDestroyContext (clutter_eglx_display(), stage_egl->egl_context); stage_egl->egl_context = NULL; - eglMakeCurrent (clutter_eglx_display(), + eglMakeCurrent (clutter_eglx_display(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); stage_egl->egl_context = None; @@ -103,37 +105,37 @@ clutter_stage_egl_realize (ClutterActor *actor) EGL_GREEN_SIZE, 6, EGL_BLUE_SIZE, 5, EGL_NONE }; - - status = eglGetConfigs (clutter_eglx_display(), - configs, - 2, + + status = eglGetConfigs (clutter_eglx_display(), + configs, + 2, &config_count); - + if (status != EGL_TRUE) - g_warning ("eglGetConfigs"); - - status = eglChooseConfig (clutter_eglx_display(), - cfg_attribs, - configs, - sizeof configs / sizeof configs[0], + g_warning ("eglGetConfigs"); + + status = eglChooseConfig (clutter_eglx_display(), + cfg_attribs, + configs, + sizeof configs / sizeof configs[0], &config_count); if (status != EGL_TRUE) - g_warning ("eglChooseConfig"); - + g_warning ("eglChooseConfig"); + if (stage_egl->xwin == None) - stage_egl->xwin + stage_egl->xwin = XCreateSimpleWindow(clutter_eglx_get_default_xdisplay(), clutter_eglx_get_default_root_window(), 0, 0, - stage_egl->xwin_width, + stage_egl->xwin_width, stage_egl->xwin_height, - 0, 0, - WhitePixel(clutter_eglx_get_default_xdisplay(), + 0, 0, + WhitePixel(clutter_eglx_get_default_xdisplay(), clutter_eglx_get_default_screen())); - XSelectInput(clutter_eglx_get_default_xdisplay(), - stage_egl->xwin, + XSelectInput(clutter_eglx_get_default_xdisplay(), + stage_egl->xwin, StructureNotifyMask |ExposureMask /* FIXME: we may want to eplicity enable MotionMask */ @@ -150,32 +152,32 @@ clutter_stage_egl_realize (ClutterActor *actor) if (stage_egl->egl_surface) eglDestroySurface (clutter_eglx_display(), stage_egl->egl_surface); - stage_egl->egl_surface - = eglCreateWindowSurface (clutter_eglx_display(), - configs[0], - (NativeWindowType)stage_egl->xwin, + stage_egl->egl_surface + = eglCreateWindowSurface (clutter_eglx_display(), + configs[0], + (NativeWindowType)stage_egl->xwin, NULL); if (stage_egl->egl_surface == EGL_NO_SURFACE) g_warning ("eglCreateWindowSurface"); - - stage_egl->egl_context = eglCreateContext (clutter_eglx_display(), - configs[0], - EGL_NO_CONTEXT, + + stage_egl->egl_context = eglCreateContext (clutter_eglx_display(), + configs[0], + EGL_NO_CONTEXT, NULL); if (stage_egl->egl_context == EGL_NO_CONTEXT) g_warning ("eglCreateContext"); - - status = eglMakeCurrent (clutter_eglx_display(), - stage_egl->egl_surface, - stage_egl->egl_surface, + + status = eglMakeCurrent (clutter_eglx_display(), + stage_egl->egl_surface, + stage_egl->egl_surface, stage_egl->egl_context); if (status != EGL_TRUE) - g_warning ("eglMakeCurrent"); + g_warning ("eglMakeCurrent"); + - } else { @@ -205,7 +207,7 @@ clutter_stage_egl_request_coords (ClutterActor *self, /* FIXME: some how have X configure_notfiys call this ? */ new_width = ABS (CLUTTER_UNITS_TO_INT (box->x2 - box->x1)); - new_height = ABS (CLUTTER_UNITS_TO_INT (box->y2 - box->y1)); + new_height = ABS (CLUTTER_UNITS_TO_INT (box->y2 - box->y1)); if (new_width != stage_egl->xwin_width || new_height != stage_egl->xwin_height) @@ -214,7 +216,7 @@ clutter_stage_egl_request_coords (ClutterActor *self, stage_egl->xwin_height = new_height; if (stage_egl->xwin != None) - XResizeWindow (stage_egl->xdpy, + XResizeWindow (stage_egl->xdpy, stage_egl->xwin, stage_egl->xwin_width, stage_egl->xwin_height); @@ -298,7 +300,7 @@ clutter_stage_egl_set_cursor_visible (ClutterStage *stage, pix = XCreatePixmap (stage_egl->xdpy, stage_egl->xwin, 1, 1, 1); memset (&col, 0, sizeof (col)); - curs = XCreatePixmapCursor (stage_egl->xdpy, + curs = XCreatePixmapCursor (stage_egl->xdpy, pix, pix, &col, &col, 1, 1); @@ -347,14 +349,14 @@ clutter_stage_egl_class_init (ClutterStageEGLClass *klass) ClutterStageClass *stage_class = CLUTTER_STAGE_CLASS (klass); gobject_class->dispose = clutter_stage_egl_dispose; - + actor_class->show = clutter_stage_egl_show; actor_class->hide = clutter_stage_egl_hide; actor_class->realize = clutter_stage_egl_realize; actor_class->unrealize = clutter_stage_egl_unrealize; actor_class->request_coords = clutter_stage_egl_request_coords; actor_class->query_coords = clutter_stage_egl_query_coords; - + stage_class->set_fullscreen = clutter_stage_egl_set_fullscreen; stage_class->set_cursor_visible = clutter_stage_egl_set_cursor_visible; stage_class->set_offscreen = clutter_stage_egl_set_offscreen; diff --git a/clutter/glx/clutter-event-glx.c b/clutter/glx/clutter-event-glx.c index 1df599496..2097ba18e 100644 --- a/clutter/glx/clutter-event-glx.c +++ b/clutter/glx/clutter-event-glx.c @@ -19,7 +19,9 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-stage-glx.h" #include "clutter-backend-glx.h" diff --git a/clutter/json/json-array.c b/clutter/json/json-array.c index 7e2362154..c4f15cdde 100644 --- a/clutter/json/json-array.c +++ b/clutter/json/json-array.c @@ -17,7 +17,9 @@ * Emmanuele Bassi */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "json-types.h" diff --git a/clutter/json/json-generator.c b/clutter/json/json-generator.c index 1395ee249..a4768d1d3 100644 --- a/clutter/json/json-generator.c +++ b/clutter/json/json-generator.c @@ -25,7 +25,9 @@ * put it into a buffer or a file. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include diff --git a/clutter/json/json-node.c b/clutter/json/json-node.c index 68b66c9c5..263f129c6 100644 --- a/clutter/json/json-node.c +++ b/clutter/json/json-node.c @@ -17,7 +17,9 @@ * Emmanuele Bassi */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include diff --git a/clutter/json/json-object.c b/clutter/json/json-object.c index b7359d74a..6d0f83a2f 100644 --- a/clutter/json/json-object.c +++ b/clutter/json/json-object.c @@ -17,7 +17,9 @@ * Emmanuele Bassi */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include diff --git a/clutter/json/json-parser.c b/clutter/json/json-parser.c index 19ff5c81a..4e3961100 100644 --- a/clutter/json/json-parser.c +++ b/clutter/json/json-parser.c @@ -25,7 +25,9 @@ * inside a file or inside a static buffer. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include diff --git a/clutter/sdl/clutter-backend-sdl.c b/clutter/sdl/clutter-backend-sdl.c index aa5afc189..52286cc0f 100644 --- a/clutter/sdl/clutter-backend-sdl.c +++ b/clutter/sdl/clutter-backend-sdl.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-backend-sdl.h" #include "clutter-stage-sdl.h" diff --git a/clutter/sdl/clutter-event-sdl.c b/clutter/sdl/clutter-event-sdl.c index 431cfe996..7605e758f 100644 --- a/clutter/sdl/clutter-event-sdl.c +++ b/clutter/sdl/clutter-event-sdl.c @@ -19,7 +19,9 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-stage-sdl.h" #include "clutter-backend-sdl.h" @@ -77,7 +79,7 @@ _clutter_events_init (ClutterBackend *backend) GSource *source; ClutterEventSource *event_source; ClutterBackendSDL *backend_sdl = CLUTTER_BACKEND_SDL (backend); - + source = backend_sdl->event_source = clutter_event_source_new (backend); event_source = (ClutterEventSource *) source; g_source_set_priority (source, CLUTTER_PRIORITY_EVENTS); @@ -118,10 +120,10 @@ clutter_event_prepare (GSource *source, num_events = SDL_PeepEvents(&events, 1, SDL_PEEKEVENT, SDL_ALLEVENTS); - if (num_events == 1) + if (num_events == 1) { clutter_threads_leave (); - + *timeout = 0; return TRUE; } @@ -170,15 +172,15 @@ key_event_translate (ClutterEvent *event, /* FIXME: This is just a quick hack to make SDL keys roughly work. * Fixing it properly is left as a exercise to someone who enjoys - * battleing the SDL API. + * battleing the SDL API. * * We probably need to use sdl_event->key.keysym.unicode to do lookups * and I have no idea how to get shifted keysyms. It looks quite easy * if you drop into xlib but that then avoids the whole point of using - * SDL in the first place (More portability than just GLX) + * SDL in the first place (More portability than just GLX) */ - switch(sdl_event->key.keysym.sym) + switch(sdl_event->key.keysym.sym) { case SDLK_UP: event->key.keyval = CLUTTER_Up; break; case SDLK_DOWN: event->key.keyval = CLUTTER_Down; break; @@ -188,7 +190,7 @@ key_event_translate (ClutterEvent *event, case SDLK_END: event->key.keyval = CLUTTER_End; break; case SDLK_PAGEUP: event->key.keyval = CLUTTER_Page_Up; break; case SDLK_PAGEDOWN: event->key.keyval = CLUTTER_Page_Down; break; - case SDLK_BACKSPACE: event->key.keyval = CLUTTER_BackSpace; break; + case SDLK_BACKSPACE: event->key.keyval = CLUTTER_BackSpace; break; case SDLK_DELETE: event->key.keyval = CLUTTER_Delete; break; default: event->key.keyval = sdl_event->key.keysym.sym; @@ -197,11 +199,11 @@ key_event_translate (ClutterEvent *event, event->key.hardware_keycode = sdl_event->key.keysym.scancode; if (sdl_event->key.keysym.mod & KMOD_CTRL) - event->key.modifier_state + event->key.modifier_state = event->key.modifier_state & CLUTTER_CONTROL_MASK; if (sdl_event->key.keysym.mod & KMOD_SHIFT) - event->key.modifier_state + event->key.modifier_state = event->key.modifier_state & CLUTTER_SHIFT_MASK; } @@ -214,7 +216,7 @@ event_translate (ClutterBackend *backend, res = TRUE; - switch (sdl_event->type) + switch (sdl_event->type) { case SDL_KEYDOWN: event->type = CLUTTER_KEY_PRESS; @@ -243,7 +245,7 @@ event_translate (ClutterBackend *backend, event->scroll.direction = CLUTTER_SCROLL_LEFT; else event->scroll.direction = CLUTTER_SCROLL_RIGHT; - + event->scroll.time = 0; event->scroll.x = sdl_event->button.x; event->scroll.y = sdl_event->button.y; @@ -315,13 +317,13 @@ clutter_event_dispatch (GSource *source, { /* FIXME: essentially translate events and push them onto the queue * below will then pop them out via _clutter_events_queue. - */ + */ if (sdl_event.type == SDL_QUIT) { SDL_Quit(); exit(0); } - else + else { event = clutter_event_new (CLUTTER_NOTHING); diff --git a/clutter/sdl/clutter-stage-sdl.c b/clutter/sdl/clutter-stage-sdl.c index ec9f3db81..92b7d2cf7 100644 --- a/clutter/sdl/clutter-stage-sdl.c +++ b/clutter/sdl/clutter-stage-sdl.c @@ -1,4 +1,6 @@ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "clutter-stage-sdl.h" #include "clutter-sdl.h"