[gtk+] Added gtk_text_iter_assign API



commit 99686a2fefa7a71af69f9fb05a94c11ac9c89d53
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sat Mar 19 20:58:33 2011 +0100

    Added gtk_text_iter_assign API
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645258

 gtk/gtktextiter.c |   22 ++++++++++++++++++++++
 gtk/gtktextiter.h |    6 ++----
 2 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c
index c399f6f..8167230 100644
--- a/gtk/gtktextiter.c
+++ b/gtk/gtktextiter.c
@@ -444,6 +444,28 @@ gtk_text_iter_free (GtkTextIter *iter)
   g_slice_free (GtkTextIter, iter);
 }
 
+/**
+ * gtk_text_iter_assign:
+ * @iter: a #GtkTextIter
+ * @other: another #GtkTextIter
+ *
+ * Assigns the value of @other to @iter.  This function
+ * is not useful in applications, because iterators can be assigned
+ * with <literal>GtkTextIter i = j;</literal>. The
+ * function is used by language bindings.
+ *
+ * Since: 3.2
+ **/
+void
+gtk_text_iter_assign (GtkTextIter       *iter,
+                      const GtkTextIter *other)
+{
+  g_return_if_fail (iter != NULL);
+  g_return_if_fail (other != NULL);
+
+  *iter = *other;
+}
+
 G_DEFINE_BOXED_TYPE (GtkTextIter, gtk_text_iter,
                      gtk_text_iter_copy,
                      gtk_text_iter_free)
diff --git a/gtk/gtktextiter.h b/gtk/gtktextiter.h
index 9d636bf..bca4eea 100644
--- a/gtk/gtktextiter.h
+++ b/gtk/gtktextiter.h
@@ -88,6 +88,8 @@ GtkTextBuffer *gtk_text_iter_get_buffer (const GtkTextIter *iter);
 
 GtkTextIter *gtk_text_iter_copy     (const GtkTextIter *iter);
 void         gtk_text_iter_free     (GtkTextIter       *iter);
+void         gtk_text_iter_assign   (GtkTextIter       *iter,
+                                     const GtkTextIter *other);
 
 GType        gtk_text_iter_get_type (void) G_GNUC_CONST;
 
@@ -234,7 +236,6 @@ gboolean gtk_text_iter_forward_visible_cursor_positions  (GtkTextIter *iter,
 gboolean gtk_text_iter_backward_visible_cursor_positions (GtkTextIter *iter,
                                                           gint         count);
 
-
 void     gtk_text_iter_set_offset         (GtkTextIter *iter,
                                            gint         char_offset);
 void     gtk_text_iter_set_line           (GtkTextIter *iter,
@@ -286,7 +287,6 @@ gboolean gtk_text_iter_backward_search (const GtkTextIter *iter,
                                         GtkTextIter       *match_end,
                                         const GtkTextIter *limit);
 
-
 /*
  * Comparisons
  */
@@ -305,5 +305,3 @@ void     gtk_text_iter_order           (GtkTextIter *first,
 G_END_DECLS
 
 #endif
-
-



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]