[libgxps] Move gxps_point_parse() from gxps-page to gxps-parse-utils



commit 3d43748b21db8ab44bd4479246bbf2428dc0e76b
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Mon Nov 14 19:41:42 2011 +0100

    Move gxps_point_parse() from gxps-page to gxps-parse-utils

 libgxps/gxps-page.c        |   31 -------------------------------
 libgxps/gxps-parse-utils.c |   31 +++++++++++++++++++++++++++++++
 libgxps/gxps-parse-utils.h |    3 +++
 3 files changed, 34 insertions(+), 31 deletions(-)
---
diff --git a/libgxps/gxps-page.c b/libgxps/gxps-page.c
index 04a6422..5b1f32e 100644
--- a/libgxps/gxps-page.c
+++ b/libgxps/gxps-page.c
@@ -1064,37 +1064,6 @@ gxps_box_parse (const gchar       *box,
 }
 
 static gboolean
-gxps_point_parse (const gchar *point,
-		  gdouble     *x,
-		  gdouble     *y)
-{
-	gchar *p;
-
-	p = g_strrstr (point, ",");
-	if (!p)
-		return FALSE;
-
-	if (x) {
-		gchar *str;
-
-		str = g_strndup (point, p - point);
-                if (!gxps_value_get_double (str, x)) {
-                        g_free (str);
-
-                        return FALSE;
-                }
-		g_free (str);
-	}
-
-	if (y) {
-                if (!gxps_value_get_double (++p, y))
-                        return FALSE;
-	}
-
-	return TRUE;
-}
-
-static gboolean
 gxps_points_parse (const gchar *points,
 		   gdouble    **coords,
 		   guint       *n_points)
diff --git a/libgxps/gxps-parse-utils.c b/libgxps/gxps-parse-utils.c
index b85dc67..cec1750 100644
--- a/libgxps/gxps-parse-utils.c
+++ b/libgxps/gxps-parse-utils.c
@@ -302,6 +302,37 @@ gxps_value_get_double_positive (const gchar *value,
         return *double_value >= 1;
 }
 
+gboolean
+gxps_point_parse (const gchar *point,
+                  gdouble     *x,
+                  gdouble     *y)
+{
+        gchar *p;
+
+        p = g_strrstr (point, ",");
+        if (!p)
+                return FALSE;
+
+        if (x) {
+                gchar *str;
+
+                str = g_strndup (point, p - point);
+                if (!gxps_value_get_double (str, x)) {
+                        g_free (str);
+
+                        return FALSE;
+                }
+                g_free (str);
+        }
+
+        if (y) {
+                if (!gxps_value_get_double (++p, y))
+                        return FALSE;
+        }
+
+        return TRUE;
+}
+
 gchar *
 gxps_resolve_relative_path (const gchar *source,
 			    const gchar *target)
diff --git a/libgxps/gxps-parse-utils.h b/libgxps/gxps-parse-utils.h
index 6c1e391..565b223 100644
--- a/libgxps/gxps-parse-utils.h
+++ b/libgxps/gxps-parse-utils.h
@@ -40,6 +40,9 @@ gboolean gxps_value_get_double          (const gchar          *value,
                                          gdouble              *double_value);
 gboolean gxps_value_get_double_positive (const gchar          *value,
                                          gdouble              *double_value);
+gboolean gxps_point_parse               (const gchar          *point,
+                                         gdouble              *x,
+                                         gdouble              *y);
 gchar   *gxps_resolve_relative_path     (const gchar          *source,
                                          const gchar          *target);
 



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