1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*  This file is part of the GtkHTML library.
3  *
4  *  Copyright 1999, 2000 Helix Code, Inc.
5  *
6  *  This library is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU Library General Public
8  *  License as published by the Free Software Foundation; either
9  *  version 2 of the License, or (at your option) any later version.
10  *
11  *  This library 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 GNU
14  *  Library General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Library General Public License
17  *  along with this library; see the file COPYING.LIB.  If not, write to
18  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  *  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef _GTKHTML_PRIVATE_H
23 #define _GTKHTML_PRIVATE_H
24 
25 #include <gtk/gtk.h>
26 #include "gtkhtml-types.h"
27 #include "htmltypes.h"
28 
29 struct _GtkHTMLPrivate {
30 	guint idle_handler_id;
31 	guint scroll_timeout_id;
32 
33 	GtkHTMLParagraphStyle paragraph_style;
34 	guint paragraph_indentation;
35 	GtkHTMLParagraphAlignment paragraph_alignment;
36 	GtkHTMLFontStyle insertion_font_style;
37 
38 	gboolean update_styles;
39 	gboolean skip_update_cursor;
40 	gboolean cursor_moved;
41 
42 	gint selection_type;
43 
44 	gchar  *base_url;
45 
46 	GtkWidget *search_input_line;
47 
48 	GSettings *desktop_interface;
49 
50 	GtkIMContext *im_context;
51 	gboolean need_im_reset;
52 	gint im_pre_len;
53 	gint im_pre_pos;
54 	GtkHTMLFontStyle im_orig_style;
55 	gboolean im_block_reset;
56 
57 	HTMLObject *dnd_object;
58 	gint        dnd_object_offset;
59 	HTMLObject *dnd_real_object;
60 	gint        dnd_real_object_offset;
61 	gboolean    dnd_in_progress;
62 	gchar      *dnd_url;
63 
64 	guint32     event_time;
65 	gboolean    selection_as_cite;
66 
67 	gboolean    magic_links;
68 	gboolean    magic_smileys;
69 	gboolean    inline_spelling;
70 
71 	gulong      toplevel_unmap_handler;
72 
73 	gboolean in_object_resize;
74 	GdkCursor *resize_cursor;
75 	HTMLObject *resize_object;
76 
77 	gboolean in_url_test_mode;
78 
79 	gboolean in_key_binding;
80 
81 	gchar *caret_first_focus_anchor;
82 	gboolean is_first_focus;
83 
84 	GtkAdjustment *hadjustment;
85 	GtkAdjustment *vadjustment;
86 };
87 
88 void  gtk_html_private_calc_scrollbars  (GtkHTML                *html,
89 					 gboolean               *changed_x,
90 					 gboolean               *changed_y);
91 void  gtk_html_editor_event_command     (GtkHTML                *html,
92 					 GtkHTMLCommandType      com_type,
93 					 gboolean                before);
94 void  gtk_html_editor_event             (GtkHTML                *html,
95 					 GtkHTMLEditorEventType  event,
96 					 GValue                 *args);
97 void  gtk_html_api_set_language         (GtkHTML                *html);
98 void  gtk_html_im_reset                 (GtkHTML                *html);
99 void  gtk_html_set_fonts                (GtkHTML                *html,
100 					 HTMLPainter            *painter);
101 
102 gchar *gtk_html_filename_to_uri		(const gchar		*filename);
103 gchar *gtk_html_filename_from_uri	(const gchar		*uri);
104 
105 #ifdef G_OS_WIN32
106 
107 const gchar *_get_icondir (void) G_GNUC_CONST;
108 const gchar *_get_gtkhtml_datadir (void) G_GNUC_CONST;
109 const gchar *_get_localedir (void) G_GNUC_CONST;
110 const gchar *_get_prefix (void) G_GNUC_CONST;
111 const gchar *_get_sysconfdir (void) G_GNUC_CONST;
112 const gchar *_get_datadir (void) G_GNUC_CONST;
113 const gchar *_get_libdir (void) G_GNUC_CONST;
114 
115 #undef ICONDIR
116 #define ICONDIR _get_icondir ()
117 
118 #undef GTKHTML_DATADIR
119 #define GTKHTML_DATADIR _get_gtkhtml_datadir ()
120 
121 #undef GNOMELOCALEDIR
122 #define GNOMELOCALEDIR _get_localedir ()
123 
124 #undef PREFIX
125 #define PREFIX _get_prefix ()
126 
127 #undef SYSCONFDIR
128 #define SYSCONFDIR _get_sysconfdir ()
129 
130 #undef DATADIR
131 #define DATADIR _get_datadir ()
132 
133 #undef LIBDIR
134 #define LIBDIR _get_libdir ()
135 
136 #endif
137 
138 #endif /* _GTKHTML_PRIVATE_H */
139