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) 2000 Helix Code, Inc. |
---|
5 | Authors: Radek Doulik (rodo@helixcode.com) |
---|
6 | |
---|
7 | This library is free software; you can redistribute it and/or |
---|
8 | modify it under the terms of the GNU Library General Public |
---|
9 | License as published by the Free Software Foundation; either |
---|
10 | version 2 of the License, or (at your option) any later version. |
---|
11 | |
---|
12 | This library 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 GNU |
---|
15 | Library General Public License for more details. |
---|
16 | |
---|
17 | You should have received a copy of the GNU Library General Public License |
---|
18 | along with this library; see the file COPYING.LIB. If not, write to |
---|
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
20 | Boston, MA 02111-1307, USA. |
---|
21 | */ |
---|
22 | |
---|
23 | #ifndef _HTML_INTERVAL_H_ |
---|
24 | #define _HTML_INTERVAL_H_ |
---|
25 | |
---|
26 | #include "htmltypes.h" |
---|
27 | |
---|
28 | struct _HTMLPoint { |
---|
29 | HTMLObject *object; |
---|
30 | guint offset; |
---|
31 | }; |
---|
32 | |
---|
33 | HTMLPoint *html_point_new (HTMLObject *o, |
---|
34 | guint off); |
---|
35 | void html_point_construct (HTMLPoint *p, |
---|
36 | HTMLObject *o, |
---|
37 | guint off); |
---|
38 | void html_point_destroy (HTMLPoint *p); |
---|
39 | HTMLPoint *html_point_max (HTMLPoint *a, |
---|
40 | HTMLPoint *b); |
---|
41 | HTMLPoint *html_point_min (HTMLPoint *a, |
---|
42 | HTMLPoint *b); |
---|
43 | gboolean html_point_eq (const HTMLPoint *a, |
---|
44 | const HTMLPoint *b); |
---|
45 | gboolean html_point_cursor_object_eq (HTMLPoint *p, |
---|
46 | HTMLPoint *c); |
---|
47 | void html_point_next_cursor (HTMLPoint *p); |
---|
48 | |
---|
49 | struct _HTMLInterval { |
---|
50 | HTMLPoint from; |
---|
51 | HTMLPoint to; |
---|
52 | }; |
---|
53 | |
---|
54 | HTMLInterval *html_interval_new (HTMLObject *from, |
---|
55 | HTMLObject *to, |
---|
56 | guint from_offset, |
---|
57 | guint to_offset); |
---|
58 | HTMLInterval *html_interval_new_from_cursor (HTMLCursor *a, |
---|
59 | HTMLCursor *b); |
---|
60 | HTMLInterval *html_interval_new_from_points (HTMLPoint *from, |
---|
61 | HTMLPoint *to); |
---|
62 | void html_interval_validate (HTMLInterval *i); |
---|
63 | HTMLInterval *html_interval_flat (HTMLInterval *i); |
---|
64 | void html_interval_destroy (HTMLInterval *i); |
---|
65 | guint html_interval_get_length (HTMLInterval *i, |
---|
66 | HTMLObject *obj); |
---|
67 | guint html_interval_get_bytes (HTMLInterval *i, |
---|
68 | HTMLObject *obj); |
---|
69 | guint html_interval_get_start (HTMLInterval *i, |
---|
70 | HTMLObject *obj); |
---|
71 | guint html_interval_get_start_index (HTMLInterval *i, |
---|
72 | HTMLObject *obj); |
---|
73 | HTMLObject *html_interval_get_head (HTMLInterval *i, |
---|
74 | HTMLObject *o); |
---|
75 | void html_interval_select (HTMLInterval *i, |
---|
76 | HTMLEngine *e); |
---|
77 | void html_interval_unselect (HTMLInterval *i, |
---|
78 | HTMLEngine *e); |
---|
79 | gint html_interval_get_from_index (HTMLInterval *i); |
---|
80 | gint html_interval_get_to_index (HTMLInterval *i); |
---|
81 | void html_interval_forall (HTMLInterval *i, |
---|
82 | HTMLEngine *e, |
---|
83 | HTMLObjectForallFunc f, |
---|
84 | gpointer data); |
---|
85 | gboolean html_interval_eq (const HTMLInterval *a, |
---|
86 | const HTMLInterval *b); |
---|
87 | HTMLInterval *html_interval_intersection (HTMLInterval *a, |
---|
88 | HTMLInterval *b); |
---|
89 | void *html_interval_substract (HTMLInterval *a, |
---|
90 | HTMLInterval *b, |
---|
91 | HTMLInterval **s1, |
---|
92 | HTMLInterval **s2); |
---|
93 | #endif |
---|