[gtkhtml] Bug #601541 - Add 'Copy Image' Option On Inline Email Images



commit 06524fd9a0e207308704a93fa285c5343b525373
Author: Milan Crha <mcrha redhat com>
Date:   Mon May 16 13:09:46 2011 +0200

    Bug #601541 - Add 'Copy Image' Option On Inline Email Images

 gtkhtml/gtkhtml.c |   23 +++++++++++++++++++++++
 gtkhtml/gtkhtml.h |    3 +++
 2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/gtkhtml/gtkhtml.c b/gtkhtml/gtkhtml.c
index 45a58cf..be21bcc 100644
--- a/gtkhtml/gtkhtml.c
+++ b/gtkhtml/gtkhtml.c
@@ -6500,6 +6500,29 @@ gtk_html_get_image_src_at (GtkHTML *html, gint x, gint y)
 	return NULL;
 }
 
+/* Unref when done with it */
+GdkPixbufAnimation *
+gtk_html_get_image_at (GtkHTML *html, gint x, gint y)
+{
+	HTMLObject *obj;
+	gint offset;
+
+	g_return_val_if_fail (GTK_IS_HTML (html), NULL);
+
+	obj = html_engine_get_object_at (html->engine, x, y, (guint *) &offset, FALSE);
+
+	if (obj && HTML_IS_IMAGE (obj)) {
+		HTMLImage *image = (HTMLImage*)obj;
+
+		if (!image->image_ptr || !image->image_ptr->animation)
+			return NULL;
+
+		return g_object_ref (image->image_ptr->animation);
+	}
+
+	return NULL;
+}
+
 gchar *
 gtk_html_get_cursor_image_src (GtkHTML *html)
 {
diff --git a/gtkhtml/gtkhtml.h b/gtkhtml/gtkhtml.h
index c400629..9ba5c2a 100644
--- a/gtkhtml/gtkhtml.h
+++ b/gtkhtml/gtkhtml.h
@@ -329,6 +329,9 @@ gchar *                     gtk_html_get_image_src_at              (GtkHTML
 								   gint                        x,
 								   gint                        y);
 gchar *                     gtk_html_get_cursor_image_src          (GtkHTML                   *html);
+GdkPixbufAnimation *        gtk_html_get_image_at		   (GtkHTML                   *html,
+								    gint		      x,
+								    gint		      y);
 
 void                       gtk_html_set_tokenizer                 (GtkHTML                   *html,
 								   HTMLTokenizer             *tokenizer);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]