From: Nick Bowler Date: Mon, 28 Mar 2011 22:53:36 +0000 (-0400) Subject: uobject: Rename some interface-related identifiers. X-Git-Url: https://git.draconx.ca/gitweb/upkg.git/commitdiff_plain/949182326954cce40971b97af387cc4c0196617b uobject: Rename some interface-related identifiers. More changes to align with GOB2's expectations. --- diff --git a/src/engine/music.c b/src/engine/music.c index 55253fe..345fc35 100644 --- a/src/engine/music.c +++ b/src/engine/music.c @@ -35,12 +35,12 @@ struct music_priv { unsigned loaded; }; -static void exportable_init(UObjectExportable *); -static void loadable_init(UObjectLoadable *); +static void exportable_init(UObjectExportableIface *); +static void loadable_init(UObjectLoadableIface *); G_DEFINE_DYNAMIC_TYPE_EXTENDED(EngineMusic, engine_music, U_TYPE_OBJECT, 0, - G_IMPLEMENT_INTERFACE(U_OBJECT_TYPE_EXPORTABLE, exportable_init) - G_IMPLEMENT_INTERFACE(U_OBJECT_TYPE_LOADABLE, loadable_init) + G_IMPLEMENT_INTERFACE(U_TYPE_OBJECT_EXPORTABLE, exportable_init) + G_IMPLEMENT_INTERFACE(U_TYPE_OBJECT_LOADABLE, loadable_init) ); static int load(GObject *o) @@ -109,13 +109,13 @@ static int export_name(GObject *o, char *buf, size_t n) return rc; } -static void exportable_init(UObjectExportable *e) +static void exportable_init(UObjectExportableIface *e) { e->export = export; e->export_name = export_name; } -static void loadable_init(UObjectLoadable *l) +static void loadable_init(UObjectLoadableIface *l) { l->load = load; l->unload = unload; diff --git a/src/uobject/exportable.c b/src/uobject/exportable.c index e927ba6..9cb1de1 100644 --- a/src/uobject/exportable.c +++ b/src/uobject/exportable.c @@ -25,7 +25,7 @@ GType u_object_exportable_get_type(void) static GType type = 0; if (type == 0) { static const GTypeInfo info = { - sizeof (UObjectExportable), + sizeof (UObjectExportableIface), NULL, NULL, }; diff --git a/src/uobject/exportable.h b/src/uobject/exportable.h index 2d427df..d3e9ce8 100644 --- a/src/uobject/exportable.h +++ b/src/uobject/exportable.h @@ -22,21 +22,21 @@ #include #include -#define U_OBJECT_TYPE_EXPORTABLE (u_object_exportable_get_type()) +#define U_TYPE_OBJECT_EXPORTABLE (u_object_exportable_get_type()) #define U_OBJECT_EXPORTABLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \ - U_OBJECT_TYPE_EXPORTABLE, UObjectExportable) + U_TYPE_OBJECT_EXPORTABLE, UObjectExportableIface) #define U_OBJECT_IS_EXPORTABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \ - U_OBJECT_TYPE_EXPORTABLE) + U_TYPE_OBJECT_EXPORTABLE) #define U_OBJECT_EXPORTABLE_GET_INTERFACE(inst) G_TYPE_INSTANCE_GET_INTERFACE \ - (inst, U_OBJECT_TYPE_EXPORTABLE, UObjectExportable) + (inst, U_TYPE_OBJECT_EXPORTABLE, UObjectExportableIface) -typedef struct UObjectExportable UObjectExportable; +typedef struct UObjectExportableIface UObjectExportableIface; /* * Interface for UObjects that support exporting to a file. For example, a * texture might be saved to disk as a PNG image for editing. */ -struct UObjectExportable { +struct UObjectExportableIface { GTypeInterface parent; int (*export)(GObject *obj, FILE *f); diff --git a/src/uobject/loadable.c b/src/uobject/loadable.c index 0475d9a..8ed00ff 100644 --- a/src/uobject/loadable.c +++ b/src/uobject/loadable.c @@ -25,7 +25,7 @@ GType u_object_loadable_get_type(void) static GType type = 0; if (type == 0) { static const GTypeInfo info = { - sizeof (UObjectLoadable), + sizeof (UObjectLoadableIface), NULL, NULL, }; diff --git a/src/uobject/loadable.h b/src/uobject/loadable.h index e5de5ad..296366b 100644 --- a/src/uobject/loadable.h +++ b/src/uobject/loadable.h @@ -22,15 +22,15 @@ #include #include -#define U_OBJECT_TYPE_LOADABLE (u_object_loadable_get_type()) +#define U_TYPE_OBJECT_LOADABLE (u_object_loadable_get_type()) #define U_OBJECT_LOADABLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \ - U_OBJECT_TYPE_LOADABLE, UObjectLoadable) + U_TYPE_OBJECT_LOADABLE, UObjectLoadableIface) #define U_OBJECT_IS_LOADABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \ - U_OBJECT_TYPE_LOADABLE) + U_TYPE_OBJECT_LOADABLE) #define U_OBJECT_LOADABLE_GET_INTERFACE(inst) G_TYPE_INSTANCE_GET_INTERFACE \ - (inst, U_OBJECT_TYPE_LOADABLE, UObjectLoadable) + (inst, U_TYPE_OBJECT_LOADABLE, UObjectLoadableIface) -typedef struct UObjectLoadable UObjectLoadable; +typedef struct UObjectLoadableIface UObjectLoadableIface; /* * Interface for UObjects supporting "load" and "unload". These are generally @@ -38,7 +38,7 @@ typedef struct UObjectLoadable UObjectLoadable; * useful -- textures and sounds, for example -- where you might want to keep * around instances but the actual texture or sound data is not needed. */ -struct UObjectLoadable { +struct UObjectLoadableIface { GTypeInterface parent; int (*load)(GObject *obj);