Mercurial > pidgin
diff src/gtkimhtml.h @ 8962:4ff4c34b7500
[gaim-migrate @ 9736]
IM Image, WYSIWYG.
It's still somewhat buggy, although the worse problems are with oscar's
direct connect. We could always yank oscar's im image flag if we think it
will cause too many bug reports.
I made the GaimImgstore struct opque.
I modified oscar's sending function to parse im images better, and
everything seems to work. I made it write some errors to the conversation
if you try to send an image and you aren't direct connected. That's just
a hack until you can set formatting flags on a per conversation bases.
There's a scrolling bug I haven't tracked down. I think it may exist
normally and this just causes it better.
It's worth noting jabber also uses this for pics in profiles, although
I never did find a test case. Hopefully some other stuff can use this
soon too, maybe Yahoo! pics in profiles or something.
committer: Tailor Script <tailor@pidgin.im>
| author | Tim Ringenbach <marv@pidgin.im> |
|---|---|
| date | Mon, 17 May 2004 06:47:20 +0000 |
| parents | 1ab2a9c17f4a |
| children | b24967757d46 |
line wrap: on
line diff
--- a/src/gtkimhtml.h Mon May 17 04:39:14 2004 +0000 +++ b/src/gtkimhtml.h Mon May 17 06:47:20 2004 +0000 @@ -48,6 +48,7 @@ typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; typedef struct _GtkIMHtmlImage GtkIMHtmlImage; typedef struct _GtkIMHtmlHr GtkIMHtmlHr; +typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs; typedef enum { GTK_IMHTML_BOLD = 1 << 0, @@ -111,6 +112,9 @@ char *clipboard_text_string; char *clipboard_html_string; + + GSList *im_images; + GtkIMHtmlFuncs *funcs; }; struct _GtkIMHtmlClass { @@ -159,6 +163,7 @@ gchar *filename; int width; int height; + int id; }; struct _GtkIMHtmlHr { @@ -178,6 +183,23 @@ GTK_IMHTML_USE_POINTSIZE = 1 << 8 } GtkIMHtmlOptions; +typedef gpointer (*GtkIMHtmlGetImageFunc) (int id); +typedef gpointer (*GtkIMHtmlGetImageDataFunc) (gpointer i); +typedef size_t (*GtkIMHtmlGetImageSizeFunc) (gpointer i); +typedef const char *(*GtkIMHtmlGetImageFilenameFunc)(gpointer i); +typedef void (*GtkIMHtmlImageRefFunc) (int id); +typedef void (*GtkIMHtmlImageUnrefFunc) (int id); + +struct _GtkIMHtmlFuncs { + GtkIMHtmlGetImageFunc image_get; + GtkIMHtmlGetImageDataFunc image_get_data; + GtkIMHtmlGetImageSizeFunc image_get_size; + GtkIMHtmlGetImageFilenameFunc image_get_filename; + GtkIMHtmlImageRefFunc image_ref; + GtkIMHtmlImageUnrefFunc image_unref; +}; + + GtkType gtk_imhtml_get_type (void); GtkWidget* gtk_imhtml_new (void *, void *); @@ -190,6 +212,8 @@ void gtk_imhtml_remove_smileys (GtkIMHtml *imhtml); +void gtk_imhtml_set_funcs (GtkIMHtml *imhtml, GtkIMHtmlFuncs *f); + void gtk_imhtml_show_comments (GtkIMHtml *imhtml, gboolean show); void gtk_imhtml_html_shortcuts(GtkIMHtml *imhtml, gboolean allow); @@ -217,7 +241,7 @@ void gtk_imhtml_font_zoom(GtkIMHtml *imhtml, double zoom); GtkIMHtmlScalable *gtk_imhtml_scalable_new(); -GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename); +GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename, int id); void gtk_imhtml_image_free(GtkIMHtmlScalable *); void gtk_imhtml_image_scale(GtkIMHtmlScalable *, int, int); void gtk_imhtml_image_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); @@ -248,6 +272,7 @@ void gtk_imhtml_insert_link(GtkIMHtml *imhtml, GtkTextMark *mark, const char *url, const char *text); void gtk_imhtml_insert_smiley(GtkIMHtml *imhtml, const char *sml, char *smiley); void gtk_imhtml_insert_smiley_at_iter(GtkIMHtml *imhtml, const char *sml, char *smiley, GtkTextIter *iter); +void gtk_imhtml_insert_image_at_iter(GtkIMHtml *imhtml, int id, GtkTextIter *iter); void gtk_imhtml_font_set_size(GtkIMHtml *imhtml, gint size); void gtk_imhtml_font_shrink(GtkIMHtml *imhtml); void gtk_imhtml_font_grow(GtkIMHtml *imhtml);
