Mercurial > pidgin.yaz
annotate src/gtkimhtml.h @ 4940:3708545afe42
[gaim-migrate @ 5274]
I forgot to say this al o fixes the problem with the gtkimhtml being
scrolled. This commit is unimportant. I just wanted to say that.
Do I get a hug?
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 01 Apr 2003 05:55:32 +0000 |
parents | 9e50494f63a1 |
children | 24c9a23df63b |
rev | line source |
---|---|
1428 | 1 /* |
2 * GtkIMHtml | |
3 * | |
4 * Copyright (C) 2000, Eric Warmenhoven <warmenhoven@yahoo.com> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
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> |
1428 | 28 |
29 #ifdef __cplusplus | |
30 extern "C" { | |
31 #endif | |
32 | |
33 #define GTK_TYPE_IMHTML (gtk_imhtml_get_type ()) | |
34 #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, GtkIMHtml)) | |
35 #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMHTML, GtkIMHtmlClass)) | |
36 #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML)) | |
37 #define GTK_IS_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMHTML)) | |
38 | |
39 typedef gchar** (*GtkIMHtmlImage) (gchar *url); | |
40 | |
2349
60c716c32c40
[gaim-migrate @ 2362]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
41 typedef struct _GtkSmileyTree GtkSmileyTree; |
4263 | 42 typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; |
2349
60c716c32c40
[gaim-migrate @ 2362]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
43 |
1428 | 44 typedef struct _GtkIMHtml GtkIMHtml; |
45 typedef struct _GtkIMHtmlClass GtkIMHtmlClass; | |
46 | |
47 struct _GtkIMHtml { | |
3922 | 48 GtkTextView text_view; |
49 GtkTextBuffer *text_buffer; | |
50 GtkTextMark *end; | |
51 gboolean comments, smileys; | |
1428 | 52 GdkCursor *hand_cursor; |
53 GdkCursor *arrow_cursor; | |
4032 | 54 GHashTable *smiley_data; |
55 GtkSmileyTree *default_smilies; | |
4254 | 56 |
57 gboolean show_smileys; | |
58 gboolean show_comments; | |
4735 | 59 |
60 GtkWidget *tip_window; | |
61 char *tip; | |
62 guint tip_timer; | |
4895 | 63 |
64 GList *scalables; | |
1428 | 65 }; |
66 | |
67 struct _GtkIMHtmlClass { | |
3922 | 68 GtkTextViewClass parent_class; |
1428 | 69 |
70 void (*url_clicked) (GtkIMHtml *, const gchar *); | |
71 }; | |
72 | |
4263 | 73 struct _GtkIMHtmlSmiley { |
74 gchar *smile; | |
75 gchar *file; | |
76 GdkPixbuf *icon; | |
77 gboolean hidden; | |
78 }; | |
79 | |
1428 | 80 typedef enum |
81 { | |
82 GTK_IMHTML_NO_COLOURS = 1 << 0, | |
83 GTK_IMHTML_NO_FONTS = 1 << 1, | |
84 GTK_IMHTML_NO_COMMENTS = 1 << 2, | |
85 GTK_IMHTML_NO_TITLE = 1 << 3, | |
86 GTK_IMHTML_NO_NEWLINE = 1 << 4, | |
87 GTK_IMHTML_NO_SIZES = 1 << 5, | |
88 GTK_IMHTML_NO_SCROLL = 1 << 6, | |
89 GTK_IMHTML_RETURN_LOG = 1 << 7 | |
90 } GtkIMHtmlOptions; | |
91 | |
92 GtkType gtk_imhtml_get_type (void); | |
3922 | 93 GtkWidget* gtk_imhtml_new (void *, void *); |
1428 | 94 |
95 void gtk_imhtml_set_adjustments (GtkIMHtml *imhtml, | |
96 GtkAdjustment *hadj, | |
97 GtkAdjustment *vadj); | |
98 | |
99 void gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, | |
4032 | 100 gchar *sml, |
4263 | 101 GtkIMHtmlSmiley *smiley); |
1428 | 102 |
2728
16df889d81e2
[gaim-migrate @ 2741]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
103 void gtk_imhtml_remove_smileys (GtkIMHtml *imhtml); |
16df889d81e2
[gaim-migrate @ 2741]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
104 |
1428 | 105 void gtk_imhtml_show_smileys (GtkIMHtml *imhtml, |
106 gboolean show); | |
107 | |
108 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, | |
109 gboolean show); | |
110 | |
111 GString* gtk_imhtml_append_text (GtkIMHtml *imhtml, | |
112 const gchar *text, | |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2728
diff
changeset
|
113 gint len, |
1428 | 114 GtkIMHtmlOptions options); |
115 | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1574
diff
changeset
|
116 void gtk_imhtml_clear (GtkIMHtml *imhtml); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1574
diff
changeset
|
117 |
2363
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2349
diff
changeset
|
118 void gtk_imhtml_page_up (GtkIMHtml *imhtml); |
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2349
diff
changeset
|
119 |
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2349
diff
changeset
|
120 void gtk_imhtml_page_down (GtkIMHtml *imhtml); |
3867 | 121 void gtk_imhtml_to_bottom (GtkIMHtml *imhtml); |
2363
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2349
diff
changeset
|
122 |
4895 | 123 /* GtkIMHtmlScalable, gaim_im_image, and gaim_hr */ |
124 | |
125 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; | |
126 #define GTK_IMHTML_SCALABLE(x) ((GtkIMHtmlScalable *)x) | |
127 | |
128 struct _GtkIMHtmlScalable{ | |
129 void (*scale)(struct _GtkIMHtmlScalable *, int, int); | |
130 void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
131 void (*free)(struct _GtkIMHtmlScalable *); | |
132 }; | |
133 | |
134 typedef struct { | |
135 GtkIMHtmlScalable scalable; | |
136 GdkPixbuf *image; | |
137 GtkIMHtml *imhtml; | |
138 GtkTextMark *mark; | |
139 int width; | |
140 int height; | |
141 } gaim_im_image; | |
142 | |
143 typedef struct { | |
144 GtkIMHtmlScalable scalable; | |
145 GtkWidget *sep; | |
146 } gaim_hr; | |
147 | |
148 GtkIMHtmlScalable *gtk_imhtml_scalable_new(); | |
149 | |
150 GtkIMHtmlScalable *gaim_im_image_new(GdkPixbuf *img); | |
151 | |
152 void gaim_im_image_free(GtkIMHtmlScalable *); | |
153 | |
154 void gaim_im_image_scale(GtkIMHtmlScalable *, int, int); | |
155 | |
156 void gaim_im_image_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
157 | |
158 GtkIMHtmlScalable *gaim_hr_new(); | |
159 | |
160 void gaim_hr_free(GtkIMHtmlScalable *); | |
161 | |
162 void gaim_hr_scale(GtkIMHtmlScalable *, int, int); | |
163 | |
164 void gaim_hr_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
165 | |
166 | |
167 | |
1428 | 168 #ifdef __cplusplus |
169 } | |
170 #endif | |
171 | |
172 #endif |