1 /* parasitelist.h: Copyright 1998 Jay Cox <jaycox@gimp.org> 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation; either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <https://www.gnu.org/licenses/>. 15 */ 16 17 #ifndef __GIMP_PARASITE_LIST_H__ 18 #define __GIMP_PARASITE_LIST_H__ 19 20 21 #include "gimpobject.h" 22 23 24 #define GIMP_TYPE_PARASITE_LIST (gimp_parasite_list_get_type ()) 25 #define GIMP_PARASITE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PARASITE_LIST, GimpParasiteList)) 26 #define GIMP_PARASITE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PARASITE_LIST, GimpParasiteListClass)) 27 #define GIMP_IS_PARASITE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_PARASITE_LIST)) 28 #define GIMP_IS_PARASITE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PARASITE_LIST)) 29 #define GIMP_PARASITE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PARASITE_LIST, GimpParasiteListClass)) 30 31 32 typedef struct _GimpParasiteListClass GimpParasiteListClass; 33 34 struct _GimpParasiteList 35 { 36 GimpObject object; 37 38 GHashTable *table; 39 }; 40 41 struct _GimpParasiteListClass 42 { 43 GimpObjectClass parent_class; 44 45 void (* add) (GimpParasiteList *list, 46 GimpParasite *parasite); 47 void (* remove) (GimpParasiteList *list, 48 GimpParasite *parasite); 49 }; 50 51 52 GType gimp_parasite_list_get_type (void) G_GNUC_CONST; 53 54 GimpParasiteList * gimp_parasite_list_new (void); 55 GimpParasiteList * gimp_parasite_list_copy (GimpParasiteList *list); 56 void gimp_parasite_list_add (GimpParasiteList *list, 57 const GimpParasite *parasite); 58 void gimp_parasite_list_remove (GimpParasiteList *list, 59 const gchar *name); 60 gint gimp_parasite_list_length (GimpParasiteList *list); 61 gint gimp_parasite_list_persistent_length (GimpParasiteList *list); 62 void gimp_parasite_list_foreach (GimpParasiteList *list, 63 GHFunc function, 64 gpointer user_data); 65 const GimpParasite * gimp_parasite_list_find (GimpParasiteList *list, 66 const gchar *name); 67 68 69 #endif /* __GIMP_PARASITE_LIST_H__ */ 70