GimpParasite

GimpParasite — Arbitrary pieces of data which can be attached to various GIMP objects.

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── GimpParasite

Description

Arbitrary pieces of data which can be attached to various GIMP objects.

Functions

gimp_parasite_new ()

GimpParasite *
gimp_parasite_new (const gchar *name,
                   guint32 flags,
                   guint32 size,
                   gconstpointer data);

Creates a new parasite and save data which may be a proper text (in which case you may want to set size as strlen(data ) + 1) or not.

Parameters

name

the new GimpParasite name.

 

flags

see libgimpbase/gimpparasite.h macros.

 

size

the size of data , including a terminal NULL byte if needed.

 

data

the data to save in a parasite.

[nullable][array length=size][element-type char]

Returns

a new GimpParasite.

[transfer full]


gimp_parasite_free ()

void
gimp_parasite_free (GimpParasite *parasite);

Free parasite 's dynamically allocated memory.

Parameters

parasite

a GimpParasite

 

gimp_parasite_copy ()

GimpParasite *
gimp_parasite_copy (const GimpParasite *parasite);

Create a new parasite with all the same values.

Parameters

parasite

a GimpParasite

 

Returns

a newly allocated GimpParasite with same contents.

[transfer full]


gimp_parasite_compare ()

gboolean
gimp_parasite_compare (const GimpParasite *a,
                       const GimpParasite *b);

Compare parasite's contents.

Parameters

a

a GimpParasite

 

b

a GimpParasite

 

Returns

TRUE if a and b have same contents, FALSE otherwise.


gimp_parasite_is_type ()

gboolean
gimp_parasite_is_type (const GimpParasite *parasite,
                       const gchar *name);

Compare parasite's names.

Parameters

parasite

a GimpParasite

 

name

a parasite name.

 

Returns

TRUE if parasite is named name , FALSE otherwise.


gimp_parasite_is_persistent ()

gboolean
gimp_parasite_is_persistent (const GimpParasite *parasite);

Parameters

parasite

a GimpParasite

 

Returns

TRUE if parasite is persistent, FALSE otherwise.


gimp_parasite_is_undoable ()

gboolean
gimp_parasite_is_undoable (const GimpParasite *parasite);

Parameters

parasite

a GimpParasite

 

Returns

TRUE if parasite is undoable, FALSE otherwise.


gimp_parasite_has_flag ()

gboolean
gimp_parasite_has_flag (const GimpParasite *parasite,
                        gulong flag);

Parameters

parasite

a GimpParasite

 

flag

a parasite flag

 

Returns

TRUE if parasite has flag set, FALSE otherwise.


gimp_parasite_get_flags ()

gulong
gimp_parasite_get_flags (const GimpParasite *parasite);

Parameters

parasite

a GimpParasite

 

Returns

parasite flags.


gimp_parasite_get_name ()

const gchar *
gimp_parasite_get_name (const GimpParasite *parasite);

Parameters

parasite

a GimpParasite

 

Returns

parasite 's name.


GIMP_IS_PARAM_SPEC_PARASITE()

#define GIMP_IS_PARAM_SPEC_PARASITE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_PARASITE))

gimp_param_spec_parasite ()

GParamSpec *
gimp_param_spec_parasite (const gchar *name,
                          const gchar *nick,
                          const gchar *blurb,
                          GParamFlags flags);

Creates a new GimpParamSpecParasite specifying a GIMP_TYPE_PARASITE property.

See g_param_spec_internal() for details on property names.

Parameters

name

Canonical name of the property specified.

 

nick

Nick name of the property specified.

 

blurb

Description of the property specified.

 

flags

Flags for the property specified.

 

Returns

The newly created GimpParamSpecParasite.

[transfer full]

Since: 2.4


GIMP_VALUE_HOLDS_PARASITE()

#define GIMP_VALUE_HOLDS_PARASITE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_PARASITE))

Types and Values

GimpParasite

typedef struct {
  gchar    *name;
  guint32   flags;
  guint32   size;
  gpointer  data;
} GimpParasite;

Members

gchar *name;

the parasite name, USE A UNIQUE PREFIX

 

guint32 flags;

the parasite flags, like save in XCF etc.

 

guint32 size;

the parasite size in bytes

 

gpointer data;

the parasite data, the owner os the parasite is responsible for tracking byte order and internal structure

 

GIMP_PARASITE_PERSISTENT

#define GIMP_PARASITE_PERSISTENT 1

GIMP_PARASITE_UNDOABLE

#define GIMP_PARASITE_UNDOABLE   2

GIMP_PARASITE_ATTACH_PARENT

#define GIMP_PARASITE_ATTACH_PARENT     (0x80 << 8)

GIMP_PARASITE_PARENT_PERSISTENT

#define GIMP_PARASITE_PARENT_PERSISTENT (GIMP_PARASITE_PERSISTENT << 8)

GIMP_PARASITE_PARENT_UNDOABLE

#define GIMP_PARASITE_PARENT_UNDOABLE   (GIMP_PARASITE_UNDOABLE << 8)

GIMP_PARASITE_ATTACH_GRANDPARENT

#define GIMP_PARASITE_ATTACH_GRANDPARENT     (0x80 << 16)

GIMP_PARASITE_GRANDPARENT_PERSISTENT

#define GIMP_PARASITE_GRANDPARENT_PERSISTENT (GIMP_PARASITE_PERSISTENT << 16)

GIMP_PARASITE_GRANDPARENT_UNDOABLE

#define GIMP_PARASITE_GRANDPARENT_UNDOABLE   (GIMP_PARASITE_UNDOABLE << 16)

GIMP_TYPE_PARASITE

#define GIMP_TYPE_PARASITE               (gimp_parasite_get_type ())

GIMP_TYPE_PARAM_PARASITE

#define GIMP_TYPE_PARAM_PARASITE           (gimp_param_parasite_get_type ())

See Also

gimp_image_attach_parasite(), gimp_item_attach_parasite(), gimp_attach_parasite() and their related functions.