summaryrefslogtreecommitdiff
path: root/gtk/a11y/gtkimageaccessible.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/a11y/gtkimageaccessible.c')
-rw-r--r--gtk/a11y/gtkimageaccessible.c42
1 files changed, 3 insertions, 39 deletions
diff --git a/gtk/a11y/gtkimageaccessible.c b/gtk/a11y/gtkimageaccessible.c
index a83a9934f9..696eb17dcb 100644
--- a/gtk/a11y/gtkimageaccessible.c
+++ b/gtk/a11y/gtkimageaccessible.c
@@ -20,7 +20,7 @@
#include <string.h>
#include <gtk/gtk.h>
#include "gtkimageaccessible.h"
-#include "gtktoolbarprivate.h"
+#include "gtkimageprivate.h"
#include "gtkintl.h"
struct _GtkImageAccessiblePrivate
@@ -252,7 +252,6 @@ gtk_image_accessible_get_image_size (AtkImage *image,
{
GtkWidget* widget;
GtkImage *gtk_image;
- GtkImageType image_type;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (image));
if (widget == NULL)
@@ -264,43 +263,8 @@ gtk_image_accessible_get_image_size (AtkImage *image,
gtk_image = GTK_IMAGE (widget);
- image_type = gtk_image_get_storage_type (gtk_image);
- switch (image_type)
- {
- case GTK_IMAGE_PIXBUF:
- {
- GdkPixbuf *pixbuf;
-
- pixbuf = gtk_image_get_pixbuf (gtk_image);
- *height = gdk_pixbuf_get_height (pixbuf);
- *width = gdk_pixbuf_get_width (pixbuf);
- break;
- }
- case GTK_IMAGE_ICON_NAME:
- case GTK_IMAGE_GICON:
- {
- GtkIconSize size;
-
- g_object_get (gtk_image, "icon-size", &size, NULL);
- gtk_icon_size_lookup (size, width, height);
- break;
- }
- case GTK_IMAGE_ANIMATION:
- {
- GdkPixbufAnimation *animation;
-
- animation = gtk_image_get_animation (gtk_image);
- *height = gdk_pixbuf_animation_get_height (animation);
- *width = gdk_pixbuf_animation_get_width (animation);
- break;
- }
- default:
- {
- *height = -1;
- *width = -1;
- break;
- }
- }
+ if (gtk_image_get_storage_type (gtk_image) != GTK_IMAGE_EMPTY)
+ gtk_image_get_image_size (gtk_image, width, height);
}
static gboolean