GimpIdTable

GimpIdTable

Synopsis

                    GimpIdTable;
struct              GimpIdTableClass;
                    GimpIdTablePriv;
GimpIdTable *       gimp_id_table_new                   (void);
gint                gimp_id_table_insert                (GimpIdTable *id_table,
                                                         gpointer data);
gint                gimp_id_table_insert_with_id        (GimpIdTable *id_table,
                                                         gint id,
                                                         gpointer data);
gpointer            gimp_id_table_lookup                (GimpIdTable *id_table,
                                                         gint id);
gboolean            gimp_id_table_remove                (GimpIdTable *id_table,
                                                         gint id);
void                gimp_id_table_replace               (GimpIdTable *id_table,
                                                         gint id,
                                                         gpointer data);

Object Hierarchy

  GObject
   +----GimpObject
         +----GimpIdTable

Description

Details

GimpIdTable

typedef struct _GimpIdTable GimpIdTable;


struct GimpIdTableClass

struct GimpIdTableClass {
  GimpObjectClass  parent_class;
};


GimpIdTablePriv

typedef struct _GimpIdTablePriv GimpIdTablePriv;


gimp_id_table_new ()

GimpIdTable *       gimp_id_table_new                   (void);

Returns :

A new GimpIdTable.

gimp_id_table_insert ()

gint                gimp_id_table_insert                (GimpIdTable *id_table,
                                                         gpointer data);

Insert data in the id table. The data will get an, in this table, unused ID assigned to it that can be used to later lookup the data.

id_table :

A GimpIdTable

data :

Data to insert and assign an id to

Returns :

The assigned ID.

gimp_id_table_insert_with_id ()

gint                gimp_id_table_insert_with_id        (GimpIdTable *id_table,
                                                         gint id,
                                                         gpointer data);

Insert data in the id table with a specific ID. If data already exsts with the given ID, this function fails.

id_table :

An GimpIdTable

id :

The ID to use. Must be greater than 0.

data :

The data to associate with the id

Returns :

The used ID if successful, -1 if it was already in use.

gimp_id_table_lookup ()

gpointer            gimp_id_table_lookup                (GimpIdTable *id_table,
                                                         gint id);

Lookup data based on ID.

id_table :

An GimpIdTable

id :

The ID of the data to lookup

Returns :

The data, or NULL if no data with the given ID was found.

gimp_id_table_remove ()

gboolean            gimp_id_table_remove                (GimpIdTable *id_table,
                                                         gint id);

Remove the data from the table with the given ID.

id_table :

An GimpIdTable

id :

The ID of the data to remove.

Returns :

TRUE if data with the ID existed and was successfully removed, FALSE otherwise.

gimp_id_table_replace ()

void                gimp_id_table_replace               (GimpIdTable *id_table,
                                                         gint id,
                                                         gpointer data);

Replaces (if an item with the given ID exists) or inserts a new entry in the id table.

id_table :

An GimpIdTable

id :

The ID to use. Must be greater than 0.

data :

The data to insert/replace