Updated Esperanto translation
[gtkhtml.git] / gtkhtml / htmlimage.h
blob0e85fb31fc71e2ed7c290fb87efab3604bf429ff
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* This file is part of the KDE libraries
4 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
5 * Copyright (C) 1997 Torben Weis (weis@kde.org)
6 * Copyright (C) 1999, 2000 Helix Code, Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
23 #ifndef _HTMLIMAGE_H_
24 #define _HTMLIMAGE_H_
26 #include <gtk/gtk.h>
27 #include "htmlobject.h"
29 #define HTML_IMAGE_FACTORY(x) ((HTMLImageFactory *)(x))
30 #define HTML_IMAGE_POINTER(x) ((HTMLImagePointer *)(x))
31 #define HTML_IS_IMAGE(x) (HTML_CHECK_TYPE ((x), HTML_TYPE_IMAGE))
33 struct _HTMLImagePointer {
34 gint refcount;
35 gchar *url;
36 GdkPixbufLoader *loader;
37 GdkPixbufAnimation *animation;
38 GdkPixbufAnimationIter *iter;
39 GSList *interests; /* A list of HTMLImage's, or a NULL pointer for the background pixmap */
40 HTMLImageFactory *factory;
41 gint stall;
42 guint stall_timeout;
43 guint animation_timeout;
46 #define HTML_IMAGE(x) ((HTMLImage *)(x))
47 #define HTML_IMAGE_POINTER(x) ((HTMLImagePointer *)(x))
49 struct _HTMLImage {
50 HTMLObject object;
51 HTMLImagePointer *image_ptr;
53 HTMLColor *color;
55 guint have_color: 1;
57 gint8 border;
59 gint16 specified_width;
60 gint16 specified_height;
61 guint percent_width : 1;
62 guint percent_height : 1;
63 guint ismap : 1;
64 guint animation_active : 1;
66 gint8 hspace;
67 gint8 vspace;
69 HTMLVAlignType valign;
71 gchar *url;
72 gchar *target;
73 gchar *alt;
74 gchar *usemap;
75 gchar *final_url;
78 struct _HTMLImageClass {
79 HTMLObjectClass parent_class;
83 extern HTMLImageClass image_class;
86 void html_image_type_init (void);
87 void html_image_class_init (HTMLImageClass *klass,
88 HTMLType type,
89 guint object_size);
90 void html_image_init (HTMLImage *image,
91 HTMLImageClass *klass,
92 HTMLImageFactory *imf,
93 const gchar *filename,
94 const gchar *url,
95 const gchar *target,
96 gint16 width,
97 gint16 height,
98 gboolean percent_width,
99 gboolean percent_height,
100 gint8 border,
101 HTMLColor *border_color,
102 HTMLVAlignType valign,
103 gboolean reload);
104 HTMLObject *html_image_new (HTMLImageFactory *imf,
105 const gchar *filename,
106 const gchar *url,
107 const gchar *target,
108 gint16 width,
109 gint16 height,
110 gboolean percent_width,
111 gboolean percent_height,
112 gint8 border,
113 HTMLColor *border_color,
114 HTMLVAlignType valign,
115 gboolean reload);
116 void html_image_set_size (HTMLImage *image,
117 gint w,
118 gint h,
119 gboolean pw,
120 gboolean ph);
121 void html_image_set_spacing (HTMLImage *image,
122 gint hspace,
123 gint vspace);
124 void html_image_set_url (HTMLImage *image,
125 const gchar *url);
126 void html_image_set_valign (HTMLImage *image,
127 HTMLVAlignType valign);
128 void html_image_set_border (HTMLImage *image,
129 gint border);
130 void html_image_set_alt (HTMLImage *image,
131 const gchar *alt);
132 void html_image_set_map (HTMLImage *image,
133 gchar *mapuri,
134 gboolean ismap);
135 gchar *html_image_resolve_image_url (GtkHTML *html,
136 gchar *image_url);
138 void html_image_edit_set_url (HTMLImage *image,
139 const gchar *url);
140 guint html_image_get_actual_width (HTMLImage *image,
141 HTMLPainter *painter);
142 guint html_image_get_actual_height (HTMLImage *image,
143 HTMLPainter *painter);
144 /* FIXME move to htmlimagefactory.c */
145 HTMLImageFactory *html_image_factory_new (HTMLEngine *e);
146 void html_image_factory_free (HTMLImageFactory *factory);
147 void html_image_factory_cleanup (HTMLImageFactory *factory); /* Does gc etc. - removes unused image entries */
148 void html_image_factory_stop_animations (HTMLImageFactory *factory);
149 void html_image_factory_start_animations (HTMLImageFactory *factory);
150 void html_image_factory_set_animate (HTMLImageFactory *factory,
151 gboolean animate);
152 gboolean html_image_factory_get_animate (HTMLImageFactory *factory);
153 void html_image_factory_deactivate_animations (HTMLImageFactory *factory);
154 HTMLImagePointer *html_image_factory_register (HTMLImageFactory *factory,
155 HTMLImage *i,
156 const gchar *filename,
157 gboolean reload);
158 void html_image_factory_unregister (HTMLImageFactory *factory,
159 HTMLImagePointer *pointer,
160 HTMLImage *i);
161 void html_image_factory_move_images (HTMLImageFactory *dst,
162 HTMLImageFactory *src);
163 void html_image_factory_ref_all_images (HTMLImageFactory *factory);
164 void html_image_factory_unref_all_images (HTMLImageFactory *factory);
165 void html_image_factory_ref_image_ptr (HTMLImageFactory *factory,
166 const gchar *url);
167 void html_image_factory_unref_image_ptr (HTMLImageFactory *factory,
168 const gchar *url);
169 #endif /* _HTMLIMAGE_H_ */