Mercurial > pidgin
annotate src/gtkimhtml.h @ 6047:668eadc46990
[gaim-migrate @ 6497]
We don't need to stinking GTK_IMHTML_GET_CLASS
Did you know the turtle is nature's very own suction cup?
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 06 Jul 2003 22:21:25 +0000 |
parents | 19cb60247a6c |
children | 395116fdd270 |
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) |
1428 | 40 |
5967 | 41 typedef struct _GtkIMHtml GtkIMHtml; |
42 typedef struct _GtkIMHtmlClass GtkIMHtmlClass; | |
43 typedef struct _GtkIMHtmlFontDetail GtkIMHtmlFontDetail; /* The five elements contained in a FONT tag */ | |
44 typedef struct _GtkSmileyTree GtkSmileyTree; | |
45 typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; | |
46 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; | |
47 typedef struct _GtkIMHtmlImage GtkIMHtmlImage; | |
48 typedef struct _GtkIMHtmlHr GtkIMHtmlHr; | |
1428 | 49 |
50 struct _GtkIMHtml { | |
3922 | 51 GtkTextView text_view; |
52 GtkTextBuffer *text_buffer; | |
53 GtkTextMark *end; | |
54 gboolean comments, smileys; | |
1428 | 55 GdkCursor *hand_cursor; |
56 GdkCursor *arrow_cursor; | |
4032 | 57 GHashTable *smiley_data; |
58 GtkSmileyTree *default_smilies; | |
4254 | 59 |
60 gboolean show_smileys; | |
4735 | 61 |
62 GtkWidget *tip_window; | |
63 char *tip; | |
64 guint tip_timer; | |
4895 | 65 |
66 GList *scalables; | |
4947 | 67 GdkRectangle old_rect; |
1428 | 68 }; |
69 | |
70 struct _GtkIMHtmlClass { | |
3922 | 71 GtkTextViewClass parent_class; |
1428 | 72 |
5967 | 73 void (*url_clicked)(GtkIMHtml *, const gchar *); |
74 }; | |
75 | |
76 struct _GtkIMHtmlFontDetail { | |
77 gushort size; | |
78 gchar *face; | |
79 gchar *fore; | |
80 gchar *back; | |
81 gchar *sml; | |
82 }; | |
83 | |
84 struct _GtkSmileyTree { | |
85 GString *values; | |
86 GtkSmileyTree **children; | |
87 GtkIMHtmlSmiley *image; | |
1428 | 88 }; |
89 | |
4263 | 90 struct _GtkIMHtmlSmiley { |
91 gchar *smile; | |
92 gchar *file; | |
93 GdkPixbuf *icon; | |
94 gboolean hidden; | |
95 }; | |
96 | |
5967 | 97 struct _GtkIMHtmlScalable { |
4895 | 98 void (*scale)(struct _GtkIMHtmlScalable *, int, int); |
99 void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
100 void (*free)(struct _GtkIMHtmlScalable *); | |
101 }; | |
102 | |
5967 | 103 struct _GtkIMHtmlImage { |
4895 | 104 GtkIMHtmlScalable scalable; |
5012 | 105 GtkImage *image; |
5046 | 106 GdkPixbuf *pixbuf; |
4895 | 107 GtkTextMark *mark; |
5012 | 108 gchar *filename; |
4895 | 109 int width; |
110 int height; | |
5967 | 111 }; |
4895 | 112 |
5967 | 113 struct _GtkIMHtmlHr { |
4895 | 114 GtkIMHtmlScalable scalable; |
115 GtkWidget *sep; | |
5967 | 116 }; |
117 | |
118 typedef enum { | |
119 GTK_IMHTML_NO_COLOURS = 1 << 0, | |
120 GTK_IMHTML_NO_FONTS = 1 << 1, | |
121 GTK_IMHTML_NO_COMMENTS = 1 << 2, | |
122 GTK_IMHTML_NO_TITLE = 1 << 3, | |
123 GTK_IMHTML_NO_NEWLINE = 1 << 4, | |
124 GTK_IMHTML_NO_SIZES = 1 << 5, | |
125 GTK_IMHTML_NO_SCROLL = 1 << 6, | |
126 GTK_IMHTML_RETURN_LOG = 1 << 7, | |
127 GTK_IMHTML_USE_POINTSIZE = 1 << 8 | |
128 } GtkIMHtmlOptions; | |
129 | |
130 GtkType gtk_imhtml_get_type (void); | |
131 GtkWidget* gtk_imhtml_new (void *, void *); | |
132 | |
133 void gtk_imhtml_set_adjustments (GtkIMHtml *imhtml, | |
134 GtkAdjustment *hadj, | |
135 GtkAdjustment *vadj); | |
136 | |
137 void gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, | |
138 gchar *sml, GtkIMHtmlSmiley *smiley); | |
139 | |
140 void gtk_imhtml_remove_smileys (GtkIMHtml *imhtml); | |
141 | |
142 void gtk_imhtml_show_smileys (GtkIMHtml *imhtml, gboolean show); | |
143 | |
144 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, gboolean show); | |
145 | |
146 GString* gtk_imhtml_append_text (GtkIMHtml *imhtml, | |
147 const gchar *text, gint len, GtkIMHtmlOptions options); | |
148 | |
149 void gtk_imhtml_clear (GtkIMHtml *imhtml); | |
150 void gtk_imhtml_page_up (GtkIMHtml *imhtml); | |
151 void gtk_imhtml_page_down (GtkIMHtml *imhtml); | |
152 void gtk_imhtml_to_bottom (GtkIMHtml *imhtml); | |
4895 | 153 |
154 GtkIMHtmlScalable *gtk_imhtml_scalable_new(); | |
5967 | 155 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, gchar *filename); |
156 void gtk_imhtml_image_free(GtkIMHtmlScalable *); | |
157 void gtk_imhtml_image_scale(GtkIMHtmlScalable *, int, int); | |
158 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
4895 | 159 |
5967 | 160 GtkIMHtmlScalable *gtk_imhtml_hr_new(); |
161 void gtk_imhtml_hr_free(GtkIMHtmlScalable *); | |
162 void gtk_imhtml_hr_scale(GtkIMHtmlScalable *, int, int); | |
163 void gtk_imhtml_hr_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
4895 | 164 |
165 | |
1428 | 166 #ifdef __cplusplus |
167 } | |
168 #endif | |
169 | |
170 #endif |