[Gtk-sharp-list] serialization support

Gonzalo Paniagua Javier gonzalo@ximian.com
12 Apr 2003 17:44:22 +0200

El sáb, 12 de 04 de 2003 a las 14:27, Lee Mallabone escribió:
>I want to serialize a hashtable of Gdk.Pixbuf objects, but Gdk.Pixbuf
>isn't serializable.

>Is it feasible to make it Serializable?

Well, first someone should modify the generator to handle <implements>
so we can tell it to implement ISerializable.

>I made an attempt, but I only seem to be able to extract a byte* to
>represent the state, rather than a full (safe) byte array of data
>within the Pixbuf. Even if serializing a byte* serializes its contents
>too,(which I doubt), I have no way to create a Pixbuf without having a
>properly managed byte array...

Take a look at gtk+/gdk-pixbuf/gdk-pixdata.c. It contains C functions to
serialize and deserialize a pixbuf.

Then implement GetObjectData and a protected .ctor the creates the
pixbuf from the data stored in GetObjectData.