From 28d83d3c1a764da1c4a8710e511f3a44aac54f86 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 3 Dec 2006 18:34:41 +0000 Subject: [PATCH] 2006-12-03 Emmanuele Bassi * clutter/clutter-texture.h: Clean up. * clutter/clutter-texture.c: Typo fix in the name of ClutterTextureTileDimension. * clutter/clutter-behaviour.c: Allow passing NULL to clutter_behaviour_set_alpha() (as we pass NULL in the finalize process). --- ChangeLog | 11 ++++ clutter/clutter-behaviour.c | 2 +- clutter/clutter-texture.c | 14 ++--- clutter/clutter-texture.h | 108 ++++++++++++++---------------------- 4 files changed, 61 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0fbfb115f..042589544 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-12-03 Emmanuele Bassi + + * clutter/clutter-texture.h: Clean up. + + * clutter/clutter-texture.c: Typo fix in the name + of ClutterTextureTileDimension. + + * clutter/clutter-behaviour.c: Allow passing NULL + to clutter_behaviour_set_alpha() (as we pass NULL + in the finalize process). + 2006-12-02 Emmanuele Bassi * clutter/clutter-version.h.in: Fix a stupid logic diff --git a/clutter/clutter-behaviour.c b/clutter/clutter-behaviour.c index 8d12c6426..fdae139fa 100644 --- a/clutter/clutter-behaviour.c +++ b/clutter/clutter-behaviour.c @@ -255,7 +255,7 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave, ClutterBehaviourPrivate *priv; g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave)); - g_return_if_fail (CLUTTER_IS_ALPHA (alpha)); + g_return_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha)); priv = behave->priv; diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index 92f2be481..e495c5ded 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -57,13 +57,13 @@ G_DEFINE_TYPE (ClutterTexture, clutter_texture, CLUTTER_TYPE_ACTOR); #define PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV #endif -typedef struct ClutterTextureTileDimention +typedef struct ClutterTextureTileDimension { gint pos, size, waste; } -ClutterTextureTileDimention; +ClutterTextureTileDimension; -struct ClutterTexturePrivate +struct _ClutterTexturePrivate { gint width, height; GLenum pixel_format; @@ -79,7 +79,7 @@ struct ClutterTexturePrivate gboolean tiled; - ClutterTextureTileDimention *x_tiles, *y_tiles; + ClutterTextureTileDimension *x_tiles, *y_tiles; gint n_x_tiles, n_y_tiles; GLuint *tiles; }; @@ -146,7 +146,7 @@ static int tile_dimension (int to_fill, int start_size, int waste, - ClutterTextureTileDimention *tiles) + ClutterTextureTileDimension *tiles) { int pos = 0; int n_tiles = 0; @@ -216,7 +216,7 @@ texture_init_tiles (ClutterTexture *texture) priv->n_x_tiles = tile_dimension (priv->width, x_pot, priv->max_tile_waste, NULL); - priv->x_tiles = g_new (ClutterTextureTileDimention, priv->n_x_tiles); + priv->x_tiles = g_new (ClutterTextureTileDimension, priv->n_x_tiles); tile_dimension (priv->width, x_pot, priv->max_tile_waste, priv->x_tiles); if (priv->y_tiles) @@ -224,7 +224,7 @@ texture_init_tiles (ClutterTexture *texture) priv->n_y_tiles = tile_dimension (priv->height, y_pot, priv->max_tile_waste, NULL); - priv->y_tiles = g_new (ClutterTextureTileDimention, priv->n_y_tiles); + priv->y_tiles = g_new (ClutterTextureTileDimension, priv->n_y_tiles); tile_dimension (priv->height, y_pot, priv->max_tile_waste, priv->y_tiles); CLUTTER_NOTE (TEXTURE, diff --git a/clutter/clutter-texture.h b/clutter/clutter-texture.h index 29bf2d948..582810c28 100644 --- a/clutter/clutter-texture.h +++ b/clutter/clutter-texture.h @@ -32,31 +32,16 @@ G_BEGIN_DECLS -#define CLUTTER_TYPE_TEXTURE clutter_texture_get_type() +#define CLUTTER_TYPE_TEXTURE (clutter_texture_get_type ()) +#define CLUTTER_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TEXTURE, ClutterTexture)) +#define CLUTTER_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TEXTURE, ClutterTextureClass)) +#define CLUTTER_IS_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TEXTURE)) +#define CLUTTER_IS_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TEXTURE)) +#define CLUTTER_TEXTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TEXTURE, ClutterTextureClass)) -#define CLUTTER_TEXTURE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - CLUTTER_TYPE_TEXTURE, ClutterTexture)) - -#define CLUTTER_TEXTURE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), \ - CLUTTER_TYPE_TEXTURE, ClutterTextureClass)) - -#define CLUTTER_IS_TEXTURE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ - CLUTTER_TYPE_TEXTURE)) - -#define CLUTTER_IS_TEXTURE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - CLUTTER_TYPE_TEXTURE)) - -#define CLUTTER_TEXTURE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - CLUTTER_TYPE_TEXTURE, ClutterTextureClass)) - -typedef struct _ClutterTexture ClutterTexture; -typedef struct _ClutterTextureClass ClutterTextureClass; -typedef struct ClutterTexturePrivate ClutterTexturePrivate; +typedef struct _ClutterTexture ClutterTexture; +typedef struct _ClutterTextureClass ClutterTextureClass; +typedef struct _ClutterTexturePrivate ClutterTexturePrivate; struct _ClutterTexture { @@ -75,53 +60,44 @@ struct _ClutterTextureClass void (*pixbuf_change) (ClutterTexture *texture); }; -GType clutter_texture_get_type (void); +GType clutter_texture_get_type (void) G_GNUC_CONST; -ClutterActor *clutter_texture_new_from_pixbuf (GdkPixbuf *pixbuf); - -ClutterActor *clutter_texture_new (void); - -void -clutter_texture_set_from_data (ClutterTexture *texture, - const guchar *data, - gboolean has_alpha, - gint width, - gint height, - gint rowstride, - gint bpp); - -void clutter_texture_set_pixbuf (ClutterTexture *texture, GdkPixbuf *pixbuf); - -GdkPixbuf *clutter_texture_get_pixbuf (ClutterTexture* texture); - -void clutter_texture_get_base_size (ClutterTexture *texture, - gint *width, - gint *height); +ClutterActor *clutter_texture_new (void); +ClutterActor *clutter_texture_new_from_pixbuf (GdkPixbuf *pixbuf); +void clutter_texture_set_from_data (ClutterTexture *texture, + const guchar *data, + gboolean has_alpha, + gint width, + gint height, + gint rowstride, + gint bpp); +void clutter_texture_set_pixbuf (ClutterTexture *texture, + GdkPixbuf *pixbuf); +GdkPixbuf * clutter_texture_get_pixbuf (ClutterTexture *texture); +void clutter_texture_get_base_size (ClutterTexture *texture, + gint *width, + gint *height); /* Below mainly for subclassed texture based actors */ -void clutter_texture_bind_tile (ClutterTexture *texture, gint index); - -void clutter_texture_get_n_tiles (ClutterTexture *texture, - gint *n_x_tiles, - gint *n_y_tiles); - -void clutter_texture_get_x_tile_detail (ClutterTexture *texture, - gint x_index, - gint *pos, - gint *size, - gint *waste); - -void clutter_texture_get_y_tile_detail (ClutterTexture *texture, - gint y_index, - gint *pos, - gint *size, - gint *waste); - +void clutter_texture_bind_tile (ClutterTexture *texture, + gint index); +void clutter_texture_get_n_tiles (ClutterTexture *texture, + gint *n_x_tiles, + gint *n_y_tiles); +void clutter_texture_get_x_tile_detail (ClutterTexture *texture, + gint x_index, + gint *pos, + gint *size, + gint *waste); +void clutter_texture_get_y_tile_detail (ClutterTexture *texture, + gint y_index, + gint *pos, + gint *size, + gint *waste); gboolean clutter_texture_has_generated_tiles (ClutterTexture *texture); - -gboolean clutter_texture_is_tiled (ClutterTexture *texture); +gboolean clutter_texture_is_tiled (ClutterTexture *texture); G_END_DECLS -#endif +#endif /* _HAVE_CLUTTER_TEXTURE_H */