2006-12-03 Emmanuele Bassi <ebassi@openedhand.com>

* 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).
This commit is contained in:
Emmanuele Bassi 2006-12-03 18:34:41 +00:00
parent 334789b1fc
commit 28d83d3c1a
4 changed files with 61 additions and 74 deletions

View File

@ -1,3 +1,14 @@
2006-12-03 Emmanuele Bassi <ebassi@openedhand.com>
* 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 <ebassi@openedhand.com> 2006-12-02 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-version.h.in: Fix a stupid logic * clutter/clutter-version.h.in: Fix a stupid logic

View File

@ -255,7 +255,7 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave,
ClutterBehaviourPrivate *priv; ClutterBehaviourPrivate *priv;
g_return_if_fail (CLUTTER_IS_BEHAVIOUR (behave)); 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; priv = behave->priv;

View File

@ -57,13 +57,13 @@ G_DEFINE_TYPE (ClutterTexture, clutter_texture, CLUTTER_TYPE_ACTOR);
#define PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV #define PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV
#endif #endif
typedef struct ClutterTextureTileDimention typedef struct ClutterTextureTileDimension
{ {
gint pos, size, waste; gint pos, size, waste;
} }
ClutterTextureTileDimention; ClutterTextureTileDimension;
struct ClutterTexturePrivate struct _ClutterTexturePrivate
{ {
gint width, height; gint width, height;
GLenum pixel_format; GLenum pixel_format;
@ -79,7 +79,7 @@ struct ClutterTexturePrivate
gboolean tiled; gboolean tiled;
ClutterTextureTileDimention *x_tiles, *y_tiles; ClutterTextureTileDimension *x_tiles, *y_tiles;
gint n_x_tiles, n_y_tiles; gint n_x_tiles, n_y_tiles;
GLuint *tiles; GLuint *tiles;
}; };
@ -146,7 +146,7 @@ static int
tile_dimension (int to_fill, tile_dimension (int to_fill,
int start_size, int start_size,
int waste, int waste,
ClutterTextureTileDimention *tiles) ClutterTextureTileDimension *tiles)
{ {
int pos = 0; int pos = 0;
int n_tiles = 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->n_x_tiles = tile_dimension (priv->width, x_pot,
priv->max_tile_waste, NULL); 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); tile_dimension (priv->width, x_pot, priv->max_tile_waste, priv->x_tiles);
if (priv->y_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->n_y_tiles = tile_dimension (priv->height, y_pot,
priv->max_tile_waste, NULL); 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); tile_dimension (priv->height, y_pot, priv->max_tile_waste, priv->y_tiles);
CLUTTER_NOTE (TEXTURE, CLUTTER_NOTE (TEXTURE,

View File

@ -32,31 +32,16 @@
G_BEGIN_DECLS 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(obj) \ #define CLUTTER_TEXTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TEXTURE, ClutterTextureClass))
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \ #define CLUTTER_IS_TEXTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TEXTURE))
CLUTTER_TYPE_TEXTURE, ClutterTexture)) #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_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 _ClutterTexture ClutterTexture;
typedef struct _ClutterTextureClass ClutterTextureClass; typedef struct _ClutterTextureClass ClutterTextureClass;
typedef struct ClutterTexturePrivate ClutterTexturePrivate; typedef struct _ClutterTexturePrivate ClutterTexturePrivate;
struct _ClutterTexture struct _ClutterTexture
{ {
@ -75,53 +60,44 @@ struct _ClutterTextureClass
void (*pixbuf_change) (ClutterTexture *texture); 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); ClutterActor *clutter_texture_new (void);
ClutterActor *clutter_texture_new_from_pixbuf (GdkPixbuf *pixbuf);
void void clutter_texture_set_from_data (ClutterTexture *texture,
clutter_texture_set_from_data (ClutterTexture *texture,
const guchar *data, const guchar *data,
gboolean has_alpha, gboolean has_alpha,
gint width, gint width,
gint height, gint height,
gint rowstride, gint rowstride,
gint bpp); gint bpp);
void clutter_texture_set_pixbuf (ClutterTexture *texture,
void clutter_texture_set_pixbuf (ClutterTexture *texture, GdkPixbuf *pixbuf); GdkPixbuf *pixbuf);
GdkPixbuf * clutter_texture_get_pixbuf (ClutterTexture *texture);
GdkPixbuf *clutter_texture_get_pixbuf (ClutterTexture* texture);
void clutter_texture_get_base_size (ClutterTexture *texture, void clutter_texture_get_base_size (ClutterTexture *texture,
gint *width, gint *width,
gint *height); gint *height);
/* Below mainly for subclassed texture based actors */ /* Below mainly for subclassed texture based actors */
void clutter_texture_bind_tile (ClutterTexture *texture, gint index); void clutter_texture_bind_tile (ClutterTexture *texture,
gint index);
void clutter_texture_get_n_tiles (ClutterTexture *texture, void clutter_texture_get_n_tiles (ClutterTexture *texture,
gint *n_x_tiles, gint *n_x_tiles,
gint *n_y_tiles); gint *n_y_tiles);
void clutter_texture_get_x_tile_detail (ClutterTexture *texture, void clutter_texture_get_x_tile_detail (ClutterTexture *texture,
gint x_index, gint x_index,
gint *pos, gint *pos,
gint *size, gint *size,
gint *waste); gint *waste);
void clutter_texture_get_y_tile_detail (ClutterTexture *texture, void clutter_texture_get_y_tile_detail (ClutterTexture *texture,
gint y_index, gint y_index,
gint *pos, gint *pos,
gint *size, gint *size,
gint *waste); gint *waste);
gboolean clutter_texture_has_generated_tiles (ClutterTexture *texture); 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 G_END_DECLS
#endif #endif /* _HAVE_CLUTTER_TEXTURE_H */