gimp r27708 - trunk/devel-docs
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27708 - trunk/devel-docs
- Date: Sat, 22 Nov 2008 12:37:58 +0000 (UTC)
Author: neo
Date: Sat Nov 22 12:37:57 2008
New Revision: 27708
URL: http://svn.gnome.org/viewvc/gimp?rev=27708&view=rev
Log:
2008-11-22 Sven Neumann <sven gimp org>
* parasites.txt: removed obsolete section about gserialize.
Modified:
trunk/devel-docs/ChangeLog
trunk/devel-docs/parasites.txt
Modified: trunk/devel-docs/parasites.txt
==============================================================================
--- trunk/devel-docs/parasites.txt (original)
+++ trunk/devel-docs/parasites.txt Sat Nov 22 12:37:57 2008
@@ -272,42 +272,3 @@
the size of the string representation of your data, you can use
gimp_config_serialize_to_string() and other functions to easily
convert your data to/from a character string.
-
-- Obsolete: Use the libgimp serialize functions
-
- NOTE: libgimp/gserialize.[ch] has been excluded from the build since
- gimp-1.2. This decision was made since noone seemed to use it so
- far. The files can still be pulled out of SVN, so if you decide
- to use them, you will have to include a copy into your plugin
- source or resurrect the functionality in libgimp.
-
- Look at the stuff in libgimp/gserialize.h. These functions allow for
- relatively easy serializing/deserializing of structs. The advantages
- are that the gimp-developers have already taken care of endian-ness
- issues and other hazzles. The drawback is that you might encounter
- problems when you want to extend your structures later, as you have to
- be prepared for images saved with parasites form a very old version of
- your plug-in, and the gserialize functions do not handle different data
- formats nicely itself.
-
- One way out around this is to prefix your data with a version identifier
- (remember to use a guchar, i.e. something without endian-ness problems).
- Remember to skip it before deserializing.
-
- Another very easy way is to add a version tag to your parasite name,
- i.e. "foo-bar-v1", "foo-bar-v2". Your plug-in could then check for older
- versions and act accordingly and/or attach the new parasite or both the
- new and the old version of your data.
-
- The gserialize stuff also makes it possible to just append more fields
- (i.e. more gserialized structs) to your data. You could check the length
- of the parasite data ("anything left?") to decide wether to decode more
- fields. Here's some example:
-
- data = parasite_data(p);
- size = parasite_data_size(p);
- length = gdeserialize(...);
- tlength += length;
- data += length;
- if (tlength != size)
- gdeserialize the next one, etc.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]