gimp/libgimp/gserialize.h
jaycox fe3fa4e2e5 libgimp/gserialize.c Changed the enum values to allow for simpler future
* libgimp/gserialize.c
	* libgimp/gserialize.h: Changed the enum values to allow for
 	simpler future expansion.

	* libgimp/parasite.c
	* libgimp/parasite.h: s/persistant/persistent/.
 	new accessor functions for parasites.  #defines for new flags.

	* app/paintbrush.c: added timeing code for brush strokes.
  	It is #ifed out, and is only valid for shift clicks.

	* app/parasite_cmds.h: fixed a warning

	* app/parasitelist.h
	* app/parasitelist.c: added _for_each and _length functions

	* app/gimpdrawable.c:  set the dirty flag when adding or removing a
 	persistent parasite

	* app/gimpimage.c: set the dirty flag when adding or removing a
 	persistent parasite.  Fixed bug and removed debug statements in
 	merge_down.

	* app/xcf.c: save and load resolution, parasites, and tattoos.

	* app/main.c: updated the deserialize test.

	* plug-ins/tiff/tiff.c
	* plug-ins/gif/gif.c: use PARASITE_PERSISTENT define instead of 1

	* plug-ins/bmp/bmp.c
	* plug-ins/bmp/bmp.h: declare some struct variable as extern.

	* app/paint_funcs.c: Lots of optimizations aimed at speeding up
 	painting.  Should see a 2-4X speed up on most painting
 	(depending on paint modes, brush size etc.)

	* app/drawable.c: check for NULL drawable in drawable_ID.
  	this stops us from being crashed by ill-behaved plug-ins
1998-12-16 11:23:30 +00:00

82 lines
2.7 KiB
C

/* gserialize.h
* Copyright (C) 1998 Jay Cox <jaycox@earthlink.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GSERIALIZE_H__
#define __GSERIALIZE_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <glib.h>
#include <stdarg.h>
typedef enum {
GSERIAL_END = 0, /* for internal use only */
GSERIAL_INT8 = 1,
GSERIAL_INT16 = 2,
GSERIAL_INT32 = 3,
GSERIAL_FLOAT = 4, /* 32 bit IEEE fp value */
GSERIAL_DOUBLE = 5, /* 64 bit IEEE fp value */
GSERIAL_STRING = 101,
GSERIAL_INT8ARRAY = 102,
GSERIAL_INT16ARRAY = 103,
GSERIAL_INT32ARRAY = 104,
GSERIAL_FLOATARRAY = 105,
GSERIAL_DOUBLEARRAY = 106,
GSERIAL_LAST_TYPE = 107
} GSerialType;
typedef struct _GSerialItem GSerialItem;
typedef struct _GSerialDescription GSerialDescription;
GSerialItem *g_new_serial_item(GSerialType type, gulong offset,
gint32 length, gulong length_offset);
#define g_serial_item(type, struct_, member) \
g_new_serial_item(type, G_STRUCT_OFFSET(struct_, member), 0, 0)
#define g_serial_array(type, struct_, member, length) \
g_new_serial_item(type, G_STRUCT_OFFSET(struct_, member), length, 0)
#define g_serial_vlen_array(type, struct_, member, length_member) \
g_new_serial_item(type, G_STRUCT_OFFSET(struct_, member), -1, \
G_STRUCT_OFFSET(struct_, length_member))
GSerialDescription *g_new_serial_description(char *name, ...);
/* pass it g_serial_s. null terminated */
void g_free_serial_description(GSerialDescription *);
long g_serialize(GSerialDescription *d, void **output, void *struct_data);
/* returns the length of the serialized data.
g_mallocs space for the data and stores a pointer to it in output */
long g_deserialize(GSerialDescription *d, void *output, void *serial);
/* output must be a preallocated area large enough to hold the
deserialized struct. */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GSERIALIZE_H__*/