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

@@ -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)
{