GimpTag

GimpTag

Synopsis

                    GimpTag;
GimpTag *           gimp_tag_new                        (const gchar *tag_string);
GimpTag *           gimp_tag_try_new                    (const gchar *tag_string);
const gchar *       gimp_tag_get_name                   (GimpTag *tag);
guint               gimp_tag_get_hash                   (GimpTag *tag);
gboolean            gimp_tag_get_internal               (GimpTag *tag);
void                gimp_tag_set_internal               (GimpTag *tag,
                                                         gboolean internal);
gboolean            gimp_tag_equals                     (const GimpTag *tag,
                                                         const GimpTag *other);
gint                gimp_tag_compare_func               (const void *p1,
                                                         const void *p2);
gint                gimp_tag_compare_with_string        (GimpTag *tag,
                                                         const gchar *tag_string);
gchar *             gimp_tag_string_make_valid          (const gchar *tag_string);
gboolean            gimp_tag_is_tag_separator           (gunichar c);
void                gimp_tag_or_null_ref                (GimpTag *tag_or_null);
void                gimp_tag_or_null_unref              (GimpTag *tag_or_null);

Object Hierarchy

  GObject
   +----GimpTag

Description

Details

GimpTag

typedef struct _GimpTag GimpTag;


gimp_tag_new ()

GimpTag *           gimp_tag_new                        (const gchar *tag_string);

If given tag name is not valid, an attempt will be made to fix it.

tag_string :

a tag name.

Returns :

a new GimpTag object, or NULL if tag string is invalid and cannot be fixed.

gimp_tag_try_new ()

GimpTag *           gimp_tag_try_new                    (const gchar *tag_string);

Similar to gimp_tag_new(), but returns NULL if tag is surely not equal to any of currently created tags. It is useful for tag querying to avoid unneeded comparisons. If tag is created, however, it does not mean that it would necessarily match with some other tag.

tag_string :

a tag name.

Returns :

new GimpTag object, or NULL if tag will not match with any other GimpTag.

gimp_tag_get_name ()

const gchar *       gimp_tag_get_name                   (GimpTag *tag);

Retrieve name of the tag.

tag :

a gimp tag.

Returns :

name of tag.

gimp_tag_get_hash ()

guint               gimp_tag_get_hash                   (GimpTag *tag);

Hashing function which is useful, for example, to store GimpTag in a GHashTable.

tag :

a gimp tag.

Returns :

hash value for tag.

gimp_tag_get_internal ()

gboolean            gimp_tag_get_internal               (GimpTag *tag);

Retrieve internal status of the tag.

tag :

a gimp tag.

Returns :

internal status of tag. Internal tags are not saved.

gimp_tag_set_internal ()

void                gimp_tag_set_internal               (GimpTag *tag,
                                                         gboolean internal);

Set internal status of the tag. Internal tags are usually automaticaly generated and will not be saved into users tag cache.

tag :

a gimp tag.

gimp_tag_equals ()

gboolean            gimp_tag_equals                     (const GimpTag *tag,
                                                         const GimpTag *other);

Compares tags for equality according to tag comparison rules.

tag :

a gimp tag.

other :

another gimp tag to compare with.

Returns :

TRUE if tags are equal, FALSE otherwise.

gimp_tag_compare_func ()

gint                gimp_tag_compare_func               (const void *p1,
                                                         const void *p2);

Compares tags according to tag comparison rules. Useful for sorting functions.

p1 :

pointer to left-hand GimpTag object.

p2 :

pointer to right-hand GimpTag object.

Returns :

meaning of return value is the same as in strcmp().

gimp_tag_compare_with_string ()

gint                gimp_tag_compare_with_string        (GimpTag *tag,
                                                         const gchar *tag_string);

Compares tag and a string according to tag comparison rules. Similar to gimp_tag_compare_func(), but can be used without creating temporary tag object.

tag :

a GimpTag object.

tag_string :

the string to compare to.

Returns :

meaning of return value is the same as in strcmp().

gimp_tag_string_make_valid ()

gchar *             gimp_tag_string_make_valid          (const gchar *tag_string);

Tries to create a valid tag string from given tag_string.

tag_string :

a text string.

Returns :

a newly allocated tag string in case given tag_string was valid or could be fixed, otherwise NULL. Allocated value should be freed using g_free().

gimp_tag_is_tag_separator ()

gboolean            gimp_tag_is_tag_separator           (gunichar c);

Defines a set of characters that are considered tag separators. The tag separators are hand-picked from the set of characters with the Terminal_Punctuation property as specified in the version 5.1.0 of the Unicode Standard.

c :

Unicode character.

Returns :

TRUE if the character is a tag separator.

gimp_tag_or_null_ref ()

void                gimp_tag_or_null_ref                (GimpTag *tag_or_null);

A simple wrapper around g_object_ref() that silently accepts NULL.


gimp_tag_or_null_unref ()

void                gimp_tag_or_null_unref              (GimpTag *tag_or_null);

A simple wrapper around g_object_unref() that silently accepts NULL.