Mercurial > pidgin
annotate src/gtkimhtml.h @ 8052:2df2fd4efa82
[gaim-migrate @ 8737]
Bye bye, Rachel.
committer: Tailor Script <tailor@pidgin.im>
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Sat, 10 Jan 2004 04:45:05 +0000 |
| parents | fa6395637e2c |
| children | ea073d234191 |
| rev | line source |
|---|---|
|
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5012
diff
changeset
|
1 /** |
| 5967 | 2 * @file gtkimhtml.h GTK+ IM/HTML rendering component |
|
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5012
diff
changeset
|
3 * @ingroup gtkui |
| 1428 | 4 * |
| 8046 | 5 * Gaim is the legal property of its developers, whose names are too numerous |
| 6 * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 7 * source distribution. | |
| 1428 | 8 * |
| 9 * This program is free software; you can redistribute it and/or modify | |
| 10 * under the terms of the GNU General Public License as published by | |
| 11 * the Free Software Foundation; either version 2 of the License, or | |
| 12 * (at your option) any later version. | |
| 13 * | |
| 14 * This program is distributed in the hope that it will be useful, | |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 * GNU General Public License for more details. | |
| 18 * | |
| 19 * You should have received a copy of the GNU General Public License | |
| 20 * along with this program; if not, write to the Free Software | |
| 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 22 */ | |
| 23 | |
| 24 #ifndef __GTK_IMHTML_H | |
| 25 #define __GTK_IMHTML_H | |
| 26 | |
| 27 #include <gdk/gdk.h> | |
| 3922 | 28 #include <gtk/gtktextview.h> |
| 4735 | 29 #include <gtk/gtktooltips.h> |
| 5012 | 30 #include <gtk/gtkimage.h> |
| 1428 | 31 |
| 32 #ifdef __cplusplus | |
| 33 extern "C" { | |
| 34 #endif | |
| 35 | |
| 36 #define GTK_TYPE_IMHTML (gtk_imhtml_get_type ()) | |
| 37 #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, GtkIMHtml)) | |
| 38 #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMHTML, GtkIMHtmlClass)) | |
| 39 #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML)) | |
| 40 #define GTK_IS_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMHTML)) | |
| 5967 | 41 #define GTK_IMHTML_SCALABLE(obj) ((GtkIMHtmlScalable *)obj) |
| 7988 | 42 #define GTK_IMHTML_COPYABLE(obj) ((GtkIMHtmlCopyable *)obj) |
| 1428 | 43 |
| 5967 | 44 typedef struct _GtkIMHtml GtkIMHtml; |
| 45 typedef struct _GtkIMHtmlClass GtkIMHtmlClass; | |
| 46 typedef struct _GtkIMHtmlFontDetail GtkIMHtmlFontDetail; /* The five elements contained in a FONT tag */ | |
| 47 typedef struct _GtkSmileyTree GtkSmileyTree; | |
| 48 typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; | |
| 49 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; | |
| 50 typedef struct _GtkIMHtmlImage GtkIMHtmlImage; | |
| 51 typedef struct _GtkIMHtmlHr GtkIMHtmlHr; | |
| 7988 | 52 typedef struct _GtkIMHtmlCopyable GtkIMHtmlCopyable; |
| 7694 | 53 |
| 1428 | 54 struct _GtkIMHtml { |
| 3922 | 55 GtkTextView text_view; |
| 56 GtkTextBuffer *text_buffer; | |
| 57 GtkTextMark *end; | |
| 58 gboolean comments, smileys; | |
| 1428 | 59 GdkCursor *hand_cursor; |
| 60 GdkCursor *arrow_cursor; | |
| 4032 | 61 GHashTable *smiley_data; |
| 62 GtkSmileyTree *default_smilies; | |
| 4254 | 63 |
| 64 gboolean show_smileys; | |
| 6124 | 65 gboolean show_comments; |
| 4735 | 66 |
| 67 GtkWidget *tip_window; | |
| 68 char *tip; | |
| 69 guint tip_timer; | |
| 4895 | 70 |
| 71 GList *scalables; | |
| 4947 | 72 GdkRectangle old_rect; |
| 7295 | 73 |
| 7988 | 74 GSList *copyables; |
| 7694 | 75 |
| 7988 | 76 gchar *search_string; |
| 1428 | 77 }; |
| 78 | |
| 79 struct _GtkIMHtmlClass { | |
| 3922 | 80 GtkTextViewClass parent_class; |
| 1428 | 81 |
| 5967 | 82 void (*url_clicked)(GtkIMHtml *, const gchar *); |
| 83 }; | |
| 84 | |
| 85 struct _GtkIMHtmlFontDetail { | |
| 86 gushort size; | |
| 87 gchar *face; | |
| 88 gchar *fore; | |
| 89 gchar *back; | |
| 90 gchar *sml; | |
| 91 }; | |
| 92 | |
| 93 struct _GtkSmileyTree { | |
| 94 GString *values; | |
| 95 GtkSmileyTree **children; | |
| 96 GtkIMHtmlSmiley *image; | |
| 1428 | 97 }; |
| 98 | |
| 4263 | 99 struct _GtkIMHtmlSmiley { |
| 100 gchar *smile; | |
| 101 gchar *file; | |
|
6814
782907a6ae65
[gaim-migrate @ 7354]
Christian Hammond <chipx86@chipx86.com>
parents:
6282
diff
changeset
|
102 GdkPixbufAnimation *icon; |
| 4263 | 103 gboolean hidden; |
| 104 }; | |
| 105 | |
| 5967 | 106 struct _GtkIMHtmlScalable { |
| 4895 | 107 void (*scale)(struct _GtkIMHtmlScalable *, int, int); |
| 108 void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
| 109 void (*free)(struct _GtkIMHtmlScalable *); | |
| 110 }; | |
| 111 | |
| 7988 | 112 struct _GtkIMHtmlCopyable { |
| 113 GtkTextMark *mark; | |
| 114 char *text; | |
| 115 }; | |
| 116 | |
| 5967 | 117 struct _GtkIMHtmlImage { |
| 4895 | 118 GtkIMHtmlScalable scalable; |
| 5012 | 119 GtkImage *image; |
| 5046 | 120 GdkPixbuf *pixbuf; |
| 4895 | 121 GtkTextMark *mark; |
| 5012 | 122 gchar *filename; |
| 4895 | 123 int width; |
| 124 int height; | |
| 5967 | 125 }; |
| 4895 | 126 |
| 5967 | 127 struct _GtkIMHtmlHr { |
| 4895 | 128 GtkIMHtmlScalable scalable; |
| 129 GtkWidget *sep; | |
| 5967 | 130 }; |
| 131 | |
| 132 typedef enum { | |
| 133 GTK_IMHTML_NO_COLOURS = 1 << 0, | |
| 134 GTK_IMHTML_NO_FONTS = 1 << 1, | |
| 135 GTK_IMHTML_NO_COMMENTS = 1 << 2, | |
| 136 GTK_IMHTML_NO_TITLE = 1 << 3, | |
| 137 GTK_IMHTML_NO_NEWLINE = 1 << 4, | |
| 138 GTK_IMHTML_NO_SIZES = 1 << 5, | |
| 139 GTK_IMHTML_NO_SCROLL = 1 << 6, | |
| 140 GTK_IMHTML_RETURN_LOG = 1 << 7, | |
| 141 GTK_IMHTML_USE_POINTSIZE = 1 << 8 | |
| 142 } GtkIMHtmlOptions; | |
| 143 | |
| 144 GtkType gtk_imhtml_get_type (void); | |
| 145 GtkWidget* gtk_imhtml_new (void *, void *); | |
| 146 | |
| 147 void gtk_imhtml_set_adjustments (GtkIMHtml *imhtml, | |
| 148 GtkAdjustment *hadj, | |
| 149 GtkAdjustment *vadj); | |
| 150 | |
| 151 void gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, | |
| 152 gchar *sml, GtkIMHtmlSmiley *smiley); | |
| 153 | |
| 154 void gtk_imhtml_remove_smileys (GtkIMHtml *imhtml); | |
| 155 | |
| 156 void gtk_imhtml_show_smileys (GtkIMHtml *imhtml, gboolean show); | |
| 157 | |
| 158 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, gboolean show); | |
| 159 | |
| 6982 | 160 #define gtk_imhtml_append_text(x, y, z) \ |
| 161 gtk_imhtml_append_text_with_images(x, y, z, NULL) | |
| 162 | |
| 163 GString* gtk_imhtml_append_text_with_images (GtkIMHtml *imhtml, | |
| 164 const gchar *text, | |
| 165 GtkIMHtmlOptions options, | |
| 166 GSList *images); | |
| 5967 | 167 |
| 168 void gtk_imhtml_clear (GtkIMHtml *imhtml); | |
| 169 void gtk_imhtml_page_up (GtkIMHtml *imhtml); | |
| 170 void gtk_imhtml_page_down (GtkIMHtml *imhtml); | |
| 4895 | 171 |
| 172 GtkIMHtmlScalable *gtk_imhtml_scalable_new(); | |
| 6982 | 173 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename); |
| 5967 | 174 void gtk_imhtml_image_free(GtkIMHtmlScalable *); |
| 175 void gtk_imhtml_image_scale(GtkIMHtmlScalable *, int, int); | |
| 176 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
| 4895 | 177 |
| 5967 | 178 GtkIMHtmlScalable *gtk_imhtml_hr_new(); |
| 179 void gtk_imhtml_hr_free(GtkIMHtmlScalable *); | |
| 180 void gtk_imhtml_hr_scale(GtkIMHtmlScalable *, int, int); | |
| 181 void gtk_imhtml_hr_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
| 4895 | 182 |
| 7295 | 183 /* Search functions */ |
| 184 gboolean gtk_imhtml_search_find(GtkIMHtml *imhtml, const gchar *text); | |
| 185 void gtk_imhtml_search_clear(GtkIMHtml *imhtml); | |
| 4895 | 186 |
| 1428 | 187 #ifdef __cplusplus |
| 188 } | |
| 189 #endif | |
| 190 | |
| 191 #endif |
