/* * database.h * * Copyright 2024 Michael Rasmussen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * */ #ifndef DATABASE_H_ #define DATABASE_H_ 1 #include #include "lensmaker.h" G_BEGIN_DECLS #define TYPE_DATABASE (database_get_type ()) #define DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE, Database)) #define DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE, DatabaseClass)) #define IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE)) #define IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE)) #define DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE, DatabaseClass)) typedef struct _Database Database; typedef struct _DatabaseClass DatabaseClass; struct _DatabaseClass { GObjectClass parent_class; void (*add_maker) (Database* self, const gchar* name, GError** error); void (*remove_maker) (Database* self, const gchar* name, GError** error); gpointer padding[12]; }; GType database_get_type (void); Database *database_new (const gchar* path, GError** error); void database_set_path(Database* self, const gchar* path, GError** error); void database_add_lens_maker(Database* self, const gchar* name, GError** error); void database_remove_lens_maker(Database* self, const gchar* name, GError** error); /* TODO: Make deep copy */ LensMaker* database_get_lens_maker(Database* self, const gchar* name, GError** error); void database_print_lens_makers(Database* self); G_END_DECLS #endif /* DATABASE_H_ */