diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2011-01-21 04:22:06 -0500 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2011-01-21 04:22:06 -0500 |
commit | 3133dc595adf44279397d30712c0f8595f0e1acc (patch) | |
tree | e9713b5b3404b524daa59f56c351399f72c51dcd /gi/pygi-foreign.c | |
parent | 1239f3709ba257c404dda72b7067b77b19c240fa (diff) | |
download | pygobject-3133dc595adf44279397d30712c0f8595f0e1acc.tar.gz |
[gi] move to using type_info and interface_info instead of arg_info
* only arguments have arg_infos, not return types and instances so
type_info is much better to pass. In fact most API that took an
arg_info simply converted it to a type_info
* In the case of instances for methods we don't even have a type_info.
Since all instances are interfaces, we also attach the interface_info
to the interface cache
Diffstat (limited to 'gi/pygi-foreign.c')
-rw-r--r-- | gi/pygi-foreign.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/gi/pygi-foreign.c b/gi/pygi-foreign.c index fa43005a..b7a9b990 100644 --- a/gi/pygi-foreign.c +++ b/gi/pygi-foreign.c @@ -107,15 +107,14 @@ pygi_struct_foreign_lookup (GIBaseInfo *base_info) } gboolean -pygi_struct_foreign_convert_to_g_argument (PyObject *value, - GITypeInfo *type_info, - GITransfer transfer, - GIArgument *arg) +pygi_struct_foreign_convert_to_g_argument (PyObject *value, + GIInterfaceInfo *interface_info, + GITransfer transfer, + GIArgument *arg) { PyObject *result; - GIBaseInfo *base_info = g_type_info_get_interface (type_info); + PyGIBaseInfo *base_info = (PyGIBaseInfo *)interface_info; PyGIForeignStruct *foreign_struct = pygi_struct_foreign_lookup (base_info); - g_base_info_unref (base_info); if (foreign_struct == NULL) { PyErr_Format(PyExc_KeyError, "could not find foreign type %s", @@ -123,7 +122,7 @@ pygi_struct_foreign_convert_to_g_argument (PyObject *value, return FALSE; } - result = foreign_struct->to_func (value, type_info, transfer, arg); + result = foreign_struct->to_func (value, interface_info, transfer, arg); if (result == NULL) return FALSE; @@ -132,18 +131,16 @@ pygi_struct_foreign_convert_to_g_argument (PyObject *value, } PyObject * -pygi_struct_foreign_convert_from_g_argument (GITypeInfo *type_info, +pygi_struct_foreign_convert_from_g_argument (GIInterfaceInfo *interface_info, GIArgument *arg) { - GIBaseInfo *base_info = g_type_info_get_interface (type_info); + GIBaseInfo *base_info = (GIBaseInfo *)interface_info; PyGIForeignStruct *foreign_struct = pygi_struct_foreign_lookup (base_info); - g_base_info_unref (base_info); - if (foreign_struct == NULL) return NULL; - return foreign_struct->from_func (type_info, arg); + return foreign_struct->from_func (interface_info, arg); } PyObject * |