diff options
Diffstat (limited to 'gi/pygi-marshal-to-py.c')
-rw-r--r-- | gi/pygi-marshal-to-py.c | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/gi/pygi-marshal-to-py.c b/gi/pygi-marshal-to-py.c index 536193c5..8384a42b 100644 --- a/gi/pygi-marshal-to-py.c +++ b/gi/pygi-marshal-to-py.c @@ -150,123 +150,3 @@ _pygi_marshal_to_py_interface_flags (PyGIInvokeState *state, return py_obj; } -PyObject * -_pygi_marshal_to_py_interface_struct_cache_adapter (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) -{ - PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache; - - return _pygi_marshal_to_py_interface_struct (arg, - iface_cache->interface_info, - iface_cache->g_type, - iface_cache->py_type, - arg_cache->transfer, - arg_cache->is_caller_allocates, - iface_cache->is_foreign); -} - -PyObject * -_pygi_marshal_to_py_interface_interface (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) -{ - PyObject *py_obj = NULL; - - PyErr_Format (PyExc_NotImplementedError, - "Marshalling for this type is not implemented yet"); - return py_obj; -} - -PyObject * -_pygi_marshal_to_py_interface_boxed (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) -{ - PyObject *py_obj = NULL; - - PyErr_Format (PyExc_NotImplementedError, - "Marshalling for this type is not implemented yet"); - return py_obj; -} - -PyObject * -_pygi_marshal_to_py_interface_union (PyGIInvokeState *state, - PyGICallableCache *callable_cache, - PyGIArgCache *arg_cache, - GIArgument *arg) -{ - PyObject *py_obj = NULL; - - PyErr_Format (PyExc_NotImplementedError, - "Marshalling for this type is not implemented yet"); - return py_obj; -} - -PyObject * -_pygi_marshal_to_py_interface_struct (GIArgument *arg, - GIInterfaceInfo *interface_info, - GType g_type, - PyObject *py_type, - GITransfer transfer, - gboolean is_allocated, - gboolean is_foreign) -{ - PyObject *py_obj = NULL; - - if (arg->v_pointer == NULL) { - Py_RETURN_NONE; - } - - if (g_type_is_a (g_type, G_TYPE_VALUE)) { - py_obj = pyg_value_as_pyobject (arg->v_pointer, FALSE); - } else if (is_foreign) { - py_obj = pygi_struct_foreign_convert_from_g_argument (interface_info, - arg->v_pointer); - } else if (g_type_is_a (g_type, G_TYPE_BOXED)) { - if (py_type) { - py_obj = _pygi_boxed_new ((PyTypeObject *) py_type, - arg->v_pointer, - transfer == GI_TRANSFER_EVERYTHING || is_allocated, - is_allocated ? - g_struct_info_get_size(interface_info) : 0); - } - } else if (g_type_is_a (g_type, G_TYPE_POINTER)) { - if (py_type == NULL || - !PyType_IsSubtype ((PyTypeObject *) py_type, &PyGIStruct_Type)) { - g_warn_if_fail (transfer == GI_TRANSFER_NOTHING); - py_obj = pyg_pointer_new (g_type, arg->v_pointer); - } else { - py_obj = _pygi_struct_new ( (PyTypeObject *) py_type, - arg->v_pointer, - transfer == GI_TRANSFER_EVERYTHING); - } - } else if (g_type_is_a (g_type, G_TYPE_VARIANT)) { - /* Note: sink the variant (add a ref) only if we are not transfered ownership. - * GLib.Variant overrides __del__ which will then call "g_variant_unref" for - * cleanup in either case. */ - if (py_type) { - if (transfer == GI_TRANSFER_NOTHING) { - g_variant_ref_sink (arg->v_pointer); - } - py_obj = _pygi_struct_new ((PyTypeObject *) py_type, - arg->v_pointer, - FALSE); - } - } else if (g_type == G_TYPE_NONE) { - if (py_type) { - py_obj = _pygi_struct_new ((PyTypeObject *) py_type, - arg->v_pointer, - transfer == GI_TRANSFER_EVERYTHING); - } - } else { - PyErr_Format (PyExc_NotImplementedError, - "structure type '%s' is not supported yet", - g_type_name (g_type)); - } - - return py_obj; -} |