New basic implementation of GTypePlugin interface as a GObject.

Sun Nov  5 13:21:28 2000  Owen Taylor  <otaylor@redhat.com>

	* Makefile.am gtypemodule.[ch]: New basic implementation of
	GTypePlugin interface as a GObject. Dynamically loaded modules can
	register any number of types and interface on the module.
This commit is contained in:
Owen Taylor
2000-11-11 00:03:19 +00:00
committed by Owen Taylor
parent daa8fe28cd
commit 7d4a8d2c4c
4 changed files with 37 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
Sun Nov 5 13:21:28 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gtypemodule.[ch]: New basic implementation of
GTypePlugin interface as a GObject. Dynamically loaded modules can
register any number of types and interface on the module.
Sun Nov 5 10:25:40 2000 Owen Taylor <otaylor@redhat.com>
* gsignal.c (handlers_find): When appending handlers and

View File

@@ -32,6 +32,7 @@ gobject_public_h_sources = @STRIP_BEGIN@ \
gparamspecs.h \
gsignal.h \
gtype.h \
gtypemodule.h \
gtypeplugin.h \
gvalue.h \
gvaluecollector.h \
@@ -52,6 +53,7 @@ gobject_c_sources = @STRIP_BEGIN@ \
gparamspecs.c \
gsignal.c \
gtype.c \
gtypemodule.c \
gtypeplugin.c \
gvalue.c \
gvaluetypes.c \

View File

@@ -1910,6 +1910,32 @@ g_type_get_plugin (GType type)
return node ? node->plugin : NULL;
}
GTypePlugin*
g_type_interface_get_plugin (GType instance_type,
GType interface_type)
{
TypeNode *node = LOOKUP_TYPE_NODE (instance_type);
TypeNode *iface = LOOKUP_TYPE_NODE (interface_type);
IFaceHolder *iholder;
g_return_val_if_fail (node == NULL, NULL);
g_return_val_if_fail (iface == NULL, NULL);
g_return_val_if_fail (G_TYPE_IS_INTERFACE (interface_type), NULL);
iholder = iface->private.iface_conformants;
while (iholder && iholder->instance_type != instance_type)
iholder = iholder->next;
if (!iholder)
{
g_warning (G_STRLOC ": Attempt to look up plugin for invalid instance/interface type pair.");
return NULL;
}
return iholder->plugin;
}
GType
g_type_fundamental_last (void)
{

View File

@@ -295,6 +295,9 @@ void g_type_add_interface_dynamic (GType instance_type,
/* --- protected (for fundamental type implementations) --- */
GTypePlugin* g_type_get_plugin (GType type);
GTypePlugin* g_type_interface_get_plugin (GType instance_type,
GType implementation_type);
GType g_type_fundamental_last (void);
gboolean g_type_check_flags (GType type,
guint flags);