]> git.draconx.ca Git - upkg.git/blob - src/serializable.h
Initial UObject implementation plus a dumb music extractor.
[upkg.git] / src / serializable.h
1 #ifndef SERIALIZABLE_H_
2 #define SERIALIZABLE_H_
3
4 #include <glib-object.h>
5 #include "upkg.h"
6
7 #define UPKG_TYPE_SERIALIZABLE (upkg_serializable_get_type())
8 #define UPKG_SERIALIZABLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \
9         UPKG_TYPE_SERIALIZABLE, UPkgSerializable)
10 #define UPKG_IS_SERIALIZABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \
11         UPKG_TYPE_SERIALIZABLE)
12 #define UPKG_SERIALIZABLE_GET_INTERFACE(inst) G_TYPE_INSTANCE_GET_INTERFACE \
13         (inst, UPKG_TYPE_SERIALIZABLE, UPkgSerializable)
14
15 typedef struct UPkgSerializable UPkgSerializable;
16
17 struct UPkgSerializable {
18         GTypeInterface parent;
19
20         int (*deserialize)(GObject *obj, struct upkg_file *f);
21 };
22
23 GType upkg_serializable_get_type(void);
24 int upkg_deserialize(GObject *obj, struct upkg_file *f);
25
26 #endif