summaryrefslogtreecommitdiff
path: root/gtk/gtktextiter.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2000-07-25 23:59:38 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-07-25 23:59:38 +0000
commita4762fbff4739fbf0373c5528eb3a9855aa9299b (patch)
tree3fc0969e7a0a0761da5c5d92920ee04b07c5f528 /gtk/gtktextiter.h
parentf56297c5346cddb72b383161bbde9168824acb94 (diff)
downloadgtk+-a4762fbff4739fbf0373c5528eb3a9855aa9299b.tar.gz
update to reflect text widget changes.
2000-07-25 Havoc Pennington <hp@redhat.com> * gtk/testtext.c, gtk/testtextbuffer.c: update to reflect text widget changes. * gtk/gtktextview.h: To be consistent with usage of "line" throughout the API to mean "newline-terminated thingy", change MOVEMENT_LINE to be MOVEMENT_WRAPPED_LINE, and MOVEMENT_PARAGRAPH to MOVEMENT_LINE. (GtkTextView): Add flags for default editability, and whether to show the cursor. Add functions to get/set that. Add (gtk_text_view_get_iter_location): new function * gtk/gtktexttypes.h: Move GtkTextLine typedef from here to gtktextlayout.h (g_convert): Add g_convert temporarily, will go in glib in a bit * gtk/gtktexttagtable.h: include gtktexttag.h, and define GtkTextTagTableForeach instead of brokenly using GHFunc. Change gtk_text_tag_table_foreach() so it doesn't use GHFunc. * gtk/gtktexttagprivate.h: Remove GtkTextStyleValues from here, moved to public header. * gtk/gtktexttag.h: Rename the "elide" attribute of tags to "invisible", since "elide" was a bad name. (gtk_text_tag_get_priority): Added (GtkTextStyleValues): put this in public header, along with functions to use it. * gtk/gtktextmarkprivate.h: Include more headers, since we no longer include gtktextbtree.h. * gtk/gtktextmark.h: Add gtk_text_mark_ref, gtk_text_mark_unref, gtk_text_mark_deleted * gtk/gtktextlayout.h: Don't include the "really private" headers, only buffer/iter. Forward declare GtkTextLIne and GtkTextLineData to make this possible. Now we only need to install gtktextlayout.h, not gtktextbtree.h and gtktext*private.h. (However the Makefile.am isn't changed yet because of the logistics of merging gtk-hp-patches piecemeal) * gtk/gtktextiterprivate.h: include btree header, so it compiles; rename gtk_text_iter_get_line to gtk_text_iter_get_text_line since gtk_text_iter_get_line is now used in the public API for a different purpose. * gtk/gtktextiter.h: Clean up function names to be more consistent. Always call char offset "offset" and byte index "index". A "line" is always a line number. (gtk_text_iter_is_last): new function, more efficient than the existing way to check (gtk_text_iter_is_first): new function, also more efficient (gtk_text_iter_up_lines, gtk_text_iter_down_lines): Remove these (gtk_text_iter_next_char, gtk_text_iter_prev_char): Renamed from gtk_text_iter_forward_char, etc. (gtk_text_iter_forward_to_tag_toggle): Renamed from forward_find_tag_toggle, since this isn't a linear search (GtkTextCharPredicate): rename from GtkTextViewCharPredicate (gtk_text_iter_forward_search, gtk_text_iter_backward_search): New functions, search for a buffer substring. * gtk/gtktextbuffer.h: Add fields to store whether a paste is interactive and default editable (since we need to store that info until we receive the selection data). Remove all the _at_char and at_line etc. versions of functions; only have iterator versions. Add _interactive() versions of functions, that consider the editability of text. (FIXME add interactive flag to the insert/delete signals per Darin's suggestion) (gtk_text_buffer_get_tag_table): new function, demand-creates the tag table if necessary Remove declaration of gtk_text_buffer_get_iter_from_string (_gtk_text_buffer_get_btree): private/internal function, added. * gtk/gtktextbtree.h: Remove forward decl of GtkTextLineData. (gtk_text_line_is_last): new function
Diffstat (limited to 'gtk/gtktextiter.h')
-rw-r--r--gtk/gtktextiter.h127
1 files changed, 72 insertions, 55 deletions
diff --git a/gtk/gtktextiter.h b/gtk/gtktextiter.h
index 2e86e47b0d..1114e3226d 100644
--- a/gtk/gtktextiter.h
+++ b/gtk/gtktextiter.h
@@ -28,7 +28,7 @@ struct _GtkTextIter {
gpointer dummy8;
gint dummy9;
gpointer pad1;
- gint pad2;
+ guint pad2;
};
@@ -46,10 +46,12 @@ void gtk_text_iter_free (GtkTextIter *iter);
/*
* Convert to different kinds of index
*/
-gint gtk_text_iter_get_char_index (const GtkTextIter *iter);
-gint gtk_text_iter_get_line_number (const GtkTextIter *iter);
-gint gtk_text_iter_get_line_char (const GtkTextIter *iter);
-gint gtk_text_iter_get_line_byte (const GtkTextIter *iter);
+
+gint gtk_text_iter_get_offset (const GtkTextIter *iter);
+gint gtk_text_iter_get_line (const GtkTextIter *iter);
+gint gtk_text_iter_get_line_offset (const GtkTextIter *iter);
+gint gtk_text_iter_get_line_index (const GtkTextIter *iter);
+
/*
* "Dereference" operators
@@ -72,19 +74,21 @@ gchar *gtk_text_iter_get_visible_text (const GtkTextIter *start,
/* Returns TRUE if the iterator pointed at a pixmap */
gboolean gtk_text_iter_get_pixmap (const GtkTextIter *iter,
- GdkPixmap **pixmap,
- GdkBitmap **mask);
+ GdkPixmap **pixmap,
+ GdkBitmap **mask);
+
+GSList *gtk_text_iter_get_marks (const GtkTextIter *iter);
/* Return list of tags toggled at this point (toggled_on determines
whether the list is of on-toggles or off-toggles) */
GSList *gtk_text_iter_get_toggled_tags (const GtkTextIter *iter,
- gboolean toggled_on);
+ gboolean toggled_on);
gboolean gtk_text_iter_begins_tag (const GtkTextIter *iter,
- GtkTextTag *tag);
+ GtkTextTag *tag);
gboolean gtk_text_iter_ends_tag (const GtkTextIter *iter,
- GtkTextTag *tag);
+ GtkTextTag *tag);
gboolean gtk_text_iter_toggles_tag (const GtkTextIter *iter,
GtkTextTag *tag);
@@ -92,78 +96,91 @@ gboolean gtk_text_iter_toggles_tag (const GtkTextIter *iter,
gboolean gtk_text_iter_has_tag (const GtkTextIter *iter,
GtkTextTag *tag);
+gboolean gtk_text_iter_editable (const GtkTextIter *iter,
+ gboolean default_setting);
+
gboolean gtk_text_iter_starts_line (const GtkTextIter *iter);
gboolean gtk_text_iter_ends_line (const GtkTextIter *iter);
gint gtk_text_iter_get_chars_in_line (const GtkTextIter *iter);
+gboolean gtk_text_iter_get_style_values (const GtkTextIter *iter,
+ GtkTextStyleValues *values);
+
+gboolean gtk_text_iter_is_last (const GtkTextIter *iter);
+gboolean gtk_text_iter_is_first (const GtkTextIter *iter);
+
/*
* Moving around the buffer
*/
-gboolean gtk_text_iter_forward_char (GtkTextIter *iter);
-gboolean gtk_text_iter_backward_char (GtkTextIter *iter);
-gboolean gtk_text_iter_forward_chars (GtkTextIter *iter,
- gint count);
-gboolean gtk_text_iter_backward_chars (GtkTextIter *iter,
- gint count);
-gboolean gtk_text_iter_forward_line (GtkTextIter *iter);
-gboolean gtk_text_iter_backward_line (GtkTextIter *iter);
-gboolean gtk_text_iter_forward_lines (GtkTextIter *iter,
- gint count);
-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_backward_word_starts(GtkTextIter *iter,
- gint count);
-gboolean gtk_text_iter_forward_word_end(GtkTextIter *iter);
-gboolean gtk_text_iter_backward_word_start(GtkTextIter *iter);
-
-gboolean gtk_text_iter_up_lines (GtkTextIter *iter,
- gint count);
-
-gboolean gtk_text_iter_down_lines (GtkTextIter *iter,
- gint count);
-
-void gtk_text_iter_set_char_index (GtkTextIter *iter,
- gint char_index);
-void gtk_text_iter_set_line_number (GtkTextIter *iter,
- gint line_number);
-void gtk_text_iter_set_line_char (GtkTextIter *iter,
- gint char_on_line);
-
-void gtk_text_iter_forward_to_end (GtkTextIter *iter);
-gboolean gtk_text_iter_forward_to_newline(GtkTextIter *iter);
+
+gboolean gtk_text_iter_next_char (GtkTextIter *iter);
+gboolean gtk_text_iter_prev_char (GtkTextIter *iter);
+gboolean gtk_text_iter_forward_chars (GtkTextIter *iter,
+ gint count);
+gboolean gtk_text_iter_backward_chars (GtkTextIter *iter,
+ gint count);
+gboolean gtk_text_iter_forward_line (GtkTextIter *iter);
+gboolean gtk_text_iter_backward_line (GtkTextIter *iter);
+gboolean gtk_text_iter_forward_lines (GtkTextIter *iter,
+ gint count);
+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_backward_word_starts (GtkTextIter *iter,
+ gint count);
+gboolean gtk_text_iter_forward_word_end (GtkTextIter *iter);
+gboolean gtk_text_iter_backward_word_start (GtkTextIter *iter);
+
+void gtk_text_iter_set_offset (GtkTextIter *iter,
+ gint char_offset);
+void gtk_text_iter_set_line (GtkTextIter *iter,
+ gint line_number);
+void gtk_text_iter_set_line_offset (GtkTextIter *iter,
+ gint char_on_line);
+void gtk_text_iter_forward_to_end (GtkTextIter *iter);
+gboolean gtk_text_iter_forward_to_newline (GtkTextIter *iter);
/* returns TRUE if a toggle was found; NULL for the tag pointer
means "any tag toggle", otherwise the next toggle of the
specified tag is located. */
-gboolean gtk_text_iter_forward_find_tag_toggle (GtkTextIter *iter,
- GtkTextTag *tag);
+gboolean gtk_text_iter_forward_to_tag_toggle (GtkTextIter *iter,
+ GtkTextTag *tag);
-gboolean gtk_text_iter_backward_find_tag_toggle (GtkTextIter *iter,
- GtkTextTag *tag);
+gboolean gtk_text_iter_backward_to_tag_toggle (GtkTextIter *iter,
+ GtkTextTag *tag);
-typedef gboolean (* GtkTextViewCharPredicate) (gunichar ch, gpointer user_data);
+typedef gboolean (* GtkTextCharPredicate) (gunichar ch, gpointer user_data);
gboolean gtk_text_iter_forward_find_char (GtkTextIter *iter,
- GtkTextViewCharPredicate pred,
+ GtkTextCharPredicate pred,
gpointer user_data);
gboolean gtk_text_iter_backward_find_char (GtkTextIter *iter,
- GtkTextViewCharPredicate pred,
+ GtkTextCharPredicate pred,
gpointer user_data);
+gboolean gtk_text_iter_forward_search (GtkTextIter *iter,
+ const char *str,
+ gboolean visible_only,
+ gboolean slice);
+
+gboolean gtk_text_iter_backward_search (GtkTextIter *iter,
+ const char *str,
+ gboolean visible_only,
+ gboolean slice);
+
/*
* Comparisons
*/
gboolean gtk_text_iter_equal (const GtkTextIter *lhs,
- const GtkTextIter *rhs);
+ const GtkTextIter *rhs);
gint gtk_text_iter_compare (const GtkTextIter *lhs,
- const GtkTextIter *rhs);
+ const GtkTextIter *rhs);
gboolean gtk_text_iter_in_region (const GtkTextIter *iter,
- const GtkTextIter *start,
- const GtkTextIter *end);
+ const GtkTextIter *start,
+ const GtkTextIter *end);
/* Put these two in ascending order */
void gtk_text_iter_reorder (GtkTextIter *first,