+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
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)
{
/* --- 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);