diff -r 1edf059a4a26 -r 5af898e91ec2 pidgin/gtkimhtml.h --- a/pidgin/gtkimhtml.h Sat May 26 13:48:41 2007 +0000 +++ b/pidgin/gtkimhtml.h Sun Jul 01 00:55:03 2007 +0000 @@ -27,6 +27,9 @@ #include #include #include +#include "gtksourceundomanager.h" + +#include "connection.h" #ifdef __cplusplus extern "C" { @@ -43,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; @@ -51,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; @@ -126,6 +131,7 @@ GSList *im_images; GtkIMHtmlFuncs *funcs; + GtkSourceUndoManager *undo_manager; }; struct _GtkIMHtmlClass { @@ -137,6 +143,8 @@ void (*clear_format)(GtkIMHtml *); void (*update_format)(GtkIMHtml *); gboolean (*message_send)(GtkIMHtml *); + void (*undo)(GtkIMHtml *); + void (*redo)(GtkIMHtml *); }; struct _GtkIMHtmlFontDetail { @@ -175,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; @@ -185,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; @@ -405,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. @@ -416,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); /** @@ -438,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); /** @@ -786,6 +830,14 @@ */ char *gtk_imhtml_get_text(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *stop); +/** + * Setup formatting for an imhtml depending on the flags specified. + * + * @param imhtml The GTK+ IM/HTML. + * @param flags The connection flag which describes the allowed types of formatting. + */ +void gtk_imhtml_setup_entry(GtkIMHtml *imhtml, PurpleConnectionFlags flags); + /*@}*/ #ifdef __cplusplus