4 * Copyright 2024 Michael Rasmussen <mir@datanom.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
28 #include <glib-object.h>
29 #include "lensmaker.h"
34 #define TYPE_DATABASE (database_get_type ())
35 #define DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE, Database))
36 #define DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE, DatabaseClass))
37 #define IS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE))
38 #define IS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE))
39 #define DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE, DatabaseClass))
41 typedef struct _Database Database
;
42 typedef struct _DatabaseClass DatabaseClass
;
44 struct _DatabaseClass
{
45 GObjectClass parent_class
;
47 void (*add_maker
) (Database
* self
, const gchar
* name
, GError
** error
);
48 void (*remove_maker
) (Database
* self
, const gchar
* name
, GError
** error
);
54 GType
database_get_type (void);
56 Database
*database_new (const gchar
* path
, GError
** error
);
57 void database_set_path(Database
* self
, const gchar
* path
, GError
** error
);
58 void database_add_lens_maker(Database
* self
, const gchar
* name
, GError
** error
);
59 void database_remove_lens_maker(Database
* self
, const gchar
* name
, GError
** error
);
60 /* TODO: Make deep copy */
61 LensMaker
* database_get_lens_maker(Database
* self
, const gchar
* name
, GError
** error
);
62 void database_print_lens_makers(Database
* self
);
66 #endif /* DATABASE_H_ */