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 (C) 1997 Martin Jones (mjones@kde.org)
5  * Copyright (C) 1997 Torben Weis (weis@kde.org)
6  * Copyright (C) 1999, 2000 Helix Code, Inc.
7  *
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.
12  *
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  * MERCHcANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
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.
22 */
23 
24 #ifndef _HTMLOBJECT_H_
25 #define _HTMLOBJECT_H_
26 
27 #include <gtk/gtk.h>
28 #include "htmltypes.h"
29 #include "htmlenums.h"
30 
31 #define HTML_OBJECT(x)		((HTMLObject *) (x))
32 #define HTML_OBJECT_CLASS(x)	((HTMLObjectClass *) (x))
33 #define HTML_OBJECT_TYPE(x)     (HTML_OBJECT (x)->klass->type)
34 
35 struct _HTMLObject {
36 	HTMLObjectClass *klass;
37 
38 	/* Pointer to the parent object.  */
39 	HTMLObject *parent;
40 
41 	HTMLObject *prev;
42 	HTMLObject *next;
43 
44 	HTMLChangeFlags change;
45 
46 	gint x, y;
47 
48 	gint ascent, descent;
49 
50 	gint min_width;
51 	gint width;
52 	gint pref_width;
53 	gint max_width;
54 
55 	gint percent;
56 
57 	guchar flags;
58 
59 	/* FIXME maybe unify with `flags'?  */
60 	guint redraw_pending : 1;
61 	guint selected : 1;
62 
63 	/* If an object has a redraw pending and is being destroyed, this flag
64 	 * is set to TRUE instead of g_free () ing the object.  When the draw
65 	 * queue is flushed, the g_free () is performed.  */
66 	guint free_pending : 1;
67 
68 	/* FIXME add the other dynamic pusedo-classes... */
69 	guint draw_focused : 1;
70 
71 	GData *object_data;
72 	GData *object_data_nocp;
73 
74 	gchar *id;
75 };
76 
77 struct _HTMLObjectClearRectangle {
78 	HTMLObject *object;
79 	gint x;
80 	gint y;
81 	gint width;
82 	gint height;
83 };
84 
85 struct _HTMLObjectClass {
86 	HTMLType type;
87 
88 	guint object_size;
89 
90 	/* Destroy the object.  */
91 	void (* destroy) (HTMLObject *o);
92 
93 	/* Copy an object into another one.  @dest can just point to a
94 	 * memory area of the proper size.  */
95 	void (* copy) (HTMLObject *self, HTMLObject *dest);
96 
97 	/* copy/cut/paste operations */
98 	HTMLObject * (* op_copy)         (HTMLObject *self,
99 					  HTMLObject *parent,
100 					  HTMLEngine *e,
101 					  GList      *from,
102 					  GList      *to,
103 					  guint      *len);
104 	HTMLObject * (* op_cut)          (HTMLObject *self,
105 					  HTMLEngine *e,
106 					  GList      *from,
107 					  GList      *to,
108 					  GList      *left,
109 					  GList      *right,
110 					  guint      *len);
111 	gboolean     (* merge)           (HTMLObject *self,
112 					  HTMLObject *o,
113 					  HTMLEngine *e,
114 					  GList      **left,
115 					  GList      **right,
116 					  HTMLCursor *cursor);
117 	void         (* remove_child)    (HTMLObject *self,
118 					  HTMLObject *child);
119 	void         (* split)           (HTMLObject *self,
120 					  HTMLEngine *e,
121 					  HTMLObject *child,
122 					  gint offset,
123 					  gint level,
124 					  GList **left,
125 					  GList **right);
126 
127 	/* Layout management and geometry handling.  */
128 
129 	HTMLFitType (* fit_line) (HTMLObject *o, HTMLPainter *painter,
130 				  gboolean start_of_line, gboolean first_run, gboolean next_to_floating,
131 				  gint width_left);
132 	gboolean (* calc_size) (HTMLObject *o, HTMLPainter *painter, GList **changed_objs);
133 	gint (* calc_min_width) (HTMLObject *o, HTMLPainter *painter);
134 	gint (* calc_preferred_width) (HTMLObject *o, HTMLPainter *painter);
135 	void (* set_max_width) (HTMLObject *o, HTMLPainter *painter, gint max_width);
136 	void (* set_max_height) (HTMLObject *o, HTMLPainter *painter, gint max_height);
137 
138 	/* Relayout object `o' starting from child `child'.  This
139 	 * method can be called by the child when it changes any of
140 	 * its layout properties.  */
141 
142 	gboolean (* layout) (HTMLObject *o, HTMLObject *child);
143 
144 	/* This method is used to draw the object.  @x & @y are in
145 	 * object coordinates (e.g. the same coordinate system as o->x
146 	 * and o->y). @tx & @ty are used to translate the object
147 	 * coordinates into painter coordinates.  */
148 
149 	void (* draw) (HTMLObject *o,
150 		       HTMLPainter *painter,
151 		       gint x, gint y,
152 		       gint width, gint height,
153 		       gint tx, gint ty);
154 
155 	/* "Transparent" objects (i.e. objects that don't draw all the
156  *         area they occupy, such as text) should return `TRUE' here.  */
157 
158 	gboolean (* is_transparent) (HTMLObject *self);
159 
160 	/* Unused ::draw_background method */
161 	void (* draw_background) (HTMLObject *o,
162 				  HTMLPainter *painter,
163 				  gint x, gint y,
164 				  gint width, gint height,
165 				  gint tx, gint ty);
166 	/* remove it later */
167 
168 	void       (* set_bg_color) (HTMLObject *o, GdkColor *color);
169 	GdkColor * (* get_bg_color) (HTMLObject *o, HTMLPainter *p);
170 
171 	/* Margins.  This should actually be used only by objects that
172 	 * contain other objects, so it should be in HTMLClue.  But
173 	 * HTMLTable does not derive from HTMLClue and we don't want
174 	 * to spend time reorganizing the hierarchy now.  */
175 
176 	gint (* get_left_margin) (HTMLObject *self, HTMLPainter *painter, gint y, gboolean with_aligned);
177 	gint (* get_right_margin) (HTMLObject *self, HTMLPainter *painter, gint y, gboolean with_aligned);
178 
179 	void (* set_painter) (HTMLObject *o, HTMLPainter *painter);
180 
181 	/* Resetting the object.  Do this before using a different
182 	 * HTMLPainter.  */
183 
184 	void (* reset) (HTMLObject *o);
185 
186 	const gchar * (* get_url)    (HTMLObject *o, gint offset);
187 	const gchar * (* get_target) (HTMLObject *o, gint offset);
188 	const gchar * (* get_src)    (HTMLObject *o);
189 
190 	HTMLAnchor * (* find_anchor) (HTMLObject *o, const gchar *name, gint *x, gint *y);
191 
192 	HTMLObject * (* check_point) (HTMLObject *self, HTMLPainter *painter,
193 				      gint x, gint y, guint *offset_return,
194 				      gboolean for_cursor);
195 
196 	/* Relayout this object.  The object will relayout all the children
197 	 * starting from `child'.  Children before `child' are not affected.
198 	 * The return value is FALSE if nothing has changed during relayout,
199 	 * TRUE otherwise.  */
200 	gboolean (* relayout) (HTMLObject *self, HTMLEngine *engine, HTMLObject *child);
201 
202 	/* Return the vertical alignment for the object in an HTMLClueFlow.  If
203 	 * the returned value is `HTML_VALIGN_BOTTOM', the bottom of the object
204 	 * is aligned to the base line; if the value is `HTML_VALIGN_TOP', the
205 	 * top of the object is aligned to the top of the line; if the value is
206 	 * `HTML_VALIGN_MIDDLE', the center of the object is aligned to the
207 	 * baseline.  */
208 	HTMLVAlignType (* get_valign) (HTMLObject *self);
209 
210 	/* Cursor handling.  */
211 
212 	gboolean (* accepts_cursor) (HTMLObject *self);
213 	void (* get_cursor) (HTMLObject *self, HTMLPainter *painter, guint offset,
214 			     gint *x1, gint *y1, gint *x2, gint *y2);
215 	void (* get_cursor_base) (HTMLObject *self, HTMLPainter *painter, guint offset,
216 				  gint *x, gint *y);
217 
218 	/* Container operations.  */
219 	HTMLEngine * (* get_engine) (HTMLObject *o, HTMLEngine *e);
220 	void (* forall) (HTMLObject *self, HTMLEngine *e, HTMLObjectForallFunc func, gpointer data);
221 	gboolean (* is_container) (HTMLObject *self);
222 
223 	/* Saving.  */
224 
225 	gboolean (* save) (HTMLObject *self, HTMLEngineSaveState *state);
226 	gboolean (* save_plain) (HTMLObject *self, HTMLEngineSaveState *state, gint requested_width);
227 
228 	/* Page splitting (for printing).  */
229 
230 	gint (* check_page_split) (HTMLObject *self, HTMLPainter *p, gint y);
231 
232 	/* Selection.  */
233 	gboolean (* select_range) (HTMLObject *self, HTMLEngine *engine, guint start, gint length,
234 				   gboolean queue_draw);
235 	void (* append_selection_string) (HTMLObject *self, GString *buffer);
236 
237 	/* Search & Replace */
238 	gboolean     (* search)          (HTMLObject *self, HTMLSearch *info);
239 	gboolean     (* search_next)     (HTMLObject *self, HTMLSearch *info);
240 
241 	/* links */
242 	HTMLObject * (* set_link)        (HTMLObject *self, HTMLColor *color, const gchar *url, const gchar *target);
243 
244 	/* length */
245 	guint        (* get_length)                (HTMLObject *self);
246 	guint        (* get_line_length)           (HTMLObject *self, HTMLPainter *p, gint line_offset);
247 	guint        (* get_recursive_length)      (HTMLObject *self);
248 
249 	/* movement */
250 	HTMLObject * (* next)            (HTMLObject *self, HTMLObject *child);
251 	HTMLObject * (* prev)            (HTMLObject *self, HTMLObject *child);
252 	HTMLObject * (* head)            (HTMLObject *self);
253 	HTMLObject * (* tail)            (HTMLObject *self);
254 
255 	HTMLClearType (* get_clear)      (HTMLObject *self);
256 
257 	gint (* get_n_children)          (HTMLObject *self);
258 	HTMLObject * (* get_child)       (HTMLObject *self, gint index);
259 	gint (* get_child_index)         (HTMLObject *self, HTMLObject *child);
260 
261 	HTMLDirection (*get_direction)   (HTMLObject *self);
262 
263 	gboolean (*cursor_forward)       (HTMLObject *self, HTMLCursor *cursor, HTMLEngine *engine);
264 	gboolean (*cursor_forward_one)   (HTMLObject *self, HTMLCursor *cursor, HTMLEngine *engine);
265 	gboolean (*cursor_backward)      (HTMLObject *self, HTMLCursor *cursor, HTMLEngine *engine);
266 	gboolean (*cursor_backward_one)  (HTMLObject *self, HTMLCursor *cursor, HTMLEngine *engine);
267 	gboolean (*cursor_right)         (HTMLObject *self, HTMLPainter *painter, HTMLCursor *cursor);
268 	gboolean (*cursor_left)          (HTMLObject *self, HTMLPainter *painter, HTMLCursor *cursor);
269 
270 	gint (*get_right_edge_offset) (HTMLObject *o, HTMLPainter *painter, gint offset);
271 	gint (*get_left_edge_offset) (HTMLObject *o, HTMLPainter *painter, gint offset);
272 
273 	gboolean (*backspace)       (HTMLObject *self, HTMLCursor *cursor, HTMLEngine *engine);
274 };
275 
276 extern HTMLObjectClass html_object_class;
277 
278 /* Basics.  */
279 void            html_object_type_init             (void);
280 void            html_object_init                  (HTMLObject            *self,
281 						   HTMLObjectClass       *klass);
282 void            html_object_class_init            (HTMLObjectClass       *klass,
283 						   HTMLType               type,
284 						   guint                  object_size);
285 HTMLObject     *html_object_new                   (HTMLObject            *parent);
286 void            html_object_destroy               (HTMLObject            *self);
287 void            html_object_copy                  (HTMLObject            *self,
288 						   HTMLObject            *dest);
289 HTMLObject     *html_object_dup                   (HTMLObject            *self);
290 
291 /* copy/cut/paste operations */
292 HTMLObject     *html_object_op_copy               (HTMLObject            *self,
293 						   HTMLObject            *parent,
294 						   HTMLEngine            *e,
295 						   GList                 *from,
296 						   GList                 *to,
297 						   guint                 *len);
298 HTMLObject     *html_object_op_cut                (HTMLObject            *self,
299 						   HTMLEngine            *e,
300 						   GList                 *from,
301 						   GList                 *to,
302 						   GList                 *left,
303 						   GList                 *right,
304 						   guint                 *len);
305 gboolean        html_object_merge                 (HTMLObject            *self,
306 						   HTMLObject            *with,
307 						   HTMLEngine            *e,
308 						   GList                 **left,
309 						   GList                 **right,
310 						   HTMLCursor            *cursor);
311 void            html_object_remove_child          (HTMLObject            *self,
312 						   HTMLObject            *child);
313 void            html_object_split                 (HTMLObject            *self,
314 						   HTMLEngine            *e,
315 						   HTMLObject            *child,
316 						   gint                   offset,
317 						   gint                   level,
318 						   GList                **left,
319 						   GList                **right);
320 void            html_object_set_parent            (HTMLObject            *self,
321 						   HTMLObject            *parent);
322 gint            html_object_get_left_margin       (HTMLObject            *self,
323 						   HTMLPainter           *painter,
324 						   gint                   y,
325 						   gboolean               with_aligned);
326 gint            html_object_get_right_margin      (HTMLObject            *self,
327 						   HTMLPainter           *painter,
328 						   gint                   y,
329 						   gboolean               with_aligned);
330 void            html_object_set_painter           (HTMLObject            *o,
331 						   HTMLPainter           *p);
332 void            html_object_reset                 (HTMLObject            *o);
333 gboolean        html_object_is_text               (HTMLObject            *object);
334 gboolean        html_object_is_clue               (HTMLObject            *object);
335 HTMLEngine     *html_object_get_engine            (HTMLObject            *self,
336 						   HTMLEngine            *e);
337 HTMLEngine     *html_object_engine                (HTMLObject            *o,
338 						   HTMLEngine            *e);
339 void            html_object_forall                (HTMLObject            *self,
340 						   HTMLEngine            *e,
341 						   HTMLObjectForallFunc   func,
342 						   gpointer               data);
343 gboolean        html_object_is_container          (HTMLObject            *self);
344 HTMLObject     *html_object_next_not_type         (HTMLObject            *self,
345 						   HTMLType               t);
346 HTMLObject     *html_object_prev_not_type         (HTMLObject            *self,
347 						   HTMLType               t);
348 HTMLObject     *html_object_next_not_slave        (HTMLObject            *self);
349 HTMLObject     *html_object_prev_not_slave        (HTMLObject            *self);
350 HTMLObject     *html_object_next_by_type          (HTMLObject            *self,
351 						   HTMLType               t);
352 HTMLObject     *html_object_prev_by_type          (HTMLObject            *self,
353 						   HTMLType               t);
354 HTMLObject     *html_object_nth_parent            (HTMLObject            *self,
355 						   gint                   n);
356 gint            html_object_get_parent_level      (HTMLObject            *self);
357 /* do search request on object using info */
358 gboolean        html_object_search                (HTMLObject            *self,
359 						   HTMLSearch            *info);
360 gboolean        html_object_search_next           (HTMLObject            *self,
361 						   HTMLSearch            *info);
362 
363 /* Drawing-related stuff.  */
364 void            html_object_draw                  (HTMLObject            *o,
365 						   HTMLPainter           *p,
366 						   gint                   x,
367 						   gint                   y,
368 						   gint                   width,
369 						   gint                   height,
370 						   gint                   tx,
371 						   gint                   ty);
372 void            html_object_set_bg_color          (HTMLObject            *o,
373 						   GdkColor              *color);
374 GdkColor       *html_object_get_bg_color          (HTMLObject            *o,
375 						   HTMLPainter           *p);
376 gboolean        html_object_is_transparent        (HTMLObject            *self);
377 
378 /* Layout.  */
379 HTMLFitType     html_object_fit_line              (HTMLObject            *o,
380 						   HTMLPainter           *painter,
381 						   gboolean               start_of_line,
382 						   gboolean               first_run,
383 						   gboolean               next_to_floating,
384 						   gint                   width_left);
385 gboolean        html_object_calc_size             (HTMLObject            *o,
386 						   HTMLPainter           *painter,
387 						   GList                **changed_objs);
388 void            html_object_set_max_width         (HTMLObject            *o,
389 						   HTMLPainter           *painter,
390 						   gint                   max_width);
391 void            html_object_set_max_height        (HTMLObject            *o,
392 						   HTMLPainter           *painter,
393 						   gint                   max_height);
394 gint            html_object_calc_min_width        (HTMLObject            *o,
395 						   HTMLPainter           *painter);
396 gint            html_object_calc_preferred_width  (HTMLObject            *o,
397 						   HTMLPainter           *painter);
398 void            html_object_calc_abs_position     (HTMLObject            *o,
399 						   gint                  *x_return,
400 						   gint                  *y_return);
401 void            html_object_calc_abs_position_in_frame (HTMLObject       *o,
402 							gint              *x_return,
403 							gint              *y_return);
404 gboolean        html_object_intersect             (HTMLObject            *o,
405 						   GdkRectangle          *intersection,
406 						   gint                   x,
407 						   gint                   y,
408 						   gint                   width,
409 						   gint                   height);
410 gboolean        html_object_relayout              (HTMLObject            *obj,
411 						   HTMLEngine            *engine,
412 						   HTMLObject            *child);
413 HTMLVAlignType  html_object_get_valign            (HTMLObject            *self);
414 
415 /* Links.  */
416 const gchar    *html_object_get_url               (HTMLObject            *o,
417 						   gint                   offset);
418 const gchar    *html_object_get_target            (HTMLObject            *o,
419 						   gint                   offset);
420 gchar          *html_object_get_complete_url      (HTMLObject            *o,
421 						   gint                   offset);
422 const gchar    *html_object_get_src               (HTMLObject            *o);
423 HTMLAnchor     *html_object_find_anchor           (HTMLObject            *o,
424 						   const gchar           *name,
425 						   gint                  *x,
426 						   gint                  *y);
427 HTMLObject     *html_object_set_link              (HTMLObject            *self,
428 						   HTMLColor             *color,
429 						   const gchar           *url,
430 						   const gchar           *target);
431 HTMLObject     *html_object_remove_link           (HTMLObject            *self,
432 						   HTMLColor             *color);
433 
434 /* Cursor.  */
435 gboolean        html_object_accepts_cursor        (HTMLObject            *obj);
436 void            html_object_get_cursor            (HTMLObject            *obj,
437 						   HTMLPainter           *painter,
438 						   guint                  offset,
439 						   gint                  *x1,
440 						   gint                  *y1,
441 						   gint                  *x2,
442 						   gint                  *y2);
443 void            html_object_get_cursor_base       (HTMLObject            *obj,
444 						   HTMLPainter           *painter,
445 						   guint                  offset,
446 						   gint                  *x,
447 						   gint                  *y);
448 guint           html_object_get_length            (HTMLObject            *self);
449 guint           html_object_get_line_length       (HTMLObject            *self,
450 						   HTMLPainter           *p,
451 						   gint                   line_offset);
452 guint           html_object_get_recursive_length  (HTMLObject            *self);
453 guint           html_object_get_bytes             (HTMLObject            *self);
454 guint           html_object_get_index             (HTMLObject            *self,
455 						   guint                  offset);
456 HTMLObject     *html_object_check_point           (HTMLObject            *clue,
457 						   HTMLPainter           *painter,
458 						   gint                   x,
459 						   gint                   y,
460 						   guint                 *offset_return,
461 						   gboolean               for_cursor);
462 
463 /* Movement functions */
464 /* move cursor in scope of object */
465 gboolean        html_object_cursor_forward        (HTMLObject            *self,
466 						   HTMLCursor            *cursor,
467 						   HTMLEngine            *engine);
468 gboolean        html_object_cursor_forward_one    (HTMLObject            *self,
469 						   HTMLCursor            *cursor,
470 						   HTMLEngine            *engine);
471 gboolean        html_object_cursor_backward       (HTMLObject            *self,
472 						   HTMLCursor            *cursor,
473 						   HTMLEngine            *engine);
474 gboolean        html_object_cursor_backward_one   (HTMLObject            *self,
475 						   HTMLCursor            *cursor,
476 						   HTMLEngine            *engine);
477 gboolean        html_object_cursor_left           (HTMLObject            *self,
478 						   HTMLPainter           *painter,
479 						   HTMLCursor            *cursor);
480 gboolean        html_object_cursor_right          (HTMLObject            *self,
481 						   HTMLPainter           *painter,
482 						   HTMLCursor            *cursor);
483 gboolean        html_object_backspace             (HTMLObject            *self,
484 						   HTMLCursor            *cursor,
485 						   HTMLEngine            *engine);
486 
487 /* get prev/next object in scope of parent */
488 HTMLObject     *html_object_next                  (HTMLObject            *self,
489 						   HTMLObject            *child);
490 HTMLObject     *html_object_prev                  (HTMLObject            *self,
491 						   HTMLObject            *child);
492 /* get head/tail object of this (parent) object */
493 HTMLObject     *html_object_head                  (HTMLObject            *self);
494 HTMLObject     *html_object_tail                  (HTMLObject            *self);
495 HTMLObject     *html_object_tail_not_slave        (HTMLObject            *self);
496 
497 /* get prev/next leaf object in scope of whole tree */
498 HTMLObject     *html_object_next_leaf             (HTMLObject            *self);
499 HTMLObject     *html_object_prev_leaf             (HTMLObject            *self);
500 HTMLObject     *html_object_next_leaf_not_type    (HTMLObject            *self,
501 						   HTMLType               t);
502 HTMLObject     *html_object_prev_leaf_not_type    (HTMLObject            *self,
503 						   HTMLType               t);
504 HTMLObject     *html_object_get_head_leaf         (HTMLObject            *o);
505 HTMLObject     *html_object_get_tail_leaf         (HTMLObject            *o);
506 HTMLObject     *html_object_next_cursor           (HTMLObject            *self,
507 						   gint                  *offset);
508 HTMLObject     *html_object_prev_cursor           (HTMLObject            *self,
509 						   gint                  *offset);
510 GdkRectangle   *html_object_get_bounds            (HTMLObject            *o,
511 						   GdkRectangle          *bounds);
512 
513 /* Page splitting.  */
514 gint  html_object_check_page_split  (HTMLObject  *self,
515 				     HTMLPainter *p,
516 				     gint         y);
517 
518 /* Selection.  */
519 gboolean    html_object_select_range             (HTMLObject *self,
520 						  HTMLEngine *engine,
521 						  guint       start,
522 						  gint        length,
523 						  gboolean    queue_draw);
524 void        html_object_append_selection_string  (HTMLObject *self,
525 						  GString    *buffer);
526 gchar      *html_object_get_selection_string     (HTMLObject *o,
527 						  HTMLEngine *e);
528 
529 /* Saving.  */
530 gboolean  html_object_save  (HTMLObject          *self,
531 			     HTMLEngineSaveState *state);
532 
533 gboolean  html_object_save_plain  (HTMLObject          *self,
534 				   HTMLEngineSaveState *state,
535 				   gint requested_width);
536 
537 /* set change flag f of this object and of all its parents */
538 void  html_object_change_set  (HTMLObject      *self,
539 			       HTMLChangeFlags  f);
540 
541 /* set change flag f for this object and all childern */
542 void  html_object_change_set_down  (HTMLObject      *self,
543 				    HTMLChangeFlags  f);
544 
545 /* object data */
546 
547 void      html_object_set_data               (HTMLObject          *object,
548 					      const gchar         *key,
549 					      const gchar         *value);
550 void      html_object_set_data_full          (HTMLObject          *object,
551 					      const gchar         *key,
552 					      gconstpointer       value,
553 					      GDestroyNotify       func);
554 gpointer  html_object_get_data               (HTMLObject          *object,
555 					      const gchar         *key);
556 void      html_object_copy_data_from_object  (HTMLObject          *dst,
557 					      HTMLObject          *src);
558 gboolean  html_object_save_data              (HTMLObject          *self,
559 					      HTMLEngineSaveState *state);
560 
561 /* for acc object */
562 void      html_object_set_data_nocp          (HTMLObject          *object,
563 					      const gchar         *key,
564 					      const gchar         *value);
565 void      html_object_set_data_full_nocp     (HTMLObject          *object,
566 					      const gchar         *key,
567 					      gconstpointer       value,
568 					      GDestroyNotify       func);
569 gpointer  html_object_get_data_nocp          (HTMLObject          *object,
570 					      const gchar         *key);
571 
572 /*
573  * editing
574 */
575 GList    *html_object_get_bound_list             (HTMLObject *obj,
576 						  GList      *list);
577 void      html_object_move_cursor_before_remove  (HTMLObject *o,
578 						  HTMLEngine *e);
579 gboolean  html_object_could_remove_whole         (HTMLObject *o,
580 						  GList      *from,
581 						  GList      *to,
582 						  GList      *left,
583 						  GList      *right);
584 void      html_object_check_cut_lists            (HTMLObject *self,
585 						  HTMLObject *replacement,
586 						  GList      *left,
587 						  GList      *right);
588 GList    *html_object_heads_list                 (HTMLObject *o);
589 GList    *html_object_tails_list                 (HTMLObject *o);
590 void      html_object_merge_down                 (HTMLObject *o,
591 						  HTMLObject *w,
592 						  HTMLEngine *e);
593 gboolean  html_object_is_parent                  (HTMLObject *parent,
594 						  HTMLObject *child);
595 gint      html_object_get_insert_level           (HTMLObject *o);
596 
597 void      html_object_engine_translation   (HTMLObject *o,
598 					    HTMLEngine *e,
599 					    gint       *tx,
600 					    gint       *ty);
601 gboolean  html_object_engine_intersection  (HTMLObject *o,
602 					    HTMLEngine *e,
603 					    gint        tx,
604 					    gint        ty,
605 					    gint       *x1,
606 					    gint       *y1,
607 					    gint       *x2,
608 					    gint       *y2);
609 
610 void  html_object_add_to_changed  (GList      **changed_objs,
611 				   HTMLObject  *o);
612 
613 gint html_object_get_n_children (HTMLObject *self);
614 HTMLObject * html_object_get_child (HTMLObject *self, gint index);
615 gint html_object_get_child_index (HTMLObject *self, HTMLObject *child);
616 
617 HTMLClearType html_object_get_clear (HTMLObject *self);
618 
619 HTMLObject *html_object_next_cursor_object  (HTMLObject *o,
620 					     HTMLEngine *e,
621 					     gint       *offset);
622 HTMLObject *html_object_prev_cursor_object  (HTMLObject *o,
623 					     HTMLEngine *e,
624 					     gint       *offset);
625 HTMLObject *html_object_next_cursor_leaf    (HTMLObject *o,
626 					     HTMLEngine *e);
627 HTMLObject *html_object_prev_cursor_leaf    (HTMLObject *o,
628 					     HTMLEngine *e);
629 
630 gint  html_object_get_right_edge_offset  (HTMLObject *o,
631 					 HTMLPainter *painter,
632 					 gint offset);
633 gint  html_object_get_left_edge_offset   (HTMLObject *o,
634 					 HTMLPainter *painter,
635 					 gint offset);
636 
637 const gchar *html_object_get_id  (HTMLObject *o);
638 void        html_object_set_id  (HTMLObject *o,
639 				 const gchar *id);
640 
641 HTMLDirection html_object_get_direction (HTMLObject *o);
642 HTMLClueFlow * html_object_get_flow (HTMLObject *o);
643 
644 #endif /* _HTMLOBJECT_H_ */
645