[gimp/osx-build: 54/55] Comment XCF saving code and test driver



commit 1b2bdd458f618dc81126d70c0b6a20b9150084a6
Author: Sven Claussner <sclaussner src gnome org>
Date:   Fri Jul 18 08:23:22 2014 +0200

    Comment XCF saving code and test driver

 app/tests/test-xcf.c  |   17 ++++++++++++++++-
 app/xcf/xcf-private.h |    2 +-
 app/xcf/xcf-save.c    |   20 +++++++++++++++-----
 3 files changed, 32 insertions(+), 7 deletions(-)
---
diff --git a/app/tests/test-xcf.c b/app/tests/test-xcf.c
index cc0e86c..dc071cb 100644
--- a/app/tests/test-xcf.c
+++ b/app/tests/test-xcf.c
@@ -271,6 +271,13 @@ gimp_test_load_image (Gimp        *gimp,
 
 /**
  * gimp_write_and_read_file:
+ * @gimp:                  #Gimp instance
+ * @with_unusual_stuff:    toggles whether to create the image with unusual
+ *                         stuff, currently only a floating selection
+ * @compat_paths:          toggles whether to use old style paths
+ *                         (before GIMP 1.3)
+ * @use_gimp_2_8_features: toggles whether to use GIMP 2.8 feature,
+ *                         currently layer groups
  *
  * Constructs the main test image and asserts its state, writes it to
  * a file, reads the image from the file, and asserts the state of the
@@ -334,6 +341,14 @@ gimp_write_and_read_file (Gimp     *gimp,
 
 /**
  * gimp_create_mainimage:
+ * gimp_write_and_read_file:
+ * @gimp:                  #Gimp instance
+ * @with_unusual_stuff:    toggles whether to create the image with unusual
+ *                         stuff, currently only a floating selection
+ * @compat_paths:          toggles whether to use old style paths
+ *                         (before GIMP 1.3)
+ * @use_gimp_2_8_features: toggles whether to use GIMP 2.8 feature,
+ *                         currently layer groups
  *
  * Creates the main test image, i.e. the image that we use for most of
  * our XCF testing purposes.
@@ -431,7 +446,7 @@ gimp_create_mainimage (Gimp     *gimp,
                                       GIMP_MAINIMAGE_SAMPLEPOINT2_Y,
                                       FALSE /*push_undo*/);
 
-  /* Tatto
+  /* Tattoo
    * We don't bother testing this, not yet at least
    */
 
diff --git a/app/xcf/xcf-private.h b/app/xcf/xcf-private.h
index 03a25ed..ddca589 100644
--- a/app/xcf/xcf-private.h
+++ b/app/xcf/xcf-private.h
@@ -22,7 +22,7 @@
  * SECTION:xcf-private
  * @Short_description:Common definitions for the XCF functions
  *
- * Common enum and structs definitions for the XCF functions
+ * Common enum and struct definitions for the XCF functions
  */
 
 
diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c
index fb9ab5f..f6d6437 100644
--- a/app/xcf/xcf-save.c
+++ b/app/xcf/xcf-save.c
@@ -306,29 +306,33 @@ xcf_save_image (XcfInfo    *info,
 
   max_progress = 1 + n_layers + n_channels;
 
-  /* write the property information for the image.
-   */
-
+  /* write the property information for the image. */
   xcf_check_error (xcf_save_image_props (info, image, error));
 
   xcf_progress_update (info);
 
   offset = info->cp + (n_layers + n_channels + 2) * 4;
 
+  /* write the layers */
   for (list = all_layers; list; list = g_list_next (list))
     {
       GimpLayer *layer = list->data;
 
+      /* write offset to layer pointers table */
       xcf_write_int32_check_error (info, &offset, 1);
 
+      /* write layer at offset */
       saved_pos = info->cp;
       xcf_check_error (xcf_seek_pos (info, offset, error));
-
       xcf_check_error (xcf_save_layer (info, image, layer, error));
 
+      /* increase offset */
       offset = info->cp;
+
+      /* set file position to layer pointers table */
       xcf_check_error (xcf_seek_pos (info, saved_pos, error));
 
+      /* indicate progress */
       xcf_progress_update (info);
     }
 
@@ -337,20 +341,26 @@ xcf_save_image (XcfInfo    *info,
    */
   xcf_write_int32_check_error (info, &zero, 1);
 
+  /* write the channels */
   for (list = all_channels; list; list = g_list_next (list))
     {
       GimpChannel *channel = list->data;
 
+      /* write offset to channel pointers table */
       xcf_write_int32_check_error (info, &offset, 1);
 
+      /* write channel at offset */
       saved_pos = info->cp;
       xcf_check_error (xcf_seek_pos (info, offset, error));
-
       xcf_check_error (xcf_save_channel (info, image, channel, error));
 
+      /* increase offset */
       offset = info->cp;
+
+      /* set file position to channel pointers table */
       xcf_check_error (xcf_seek_pos (info, saved_pos, error));
 
+      /* indicate progress */
       xcf_progress_update (info);
     }
 


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