diff options
Diffstat (limited to 'gi/pygi-cache.c')
-rw-r--r-- | gi/pygi-cache.c | 71 |
1 files changed, 11 insertions, 60 deletions
diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c index a8468cce..ecd1eaec 100644 --- a/gi/pygi-cache.c +++ b/gi/pygi-cache.c @@ -29,6 +29,7 @@ #include "pygi-type.h" #include "pygi-hashtable.h" #include "pygi-basictype.h" +#include "pygi-list.h" PyGIArgCache * _arg_cache_new_for_interface (GIInterfaceInfo *iface_info, @@ -460,38 +461,6 @@ _arg_cache_to_py_array_setup (PyGIArgCache *arg_cache, } static void -_arg_cache_from_py_glist_setup (PyGIArgCache *arg_cache, - GITransfer transfer) -{ - arg_cache->from_py_marshaller = _pygi_marshal_from_py_glist; - arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_glist; -} - -static void -_arg_cache_to_py_glist_setup (PyGIArgCache *arg_cache, - GITransfer transfer) -{ - arg_cache->to_py_marshaller = _pygi_marshal_to_py_glist; - arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_glist; -} - -static void -_arg_cache_from_py_gslist_setup (PyGIArgCache *arg_cache, - GITransfer transfer) -{ - arg_cache->from_py_marshaller = _pygi_marshal_from_py_gslist; - arg_cache->from_py_cleanup = _pygi_marshal_cleanup_from_py_glist; -} - -static void -_arg_cache_to_py_gslist_setup (PyGIArgCache *arg_cache, - GITransfer transfer) -{ - arg_cache->to_py_marshaller = _pygi_marshal_to_py_gslist; - arg_cache->to_py_cleanup = _pygi_marshal_cleanup_to_py_glist; -} - -static void _arg_cache_from_py_gerror_setup (PyGIArgCache *arg_cache) { arg_cache->from_py_marshaller = _pygi_marshal_from_py_gerror; @@ -825,21 +794,12 @@ _arg_cache_new (GITypeInfo *type_info, } case GI_TYPE_TAG_GLIST: { - PyGISequenceCache *seq_cache = - pygi_arg_sequence_new (type_info, - arg_info, - transfer, - direction); - - arg_cache = (PyGIArgCache *)seq_cache; + arg_cache = pygi_arg_glist_new_from_info (type_info, + arg_info, + transfer, + direction); if (arg_cache == NULL) - break; - - if (direction & PYGI_DIRECTION_FROM_PYTHON) - _arg_cache_from_py_glist_setup (arg_cache, transfer); - - if (direction & PYGI_DIRECTION_TO_PYTHON) - _arg_cache_to_py_glist_setup (arg_cache, transfer); + return NULL; arg_cache->py_arg_index = py_arg_index; arg_cache->c_arg_index = c_arg_index; @@ -847,21 +807,12 @@ _arg_cache_new (GITypeInfo *type_info, } case GI_TYPE_TAG_GSLIST: { - PyGISequenceCache *seq_cache = - pygi_arg_sequence_new (type_info, - arg_info, - transfer, - direction); - - arg_cache = (PyGIArgCache *)seq_cache; + arg_cache = pygi_arg_gslist_new_from_info (type_info, + arg_info, + transfer, + direction); if (arg_cache == NULL) - break; - - if (direction & PYGI_DIRECTION_FROM_PYTHON) - _arg_cache_from_py_gslist_setup (arg_cache, transfer); - - if (direction & PYGI_DIRECTION_TO_PYTHON) - _arg_cache_to_py_gslist_setup (arg_cache, transfer); + return NULL; arg_cache->py_arg_index = py_arg_index; arg_cache->c_arg_index = c_arg_index; |