icontheme: Remove surface support
authorBenjamin Otte <otte@redhat.com>
Thu, 15 Mar 2018 02:47:19 +0000 (03:47 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 16 Mar 2018 05:04:45 +0000 (06:04 +0100)
It's not used anymore.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkicontheme.c
gtk/gtkicontheme.h

index 90d335a7598aaad5a5a605f10c850d6a9588edec..a653a7558abaf45fa82078b18a3d7b4bfdb617ef 100644 (file)
@@ -5078,7 +5078,6 @@ gtk_icon_theme_lookup_by_gicon
 gtk_icon_theme_lookup_by_gicon_for_scale
 gtk_icon_theme_load_icon
 gtk_icon_theme_load_icon_for_scale
-gtk_icon_theme_load_surface
 gtk_icon_theme_list_contexts
 gtk_icon_theme_list_icons
 gtk_icon_theme_get_icon_sizes
@@ -5089,7 +5088,6 @@ gtk_icon_info_get_base_size
 gtk_icon_info_get_base_scale
 gtk_icon_info_get_filename
 gtk_icon_info_load_icon
-gtk_icon_info_load_surface
 gtk_icon_info_load_texture
 gtk_icon_info_load_icon_async
 gtk_icon_info_load_icon_finish
index 7d54ff450f0c0f49b9253e337c186589ba45ba65..7df11009732c0429d5a09b87aa38c58fa67c61de 100644 (file)
@@ -2266,68 +2266,6 @@ gtk_icon_theme_load_icon_for_scale (GtkIconTheme        *icon_theme,
   return pixbuf;
 }
 
-/**
- * gtk_icon_theme_load_surface:
- * @icon_theme: a #GtkIconTheme
- * @icon_name: the name of the icon to lookup
- * @size: the desired icon size. The resulting icon may not be
- *     exactly this size; see gtk_icon_info_load_icon().
- * @scale: desired scale
- * @for_window: (allow-none): #GdkWindow to optimize drawing for, or %NULL
- * @flags: flags modifying the behavior of the icon lookup
- * @error: (allow-none): Location to store error information on failure,
- *     or %NULL.
- *
- * Looks up an icon in an icon theme for a particular window scale,
- * scales it to the given size and renders it into a cairo surface. This is a
- * convenience function; if more details about the icon are needed,
- * use gtk_icon_theme_lookup_icon() followed by
- * gtk_icon_info_load_surface().
- *
- * Note that you probably want to listen for icon theme changes and
- * update the icon. This is usually done by connecting to the
- * GtkWidget::style-set signal.
- *
- * Returns: (nullable) (transfer full): the rendered icon; this may be
- *     a newly created icon or a new reference to an internal icon, so
- *     you must not modify the icon. Use cairo_surface_destroy() to
- *     release your reference to the icon. %NULL if the icon isn’t
- *     found.
- */
-cairo_surface_t *
-gtk_icon_theme_load_surface (GtkIconTheme        *icon_theme,
-                             const gchar         *icon_name,
-                             gint                 size,
-                             gint                 scale,
-                             GdkWindow           *for_window,
-                             GtkIconLookupFlags   flags,
-                             GError             **error)
-{
-  GtkIconInfo *icon_info;
-  cairo_surface_t *surface = NULL;
-  
-  g_return_val_if_fail (GTK_IS_ICON_THEME (icon_theme), NULL);
-  g_return_val_if_fail (icon_name != NULL, NULL);
-  g_return_val_if_fail ((flags & GTK_ICON_LOOKUP_NO_SVG) == 0 ||
-                        (flags & GTK_ICON_LOOKUP_FORCE_SVG) == 0, NULL);
-  g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-  g_return_val_if_fail (scale >= 1, NULL);
-
-  icon_info = gtk_icon_theme_lookup_icon_for_scale (icon_theme, icon_name, size, scale,
-                                                    flags | GTK_ICON_LOOKUP_USE_BUILTIN);
-  if (!icon_info)
-    {
-      g_set_error (error, GTK_ICON_THEME_ERROR,  GTK_ICON_THEME_NOT_FOUND,
-                   _("Icon “%s” not present in theme %s"), icon_name, icon_theme->priv->current_theme);
-      return NULL;
-    }
-
-  surface = gtk_icon_info_load_surface (icon_info, for_window, error);
-  g_object_unref (icon_info);
-
-  return surface;
-}
-
 /**
  * gtk_icon_theme_has_icon:
  * @icon_theme: a #GtkIconTheme
@@ -3935,51 +3873,6 @@ gtk_icon_info_load_texture (GtkIconInfo *icon_info)
   return g_object_ref (icon_info->texture);
 }
 
-/**
- * gtk_icon_info_load_surface:
- * @icon_info: a #GtkIconInfo from gtk_icon_theme_lookup_icon()
- * @for_window: (allow-none): #GdkWindow to optimize drawing for, or %NULL
- * @error: (allow-none): location for error information on failure, or %NULL
- *
- * Renders an icon previously looked up in an icon theme using
- * gtk_icon_theme_lookup_icon(); the size will be based on the size
- * passed to gtk_icon_theme_lookup_icon(). Note that the resulting
- * surface may not be exactly this size; an icon theme may have icons
- * that differ slightly from their nominal sizes, and in addition GTK+
- * will avoid scaling icons that it considers sufficiently close to the
- * requested size or for which the source image would have to be scaled
- * up too far. (This maintains sharpness.). This behaviour can be changed
- * by passing the %GTK_ICON_LOOKUP_FORCE_SIZE flag when obtaining
- * the #GtkIconInfo. If this flag has been specified, the pixbuf
- * returned by this function will be scaled to the exact size.
- *
- * Returns: (transfer full): the rendered icon; this may be a newly
- *     created icon or a new reference to an internal icon, so you must
- *     not modify the icon. Use cairo_surface_destroy() to release your
- *     reference to the icon.
- */
-cairo_surface_t *
-gtk_icon_info_load_surface (GtkIconInfo  *icon_info,
-                            GdkWindow    *for_window,
-                            GError      **error)
-{
-  GdkPixbuf *pixbuf;
-  cairo_surface_t *surface;
-
-  g_return_val_if_fail (icon_info != NULL, NULL);
-  g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
-  pixbuf = gtk_icon_info_load_icon (icon_info, error);
-
-  if (pixbuf == NULL)
-    return NULL;
-
-  surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, icon_info->desired_scale, for_window);
-  g_object_unref (pixbuf);
-
-  return surface;
-}
-
 static void
 load_icon_thread  (GTask        *task,
                    gpointer      source_object,
index f5167c2465b8501c5bd1e3d99f0500c4e922c6ae..b618ffec0d8dbee35ec0821e37a426b2c5d26ef6 100644 (file)
@@ -239,14 +239,6 @@ GdkPixbuf *   gtk_icon_theme_load_icon_for_scale   (GtkIconTheme
                                                     gint                         scale,
                                                     GtkIconLookupFlags           flags,
                                                     GError                     **error);
-GDK_AVAILABLE_IN_ALL
-cairo_surface_t * gtk_icon_theme_load_surface      (GtkIconTheme        *icon_theme,
-                                                   const gchar         *icon_name,
-                                                   gint                 size,
-                                                   gint                 scale,
-                                                   GdkWindow           *for_window,
-                                                   GtkIconLookupFlags   flags,
-                                                   GError             **error);
 
 GDK_AVAILABLE_IN_ALL
 GtkIconInfo * gtk_icon_theme_lookup_by_gicon       (GtkIconTheme                *icon_theme,
@@ -291,10 +283,6 @@ GDK_AVAILABLE_IN_ALL
 GdkPixbuf *           gtk_icon_info_load_icon          (GtkIconInfo   *icon_info,
                                                        GError       **error);
 GDK_AVAILABLE_IN_ALL
-cairo_surface_t *     gtk_icon_info_load_surface       (GtkIconInfo   *icon_info,
-                                                       GdkWindow     *for_window,
-                                                       GError       **error);
-GDK_AVAILABLE_IN_ALL
 GdkTexture *          gtk_icon_info_load_texture       (GtkIconInfo   *icon_info);
 
 GDK_AVAILABLE_IN_ALL