forked from AuroraMiddleware/gtk
Bug 561186 – GdkPixbuf API type checking needs cleanup
2008-11-30 Christian Dywan <christian@imendio.com> Bug 561186 – GdkPixbuf API type checking needs cleanup * gdk-pixbuf-loader.c (gdk_pixbuf_loader_write), (gdk_pixbuf_loader_get_pixbuf), (gdk_pixbuf_loader_get_animation), (gdk_pixbuf_loader_close), (gdk_pixbuf_loader_get_format): * gdk-pixbuf-scale.c (gdk_pixbuf_scale), (gdk_pixbuf_composite), (gdk_pixbuf_composite_color), (gdk_pixbuf_scale_simple), (gdk_pixbuf_composite_color_simple): * gdk-pixbuf-simple-anim.c (gdk_pixbuf_simple_anim_add_frame): * gdk-pixbuf-util.c (gdk_pixbuf_add_alpha), (gdk_pixbuf_apply_embedded_orientation): Improve type checking in pixbuf API svn path=/trunk/; revision=21832
This commit is contained in:
parent
c8392add22
commit
2dea920895
@ -1,3 +1,18 @@
|
||||
2008-11-30 Christian Dywan <christian@imendio.com>
|
||||
|
||||
Bug 561186 – GdkPixbuf API type checking needs cleanup
|
||||
|
||||
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_write),
|
||||
(gdk_pixbuf_loader_get_pixbuf), (gdk_pixbuf_loader_get_animation),
|
||||
(gdk_pixbuf_loader_close), (gdk_pixbuf_loader_get_format):
|
||||
* gdk-pixbuf-scale.c (gdk_pixbuf_scale), (gdk_pixbuf_composite),
|
||||
(gdk_pixbuf_composite_color), (gdk_pixbuf_scale_simple),
|
||||
(gdk_pixbuf_composite_color_simple):
|
||||
* gdk-pixbuf-simple-anim.c (gdk_pixbuf_simple_anim_add_frame):
|
||||
* gdk-pixbuf-util.c (gdk_pixbuf_add_alpha),
|
||||
(gdk_pixbuf_apply_embedded_orientation):
|
||||
Improve type checking in pixbuf API
|
||||
|
||||
2008-10-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Bug 555791 – Natuilus Crashes when opening USB MP3 Player Contents
|
||||
|
@ -446,7 +446,6 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
|
||||
{
|
||||
GdkPixbufLoaderPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (loader != NULL, FALSE);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), FALSE);
|
||||
|
||||
g_return_val_if_fail (buf != NULL, FALSE);
|
||||
@ -632,7 +631,6 @@ gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader)
|
||||
{
|
||||
GdkPixbufLoaderPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (loader != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL);
|
||||
|
||||
priv = loader->priv;
|
||||
@ -661,7 +659,6 @@ gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader)
|
||||
{
|
||||
GdkPixbufLoaderPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (loader != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL);
|
||||
|
||||
priv = loader->priv;
|
||||
@ -694,7 +691,6 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
|
||||
GdkPixbufLoaderPrivate *priv;
|
||||
gboolean retval = TRUE;
|
||||
|
||||
g_return_val_if_fail (loader != NULL, TRUE);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), TRUE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, TRUE);
|
||||
|
||||
@ -773,7 +769,6 @@ gdk_pixbuf_loader_get_format (GdkPixbufLoader *loader)
|
||||
{
|
||||
GdkPixbufLoaderPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (loader != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL);
|
||||
|
||||
priv = loader->priv;
|
||||
|
@ -70,8 +70,8 @@ gdk_pixbuf_scale (const GdkPixbuf *src,
|
||||
double scale_y,
|
||||
GdkInterpType interp_type)
|
||||
{
|
||||
g_return_if_fail (src != NULL);
|
||||
g_return_if_fail (dest != NULL);
|
||||
g_return_if_fail (GDK_IS_PIXBUF (src));
|
||||
g_return_if_fail (GDK_IS_PIXBUF (dest));
|
||||
g_return_if_fail (dest_x >= 0 && dest_x + dest_width <= dest->width);
|
||||
g_return_if_fail (dest_y >= 0 && dest_y + dest_height <= dest->height);
|
||||
|
||||
@ -130,8 +130,8 @@ gdk_pixbuf_composite (const GdkPixbuf *src,
|
||||
GdkInterpType interp_type,
|
||||
int overall_alpha)
|
||||
{
|
||||
g_return_if_fail (src != NULL);
|
||||
g_return_if_fail (dest != NULL);
|
||||
g_return_if_fail (GDK_IS_PIXBUF (src));
|
||||
g_return_if_fail (GDK_IS_PIXBUF (dest));
|
||||
g_return_if_fail (dest_x >= 0 && dest_x + dest_width <= dest->width);
|
||||
g_return_if_fail (dest_y >= 0 && dest_y + dest_height <= dest->height);
|
||||
g_return_if_fail (overall_alpha >= 0 && overall_alpha <= 255);
|
||||
@ -197,8 +197,8 @@ gdk_pixbuf_composite_color (const GdkPixbuf *src,
|
||||
guint32 color1,
|
||||
guint32 color2)
|
||||
{
|
||||
g_return_if_fail (src != NULL);
|
||||
g_return_if_fail (dest != NULL);
|
||||
g_return_if_fail (GDK_IS_PIXBUF (src));
|
||||
g_return_if_fail (GDK_IS_PIXBUF (dest));
|
||||
g_return_if_fail (dest_x >= 0 && dest_x + dest_width <= dest->width);
|
||||
g_return_if_fail (dest_y >= 0 && dest_y + dest_height <= dest->height);
|
||||
g_return_if_fail (overall_alpha >= 0 && overall_alpha <= 255);
|
||||
@ -247,7 +247,7 @@ gdk_pixbuf_scale_simple (const GdkPixbuf *src,
|
||||
{
|
||||
GdkPixbuf *dest;
|
||||
|
||||
g_return_val_if_fail (src != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (src), NULL);
|
||||
g_return_val_if_fail (dest_width > 0, NULL);
|
||||
g_return_val_if_fail (dest_height > 0, NULL);
|
||||
|
||||
@ -293,7 +293,7 @@ gdk_pixbuf_composite_color_simple (const GdkPixbuf *src,
|
||||
{
|
||||
GdkPixbuf *dest;
|
||||
|
||||
g_return_val_if_fail (src != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (src), NULL);
|
||||
g_return_val_if_fail (dest_width > 0, NULL);
|
||||
g_return_val_if_fail (dest_height > 0, NULL);
|
||||
g_return_val_if_fail (overall_alpha >= 0 && overall_alpha <= 255, NULL);
|
||||
|
@ -423,8 +423,8 @@ gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation,
|
||||
GdkPixbufFrame *frame;
|
||||
int nframe = 0;
|
||||
|
||||
g_return_if_fail (animation != NULL);
|
||||
g_return_if_fail (pixbuf != NULL);
|
||||
g_return_if_fail (GDK_IS_PIXBUF_SIMPLE_ANIM (animation));
|
||||
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
|
||||
|
||||
nframe = g_list_length (animation->frames);
|
||||
|
||||
@ -432,7 +432,7 @@ gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation,
|
||||
frame->delay_time = (gint) (1000 / animation->rate);
|
||||
frame->elapsed = (gint) (frame->delay_time * nframe);
|
||||
animation->total_time += frame->delay_time;
|
||||
frame->pixbuf = GDK_PIXBUF (g_object_ref (pixbuf));
|
||||
frame->pixbuf = g_object_ref (pixbuf);
|
||||
|
||||
animation->frames = g_list_append (animation->frames, frame);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ gdk_pixbuf_add_alpha (const GdkPixbuf *pixbuf,
|
||||
GdkPixbuf *new_pixbuf;
|
||||
int x, y;
|
||||
|
||||
g_return_val_if_fail (pixbuf != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
|
||||
g_return_val_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB, NULL);
|
||||
g_return_val_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4, NULL);
|
||||
g_return_val_if_fail (pixbuf->bits_per_sample == 8, NULL);
|
||||
@ -277,7 +277,7 @@ gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src)
|
||||
GdkPixbuf *temp;
|
||||
GdkPixbuf *dest;
|
||||
|
||||
g_return_val_if_fail (src != NULL, NULL);
|
||||
g_return_val_if_fail (GDK_IS_PIXBUF (src), NULL);
|
||||
|
||||
/* Read the orientation option associated with the pixbuf */
|
||||
orientation_string = gdk_pixbuf_get_option (src, "orientation");
|
||||
|
Loading…
Reference in New Issue
Block a user