[gimp/osx-build: 49/50] XCF loader/saver: fix wrong 'locked' attribute in PROP_PATHS



commit 5098c85fdc4b537981d048815c3dd059111f9e76
Author: Sven Claussner <sclaussner src gnome org>
Date:   Sun Jul 13 18:27:09 2014 +0200

    XCF loader/saver: fix wrong 'locked' attribute in PROP_PATHS
    
    Replace the ancient and wrong 'locked' attribute by the correct
    'linked' attribute.

 app/xcf/xcf-load.c |   31 ++++++++++++++++++++++++++-----
 app/xcf/xcf-save.c |    8 ++++----
 devel-docs/xcf.txt |    6 +++++-
 3 files changed, 35 insertions(+), 10 deletions(-)
---
diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c
index dede16e..cb82f58 100644
--- a/app/xcf/xcf-load.c
+++ b/app/xcf/xcf-load.c
@@ -71,6 +71,13 @@
 #include "gimp-intl.h"
 
 
+/**
+ * SECTION:xcf-load
+ * @Short_description:XCF file loader functions
+ *
+ * This section describes the XCF file loader.
+ */
+
 #define MAX_XCF_PARASITE_DATA_LEN (256L * 1024 * 1024)
 
 /* #define GIMP_XCF_PATH_DEBUG */
@@ -131,6 +138,20 @@ static gboolean        xcf_skip_unknown_prop  (XcfInfo      *info,
   } G_STMT_END
 
 
+/**
+ * xcf_load_image:
+ *
+ * @gimp:  Pointer to the #Gimp instance
+ * @info:  Pointer to the #XcfInfo structure of the file to open
+ * @error: Return location for hard errors
+ *
+ * Returns: Image of type #GimpImage with the loaded content from the XCF file
+ *          or %NULL if a hard error occured.
+ *
+ * On hard errors, @error will contain the occured error and %NULL be returned.
+ *
+ * Loads an image from an XCF file.
+ */
 GimpImage *
 xcf_load_image (Gimp     *gimp,
                 XcfInfo  *info,
@@ -1391,7 +1412,7 @@ xcf_load_level (XcfInfo     *info,
   if (offset == 0)
     return TRUE;
 
-  /* Initialise the reference for the in-memory tile-compression
+  /* Initialize the reference for the in-memory tile-compression
    */
   previous = NULL;
 
@@ -1700,7 +1721,7 @@ xcf_load_old_path (XcfInfo   *info,
                    GimpImage *image)
 {
   gchar                  *name;
-  guint32                 locked;
+  guint32                 linked;
   guint8                  state;
   guint32                 closed;
   guint32                 num_points;
@@ -1711,7 +1732,7 @@ xcf_load_old_path (XcfInfo   *info,
   gint                    i;
 
   info->cp += xcf_read_string (info->fp, &name, 1);
-  info->cp += xcf_read_int32  (info->fp, &locked, 1);
+  info->cp += xcf_read_int32  (info->fp, &linked, 1);
   info->cp += xcf_read_int8   (info->fp, &state, 1);
   info->cp += xcf_read_int32  (info->fp, &closed, 1);
   info->cp += xcf_read_int32  (info->fp, &num_points, 1);
@@ -1728,7 +1749,7 @@ xcf_load_old_path (XcfInfo   *info,
     {
       guint32 dummy;
 
-      /* Has extra tatto field */
+      /* Has extra tattoo field */
       info->cp += xcf_read_int32 (info->fp, (guint32 *) &dummy,  1);
       info->cp += xcf_read_int32 (info->fp, (guint32 *) &tattoo, 1);
     }
@@ -1781,7 +1802,7 @@ xcf_load_old_path (XcfInfo   *info,
   g_free (name);
   g_free (points);
 
-  gimp_item_set_linked (GIMP_ITEM (vectors), locked, FALSE);
+  gimp_item_set_linked (GIMP_ITEM (vectors), linked, FALSE);
 
   if (tattoo)
     gimp_item_set_tattoo (GIMP_ITEM (vectors), tattoo);
diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c
index d4c943b..627857e 100644
--- a/app/xcf/xcf-save.c
+++ b/app/xcf/xcf-save.c
@@ -1618,7 +1618,7 @@ xcf_save_old_paths (XcfInfo    *info,
     {
       GimpVectors            *vectors = list->data;
       gchar                  *name;
-      guint32                 locked;
+      guint32                 linked;
       guint8                  state;
       guint32                 version;
       guint32                 pathtype;
@@ -1630,7 +1630,7 @@ xcf_save_old_paths (XcfInfo    *info,
 
       /*
        * name (string)
-       * locked (gint)
+       * linked (gint)
        * state (gchar)
        * closed (gint)
        * number points (gint)
@@ -1650,14 +1650,14 @@ xcf_save_old_paths (XcfInfo    *info,
        * around to fix that cruft  */
 
       name     = (gchar *) gimp_object_get_name (vectors);
-      locked   = gimp_item_get_linked (GIMP_ITEM (vectors));
+      linked   = gimp_item_get_linked (GIMP_ITEM (vectors));
       state    = closed ? 4 : 2;  /* EDIT : ADD  (editing state, 1.2 compat) */
       version  = 3;
       pathtype = 1;  /* BEZIER  (1.2 compat) */
       tattoo   = gimp_item_get_tattoo (GIMP_ITEM (vectors));
 
       xcf_write_string_check_error (info, &name,       1);
-      xcf_write_int32_check_error  (info, &locked,     1);
+      xcf_write_int32_check_error  (info, &linked,     1);
       xcf_write_int8_check_error   (info, &state,      1);
       xcf_write_int32_check_error  (info, &closed,     1);
       xcf_write_int32_check_error  (info, &num_points, 1);
diff --git a/devel-docs/xcf.txt b/devel-docs/xcf.txt
index edc718d..2c39f7c 100644
--- a/devel-docs/xcf.txt
+++ b/devel-docs/xcf.txt
@@ -762,7 +762,8 @@ PROP_PATHS
 
     Format 1:   Format 2:   Format 3:
      string      string      string     name     Name of the path
-     uint32      uint32      uint32     locked   (TODO: correct to 'linked')
+     uint32      uint32      uint32     linked   1 if the path is linked;
+                                                 0 if not
      byte        byte        byte       state    4 if closed; 2 otherwise
                                                  (for GIMP 1.2 compatibility)
      uint32      uint32      uint32     closed   1 if path is closed;
@@ -784,6 +785,9 @@ PROP_PATHS
   continuous sequences of Bezier strokes. Otherwise GIMP stores the paths in
   PROP_VECTORS.
 
+  Note: the attribute 'linked' was formerly erroneously called 'locked'
+  (but meant 'linked' anyway).
+  
   A closed path is a path which has the last and the first point connected,
   for instance a triangle.
 


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