]> git.datanom.net - gtk_lensdatabase.git/blob - src/database.h
On the way
[gtk_lensdatabase.git] / src / database.h
1 /*
2 * database.h
3 *
4 * Copyright 2024 Michael Rasmussen <mir@datanom.net>
5 *
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.
10 *
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.
15 *
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,
19 * MA 02110-1301, USA.
20 *
21 *
22 */
23
24
25 #ifndef DATABASE_H_
26 #define DATABASE_H_ 1
27
28 #include <glib-object.h>
29 #include "lensmaker.h"
30
31 G_BEGIN_DECLS
32
33
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))
40
41 typedef struct _Database Database;
42 typedef struct _DatabaseClass DatabaseClass;
43
44 struct _DatabaseClass {
45 GObjectClass parent_class;
46
47 void (*add_maker) (Database* self, const gchar* name, GError** error);
48 void (*remove_maker) (Database* self, const gchar* name, GError** error);
49
50 gpointer padding[12];
51 };
52
53
54 GType database_get_type (void);
55
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);
63
64 G_END_DECLS
65
66 #endif /* DATABASE_H_ */
This page took 0.801958 seconds and 6 git commands to generate.