Mercurial > pidgin
annotate src/gtkimhtml.h @ 5721:32f42e847713
[gaim-migrate @ 6143]
Zoltan Sutto updated the hungarian translation
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Tue, 03 Jun 2003 20:59:06 +0000 |
parents | 3becf79500d2 |
children | 156953fe3e14 |
rev | line source |
---|---|
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5012
diff
changeset
|
1 /** |
5537 | 2 * @file gtkimhtml.h GTK+ Gaim IM 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)) | |
39 | |
40 typedef gchar** (*GtkIMHtmlImage) (gchar *url); | |
41 | |
2349
60c716c32c40
[gaim-migrate @ 2362]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
42 typedef struct _GtkSmileyTree GtkSmileyTree; |
4263 | 43 typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; |
2349
60c716c32c40
[gaim-migrate @ 2362]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
44 |
1428 | 45 typedef struct _GtkIMHtml GtkIMHtml; |
46 typedef struct _GtkIMHtmlClass GtkIMHtmlClass; | |
47 | |
48 struct _GtkIMHtml { | |
3922 | 49 GtkTextView text_view; |
50 GtkTextBuffer *text_buffer; | |
51 GtkTextMark *end; | |
52 gboolean comments, smileys; | |
1428 | 53 GdkCursor *hand_cursor; |
54 GdkCursor *arrow_cursor; | |
4032 | 55 GHashTable *smiley_data; |
56 GtkSmileyTree *default_smilies; | |
4254 | 57 |
58 gboolean show_smileys; | |
59 gboolean show_comments; | |
4735 | 60 |
61 GtkWidget *tip_window; | |
62 char *tip; | |
63 guint tip_timer; | |
4895 | 64 |
65 GList *scalables; | |
4947 | 66 GdkRectangle old_rect; |
1428 | 67 }; |
68 | |
69 struct _GtkIMHtmlClass { | |
3922 | 70 GtkTextViewClass parent_class; |
1428 | 71 |
72 void (*url_clicked) (GtkIMHtml *, const gchar *); | |
73 }; | |
74 | |
4263 | 75 struct _GtkIMHtmlSmiley { |
76 gchar *smile; | |
77 gchar *file; | |
78 GdkPixbuf *icon; | |
79 gboolean hidden; | |
80 }; | |
81 | |
1428 | 82 typedef enum |
83 { | |
84 GTK_IMHTML_NO_COLOURS = 1 << 0, | |
85 GTK_IMHTML_NO_FONTS = 1 << 1, | |
86 GTK_IMHTML_NO_COMMENTS = 1 << 2, | |
87 GTK_IMHTML_NO_TITLE = 1 << 3, | |
88 GTK_IMHTML_NO_NEWLINE = 1 << 4, | |
89 GTK_IMHTML_NO_SIZES = 1 << 5, | |
90 GTK_IMHTML_NO_SCROLL = 1 << 6, | |
5367 | 91 GTK_IMHTML_RETURN_LOG = 1 << 7, |
92 GTK_IMHTML_USE_POINTSIZE = 1 << 8 | |
1428 | 93 } GtkIMHtmlOptions; |
94 | |
95 GtkType gtk_imhtml_get_type (void); | |
3922 | 96 GtkWidget* gtk_imhtml_new (void *, void *); |
1428 | 97 |
98 void gtk_imhtml_set_adjustments (GtkIMHtml *imhtml, | |
99 GtkAdjustment *hadj, | |
100 GtkAdjustment *vadj); | |
101 | |
102 void gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, | |
4032 | 103 gchar *sml, |
4263 | 104 GtkIMHtmlSmiley *smiley); |
1428 | 105 |
2728
16df889d81e2
[gaim-migrate @ 2741]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
106 void gtk_imhtml_remove_smileys (GtkIMHtml *imhtml); |
16df889d81e2
[gaim-migrate @ 2741]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
107 |
1428 | 108 void gtk_imhtml_show_smileys (GtkIMHtml *imhtml, |
109 gboolean show); | |
110 | |
111 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, | |
112 gboolean show); | |
113 | |
114 GString* gtk_imhtml_append_text (GtkIMHtml *imhtml, | |
115 const gchar *text, | |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2728
diff
changeset
|
116 gint len, |
1428 | 117 GtkIMHtmlOptions options); |
118 | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1574
diff
changeset
|
119 void gtk_imhtml_clear (GtkIMHtml *imhtml); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1574
diff
changeset
|
120 |
2363
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2349
diff
changeset
|
121 void gtk_imhtml_page_up (GtkIMHtml *imhtml); |
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2349
diff
changeset
|
122 |
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2349
diff
changeset
|
123 void gtk_imhtml_page_down (GtkIMHtml *imhtml); |
3867 | 124 void gtk_imhtml_to_bottom (GtkIMHtml *imhtml); |
2363
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2349
diff
changeset
|
125 |
4895 | 126 /* GtkIMHtmlScalable, gaim_im_image, and gaim_hr */ |
127 | |
128 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; | |
129 #define GTK_IMHTML_SCALABLE(x) ((GtkIMHtmlScalable *)x) | |
130 | |
131 struct _GtkIMHtmlScalable{ | |
132 void (*scale)(struct _GtkIMHtmlScalable *, int, int); | |
133 void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
134 void (*free)(struct _GtkIMHtmlScalable *); | |
135 }; | |
136 | |
137 typedef struct { | |
138 GtkIMHtmlScalable scalable; | |
5012 | 139 GtkImage *image; |
5046 | 140 GdkPixbuf *pixbuf; |
4895 | 141 GtkTextMark *mark; |
5012 | 142 gchar *filename; |
4895 | 143 int width; |
144 int height; | |
145 } gaim_im_image; | |
146 | |
147 typedef struct { | |
148 GtkIMHtmlScalable scalable; | |
149 GtkWidget *sep; | |
150 } gaim_hr; | |
151 | |
152 GtkIMHtmlScalable *gtk_imhtml_scalable_new(); | |
153 | |
5012 | 154 GtkIMHtmlScalable *gaim_im_image_new(GdkPixbuf *img, gchar *filename); |
4895 | 155 |
156 void gaim_im_image_free(GtkIMHtmlScalable *); | |
157 | |
158 void gaim_im_image_scale(GtkIMHtmlScalable *, int, int); | |
159 | |
160 void gaim_im_image_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
161 | |
162 GtkIMHtmlScalable *gaim_hr_new(); | |
163 | |
164 void gaim_hr_free(GtkIMHtmlScalable *); | |
165 | |
166 void gaim_hr_scale(GtkIMHtmlScalable *, int, int); | |
167 | |
168 void gaim_hr_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
169 | |
170 | |
1428 | 171 #ifdef __cplusplus |
172 } | |
173 #endif | |
174 | |
175 #endif |