diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-01-20 14:35:16 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-01-20 14:35:16 +0100 |
commit | 484c9a1bacd254795703c014a170b5801a1f3104 (patch) | |
tree | 937e81fd4b005b9be438ed50748ef79ceb4b1e44 | |
parent | 129d90ebcd83efd7d7f2ebc75c77922bd9771b9d (diff) | |
download | nautilus-484c9a1bacd254795703c014a170b5801a1f3104.tar.gz |
eel: remove eel-gdk-pixbuf-extensions
-rw-r--r-- | eel/Makefile.am | 2 | ||||
-rw-r--r-- | eel/eel-gdk-pixbuf-extensions.c | 121 | ||||
-rw-r--r-- | eel/eel-gdk-pixbuf-extensions.h | 36 |
3 files changed, 0 insertions, 159 deletions
diff --git a/eel/Makefile.am b/eel/Makefile.am index ff5a772e8..457e33601 100644 --- a/eel/Makefile.am +++ b/eel/Makefile.am @@ -39,7 +39,6 @@ eel_headers = \ eel-debug.h \ eel-editable-label.h \ eel-gdk-extensions.h \ - eel-gdk-pixbuf-extensions.h \ eel-glib-extensions.h \ eel-gnome-extensions.h \ eel-graphic-effects.h \ @@ -61,7 +60,6 @@ libeel_2_la_SOURCES = \ eel-debug.c \ eel-editable-label.c \ eel-gdk-extensions.c \ - eel-gdk-pixbuf-extensions.c \ eel-glib-extensions.c \ eel-gnome-extensions.c \ eel-graphic-effects.c \ diff --git a/eel/eel-gdk-pixbuf-extensions.c b/eel/eel-gdk-pixbuf-extensions.c deleted file mode 100644 index 3a7fe9d7a..000000000 --- a/eel/eel-gdk-pixbuf-extensions.c +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* eel-gdk-pixbuf-extensions.c: Routines to augment what's in gdk-pixbuf. - - Copyright (C) 2000 Eazel, Inc. - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - Authors: Darin Adler <darin@eazel.com> - Ramiro Estrugo <ramiro@eazel.com> -*/ - -#include <config.h> -#include "eel-gdk-pixbuf-extensions.h" - -#include "eel-debug.h" -#include "eel-gdk-extensions.h" -#include "eel-glib-extensions.h" -#include "eel-graphic-effects.h" -#include "eel-lib-self-check-functions.h" -#include "eel-string.h" -#include <gdk-pixbuf/gdk-pixbuf.h> -#include <gdk/gdkprivate.h> -#include <gdk/gdkx.h> -#include <gio/gio.h> -#include <math.h> -#include <stdlib.h> -#include <stdio.h> - -#define LOAD_BUFFER_SIZE 65536 - -static void -pixbuf_loader_size_prepared (GdkPixbufLoader *loader, - int width, - int height, - gpointer desired_size_ptr) -{ - int size, desired_size; - float scale; - - size = MAX (width, height); - desired_size = GPOINTER_TO_INT (desired_size_ptr); - - if (size != desired_size) { - scale = (float) desired_size / size; - gdk_pixbuf_loader_set_size (loader, - floor (scale * width + 0.5), - floor (scale * height + 0.5)); - } -} - -GdkPixbuf * -eel_gdk_pixbuf_load_from_stream_at_size (GInputStream *stream, - int size) -{ - char buffer[LOAD_BUFFER_SIZE]; - gssize bytes_read; - GdkPixbufLoader *loader; - GdkPixbuf *pixbuf; - gboolean got_eos; - - - g_return_val_if_fail (stream != NULL, NULL); - - got_eos = FALSE; - loader = gdk_pixbuf_loader_new (); - - if (size > 0) { - g_signal_connect (loader, "size-prepared", - G_CALLBACK (pixbuf_loader_size_prepared), - GINT_TO_POINTER (size)); - } - - while (1) { - bytes_read = g_input_stream_read (stream, buffer, sizeof (buffer), - NULL, NULL); - - if (bytes_read < 0) { - break; - } - if (bytes_read == 0) { - got_eos = TRUE; - break; - } - if (!gdk_pixbuf_loader_write (loader, - buffer, - bytes_read, - NULL)) { - break; - } - } - - g_input_stream_close (stream, NULL, NULL); - gdk_pixbuf_loader_close (loader, NULL); - - pixbuf = NULL; - if (got_eos) { - pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); - if (pixbuf != NULL) { - g_object_ref (pixbuf); - } - } - - g_object_unref (loader); - - return pixbuf; -} - diff --git a/eel/eel-gdk-pixbuf-extensions.h b/eel/eel-gdk-pixbuf-extensions.h deleted file mode 100644 index 26018714f..000000000 --- a/eel/eel-gdk-pixbuf-extensions.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* eel-gdk-pixbuf-extensions.h: Routines to augment what's in gdk-pixbuf. - - Copyright (C) 2000 Eazel, Inc. - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome Library is distributed in the hope that it will be useful, - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - Authors: Darin Adler <darin@eazel.com> - Ramiro Estrugo <ramiro@eazel.com> -*/ - -#ifndef EEL_GDK_PIXBUF_EXTENSIONS_H -#define EEL_GDK_PIXBUF_EXTENSIONS_H - -#include <gdk-pixbuf/gdk-pixbuf.h> -#include <gdk/gdk.h> -#include <gio/gio.h> - -/* Loading a GdkPixbuf with a URI. */ -GdkPixbuf * eel_gdk_pixbuf_load_from_stream_at_size (GInputStream *stream, - int size); - -#endif /* EEL_GDK_PIXBUF_EXTENSIONS_H */ |