4 * Copyright (C) 2000, Eric Warmenhoven <warmenhoven@yahoo.com>
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.
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.
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
22 #ifndef __GTK_IMHTML_H
23 #define __GTK_IMHTML_H
26 #include <gtk/gtklayout.h>
32 #define GTK_TYPE_IMHTML (gtk_imhtml_get_type ())
33 #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, GtkIMHtml))
34 #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_IMHTML, GtkIMHtmlClass))
35 #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML))
36 #define GTK_IS_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_IMHTML))
38 typedef gchar
** (*GtkIMHtmlImage
) (gchar
*url
);
40 typedef struct _GtkSmileyTree GtkSmileyTree
;
42 typedef struct _GtkIMHtml GtkIMHtml
;
43 typedef struct _GtkIMHtmlClass GtkIMHtmlClass
;
48 GdkFont
*default_font
;
49 GdkColor
*default_fg_color
;
50 GdkColor
*default_bg_color
;
51 GdkColor
*default_hl_color
;
52 GdkColor
*default_hlfg_color
;
54 GdkCursor
*hand_cursor
;
55 GdkCursor
*arrow_cursor
;
59 struct _GtkIMHtmlBit
*tip_bit
;
61 GtkWidget
*tip_window
;
64 guint sel_startx
, sel_starty
;
65 guint sel_endx
, sel_endy
;
68 GString
*selected_text
;
69 struct line_info
*sel_endchunk
;
83 GtkSmileyTree
*smiley_data
;
86 struct _GtkIMHtmlClass
{
87 GtkLayoutClass parent_class
;
89 void (*url_clicked
) (GtkIMHtml
*, const gchar
*);
94 GTK_IMHTML_NO_COLOURS
= 1 << 0,
95 GTK_IMHTML_NO_FONTS
= 1 << 1,
96 GTK_IMHTML_NO_COMMENTS
= 1 << 2,
97 GTK_IMHTML_NO_TITLE
= 1 << 3,
98 GTK_IMHTML_NO_NEWLINE
= 1 << 4,
99 GTK_IMHTML_NO_SIZES
= 1 << 5,
100 GTK_IMHTML_NO_SCROLL
= 1 << 6,
101 GTK_IMHTML_RETURN_LOG
= 1 << 7
104 GtkType
gtk_imhtml_get_type (void);
105 GtkWidget
* gtk_imhtml_new (GtkAdjustment
*hadj
,
106 GtkAdjustment
*vadj
);
108 void gtk_imhtml_set_adjustments (GtkIMHtml
*imhtml
,
110 GtkAdjustment
*vadj
);
112 void gtk_imhtml_set_defaults (GtkIMHtml
*imhtml
,
117 void gtk_imhtml_set_img_handler (GtkIMHtml
*imhtml
,
118 GtkIMHtmlImage handler
);
120 void gtk_imhtml_associate_smiley (GtkIMHtml
*imhtml
,
124 void gtk_imhtml_remove_smileys (GtkIMHtml
*imhtml
);
126 void gtk_imhtml_show_smileys (GtkIMHtml
*imhtml
,
129 void gtk_imhtml_show_comments (GtkIMHtml
*imhtml
,
132 GString
* gtk_imhtml_append_text (GtkIMHtml
*imhtml
,
135 GtkIMHtmlOptions options
);
137 void gtk_imhtml_clear (GtkIMHtml
*imhtml
);
139 void gtk_imhtml_page_up (GtkIMHtml
*imhtml
);
141 void gtk_imhtml_page_down (GtkIMHtml
*imhtml
);