diff options
-rw-r--r-- | gtk/gtkcellrendererpixbuf.c | 15 | ||||
-rw-r--r-- | gtk/gtkentry.c | 1 | ||||
-rw-r--r-- | gtk/gtkiconhelper.c | 47 | ||||
-rw-r--r-- | gtk/gtkiconhelperprivate.h | 3 | ||||
-rw-r--r-- | gtk/gtkimage.c | 1 | ||||
-rw-r--r-- | gtk/gtkimage.h | 3 | ||||
-rw-r--r-- | gtk/gtkimagedefinition.c | 37 | ||||
-rw-r--r-- | gtk/gtkimagedefinitionprivate.h | 2 |
8 files changed, 6 insertions, 103 deletions
diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c index 3cca5e5555..083a7ff2d0 100644 --- a/gtk/gtkcellrendererpixbuf.c +++ b/gtk/gtkcellrendererpixbuf.c @@ -240,7 +240,7 @@ gtk_cell_renderer_pixbuf_get_property (GObject *object, g_value_set_object (value, priv->pixbuf_expander_closed); break; case PROP_TEXTURE: - g_value_set_object (value, gtk_image_definition_get_texture (priv->image_def)); + g_value_set_object (value, gtk_image_definition_get_paintable (priv->image_def)); break; case PROP_ICON_SIZE: g_value_set_enum (value, priv->icon_size); @@ -263,11 +263,8 @@ notify_storage_type (GtkCellRendererPixbuf *cellpixbuf, { switch (storage_type) { - case GTK_IMAGE_TEXTURE: - g_object_notify (G_OBJECT (cellpixbuf), "texture"); - break; case GTK_IMAGE_PAINTABLE: - g_object_notify (G_OBJECT (cellpixbuf), "paintable"); + g_object_notify (G_OBJECT (cellpixbuf), "texture"); break; case GTK_IMAGE_ICON_NAME: g_object_notify (G_OBJECT (cellpixbuf), "icon-name"); @@ -335,7 +332,7 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object, texture = gdk_texture_new_for_pixbuf (pixbuf); else texture = NULL; - take_image_definition (cellpixbuf, gtk_image_definition_new_texture (texture)); + take_image_definition (cellpixbuf, gtk_image_definition_new_paintable (GDK_PAINTABLE (texture))); break; case PROP_PIXBUF_EXPANDER_OPEN: if (priv->pixbuf_expander_open) @@ -348,7 +345,7 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object, priv->pixbuf_expander_closed = (GdkPixbuf*) g_value_dup_object (value); break; case PROP_TEXTURE: - take_image_definition (cellpixbuf, gtk_image_definition_new_texture (g_value_get_object (value))); + take_image_definition (cellpixbuf, gtk_image_definition_new_paintable (g_value_get_object (value))); break; case PROP_ICON_SIZE: gtk_cell_renderer_pixbuf_set_icon_size (cellpixbuf, g_value_get_enum (value)); @@ -530,14 +527,14 @@ gtk_cell_renderer_pixbuf_snapshot (GtkCellRenderer *cell, { icon_helper = gtk_icon_helper_new (gtk_style_context_get_node (context), widget); texture = gdk_texture_new_for_pixbuf (priv->pixbuf_expander_open); - _gtk_icon_helper_set_texture (icon_helper, texture); + _gtk_icon_helper_set_paintable (icon_helper, GDK_PAINTABLE (texture)); g_object_unref (texture); } else if (!is_expanded && priv->pixbuf_expander_closed != NULL) { icon_helper = gtk_icon_helper_new (gtk_style_context_get_node (context), widget); texture = gdk_texture_new_for_pixbuf (priv->pixbuf_expander_closed); - _gtk_icon_helper_set_texture (icon_helper, texture); + _gtk_icon_helper_set_paintable (icon_helper, GDK_PAINTABLE (texture)); g_object_unref (texture); } else diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index dfbb95ae86..8cdac60e2c 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -6555,7 +6555,6 @@ gtk_entry_clear_icon (GtkEntry *entry, : PROP_GICON_SECONDARY]); break; - case GTK_IMAGE_TEXTURE: case GTK_IMAGE_EMPTY: default: g_assert_not_reached (); diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index c9aff693b6..6959268096 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -104,16 +104,6 @@ get_icon_lookup_flags (GtkIconHelper *self, } static GdkPaintable * -ensure_paintable_from_texture (GtkIconHelper *self, - GdkTexture *texture, - int *scale) -{ - *scale = gtk_image_definition_get_storage_type (self->def); - - return g_object_ref (GDK_PAINTABLE (texture)); -} - -static GdkPaintable * ensure_paintable_from_paintable (GtkIconHelper *self, GdkPaintable *paintable, int *scale) @@ -171,11 +161,6 @@ gtk_icon_helper_load_paintable (GtkIconHelper *self, switch (gtk_image_definition_get_storage_type (self->def)) { - case GTK_IMAGE_TEXTURE: - paintable = ensure_paintable_from_texture (self, gtk_image_definition_get_texture (self->def), &scale); - symbolic = FALSE; - break; - case GTK_IMAGE_PAINTABLE: paintable = ensure_paintable_from_paintable (self, gtk_image_definition_get_paintable (self->def), &scale); symbolic = FALSE; @@ -273,7 +258,6 @@ gtk_icon_helper_paintable_snapshot (GdkPaintable *paintable, } break; - case GTK_IMAGE_TEXTURE: case GTK_IMAGE_PAINTABLE: case GTK_IMAGE_EMPTY: default: @@ -305,9 +289,6 @@ gtk_icon_helper_paintable_get_intrinsic_width (GdkPaintable *paintable) switch (gtk_image_definition_get_storage_type (self->def)) { - case GTK_IMAGE_TEXTURE: - return gdk_paintable_get_intrinsic_width (GDK_PAINTABLE (gtk_image_definition_get_texture (self->def))); - case GTK_IMAGE_PAINTABLE: return gdk_paintable_get_intrinsic_width (gtk_image_definition_get_paintable (self->def)); @@ -337,9 +318,6 @@ gtk_icon_helper_paintable_get_intrinsic_height (GdkPaintable *paintable) switch (gtk_image_definition_get_storage_type (self->def)) { - case GTK_IMAGE_TEXTURE: - return gdk_paintable_get_intrinsic_height (GDK_PAINTABLE (gtk_image_definition_get_texture (self->def))); - case GTK_IMAGE_PAINTABLE: return gdk_paintable_get_intrinsic_height (gtk_image_definition_get_paintable (self->def)); @@ -368,9 +346,6 @@ static double gtk_icon_helper_paintable_get_intrinsic_aspect_ratio (GdkPaintable switch (gtk_image_definition_get_storage_type (self->def)) { - case GTK_IMAGE_TEXTURE: - return gdk_paintable_get_intrinsic_aspect_ratio (GDK_PAINTABLE (gtk_image_definition_get_texture (self->def))); - case GTK_IMAGE_PAINTABLE: return gdk_paintable_get_intrinsic_aspect_ratio (gtk_image_definition_get_paintable (self->def)); @@ -551,7 +526,6 @@ gtk_icon_helper_measure (GtkIconHelper *self, } break; - case GTK_IMAGE_TEXTURE: case GTK_IMAGE_ICON_NAME: case GTK_IMAGE_GICON: case GTK_IMAGE_EMPTY: @@ -626,14 +600,6 @@ _gtk_icon_helper_get_size (GtkIconHelper *self, width = height = get_default_size (self); break; - case GTK_IMAGE_TEXTURE: - { - GdkTexture *texture = gtk_image_definition_get_texture (self->def); - width = gdk_texture_get_width (texture); - height = gdk_texture_get_height (texture); - } - break; - case GTK_IMAGE_PAINTABLE: { GdkPaintable *paintable = gtk_image_definition_get_paintable (self->def); @@ -693,13 +659,6 @@ _gtk_icon_helper_set_icon_name (GtkIconHelper *self, } void -_gtk_icon_helper_set_texture (GtkIconHelper *self, - GdkTexture *texture) -{ - gtk_icon_helper_take_definition (self, gtk_image_definition_new_texture (texture)); -} - -void _gtk_icon_helper_set_paintable (GtkIconHelper *self, GdkPaintable *paintable) { @@ -762,12 +721,6 @@ _gtk_icon_helper_peek_gicon (GtkIconHelper *self) return gtk_image_definition_get_gicon (self->def); } -GdkTexture * -_gtk_icon_helper_peek_texture (GtkIconHelper *self) -{ - return gtk_image_definition_get_texture (self->def); -} - GdkPaintable * _gtk_icon_helper_peek_paintable (GtkIconHelper *self) { diff --git a/gtk/gtkiconhelperprivate.h b/gtk/gtkiconhelperprivate.h index 2e6846c266..b2d7b819e9 100644 --- a/gtk/gtkiconhelperprivate.h +++ b/gtk/gtkiconhelperprivate.h @@ -46,8 +46,6 @@ void _gtk_icon_helper_set_gicon (GtkIconHelper *self, void _gtk_icon_helper_set_icon_name (GtkIconHelper *self, const gchar *icon_name); -void _gtk_icon_helper_set_texture (GtkIconHelper *self, - GdkTexture *texture); void _gtk_icon_helper_set_paintable (GtkIconHelper *self, GdkPaintable *paintable); @@ -61,7 +59,6 @@ gint _gtk_icon_helper_get_pixel_size (GtkIconHelper *self); gboolean _gtk_icon_helper_get_use_fallback (GtkIconHelper *self); GIcon *_gtk_icon_helper_peek_gicon (GtkIconHelper *self); -GdkTexture *_gtk_icon_helper_peek_texture (GtkIconHelper *self); GdkPaintable *_gtk_icon_helper_peek_paintable (GtkIconHelper *self); GtkImageDefinition *gtk_icon_helper_get_definition (GtkIconHelper *self); diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index f56ea2b1e0..863f88aebd 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -1205,7 +1205,6 @@ gtk_image_notify_for_storage_type (GtkImage *image, case GTK_IMAGE_PAINTABLE: g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_PAINTABLE]); break; - case GTK_IMAGE_TEXTURE: case GTK_IMAGE_EMPTY: default: break; diff --git a/gtk/gtkimage.h b/gtk/gtkimage.h index f6f3db12a0..f991e188ee 100644 --- a/gtk/gtkimage.h +++ b/gtk/gtkimage.h @@ -55,8 +55,6 @@ typedef struct _GtkImageClass GtkImageClass; * This image type was added in GTK+ 2.6 * @GTK_IMAGE_GICON: the widget contains a #GIcon. * This image type was added in GTK+ 2.14 - * @GTK_IMAGE_TEXTURE: the widget contains a #GdkTexture. - * This image type was added in GTK+ 3.94 * @GTK_IMAGE_PAINTABLE: the widget contains a #GdkPaintable. * This image type was added in GTK+ 3.96 * @@ -73,7 +71,6 @@ typedef enum GTK_IMAGE_EMPTY, GTK_IMAGE_ICON_NAME, GTK_IMAGE_GICON, - GTK_IMAGE_TEXTURE, GTK_IMAGE_PAINTABLE } GtkImageType; diff --git a/gtk/gtkimagedefinition.c b/gtk/gtkimagedefinition.c index 059b41820d..5c2d617164 100644 --- a/gtk/gtkimagedefinition.c +++ b/gtk/gtkimagedefinition.c @@ -22,7 +22,6 @@ typedef struct _GtkImageDefinitionEmpty GtkImageDefinitionEmpty; typedef struct _GtkImageDefinitionIconName GtkImageDefinitionIconName; typedef struct _GtkImageDefinitionGIcon GtkImageDefinitionGIcon; -typedef struct _GtkImageDefinitionTexture GtkImageDefinitionTexture; typedef struct _GtkImageDefinitionPaintable GtkImageDefinitionPaintable; struct _GtkImageDefinitionEmpty { @@ -44,13 +43,6 @@ struct _GtkImageDefinitionGIcon { GIcon *gicon; }; -struct _GtkImageDefinitionTexture { - GtkImageType type; - gint ref_count; - - GdkTexture *texture; -}; - struct _GtkImageDefinitionPaintable { GtkImageType type; gint ref_count; @@ -64,7 +56,6 @@ union _GtkImageDefinition GtkImageDefinitionEmpty empty; GtkImageDefinitionIconName icon_name; GtkImageDefinitionGIcon gicon; - GtkImageDefinitionTexture texture; GtkImageDefinitionPaintable paintable; }; @@ -83,7 +74,6 @@ gtk_image_definition_alloc (GtkImageType type) sizeof (GtkImageDefinitionEmpty), sizeof (GtkImageDefinitionIconName), sizeof (GtkImageDefinitionGIcon), - sizeof (GtkImageDefinitionTexture), sizeof (GtkImageDefinitionPaintable) }; GtkImageDefinition *def; @@ -126,20 +116,6 @@ gtk_image_definition_new_gicon (GIcon *gicon) } GtkImageDefinition * -gtk_image_definition_new_texture (GdkTexture *texture) -{ - GtkImageDefinition *def; - - if (texture == NULL) - return NULL; - - def = gtk_image_definition_alloc (GTK_IMAGE_TEXTURE); - def->texture.texture = g_object_ref (texture); - - return def; -} - -GtkImageDefinition * gtk_image_definition_new_paintable (GdkPaintable *paintable) { GtkImageDefinition *def; @@ -175,9 +151,6 @@ gtk_image_definition_unref (GtkImageDefinition *def) case GTK_IMAGE_EMPTY: g_assert_not_reached (); break; - case GTK_IMAGE_TEXTURE: - g_object_unref (def->texture.texture); - break; case GTK_IMAGE_PAINTABLE: g_object_unref (def->paintable.paintable); break; @@ -207,7 +180,6 @@ gtk_image_definition_get_scale (const GtkImageDefinition *def) g_assert_not_reached (); case GTK_IMAGE_EMPTY: case GTK_IMAGE_PAINTABLE: - case GTK_IMAGE_TEXTURE: case GTK_IMAGE_ICON_NAME: case GTK_IMAGE_GICON: return 1; @@ -232,15 +204,6 @@ gtk_image_definition_get_gicon (const GtkImageDefinition *def) return def->gicon.gicon; } -GdkTexture * -gtk_image_definition_get_texture (const GtkImageDefinition *def) -{ - if (def->type != GTK_IMAGE_TEXTURE) - return NULL; - - return def->texture.texture; -} - GdkPaintable * gtk_image_definition_get_paintable (const GtkImageDefinition *def) { diff --git a/gtk/gtkimagedefinitionprivate.h b/gtk/gtkimagedefinitionprivate.h index 091d90cacc..fc77fe1594 100644 --- a/gtk/gtkimagedefinitionprivate.h +++ b/gtk/gtkimagedefinitionprivate.h @@ -28,7 +28,6 @@ typedef union _GtkImageDefinition GtkImageDefinition; GtkImageDefinition * gtk_image_definition_new_empty (void); GtkImageDefinition * gtk_image_definition_new_icon_name (const char *icon_name); GtkImageDefinition * gtk_image_definition_new_gicon (GIcon *gicon); -GtkImageDefinition * gtk_image_definition_new_texture (GdkTexture *texture); GtkImageDefinition * gtk_image_definition_new_paintable (GdkPaintable *paintable); GtkImageDefinition * gtk_image_definition_ref (GtkImageDefinition *def); @@ -38,7 +37,6 @@ GtkImageType gtk_image_definition_get_storage_type (const GtkImageD gint gtk_image_definition_get_scale (const GtkImageDefinition *def); const gchar * gtk_image_definition_get_icon_name (const GtkImageDefinition *def); GIcon * gtk_image_definition_get_gicon (const GtkImageDefinition *def); -GdkTexture * gtk_image_definition_get_texture (const GtkImageDefinition *def); GdkPaintable * gtk_image_definition_get_paintable (const GtkImageDefinition *def); |