Ardour  9.0-pre0-427-gd2a3450e2f
gtktextbtree.h
Go to the documentation of this file.
1 /* GTK - The GIMP Toolkit
2  * gtktextbtree.h Copyright (C) 2000 Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 
20 /*
21  * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22  * file for a list of people on the GTK+ Team. See the ChangeLog
23  * files for a list of changes. These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26 
27 #ifndef __GTK_TEXT_BTREE_H__
28 #define __GTK_TEXT_BTREE_H__
29 
30 #if 0
31 #define DEBUG_VALIDATION_AND_SCROLLING
32 #endif
33 
34 #ifdef DEBUG_VALIDATION_AND_SCROLLING
35 #define DV(x) (x)
36 #else
37 #define DV(x)
38 #endif
39 
40 #include <gtk/gtktextbuffer.h>
41 #include <gtk/gtktexttag.h>
42 #include <gtk/gtktextmark.h>
43 #include <gtk/gtktextchild.h>
44 #include <gtk/gtktextsegment.h>
45 #include <gtk/gtktextiter.h>
46 
47 G_BEGIN_DECLS
48 
50  GtkTextBuffer *buffer);
54 
55 
59 
61  GtkTextLine *line,
62  GtkTextLineSegment *seg,
63  int byte_index,
64  int char_offset);
65 
66 /* Indexable segment mutation */
67 
69  GtkTextIter *end);
71  const gchar *text,
72  gint len);
74  GdkPixbuf *pixbuf);
75 
77  GtkTextChildAnchor *anchor);
78 
80 
81 /* View stuff */
83  gpointer view_id,
84  gint ypixel,
85  gint *line_top_y);
87  GtkTextLine *line,
88  gpointer view_id);
90  GtkTextLayout *layout);
92  gpointer view_id);
94  const GtkTextIter *start,
95  const GtkTextIter *end,
96  gboolean cursors_only);
98  gpointer view_id,
99  gint *width,
100  gint *height);
102  gpointer view_id);
104  gpointer view_id,
105  gint max_pixels,
106  gint *y,
107  gint *old_height,
108  gint *new_height);
110  GtkTextLine *line,
111  gpointer view_id);
112 
113 /* Tag */
114 
116  const GtkTextIter *end,
117  GtkTextTag *tag,
118  gboolean apply);
119 
120 /* "Getters" */
121 
123  gint line_number,
124  gint *real_line_number);
126  gint line_number,
127  gint *real_line_number);
130  gint char_index,
131  gint *line_start_index,
132  gint *real_char_index);
134  gint *num_tags);
136  const GtkTextIter *end,
137  gboolean include_hidden,
138  gboolean include_nonchars);
142 
143 
144 
145 /* Get iterators (these are implemented in gtktextiter.c) */
147  GtkTextIter *iter,
148  gint char_index);
150  GtkTextIter *iter,
151  gint line_number,
152  gint char_index);
154  GtkTextIter *iter,
155  gint line_number,
156  gint byte_index);
158  GtkTextIter *iter,
159  const gchar *string);
161  GtkTextIter *iter,
162  const gchar *mark_name);
164  GtkTextIter *iter,
165  GtkTextMark *mark);
167  GtkTextIter *iter);
169  GtkTextIter *iter,
170  GtkTextLine *line,
171  gint byte_offset);
173  GtkTextIter *iter,
174  GtkTextTag *tag);
176  GtkTextIter *iter,
177  GtkTextTag *tag);
178 
180  GtkTextIter *iter,
181  GtkTextChildAnchor *anchor);
182 
183 
184 
185 /* Manipulate marks */
187  GtkTextMark *existing_mark,
188  const gchar *name,
189  gboolean left_gravity,
190  const GtkTextIter *index,
191  gboolean should_exist);
193  const gchar *name);
195  GtkTextMark *segment);
198  GtkTextIter *end);
200  const GtkTextIter *where);
202  const GtkTextIter *ins,
203  const GtkTextIter *bound);
205  GtkTextMark *segment);
207  GtkTextMark *segment);
211  const gchar *name);
213  GtkTextTag *tag);
215  GtkTextTag *tag);
216 
217 /* Lines */
218 
219 /* Chunk of data associated with a line; views can use this to store
220  info at the line. They should "subclass" the header struct here. */
222  gpointer view_id;
224  gint height;
225  signed int width : 24;
226  guint valid : 8; /* Actually a boolean */
227 };
228 
229 /*
230  * The data structure below defines a single line of text (from newline
231  * to newline, not necessarily what appears on one line of the screen).
232  *
233  * You can consider this line a "paragraph" also
234  */
235 
236 struct _GtkTextLine {
237  GtkTextBTreeNode *parent; /* Pointer to parent node containing
238  * line. */
239  GtkTextLine *next; /* Next in linked list of lines with
240  * same parent node in B-tree. NULL
241  * means end of list. */
242  GtkTextLineSegment *segments; /* First in ordered list of segments
243  * that make up the line. */
244  GtkTextLineData *views; /* data stored here by views */
245  guchar dir_strong; /* BiDi algo dir of line */
246  guchar dir_propagated_back; /* BiDi algo dir of next line */
247  guchar dir_propagated_forward; /* BiDi algo dir of prev line */
248 };
249 
250 
253  GtkTextBTree *tree,
254  gint char_in_line,
255  GtkTextTag *tag);
257  GtkTextBTree *tree,
258  gint byte_in_line,
259  GtkTextTag *tag);
261  GtkTextBTree *tree);
263  GtkTextBTree *tree);
268  GtkTextLineData *data);
270  gpointer view_id);
272  gpointer view_id);
274  GtkTextLineData *ld);
279  gint byte_offset,
280  gint *seg_offset);
282  gint char_offset,
283  gint *seg_offset);
285  gint byte_offset,
286  GtkTextLineSegment **segment,
287  GtkTextLineSegment **any_segment,
288  gint *seg_byte_offset,
289  gint *line_byte_offset);
291  gint char_offset,
292  GtkTextLineSegment **segment,
293  GtkTextLineSegment **any_segment,
294  gint *seg_char_offset,
295  gint *line_char_offset);
297  gint byte_offset,
298  gint *line_char_offset,
299  gint *seg_char_offset);
301  gint char_offset,
302  gint *line_byte_offset,
303  gint *seg_byte_offset);
305  gint byte_offset,
306  gint *seg_offset);
308  gint char_offset,
309  gint *seg_offset);
311  gint byte_offset);
313  gint char_offset);
315  GtkTextBTree *tree,
316  GtkTextTag *tag);
318  GtkTextBTree *tree,
319  GtkTextTag *tag);
320 
322  GtkTextLine *line);
323 
324 /* Debug */
327 extern gboolean _gtk_text_view_debug_btree;
328 
329 /* ignore, exported only for gtktextsegment.c */
331  GtkTextLine *line);
334  gint delta);
335 
336 /* for gtktextmark.c */
338  GtkTextLineSegment *segment);
339 
340 /* for coordination with the tag table */
342  GtkTextTag *tag);
343 
344 G_END_DECLS
345 
346 #endif
347 
348 
GtkImageIconNameData name
Definition: gtkimage.h:6
GtkImagePixbufData pixbuf
Definition: gtkimage.h:2
GtkTextLine * _gtk_text_btree_find_line_by_y(GtkTextBTree *tree, gpointer view_id, gint ypixel, gint *line_top_y)
gpointer _gtk_text_line_get_data(GtkTextLine *line, gpointer view_id)
GtkTextBuffer * _gtk_text_btree_get_buffer(GtkTextBTree *tree)
GtkTextLineData * _gtk_text_line_data_new(GtkTextLayout *layout, GtkTextLine *line)
void _gtk_text_btree_select_range(GtkTextBTree *tree, const GtkTextIter *ins, const GtkTextIter *bound)
gint _gtk_text_line_char_index(GtkTextLine *line)
GtkTextLineSegment * _gtk_text_line_char_to_any_segment(GtkTextLine *line, gint char_offset, gint *seg_offset)
void _gtk_text_btree_ref(GtkTextBTree *tree)
gboolean _gtk_text_btree_is_end(GtkTextBTree *tree, GtkTextLine *line, GtkTextLineSegment *seg, int byte_index, int char_offset)
GtkTextTag ** _gtk_text_btree_get_tags(const GtkTextIter *iter, gint *num_tags)
void _gtk_text_btree_tag(const GtkTextIter *start, const GtkTextIter *end, GtkTextTag *tag, gboolean apply)
gpointer _gtk_text_line_remove_data(GtkTextLine *line, gpointer view_id)
void _gtk_text_btree_get_iter_at_child_anchor(GtkTextBTree *tree, GtkTextIter *iter, GtkTextChildAnchor *anchor)
GtkTextLineSegment * _gtk_text_line_byte_to_segment(GtkTextLine *line, gint byte_offset, gint *seg_offset)
G_BEGIN_DECLS GtkTextBTree * _gtk_text_btree_new(GtkTextTagTable *table, GtkTextBuffer *buffer)
gboolean _gtk_text_btree_mark_is_insert(GtkTextBTree *tree, GtkTextMark *segment)
GtkTextLine * _gtk_text_line_next_could_contain_tag(GtkTextLine *line, GtkTextBTree *tree, GtkTextTag *tag)
GtkTextLine * _gtk_text_line_previous(GtkTextLine *line)
gchar * _gtk_text_btree_get_text(const GtkTextIter *start, const GtkTextIter *end, gboolean include_hidden, gboolean include_nonchars)
GtkTextMark * _gtk_text_btree_set_mark(GtkTextBTree *tree, GtkTextMark *existing_mark, const gchar *name, gboolean left_gravity, const GtkTextIter *index, gboolean should_exist)
void _gtk_text_btree_spew(GtkTextBTree *tree)
gboolean _gtk_text_view_debug_btree
void _gtk_text_btree_get_iter_at_char(GtkTextBTree *tree, GtkTextIter *iter, gint char_index)
void _gtk_text_line_char_to_byte_offsets(GtkTextLine *line, gint char_offset, gint *line_byte_offset, gint *seg_byte_offset)
void _gtk_text_btree_get_iter_at_line_char(GtkTextBTree *tree, GtkTextIter *iter, gint line_number, gint char_index)
gint _gtk_text_line_char_to_byte(GtkTextLine *line, gint char_offset)
gboolean _gtk_text_btree_get_iter_from_string(GtkTextBTree *tree, GtkTextIter *iter, const gchar *string)
gboolean _gtk_text_line_byte_locate(GtkTextLine *line, gint byte_offset, GtkTextLineSegment **segment, GtkTextLineSegment **any_segment, gint *seg_byte_offset, gint *line_byte_offset)
gboolean _gtk_text_line_byte_has_tag(GtkTextLine *line, GtkTextBTree *tree, gint byte_in_line, GtkTextTag *tag)
GtkTextMark * _gtk_text_btree_get_insert(GtkTextBTree *tree)
void _gtk_text_btree_remove_view(GtkTextBTree *tree, gpointer view_id)
void _gtk_text_btree_notify_will_remove_tag(GtkTextBTree *tree, GtkTextTag *tag)
void _gtk_text_line_byte_to_char_offsets(GtkTextLine *line, gint byte_offset, gint *line_char_offset, gint *seg_char_offset)
gboolean _gtk_text_btree_get_selection_bounds(GtkTextBTree *tree, GtkTextIter *start, GtkTextIter *end)
gboolean _gtk_text_line_char_locate(GtkTextLine *line, gint char_offset, GtkTextLineSegment **segment, GtkTextLineSegment **any_segment, gint *seg_char_offset, gint *line_char_offset)
GtkTextLine * _gtk_text_line_next_excluding_last(GtkTextLine *line)
GtkTextLine * _gtk_text_btree_get_line(GtkTextBTree *tree, gint line_number, gint *real_line_number)
guint _gtk_text_btree_get_segments_changed_stamp(GtkTextBTree *tree)
void _gtk_text_btree_remove_mark(GtkTextBTree *tree, GtkTextMark *segment)
void _gtk_text_btree_get_end_iter(GtkTextBTree *tree, GtkTextIter *iter)
GtkTextMark * _gtk_text_btree_get_selection_bound(GtkTextBTree *tree)
gint _gtk_text_btree_line_count(GtkTextBTree *tree)
gboolean _gtk_text_btree_char_is_invisible(const GtkTextIter *iter)
GtkTextLineSegment * _gtk_text_line_byte_to_any_segment(GtkTextLine *line, gint byte_offset, gint *seg_offset)
gint _gtk_text_line_byte_to_char(GtkTextLine *line, gint byte_offset)
void _gtk_text_btree_unref(GtkTextBTree *tree)
gboolean _gtk_text_btree_get_iter_at_mark_name(GtkTextBTree *tree, GtkTextIter *iter, const gchar *mark_name)
gboolean _gtk_text_btree_mark_is_selection_bound(GtkTextBTree *tree, GtkTextMark *segment)
void _gtk_text_btree_segments_changed(GtkTextBTree *tree)
void _gtk_text_btree_get_iter_at_mark(GtkTextBTree *tree, GtkTextIter *iter, GtkTextMark *mark)
GtkTextLine * _gtk_text_btree_get_line_no_last(GtkTextBTree *tree, gint line_number, gint *real_line_number)
void _gtk_text_btree_insert_pixbuf(GtkTextIter *iter, GdkPixbuf *pixbuf)
void _gtk_text_btree_unregister_child_anchor(GtkTextChildAnchor *anchor)
void _gtk_text_btree_add_view(GtkTextBTree *tree, GtkTextLayout *layout)
gboolean _gtk_text_btree_get_iter_at_first_toggle(GtkTextBTree *tree, GtkTextIter *iter, GtkTextTag *tag)
void _gtk_text_btree_get_view_size(GtkTextBTree *tree, gpointer view_id, gint *width, gint *height)
gboolean _gtk_text_line_char_has_tag(GtkTextLine *line, GtkTextBTree *tree, gint char_in_line, GtkTextTag *tag)
gint _gtk_text_line_char_count(GtkTextLine *line)
gint _gtk_text_line_get_number(GtkTextLine *line)
GtkTextLine * _gtk_text_btree_get_line_at_char(GtkTextBTree *tree, gint char_index, gint *line_start_index, gint *real_char_index)
gboolean _gtk_text_line_is_last(GtkTextLine *line, GtkTextBTree *tree)
GtkTextLineSegment * _gtk_text_line_char_to_segment(GtkTextLine *line, gint char_offset, gint *seg_offset)
void _gtk_text_line_invalidate_wrap(GtkTextLine *line, GtkTextLineData *ld)
gint _gtk_text_btree_char_count(GtkTextBTree *tree)
GtkTextMark * _gtk_text_btree_get_mark_by_name(GtkTextBTree *tree, const gchar *name)
gboolean _gtk_text_btree_validate(GtkTextBTree *tree, gpointer view_id, gint max_pixels, gint *y, gint *old_height, gint *new_height)
void _gtk_toggle_segment_check_func(GtkTextLineSegment *segPtr, GtkTextLine *line)
gboolean _gtk_text_line_contains_end_iter(GtkTextLine *line, GtkTextBTree *tree)
gint _gtk_text_line_byte_count(GtkTextLine *line)
GtkTextLine * _gtk_text_line_previous_could_contain_tag(GtkTextLine *line, GtkTextBTree *tree, GtkTextTag *tag)
void _gtk_text_btree_delete(GtkTextIter *start, GtkTextIter *end)
void _gtk_text_btree_place_cursor(GtkTextBTree *tree, const GtkTextIter *where)
GtkTextLine * _gtk_text_btree_get_end_iter_line(GtkTextBTree *tree)
void _gtk_text_btree_invalidate_region(GtkTextBTree *tree, const GtkTextIter *start, const GtkTextIter *end, gboolean cursors_only)
void _gtk_text_btree_remove_mark_by_name(GtkTextBTree *tree, const gchar *name)
void _gtk_text_btree_insert_child_anchor(GtkTextIter *iter, GtkTextChildAnchor *anchor)
GtkTextLine * _gtk_text_btree_first_could_contain_tag(GtkTextBTree *tree, GtkTextTag *tag)
void _gtk_text_btree_release_mark_segment(GtkTextBTree *tree, GtkTextLineSegment *segment)
void _gtk_text_btree_validate_line(GtkTextBTree *tree, GtkTextLine *line, gpointer view_id)
gboolean _gtk_text_btree_is_valid(GtkTextBTree *tree, gpointer view_id)
gboolean _gtk_text_btree_get_iter_at_last_toggle(GtkTextBTree *tree, GtkTextIter *iter, GtkTextTag *tag)
void _gtk_text_btree_get_iter_at_line_byte(GtkTextBTree *tree, GtkTextIter *iter, gint line_number, gint byte_index)
GtkTextLine * _gtk_text_btree_last_could_contain_tag(GtkTextBTree *tree, GtkTextTag *tag)
GtkTextLine * _gtk_text_line_next(GtkTextLine *line)
gint _gtk_text_btree_find_line_top(GtkTextBTree *tree, GtkTextLine *line, gpointer view_id)
void _gtk_text_btree_check(GtkTextBTree *tree)
void _gtk_text_btree_get_iter_at_line(GtkTextBTree *tree, GtkTextIter *iter, GtkTextLine *line, gint byte_offset)
guint _gtk_text_btree_get_chars_changed_stamp(GtkTextBTree *tree)
void _gtk_text_btree_insert(GtkTextIter *iter, const gchar *text, gint len)
void _gtk_text_line_add_data(GtkTextLine *line, GtkTextLineData *data)
void _gtk_change_node_toggle_count(GtkTextBTreeNode *node, GtkTextTagInfo *info, gint delta)
struct _GtkTextBTree GtkTextBTree
Definition: gtktextbuffer.h:61
typedefG_BEGIN_DECLS struct _GtkTextChildAnchor GtkTextChildAnchor
Definition: gtktextchild.h:45
typedefG_BEGIN_DECLS struct _GtkTextLine GtkTextLine
Definition: gtktextlayout.h:99
typedefG_BEGIN_DECLS struct _GtkTextMark GtkTextMark
Definition: gtktextmark.h:61
typedefG_BEGIN_DECLS struct _GtkTextTagInfo GtkTextTagInfo
typedefG_BEGIN_DECLS struct _GtkTextIter GtkTextIter
Definition: gtktexttag.h:67
struct _GtkTextBTreeNode GtkTextBTreeNode
PBD::PropertyDescriptor< timepos_t > start
Transmitter info
signed int width
Definition: gtktextbtree.h:225
GtkTextLineData * next
Definition: gtktextbtree.h:223
guchar dir_propagated_back
Definition: gtktextbtree.h:246
guchar dir_propagated_forward
Definition: gtktextbtree.h:247
GtkTextLineData * views
Definition: gtktextbtree.h:244
GtkTextLine * next
Definition: gtktextbtree.h:239
GtkTextBTreeNode * parent
Definition: gtktextbtree.h:237
GtkTextLineSegment * segments
Definition: gtktextbtree.h:242
guchar dir_strong
Definition: gtktextbtree.h:245
gint height
Definition: xcursors.h:1
gint width
Definition: xcursors.h:1