| 44 #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, GtkIMHtml)) |
44 #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, GtkIMHtml)) |
| 45 #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMHTML, GtkIMHtmlClass)) |
45 #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMHTML, GtkIMHtmlClass)) |
| 46 #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML)) |
46 #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML)) |
| 47 #define GTK_IS_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMHTML)) |
47 #define GTK_IS_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMHTML)) |
| 48 #define GTK_IMHTML_SCALABLE(obj) ((GtkIMHtmlScalable *)obj) |
48 #define GTK_IMHTML_SCALABLE(obj) ((GtkIMHtmlScalable *)obj) |
| |
49 #define GTK_IMHTML_ANIMATION(obj) ((GtkIMHtmlAnimation *)obj) |
| 49 |
50 |
| 50 typedef struct _GtkIMHtml GtkIMHtml; |
51 typedef struct _GtkIMHtml GtkIMHtml; |
| 51 typedef struct _GtkIMHtmlClass GtkIMHtmlClass; |
52 typedef struct _GtkIMHtmlClass GtkIMHtmlClass; |
| 52 typedef struct _GtkIMHtmlFontDetail GtkIMHtmlFontDetail; /* The five elements contained in a FONT tag */ |
53 typedef struct _GtkIMHtmlFontDetail GtkIMHtmlFontDetail; /* The five elements contained in a FONT tag */ |
| 53 typedef struct _GtkSmileyTree GtkSmileyTree; |
54 typedef struct _GtkSmileyTree GtkSmileyTree; |
| 54 typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; |
55 typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; |
| 55 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; |
56 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; |
| 56 typedef struct _GtkIMHtmlImage GtkIMHtmlImage; |
57 typedef struct _GtkIMHtmlImage GtkIMHtmlImage; |
| |
58 typedef struct _GtkIMHtmlAnimation GtkIMHtmlAnimation; |
| 57 typedef struct _GtkIMHtmlHr GtkIMHtmlHr; |
59 typedef struct _GtkIMHtmlHr GtkIMHtmlHr; |
| 58 typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs; |
60 typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs; |
| 59 |
61 |
| 60 typedef enum { |
62 typedef enum { |
| 61 GTK_IMHTML_BOLD = 1 << 0, |
63 GTK_IMHTML_BOLD = 1 << 0, |
| 179 void (*free)(struct _GtkIMHtmlScalable *); |
181 void (*free)(struct _GtkIMHtmlScalable *); |
| 180 }; |
182 }; |
| 181 |
183 |
| 182 struct _GtkIMHtmlImage { |
184 struct _GtkIMHtmlImage { |
| 183 GtkIMHtmlScalable scalable; |
185 GtkIMHtmlScalable scalable; |
| 184 GtkImage *image; |
186 GtkImage *image; /**< Contains the scaled version of this pixbuf. */ |
| 185 GdkPixbuf *pixbuf; |
187 GdkPixbuf *pixbuf; /**< The original pixbuf, before any scaling. */ |
| 186 GtkTextMark *mark; |
188 GtkTextMark *mark; |
| 187 gchar *filename; |
189 gchar *filename; |
| 188 int width; |
190 int width; |
| 189 int height; |
191 int height; |
| 190 int id; |
192 int id; |
| 191 GtkWidget *filesel; |
193 GtkWidget *filesel; |
| |
194 }; |
| |
195 |
| |
196 struct _GtkIMHtmlAnimation { |
| |
197 GtkIMHtmlImage imhtmlimage; |
| |
198 GdkPixbufAnimation *anim; /**< The original animation, before any scaling. */ |
| |
199 GdkPixbufAnimationIter *iter; |
| |
200 guint timer; |
| 192 }; |
201 }; |
| 193 |
202 |
| 194 struct _GtkIMHtmlHr { |
203 struct _GtkIMHtmlHr { |
| 195 GtkIMHtmlScalable scalable; |
204 GtkIMHtmlScalable scalable; |
| 196 GtkWidget *sep; |
205 GtkWidget *sep; |
| 409 * @return A new IM/HTML Scalable object. |
418 * @return A new IM/HTML Scalable object. |
| 410 */ |
419 */ |
| 411 GtkIMHtmlScalable *gtk_imhtml_scalable_new(void); |
420 GtkIMHtmlScalable *gtk_imhtml_scalable_new(void); |
| 412 |
421 |
| 413 /** |
422 /** |
| 414 * Creates and returns an new GTK+ IM/HTML scalable object with an image. |
423 * Creates and returns a new GTK+ IM/HTML scalable object with an image. |
| 415 * |
424 * |
| 416 * @param img A GdkPixbuf of the image to add. |
425 * @param img A GdkPixbuf of the image to add. |
| 417 * @param filename The filename to associate with the image. |
426 * @param filename The filename to associate with the image. |
| 418 * @param id The id to associate with the image. |
427 * @param id The id to associate with the image. |
| 419 * |
428 * |
| 420 * @return A new IM/HTML Scalable object with an image. |
429 * @return A new IM/HTML Scalable object with an image. |
| 421 */ |
430 */ |
| 422 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename, int id); |
431 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename, int id); |
| 423 |
432 |
| 424 /** |
433 /** |
| |
434 * Creates and returns a new GTK+ IM/HTML scalable object with an |
| |
435 * animated image. |
| |
436 * |
| |
437 * @param img A GdkPixbufAnimation of the image to add. |
| |
438 * @param filename The filename to associate with the image. |
| |
439 * @param id The id to associate with the image. |
| |
440 * |
| |
441 * @return A new IM/HTML Scalable object with an image. |
| |
442 */ |
| |
443 /* |
| |
444 * TODO: All this animation code could be combined much better with |
| |
445 * the image code. It couldn't be done when it was written |
| |
446 * because it requires breaking backward compatibility. It |
| |
447 * would be good to do it for 3.0.0. |
| |
448 */ |
| |
449 GtkIMHtmlScalable *gtk_imhtml_animation_new(GdkPixbufAnimation *img, const gchar *filename, int id); |
| |
450 |
| |
451 /** |
| 425 * Destroys and frees a GTK+ IM/HTML scalable image. |
452 * Destroys and frees a GTK+ IM/HTML scalable image. |
| 426 * |
453 * |
| 427 * @param scale The GTK+ IM/HTML scalable. |
454 * @param scale The GTK+ IM/HTML scalable. |
| 428 */ |
455 */ |
| |
456 /* TODO: Is there any reason this isn't private? */ |
| 429 void gtk_imhtml_image_free(GtkIMHtmlScalable *scale); |
457 void gtk_imhtml_image_free(GtkIMHtmlScalable *scale); |
| |
458 |
| |
459 /** |
| |
460 * Destroys and frees a GTK+ IM/HTML scalable animation. |
| |
461 * |
| |
462 * @param scale The GTK+ IM/HTML scalable. |
| |
463 */ |
| |
464 /* TODO: Is there any reason this isn't private? */ |
| |
465 void gtk_imhtml_animation_free(GtkIMHtmlScalable *scale); |
| 430 |
466 |
| 431 /** |
467 /** |
| 432 * Rescales a GTK+ IM/HTML scalable image to a given size. |
468 * Rescales a GTK+ IM/HTML scalable image to a given size. |
| 433 * |
469 * |
| 434 * @param scale The GTK+ IM/HTML scalable. |
470 * @param scale The GTK+ IM/HTML scalable. |
| 435 * @param width The new width. |
471 * @param width The new width. |
| 436 * @param height The new height. |
472 * @param height The new height. |
| 437 */ |
473 */ |
| |
474 /* TODO: Is there any reason this isn't private? */ |
| 438 void gtk_imhtml_image_scale(GtkIMHtmlScalable *scale, int width, int height); |
475 void gtk_imhtml_image_scale(GtkIMHtmlScalable *scale, int width, int height); |
| 439 |
476 |
| 440 /** |
477 /** |
| 441 * Adds a GTK+ IM/HTML scalable image to a given GTK+ IM/HTML at a given iter. |
478 * Adds a GTK+ IM/HTML scalable image to a given GTK+ IM/HTML at a given iter. |
| 442 * |
479 * |
| 443 * @param scale The GTK+ IM/HTML scalable. |
480 * @param scale The GTK+ IM/HTML scalable. |
| 444 * @param imhtml The GTK+ IM/HTML. |
481 * @param imhtml The GTK+ IM/HTML. |
| 445 * @param iter The GtkTextIter at which to add the scalable. |
482 * @param iter The GtkTextIter at which to add the scalable. |
| 446 */ |
483 */ |
| |
484 /* TODO: Is there any reason this isn't private? */ |
| 447 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *scale, GtkIMHtml *imhtml, GtkTextIter *iter); |
485 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *scale, GtkIMHtml *imhtml, GtkTextIter *iter); |
| 448 |
486 |
| 449 /** |
487 /** |
| 450 * Creates and returns an new GTK+ IM/HTML scalable with a horizontal rule. |
488 * Creates and returns an new GTK+ IM/HTML scalable with a horizontal rule. |
| 451 * |
489 * |