PageRenderTime 48ms CodeModel.GetById 22ms app.highlight 22ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/gtk2/src/gtk+/gtk/gtktextiter.inc

https://github.com/slibre/freepascal
Pascal | 199 lines | 117 code | 20 blank | 62 comment | 0 complexity | bb44fc1cf8f95e4b947ca758aaf2f3bd MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
  1// included by gtk2.pas
  2
  3{$IFDEF read_forward_definitions}
  4{$ENDIF read_forward_definitions}
  5
  6//------------------------------------------------------------------------------
  7
  8{$IFDEF read_interface_types}
  9{ Possible future plans: SEARCH_CASE_INSENSITIVE, SEARCH_REGEXP  }
 10   PGtkTextSearchFlags = ^TGtkTextSearchFlags;
 11   TGtkTextSearchFlags = longint;
 12
 13{ GtkTextIter is an opaque datatype; ignore all these fields.
 14     Initialize the iter with gtk_text_buffer_get_iter_
 15     functions
 16    }
 17{< private > }
 18{ padding  }
 19   PGtkTextIter = ^TGtkTextIter;
 20   TGtkTextIter = record
 21        dummy1 : gpointer;
 22        dummy2 : gpointer;
 23        dummy3 : gint;
 24        dummy4 : gint;
 25        dummy5 : gint;
 26        dummy6 : gint;
 27        dummy7 : gint;
 28        dummy8 : gint;
 29        dummy9 : gpointer;
 30        dummy10 : gpointer;
 31        dummy11 : gint;
 32        dummy12 : gint;
 33        dummy13 : gint;
 34        dummy14 : gpointer;
 35     end;
 36
 37   TGtkTextCharPredicate = function (ch:gunichar; user_data:gpointer):gboolean; cdecl;
 38{$ENDIF read_interface_types}
 39
 40//------------------------------------------------------------------------------
 41
 42{$IFDEF read_interface_rest}
 43
 44const
 45   GTK_TEXT_SEARCH_VISIBLE_ONLY = 0;  (* values of TGtkTextSearchFlags *)
 46   GTK_TEXT_SEARCH_TEXT_ONLY    = 1;
 47
 48{
 49   Iter: represents a location in the text. Becomes invalid if the
 50   characters/pixmaps/widgets (indexable objects) in the text buffer
 51   are changed.
 52  }
 53function GTK_TYPE_TEXT_ITER : GType;
 54
 55{ This is primarily intended for language bindings that want to avoid
 56  a "buffer" argument to text insertions, deletions, etc.  }
 57function gtk_text_iter_get_buffer(iter:PGtkTextIter):PGtkTextBuffer; cdecl; external gtklib;
 58{
 59   Life cycle
 60  }
 61function gtk_text_iter_copy(iter:PGtkTextIter):PGtkTextIter; cdecl; external gtklib;
 62procedure gtk_text_iter_free(iter:PGtkTextIter); cdecl; external gtklib;
 63function gtk_text_iter_get_type:GType; cdecl; external gtklib;
 64{
 65   Convert to different kinds of index
 66  }
 67function gtk_text_iter_get_offset(iter:PGtkTextIter):gint; cdecl; external gtklib;
 68function gtk_text_iter_get_line(iter:PGtkTextIter):gint; cdecl; external gtklib;
 69function gtk_text_iter_get_line_offset(iter:PGtkTextIter):gint; cdecl; external gtklib;
 70function gtk_text_iter_get_line_index(iter:PGtkTextIter):gint; cdecl; external gtklib;
 71function gtk_text_iter_get_visible_line_offset(iter:PGtkTextIter):gint; cdecl; external gtklib;
 72function gtk_text_iter_get_visible_line_index(iter:PGtkTextIter):gint; cdecl; external gtklib;
 73{
 74   "Dereference" operators
 75  }
 76
 77function gtk_text_iter_get_char(iter:PGtkTextIter):gunichar; cdecl; external gtklib;
 78
 79{ includes the 0xFFFC char for pixmaps/widgets, so char offsets
 80   into the returned string map properly into buffer char offsets
 81  }
 82function gtk_text_iter_get_slice(start:PGtkTextIter; theEnd:PGtkTextIter):Pgchar; cdecl; external gtklib;
 83
 84{ includes only text, no 0xFFFC  }
 85function gtk_text_iter_get_text(start:PGtkTextIter; theEnd:PGtkTextIter):Pgchar; cdecl; external gtklib;
 86
 87{ exclude invisible chars  }
 88function gtk_text_iter_get_visible_slice(start:PGtkTextIter; theEnd:PGtkTextIter):Pgchar; cdecl; external gtklib;
 89function gtk_text_iter_get_visible_text(start:PGtkTextIter; theEnd:PGtkTextIter):Pgchar; cdecl; external gtklib;
 90function gtk_text_iter_get_pixbuf(iter:PGtkTextIter):PGdkPixbuf; cdecl; external gtklib;
 91function gtk_text_iter_get_marks(iter:PGtkTextIter):PGSList; cdecl; external gtklib;
 92function gtk_text_iter_get_child_anchor(iter:PGtkTextIter):PGtkTextChildAnchor; cdecl; external gtklib;
 93{ Return list of tags toggled at this point (toggled_on determines
 94   whether the list is of on-toggles or off-toggles)
 95  }
 96function gtk_text_iter_get_toggled_tags(iter:PGtkTextIter; toggled_on:gboolean):PGSList; cdecl; external gtklib;
 97function gtk_text_iter_begins_tag(iter:PGtkTextIter; tag:PGtkTextTag):gboolean; cdecl; external gtklib;
 98function gtk_text_iter_ends_tag(iter:PGtkTextIter; tag:PGtkTextTag):gboolean; cdecl; external gtklib;
 99function gtk_text_iter_toggles_tag(iter:PGtkTextIter; tag:PGtkTextTag):gboolean; cdecl; external gtklib;
