Mercurial > pidgin.yaz
annotate src/gtkimhtml.h @ 7295:c7f0a4397d9e
[gaim-migrate @ 7879]
I added a search feature to conversations. I actually did most of this a
while ago for the log viewer. GtkIMHtml has some functions to handle searching
itself. I just added a new item to the conversation menu to handle it.
This should be useful for long IRC channel backlogs and the sorts.
It's case-sensitive right now. That kinda sucks, but that's all GTK lets me
do. GtkSourceView has some nice case-insensitive search functions that I'll
likely bring in before the release.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 18 Oct 2003 01:58:02 +0000 |
parents | 083d1e4a9c78 |
children | 15155dbc768a |
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; | |
6124 | 61 gboolean show_comments; |
4735 | 62 |
63 GtkWidget *tip_window; | |
64 char *tip; | |
65 guint tip_timer; | |
4895 | 66 |
67 GList *scalables; | |
4947 | 68 GdkRectangle old_rect; |
7295 | 69 |
70 gchar *search_string; | |
1428 | 71 }; |
72 | |
73 struct _GtkIMHtmlClass { | |
3922 | 74 GtkTextViewClass parent_class; |
1428 | 75 |
5967 | 76 void (*url_clicked)(GtkIMHtml *, const gchar *); |
77 }; | |
78 | |
79 struct _GtkIMHtmlFontDetail { | |
80 gushort size; | |
81 gchar *face; | |
82 gchar *fore; | |
83 gchar *back; | |
84 gchar *sml; | |
85 }; | |
86 | |
87 struct _GtkSmileyTree { | |
88 GString *values; | |
89 GtkSmileyTree **children; | |
90 GtkIMHtmlSmiley *image; | |
1428 | 91 }; |
92 | |
4263 | 93 struct _GtkIMHtmlSmiley { |
94 gchar *smile; | |
95 gchar *file; | |
6814
782907a6ae65
[gaim-migrate @ 7354]
Christian Hammond <chipx86@chipx86.com>
parents:
6282
diff
changeset
|
96 GdkPixbufAnimation *icon; |
4263 | 97 gboolean hidden; |
98 }; | |
99 | |
5967 | 100 struct _GtkIMHtmlScalable { |
4895 | 101 void (*scale)(struct _GtkIMHtmlScalable *, int, int); |
102 void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
103 void (*free)(struct _GtkIMHtmlScalable *); | |
104 }; | |
105 | |
5967 | 106 struct _GtkIMHtmlImage { |
4895 | 107 GtkIMHtmlScalable scalable; |
5012 | 108 GtkImage *image; |
5046 | 109 GdkPixbuf *pixbuf; |
4895 | 110 GtkTextMark *mark; |
5012 | 111 gchar *filename; |
4895 | 112 int width; |
113 int height; | |
5967 | 114 }; |
4895 | 115 |
5967 | 116 struct _GtkIMHtmlHr { |
4895 | 117 GtkIMHtmlScalable scalable; |
118 GtkWidget *sep; | |
5967 | 119 }; |
120 | |
121 typedef enum { | |
122 GTK_IMHTML_NO_COLOURS = 1 << 0, | |
123 GTK_IMHTML_NO_FONTS = 1 << 1, | |
124 GTK_IMHTML_NO_COMMENTS = 1 << 2, | |
125 GTK_IMHTML_NO_TITLE = 1 << 3, | |
126 GTK_IMHTML_NO_NEWLINE = 1 << 4, | |
127 GTK_IMHTML_NO_SIZES = 1 << 5, | |
128 GTK_IMHTML_NO_SCROLL = 1 << 6, | |
129 GTK_IMHTML_RETURN_LOG = 1 << 7, | |
130 GTK_IMHTML_USE_POINTSIZE = 1 << 8 | |
131 } GtkIMHtmlOptions; | |
132 | |
133 GtkType gtk_imhtml_get_type (void); | |
134 GtkWidget* gtk_imhtml_new (void *, void *); | |
135 | |
136 void gtk_imhtml_set_adjustments (GtkIMHtml *imhtml, | |
137 GtkAdjustment *hadj, | |
138 GtkAdjustment *vadj); | |
139 | |
140 void gtk_imhtml_associate_smiley (GtkIMHtml *imhtml, | |
141 gchar *sml, GtkIMHtmlSmiley *smiley); | |
142 | |
143 void gtk_imhtml_remove_smileys (GtkIMHtml *imhtml); | |
144 | |
145 void gtk_imhtml_show_smileys (GtkIMHtml *imhtml, gboolean show); | |
146 | |
147 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, gboolean show); | |
148 | |
6982 | 149 #define gtk_imhtml_append_text(x, y, z) \ |
150 gtk_imhtml_append_text_with_images(x, y, z, NULL) | |
151 | |
152 GString* gtk_imhtml_append_text_with_images (GtkIMHtml *imhtml, | |
153 const gchar *text, | |
154 GtkIMHtmlOptions options, | |
155 GSList *images); | |
5967 | 156 |
157 void gtk_imhtml_clear (GtkIMHtml *imhtml); | |
158 void gtk_imhtml_page_up (GtkIMHtml *imhtml); | |
159 void gtk_imhtml_page_down (GtkIMHtml *imhtml); | |
4895 | 160 |
161 GtkIMHtmlScalable *gtk_imhtml_scalable_new(); | |
6982 | 162 GtkIMHtmlScalable *gtk_imhtml_image_new(GdkPixbuf *img, const gchar *filename); |
5967 | 163 void gtk_imhtml_image_free(GtkIMHtmlScalable *); |
164 void gtk_imhtml_image_scale(GtkIMHtmlScalable *, int, int); | |
165 void gtk_imhtml_image_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
4895 | 166 |
5967 | 167 GtkIMHtmlScalable *gtk_imhtml_hr_new(); |
168 void gtk_imhtml_hr_free(GtkIMHtmlScalable *); | |
169 void gtk_imhtml_hr_scale(GtkIMHtmlScalable *, int, int); | |
170 void gtk_imhtml_hr_add_to(GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter *); | |
4895 | 171 |
7295 | 172 /* Search functions */ |
173 gboolean gtk_imhtml_search_find(GtkIMHtml *imhtml, const gchar *text); | |
174 void gtk_imhtml_search_clear(GtkIMHtml *imhtml); | |
4895 | 175 |
1428 | 176 #ifdef __cplusplus |
177 } | |
178 #endif | |
179 | |
180 #endif |