]> git.draconx.ca Git - upkg.git/blobdiff - src/serializable.h
Initial UObject implementation plus a dumb music extractor.
[upkg.git] / src / serializable.h
diff --git a/src/serializable.h b/src/serializable.h
new file mode 100644 (file)
index 0000000..5d83d57
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef SERIALIZABLE_H_
+#define SERIALIZABLE_H_
+
+#include <glib-object.h>
+#include "upkg.h"
+
+#define UPKG_TYPE_SERIALIZABLE (upkg_serializable_get_type())
+#define UPKG_SERIALIZABLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \
+       UPKG_TYPE_SERIALIZABLE, UPkgSerializable)
+#define UPKG_IS_SERIALIZABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \
+       UPKG_TYPE_SERIALIZABLE)
+#define UPKG_SERIALIZABLE_GET_INTERFACE(inst) G_TYPE_INSTANCE_GET_INTERFACE \
+       (inst, UPKG_TYPE_SERIALIZABLE, UPkgSerializable)
+
+typedef struct UPkgSerializable UPkgSerializable;
+
+struct UPkgSerializable {
+       GTypeInterface parent;
+
+       int (*deserialize)(GObject *obj, struct upkg_file *f);
+};
+
+GType upkg_serializable_get_type(void);
+int upkg_deserialize(GObject *obj, struct upkg_file *f);
+
+#endif