[gimp] app: Add gimp_vectors_get_stroke()



commit 2d2b6f03c580127e1aca7fcdbc391893301560cd
Author: Martin Nordholts <martinn src gnome org>
Date:   Wed Dec 30 11:06:56 2009 +0100

    app: Add gimp_vectors_get_stroke()

 app/vectors/gimpvectors.c |    8 ++++++++
 app/vectors/gimpvectors.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/app/vectors/gimpvectors.c b/app/vectors/gimpvectors.c
index 2c1eb21..dcd1e1b 100644
--- a/app/vectors/gimpvectors.c
+++ b/app/vectors/gimpvectors.c
@@ -726,6 +726,14 @@ gimp_vectors_get_n_strokes (const GimpVectors *vectors)
   return g_list_length (vectors->strokes);
 }
 
+GimpStroke *
+gimp_vectors_get_stroke (const GimpVectors *vectors,
+                         int                index)
+{
+  g_return_val_if_fail (GIMP_IS_VECTORS (vectors), 0);
+
+  return GIMP_STROKE (g_list_nth_data (vectors->strokes, index));
+}
 
 GimpStroke *
 gimp_vectors_stroke_get (const GimpVectors *vectors,
diff --git a/app/vectors/gimpvectors.h b/app/vectors/gimpvectors.h
index 235e925..1642cd8 100644
--- a/app/vectors/gimpvectors.h
+++ b/app/vectors/gimpvectors.h
@@ -138,6 +138,8 @@ void            gimp_vectors_stroke_add         (GimpVectors        *vectors,
 void            gimp_vectors_stroke_remove      (GimpVectors        *vectors,
                                                  GimpStroke         *stroke);
 gint            gimp_vectors_get_n_strokes      (const GimpVectors  *vectors);
+GimpStroke    * gimp_vectors_get_stroke         (const GimpVectors  *vectors,
+                                                 int                 index);
 GimpStroke    * gimp_vectors_stroke_get         (const GimpVectors  *vectors,
                                                  const GimpCoords   *coord);
 GimpStroke    * gimp_vectors_stroke_get_by_ID   (const GimpVectors  *vectors,



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