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