]> spindle.queued.net Git - midori/commitdiff
Remove unused gdk_pixbuf_new_from_stream and sokoke_web_icon
authorChristian Dywan <christian@twotoasts.de>
Thu, 6 Nov 2008 00:36:57 +0000 (01:36 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 6 Nov 2008 00:36:57 +0000 (01:36 +0100)
midori/compat.c
midori/compat.h
midori/sokoke.c
midori/sokoke.h

index e51fc09502b2b1da2b453f1b6c614b9ddfde64a7..20fdc2dfedc2b985d5de833bfcf70e50217e7ad4 100644 (file)
@@ -29,88 +29,6 @@ g_strcmp0 (const gchar* string1,
 
 #endif
 
-#if !GTK_CHECK_VERSION(2, 14, 0)
-
-#if GLIB_CHECK_VERSION (2, 16, 0)
-
-/* GTK+/ GdkPixbuf internal helper function
-   Copyright (C) 2008 Matthias Clasen <mclasen@redhat.com>
-   Copied from Gtk+ 2.13, coding style adjusted */
-
-static GdkPixbuf*
-load_from_stream (GdkPixbufLoader* loader,
-                  GInputStream*    stream,
-                  GCancellable*    cancellable,
-                  GError**         error)
-{
-    GdkPixbuf* pixbuf;
-    gssize n_read;
-    guchar buffer[65536];
-    gboolean res;
-
-    res = TRUE;
-    while (1)
-    {
-        n_read = g_input_stream_read (stream, buffer, sizeof (buffer),
-                                      cancellable, error);
-        if (n_read < 0)
-        {
-            res = FALSE;
-            error = NULL; /* Ignore further errors */
-            break;
-        }
-
-        if (!n_read)
-            break;
-
-        if (!gdk_pixbuf_loader_write (loader, buffer, n_read,
-                                      error))
-        {
-            res = FALSE;
-            error = NULL;
-            break;
-        }
-    }
-
-    if (!gdk_pixbuf_loader_close (loader, error))
-    {
-        res = FALSE;
-        error = NULL;
-    }
-
-    pixbuf = NULL;
-    if (res)
-    {
-        pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
-        if (pixbuf)
-        g_object_ref (pixbuf);
-    }
-
-    return pixbuf;
-}
-
-/* GTK+/ GdkPixbuf stream loading function
-   Copyright (C) 2008 Matthias Clasen <mclasen@redhat.com>
-   Copied from Gtk+ 2.13, coding style adjusted */
-GdkPixbuf*
-gdk_pixbuf_new_from_stream (GInputStream* stream,
-                            GCancellable* cancellable,
-                            GError**      error)
-{
-    GdkPixbuf* pixbuf;
-    GdkPixbufLoader* loader;
-
-    loader = gdk_pixbuf_loader_new ();
-    pixbuf = load_from_stream (loader, stream, cancellable, error);
-    g_object_unref (loader);
-
-    return pixbuf;
-}
-
-#endif
-
-#endif
-
 #if !GTK_CHECK_VERSION(2, 12, 0)
 
 void
index 423b2236a93ec581f8ecc096e65b36d7a337d959..68cda3605c73826c59bf2ab72ec9af79203c1eb9 100644 (file)
@@ -32,19 +32,6 @@ g_strcmp0 (const gchar* string1,
 
 #endif
 
-#if !GTK_CHECK_VERSION (2, 14, 0)
-
-#if GLIB_CHECK_VERSION (2, 16, 0)
-
-GdkPixbuf*
-gdk_pixbuf_new_from_stream (GInputStream* stream,
-                            GCancellable* cancellable,
-                            GError**      error);
-
-#endif
-
-#endif
-
 #if !GTK_CHECK_VERSION(2, 12, 0)
 
 void
index 3403669857c447f3165fc9a3a6471b440ddd7302..5310cf4c1566c133b377f98e68f79d7eb2299d33 100644 (file)
@@ -474,44 +474,6 @@ sokoke_widget_get_text_size (GtkWidget*   widget,
     g_object_unref (layout);
 }
 
-GdkPixbuf*
-sokoke_web_icon (const gchar* icon,
-                 GtkIconSize  size,
-                 GtkWidget*   widget)
-{
-    g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-
-    GdkPixbuf* pixbuf = NULL;
-    if (icon && *icon)
-    {
-        /* TODO: We want to allow http as well, maybe also base64? */
-        const gchar* icon_ready = g_str_has_prefix (icon, "file://")
-            ? &icon[7] : icon;
-        GtkStockItem stock_id;
-        if (gtk_stock_lookup (icon, &stock_id))
-            pixbuf = gtk_widget_render_icon (widget, icon_ready, size, NULL);
-        else
-        {
-            gint width, height;
-            if (gtk_widget_has_screen (widget))
-            {
-                GdkScreen* screen = gtk_widget_get_screen (widget);
-                gtk_icon_size_lookup_for_settings (
-                    gtk_settings_get_for_screen (screen),
-                    size, &width, &height);
-                pixbuf = gtk_icon_theme_load_icon (
-                    gtk_icon_theme_get_for_screen (screen), icon,
-                    MAX (width, height), GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
-            }
-        }
-        if (!pixbuf)
-            pixbuf = gdk_pixbuf_new_from_file_at_size (icon_ready, 16, 16, NULL);
-    }
-    if (!pixbuf)
-        pixbuf = gtk_widget_render_icon (widget, GTK_STOCK_FIND, size, NULL);
-    return pixbuf;
-}
-
 gint
 sokoke_object_get_int (gpointer     object,
                        const gchar* property)
index 0f69217b0a645f6ae1c6323be7144f299a8f2a33..526e9b3faf529631fa14049c4eaa15e49e3f31a4 100644 (file)
@@ -115,11 +115,6 @@ sokoke_widget_get_text_size          (GtkWidget*     widget,
                                       gint*          width,
                                       gint*          height);
 
-GdkPixbuf*
-sokoke_web_icon                      (const gchar*   icon,
-                                      GtkIconSize    size,
-                                      GtkWidget*     widget);
-
 gint
 sokoke_object_get_int                (gpointer       object,
                                       const gchar*   property);