Ardour  9.0-pre0-384-ga76afae0e9
gtktextiter.h
Go to the documentation of this file.
1 /* GTK - The GIMP Toolkit
2  * gtktextiter.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_ITER_H__
28 #define __GTK_TEXT_ITER_H__
29 
30 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
31 #error "Only <gtk/gtk.h> can be included directly."
32 #endif
33 
34 #include <gtk/gtktexttag.h>
35 #include <gtk/gtktextchild.h>
36 
37 G_BEGIN_DECLS
38 
39 typedef enum {
42  /* Possible future plans: SEARCH_CASE_INSENSITIVE, SEARCH_REGEXP */
44 
45 /*
46  * Iter: represents a location in the text. Becomes invalid if the
47  * characters/pixmaps/widgets (indexable objects) in the text buffer
48  * are changed.
49  */
50 
51 typedef struct _GtkTextBuffer GtkTextBuffer;
52 
53 #define GTK_TYPE_TEXT_ITER (gtk_text_iter_get_type ())
54 
55 struct _GtkTextIter {
56  /* GtkTextIter is an opaque datatype; ignore all these fields.
57  * Initialize the iter with gtk_text_buffer_get_iter_*
58  * functions
59  */
60  /*< private >*/
61  gpointer dummy1;
62  gpointer dummy2;
63  gint dummy3;
64  gint dummy4;
65  gint dummy5;
66  gint dummy6;
67  gint dummy7;
68  gint dummy8;
69  gpointer dummy9;
70  gpointer dummy10;
71  gint dummy11;
72  gint dummy12;
73  /* padding */
74  gint dummy13;
75  gpointer dummy14;
76 };
77 
78 
79 /* This is primarily intended for language bindings that want to avoid
80  a "buffer" argument to text insertions, deletions, etc. */
82 
83 /*
84  * Life cycle
85  */
86 
89 
90 GType gtk_text_iter_get_type (void) G_GNUC_CONST;
91 
92 /*
93  * Convert to different kinds of index
94  */
95 
100 
103 
104 
105 /*
106  * "Dereference" operators
107  */
108 gunichar gtk_text_iter_get_char (const GtkTextIter *iter);
109 
110 /* includes the 0xFFFC char for pixmaps/widgets, so char offsets
111  * into the returned string map properly into buffer char offsets
112  */
114  const GtkTextIter *end);
115 
116 /* includes only text, no 0xFFFC */
118  const GtkTextIter *end);
119 /* exclude invisible chars */
121  const GtkTextIter *end);
123  const GtkTextIter *end);
124 
125 GdkPixbuf* gtk_text_iter_get_pixbuf (const GtkTextIter *iter);
126 GSList * gtk_text_iter_get_marks (const GtkTextIter *iter);
127 
129 
130 /* Return list of tags toggled at this point (toggled_on determines
131  * whether the list is of on-toggles or off-toggles)
132  */
134  gboolean toggled_on);
135 
136 gboolean gtk_text_iter_begins_tag (const GtkTextIter *iter,
137  GtkTextTag *tag);
138 
139 gboolean gtk_text_iter_ends_tag (const GtkTextIter *iter,
140  GtkTextTag *tag);
141 
143  GtkTextTag *tag);
144 
145 gboolean gtk_text_iter_has_tag (const GtkTextIter *iter,
146  GtkTextTag *tag);
147 GSList *gtk_text_iter_get_tags (const GtkTextIter *iter);
148 
149 gboolean gtk_text_iter_editable (const GtkTextIter *iter,
150  gboolean default_setting);
151 gboolean gtk_text_iter_can_insert (const GtkTextIter *iter,
152  gboolean default_editability);
153 
154 gboolean gtk_text_iter_starts_word (const GtkTextIter *iter);
155 gboolean gtk_text_iter_ends_word (const GtkTextIter *iter);
156 gboolean gtk_text_iter_inside_word (const GtkTextIter *iter);
160 gboolean gtk_text_iter_starts_line (const GtkTextIter *iter);
161 gboolean gtk_text_iter_ends_line (const GtkTextIter *iter);
163 
166 
168  GtkTextAttributes *values);
169 PangoLanguage* gtk_text_iter_get_language (const GtkTextIter *iter);
170 gboolean gtk_text_iter_is_end (const GtkTextIter *iter);
171 gboolean gtk_text_iter_is_start (const GtkTextIter *iter);
172 
173 /*
174  * Moving around the buffer
175  */
176 
180  gint count);
182  gint count);
186  gint count);
188  gint count);
192  gint count);
194  gint count);
195 
199  gint count);
201  gint count);
202 
206  gint count);
208  gint count);
209 
213  gint count);
215  gint count);
216 /* cursor positions are almost equivalent to chars, but not quite;
217  * in some languages, you can't put the cursor between certain
218  * chars. Also, you can't put the cursor between \r\n at the end
219  * of a line.
220  */
224  gint count);
226  gint count);
227 
231  gint count);
233  gint count);
234 
235 
237  gint char_offset);
239  gint line_number);
241  gint char_on_line);
243  gint byte_on_line);
246 
248  gint char_on_line);
250  gint byte_on_line);
251 
252 /* returns TRUE if a toggle was found; NULL for the tag pointer
253  * means "any tag toggle", otherwise the next toggle of the
254  * specified tag is located.
255  */
257  GtkTextTag *tag);
258 
260  GtkTextTag *tag);
261 
262 typedef gboolean (* GtkTextCharPredicate) (gunichar ch, gpointer user_data);
263 
266  gpointer user_data,
267  const GtkTextIter *limit);
270  gpointer user_data,
271  const GtkTextIter *limit);
272 
274  const gchar *str,
275  GtkTextSearchFlags flags,
276  GtkTextIter *match_start,
277  GtkTextIter *match_end,
278  const GtkTextIter *limit);
279 
281  const gchar *str,
282  GtkTextSearchFlags flags,
283  GtkTextIter *match_start,
284  GtkTextIter *match_end,
285  const GtkTextIter *limit);
286 
287 
288 /*
289  * Comparisons
290  */
291 gboolean gtk_text_iter_equal (const GtkTextIter *lhs,
292  const GtkTextIter *rhs);
294  const GtkTextIter *rhs);
295 gboolean gtk_text_iter_in_range (const GtkTextIter *iter,
296  const GtkTextIter *start,
297  const GtkTextIter *end);
298 
299 /* Put these two in ascending order */
301  GtkTextIter *second);
302 
303 G_END_DECLS
304 
305 #endif
306 
307 
typedefG_BEGIN_DECLS struct _GtkTextChildAnchor GtkTextChildAnchor
Definition: gtktextchild.h:45
gint gtk_text_iter_get_chars_in_line(const GtkTextIter *iter)
gboolean gtk_text_iter_backward_sentence_starts(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_forward_visible_word_end(GtkTextIter *iter)
gboolean gtk_text_iter_forward_visible_cursor_positions(GtkTextIter *iter, gint count)
void gtk_text_iter_forward_to_end(GtkTextIter *iter)
gboolean(* GtkTextCharPredicate)(gunichar ch, gpointer user_data)
Definition: gtktextiter.h:262
gint gtk_text_iter_get_offset(const GtkTextIter *iter)
gint gtk_text_iter_get_line_offset(const GtkTextIter *iter)
GSList * gtk_text_iter_get_marks(const GtkTextIter *iter)
gboolean gtk_text_iter_is_end(const GtkTextIter *iter)
gboolean gtk_text_iter_backward_char(GtkTextIter *iter)
gboolean gtk_text_iter_inside_sentence(const GtkTextIter *iter)
gboolean gtk_text_iter_starts_sentence(const GtkTextIter *iter)
gunichar gtk_text_iter_get_char(const GtkTextIter *iter)
void gtk_text_iter_set_line(GtkTextIter *iter, gint line_number)
gboolean gtk_text_iter_backward_find_char(GtkTextIter *iter, GtkTextCharPredicate pred, gpointer user_data, const GtkTextIter *limit)
gboolean gtk_text_iter_forward_sentence_ends(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_forward_find_char(GtkTextIter *iter, GtkTextCharPredicate pred, gpointer user_data, const GtkTextIter *limit)
gboolean gtk_text_iter_equal(const GtkTextIter *lhs, const GtkTextIter *rhs)
gboolean gtk_text_iter_backward_lines(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_forward_word_ends(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_forward_word_end(GtkTextIter *iter)
gboolean gtk_text_iter_starts_word(const GtkTextIter *iter)
gboolean gtk_text_iter_backward_chars(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_ends_sentence(const GtkTextIter *iter)
gboolean gtk_text_iter_toggles_tag(const GtkTextIter *iter, GtkTextTag *tag)
gboolean gtk_text_iter_forward_to_tag_toggle(GtkTextIter *iter, GtkTextTag *tag)
gchar * gtk_text_iter_get_visible_text(const GtkTextIter *start, const GtkTextIter *end)
gboolean gtk_text_iter_backward_cursor_positions(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_backward_visible_line(GtkTextIter *iter)
gboolean gtk_text_iter_starts_line(const GtkTextIter *iter)
gboolean gtk_text_iter_backward_cursor_position(GtkTextIter *iter)
void gtk_text_iter_set_visible_line_offset(GtkTextIter *iter, gint char_on_line)
gboolean gtk_text_iter_forward_cursor_positions(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_backward_visible_cursor_position(GtkTextIter *iter)
void gtk_text_iter_set_offset(GtkTextIter *iter, gint char_offset)
gboolean gtk_text_iter_backward_visible_lines(GtkTextIter *iter, gint count)
gchar * gtk_text_iter_get_slice(const GtkTextIter *start, const GtkTextIter *end)
gint gtk_text_iter_get_bytes_in_line(const GtkTextIter *iter)
gboolean gtk_text_iter_backward_search(const GtkTextIter *iter, const gchar *str, GtkTextSearchFlags flags, GtkTextIter *match_start, GtkTextIter *match_end, const GtkTextIter *limit)
GtkTextChildAnchor * gtk_text_iter_get_child_anchor(const GtkTextIter *iter)
gboolean gtk_text_iter_backward_visible_word_start(GtkTextIter *iter)
void gtk_text_iter_set_line_offset(GtkTextIter *iter, gint char_on_line)
gboolean gtk_text_iter_forward_visible_lines(GtkTextIter *iter, gint count)
GtkTextBuffer * gtk_text_iter_get_buffer(const GtkTextIter *iter)
GSList * gtk_text_iter_get_toggled_tags(const GtkTextIter *iter, gboolean toggled_on)
void gtk_text_iter_set_visible_line_index(GtkTextIter *iter, gint byte_on_line)
gboolean gtk_text_iter_editable(const GtkTextIter *iter, gboolean default_setting)
gint gtk_text_iter_get_visible_line_offset(const GtkTextIter *iter)
gboolean gtk_text_iter_forward_visible_line(GtkTextIter *iter)
gboolean gtk_text_iter_forward_to_line_end(GtkTextIter *iter)
gboolean gtk_text_iter_has_tag(const GtkTextIter *iter, GtkTextTag *tag)
gboolean gtk_text_iter_backward_word_starts(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_forward_visible_word_ends(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_forward_char(GtkTextIter *iter)
gboolean gtk_text_iter_backward_visible_word_starts(GtkTextIter *iter, gint count)
gint gtk_text_iter_get_line(const GtkTextIter *iter)
gint gtk_text_iter_get_visible_line_index(const GtkTextIter *iter)
gint gtk_text_iter_compare(const GtkTextIter *lhs, const GtkTextIter *rhs)
gchar * gtk_text_iter_get_text(const GtkTextIter *start, const GtkTextIter *end)
gboolean gtk_text_iter_backward_visible_cursor_positions(GtkTextIter *iter, gint count)
void gtk_text_iter_order(GtkTextIter *first, GtkTextIter *second)
gboolean gtk_text_iter_forward_lines(GtkTextIter *iter, gint count)
GtkTextIter * gtk_text_iter_copy(const GtkTextIter *iter)
gboolean gtk_text_iter_forward_visible_cursor_position(GtkTextIter *iter)
gboolean gtk_text_iter_begins_tag(const GtkTextIter *iter, GtkTextTag *tag)
gboolean gtk_text_iter_get_attributes(const GtkTextIter *iter, GtkTextAttributes *values)
gboolean gtk_text_iter_backward_word_start(GtkTextIter *iter)
void gtk_text_iter_free(GtkTextIter *iter)
gboolean gtk_text_iter_can_insert(const GtkTextIter *iter, gboolean default_editability)
gboolean gtk_text_iter_backward_to_tag_toggle(GtkTextIter *iter, GtkTextTag *tag)
GType gtk_text_iter_get_type(void) G_GNUC_CONST
gint gtk_text_iter_get_line_index(const GtkTextIter *iter)
gboolean gtk_text_iter_ends_tag(const GtkTextIter *iter, GtkTextTag *tag)
gboolean gtk_text_iter_inside_word(const GtkTextIter *iter)
gboolean gtk_text_iter_forward_search(const GtkTextIter *iter, const gchar *str, GtkTextSearchFlags flags, GtkTextIter *match_start, GtkTextIter *match_end, const GtkTextIter *limit)
gchar * gtk_text_iter_get_visible_slice(const GtkTextIter *start, const GtkTextIter *end)
gboolean gtk_text_iter_forward_chars(GtkTextIter *iter, gint count)
gboolean gtk_text_iter_ends_line(const GtkTextIter *iter)
void gtk_text_iter_set_line_index(GtkTextIter *iter, gint byte_on_line)
gboolean gtk_text_iter_forward_line(GtkTextIter *iter)
GtkTextSearchFlags
Definition: gtktextiter.h:39
@ GTK_TEXT_SEARCH_TEXT_ONLY
Definition: gtktextiter.h:41
@ GTK_TEXT_SEARCH_VISIBLE_ONLY
Definition: gtktextiter.h:40
gboolean gtk_text_iter_backward_sentence_start(GtkTextIter *iter)
gboolean gtk_text_iter_is_cursor_position(const GtkTextIter *iter)
GdkPixbuf * gtk_text_iter_get_pixbuf(const GtkTextIter *iter)
GSList * gtk_text_iter_get_tags(const GtkTextIter *iter)
gboolean gtk_text_iter_backward_line(GtkTextIter *iter)
gboolean gtk_text_iter_ends_word(const GtkTextIter *iter)
gboolean gtk_text_iter_is_start(const GtkTextIter *iter)
gboolean gtk_text_iter_forward_sentence_end(GtkTextIter *iter)
gboolean gtk_text_iter_forward_cursor_position(GtkTextIter *iter)
PangoLanguage * gtk_text_iter_get_language(const GtkTextIter *iter)
gboolean gtk_text_iter_in_range(const GtkTextIter *iter, const GtkTextIter *start, const GtkTextIter *end)
typedefG_BEGIN_DECLS struct _GtkTextIter GtkTextIter
Definition: gtktexttag.h:67
PBD::PropertyDescriptor< timepos_t > start
gpointer dummy9
Definition: gtktextiter.h:69
gpointer dummy1
Definition: gtktextiter.h:61
gpointer dummy2
Definition: gtktextiter.h:62
gpointer dummy10
Definition: gtktextiter.h:70
gpointer dummy14
Definition: gtktextiter.h:75