100function gtk_text_iter_has_tag(iter:PGtkTextIter; tag:PGtkTextTag):gboolean; cdecl; external gtklib;
101function gtk_text_iter_get_tags(iter:PGtkTextIter):PGSList; cdecl; external gtklib;
102function gtk_text_iter_editable(iter:PGtkTextIter; default_setting:gboolean):gboolean; cdecl; external gtklib;
103function gtk_text_iter_can_insert(iter:PGtkTextIter; default_editability:gboolean):gboolean; cdecl; external gtklib;
104function gtk_text_iter_starts_word(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
105function gtk_text_iter_ends_word(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
106function gtk_text_iter_inside_word(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
107function gtk_text_iter_starts_sentence(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
108function gtk_text_iter_ends_sentence(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
109function gtk_text_iter_inside_sentence(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
110function gtk_text_iter_starts_line(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
111function gtk_text_iter_ends_line(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
112function gtk_text_iter_is_cursor_position(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
113function gtk_text_iter_get_chars_in_line(iter:PGtkTextIter):gint; cdecl; external gtklib;
114function gtk_text_iter_get_bytes_in_line(iter:PGtkTextIter):gint; cdecl; external gtklib;
115function gtk_text_iter_get_attributes(iter:PGtkTextIter; values:PGtkTextAttributes):gboolean; cdecl; external gtklib;
116function gtk_text_iter_get_language(iter:PGtkTextIter):PPangoLanguage; cdecl; external gtklib;
117function gtk_text_iter_is_end(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
118function gtk_text_iter_is_start(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
119{
120   Moving around the buffer
121  }
122function gtk_text_iter_forward_char(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
123function gtk_text_iter_backward_char(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
124function gtk_text_iter_forward_chars(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
125function gtk_text_iter_backward_chars(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
126function gtk_text_iter_forward_line(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
127function gtk_text_iter_backward_line(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
128function gtk_text_iter_forward_lines(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
129function gtk_text_iter_backward_lines(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
130function gtk_text_iter_forward_word_end(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
131function gtk_text_iter_backward_word_start(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
132function gtk_text_iter_forward_word_ends(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
133function gtk_text_iter_backward_word_starts(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
134function gtk_text_iter_forward_sentence_end(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
135function gtk_text_iter_backward_sentence_start(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
136function gtk_text_iter_forward_sentence_ends(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
137function gtk_text_iter_backward_sentence_starts(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
138{ cursor positions are almost equivalent to chars, but not quite;
139   in some languages, you can't put the cursor between certain
140   chars. Also, you can't put the cursor between \r\n at the theEnd
141   of a line.
142  }
143function gtk_text_iter_forward_cursor_position(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
144function gtk_text_iter_backward_cursor_position(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
145function gtk_text_iter_forward_cursor_positions(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
146function gtk_text_iter_backward_cursor_positions(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
147procedure gtk_text_iter_set_offset(iter:PGtkTextIter; char_offset:gint); cdecl; external gtklib;
148procedure gtk_text_iter_set_line(iter:PGtkTextIter; line_number:gint); cdecl; external gtklib;
149procedure gtk_text_iter_set_line_offset(iter:PGtkTextIter; char_on_line:gint); cdecl; external gtklib;
150procedure gtk_text_iter_set_line_index(iter:PGtkTextIter; byte_on_line:gint); cdecl; external gtklib;
151procedure gtk_text_iter_forward_to_end(iter:PGtkTextIter); cdecl; external gtklib;
152function gtk_text_iter_forward_to_line_end(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
153procedure gtk_text_iter_set_visible_line_offset(iter:PGtkTextIter; char_on_line:gint); cdecl; external gtklib;
154procedure gtk_text_iter_set_visible_line_index(iter:PGtkTextIter; byte_on_line:gint); cdecl; external gtklib;
155{ returns TRUE if a toggle was found; NULL for the tag pointer
156   means "any tag toggle", otherwise the next toggle of the
157   specified tag is located.
158  }
159function gtk_text_iter_forward_to_tag_toggle(iter:PGtkTextIter; tag:PGtkTextTag):gboolean; cdecl; external gtklib;
160function gtk_text_iter_backward_to_tag_toggle(iter:PGtkTextIter; tag:PGtkTextTag):gboolean; cdecl; external gtklib;
161function gtk_text_iter_forward_find_char(iter:PGtkTextIter; pred:TGtkTextCharPredicate; user_data:gpointer; limit:PGtkTextIter):gboolean; cdecl; external gtklib;
162function gtk_text_iter_backward_find_char(iter:PGtkTextIter; pred:TGtkTextCharPredicate; user_data:gpointer; limit:PGtkTextIter):gboolean; cdecl; external gtklib;
163function gtk_text_iter_forward_search(iter:PGtkTextIter; str:Pgchar; flags:TGtkTextSearchFlags; match_start:PGtkTextIter; match_end:PGtkTextIter;
164           limit:PGtkTextIter):gboolean; cdecl; external gtklib;
165function gtk_text_iter_backward_search(iter:PGtkTextIter; str:Pgchar; flags:TGtkTextSearchFlags; match_start:PGtkTextIter; match_end:PGtkTextIter;
166           limit:PGtkTextIter):gboolean; cdecl; external gtklib;
167{
168   Comparisons
169  }
170function gtk_text_iter_equal(lhs:PGtkTextIter; rhs:PGtkTextIter):gboolean; cdecl; external gtklib;
171function gtk_text_iter_compare(lhs:PGtkTextIter; rhs:PGtkTextIter):gint; cdecl; external gtklib;
172function gtk_text_iter_in_range(iter:PGtkTextIter; start:PGtkTextIter; theEnd:PGtkTextIter):gboolean; cdecl; external gtklib;
173{ Put these two in ascending order  }
174procedure gtk_text_iter_order(first:PGtkTextIter; second:PGtkTextIter); cdecl; external gtklib;
175
176{$ifdef HasGTK2_4}
177function gtk_text_iter_backward_visible_cursor_position(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
178function gtk_text_iter_backward_visible_cursor_positions(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
179function gtk_text_iter_backward_visible_word_start(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
180function gtk_text_iter_backward_visible_word_starts(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
181function gtk_text_iter_forward_visible_cursor_position(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
182function gtk_text_iter_forward_visible_cursor_positions(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
183function gtk_text_iter_forward_visible_word_end(iter:PGtkTextIter):gboolean; cdecl; external gtklib;
184function gtk_text_iter_forward_visible_word_ends(iter:PGtkTextIter; count:gint):gboolean; cdecl; external gtklib;
185{$endif}
186
187{$ENDIF read_interface_rest}
188
189//------------------------------------------------------------------------------
190
191{$IFDEF read_implementation}
192function GTK_TYPE_TEXT_ITER : GType;
193begin
194   GTK_TYPE_TEXT_ITER:=gtk_text_iter_get_type;
195end;
196
197{$ENDIF read_implementation}
198// included by gtk2.pas
199