summaryrefslogtreecommitdiff
path: root/gtk/gtkiconhelper.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-06-24 14:05:27 +0200
committerAlexander Larsson <alexl@redhat.com>2013-07-03 14:39:25 +0200
commit5d8fd4ee247230e4ab97c223e618791f25f3ba24 (patch)
treeda3670ff47b21184ca2a6569ce3e351046d10eca /gtk/gtkiconhelper.c
parent6a4f82a1f47bd839cab4d5e049ed1f33010b2f07 (diff)
downloadgtk+-5d8fd4ee247230e4ab97c223e618791f25f3ba24.tar.gz
GtkIconHelper: Add set_window()
This is a hint on where the icon will be drawn. It will allow us to pre-allocate cairo surfaces for the right target.
Diffstat (limited to 'gtk/gtkiconhelper.c')
-rw-r--r--gtk/gtkiconhelper.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index 1ec7b850e7..629f007827 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -26,6 +26,8 @@ G_DEFINE_TYPE (GtkIconHelper, _gtk_icon_helper, G_TYPE_OBJECT)
struct _GtkIconHelperPrivate {
GtkImageType storage_type;
+ GdkWindow *window;
+
GdkPixbuf *orig_pixbuf;
GdkPixbufAnimation *animation;
GIcon *gicon;
@@ -50,6 +52,7 @@ _gtk_icon_helper_clear (GtkIconHelper *self)
g_clear_object (&self->priv->orig_pixbuf);
g_clear_object (&self->priv->animation);
g_clear_object (&self->priv->rendered_pixbuf);
+ g_clear_object (&self->priv->window);
if (self->priv->icon_set != NULL)
{
@@ -76,6 +79,17 @@ _gtk_icon_helper_invalidate (GtkIconHelper *self)
g_clear_object (&self->priv->rendered_pixbuf);
}
+void
+ _gtk_icon_helper_set_window (GtkIconHelper *self,
+ GdkWindow *window)
+{
+ if (window)
+ g_object_ref (window);
+ g_clear_object (&self->priv->window);
+ self->priv->window = window;
+
+}
+
static void
gtk_icon_helper_finalize (GObject *object)
{