Commit 740490e1 authored by Christian Hergert's avatar Christian Hergert

gi: locate GTypes from GIRegisteredTypeInfo

This allows you to convert something like GObject.Object into a
GType when the GI parameter is expected a GType.
parent df431f45
......@@ -142,6 +142,10 @@ tmpl_gi_argument_from_g_value (const GValue *value,
case GI_TYPE_TAG_GTYPE:
if (G_VALUE_HOLDS (value, G_TYPE_GTYPE))
arg->v_long = g_value_get_gtype (value);
else if (G_VALUE_HOLDS (value, TMPL_TYPE_BASE_INFO) &&
g_value_get_pointer (value) != NULL &&
GI_IS_REGISTERED_TYPE_INFO (g_value_get_pointer (value)))
arg->v_long = g_registered_type_info_get_g_type (g_value_get_pointer (value));
else
return_type_mismatch (value, G_TYPE_GTYPE);
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment