pidgin/gtkimhtml.h

branch
release-2.1.0
changeset 18151
97fd60f47229
parent 18105
bab0b0bcb664
child 19859
71d37b57eff2
--- a/pidgin/gtkimhtml.h	Mon Jun 11 07:45:19 2007 +0000
+++ b/pidgin/gtkimhtml.h	Mon Jun 11 07:48:49 2007 +0000
@@ -46,6 +46,7 @@
 #define GTK_IS_IMHTML(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML))
 #define GTK_IS_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMHTML))
 #define GTK_IMHTML_SCALABLE(obj)   ((GtkIMHtmlScalable *)obj)
+#define GTK_IMHTML_ANIMATION(obj)   ((GtkIMHtmlAnimation *)obj)
 
 typedef struct _GtkIMHtml			GtkIMHtml;
 typedef struct _GtkIMHtmlClass		GtkIMHtmlClass;
@@ -54,6 +55,7 @@
 typedef struct _GtkIMHtmlSmiley		GtkIMHtmlSmiley;
 typedef struct _GtkIMHtmlScalable	GtkIMHtmlScalable;
 typedef struct _GtkIMHtmlImage		GtkIMHtmlImage;
+typedef struct _GtkIMHtmlAnimation	GtkIMHtmlAnimation;
 typedef struct _GtkIMHtmlHr			GtkIMHtmlHr;
 typedef struct _GtkIMHtmlFuncs		GtkIMHtmlFuncs;
 
@@ -181,8 +183,8 @@
 
 struct _GtkIMHtmlImage {
 	GtkIMHtmlScalable scalable;
-	GtkImage *image;
-	GdkPixbuf *pixbuf;
+	GtkImage *image; /**< Contains the scaled version of this pixbuf. */
+	GdkPixbuf *pixbuf; /**< The original pixbuf, before any scaling. */
 	GtkTextMark *mark;
 	gchar *filename;
 	int width;
@@ -191,6 +193,13 @@
 	GtkWidget *filesel;
 };
 
+struct _GtkIMHtmlAnimation {
+	GtkIMHtmlImage imhtmlimage;
+	GdkPixbufAnimation *anim; /**< The original animation, before any scaling. */
+	GdkPixbufAnimationIter *iter;
+	guint timer;
+};
+
 struct _GtkIMHtmlHr {
 	GtkIMHtmlScalable scalable;
 	GtkWidget *sep;
@@ -411,7 +420,7 @@
 GtkIMHtmlScalable *gtk_imhtml_scalable_new(void);
 
 /**
- * Creates and returns an new GTK+ IM/HTML scalable object with an image.
+ * Creates and returns a new GTK+ IM/HTML scalable object with an image.
  *
  * @param img      A GdkPixbuf of the image to add.
  * @param filename The filename to associate with the image.
@@ -422,19 +431,47 @@
 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename, int id);
 
 /**
+ * Creates and returns a new GTK+ IM/HTML scalable object with an
+ * animated image.
+ *
+ * @param img      A GdkPixbufAnimation of the image to add.
+ * @param filename The filename to associate with the image.
+ * @param id       The id to associate with the image.
+ *
+ * @return A new IM/HTML Scalable object with an image.
+ */
+/*
+ * TODO: All this animation code could be combined much better with
+ *       the image code.  It couldn't be done when it was written
+ *       because it requires breaking backward compatibility.  It
+ *       would be good to do it for 3.0.0.
+ */
+GtkIMHtmlScalable *gtk_imhtml_animation_new(GdkPixbufAnimation *img, const gchar *filename, int id);
+
+/**
  * Destroys and frees a GTK+ IM/HTML scalable image.
  *
  * @param scale The GTK+ IM/HTML scalable.
  */
+/* TODO: Is there any reason this isn't private? */
 void gtk_imhtml_image_free(GtkIMHtmlScalable *scale);
 
 /**
+ * Destroys and frees a GTK+ IM/HTML scalable animation.
+ *
+ * @param scale The GTK+ IM/HTML scalable.
+ */
+/* TODO: Is there any reason this isn't private? */
+void gtk_imhtml_animation_free(GtkIMHtmlScalable *scale);
+
+/**
  * Rescales a GTK+ IM/HTML scalable image to a given size.
  *
  * @param scale  The GTK+ IM/HTML scalable.
  * @param width  The new width.
  * @param height The new height.
  */
+/* TODO: Is there any reason this isn't private? */
 void gtk_imhtml_image_scale(GtkIMHtmlScalable *scale, int width, int height);
 
 /**
@@ -444,6 +481,7 @@
  * @param imhtml The GTK+ IM/HTML.
  * @param iter   The GtkTextIter at which to add the scalable.
  */
+/* TODO: Is there any reason this isn't private? */
 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *scale, GtkIMHtml *imhtml, GtkTextIter *iter);
 
 /**

mercurial