Commit 9f101baa authored by John (J5) Palmieri's avatar John (J5) Palmieri
Browse files

[gi] marshal out flags and enum

parent 4c93bdea
......@@ -3532,7 +3532,7 @@ _pygi_marshal_out_gerror (PyGIInvokeState *state,
PyObject *py_obj = NULL;
PyErr_Format(PyExc_NotImplementedError,
"Marshalling for this type is not implemented yet");
"Marshalling for gerror out is not implemented");
return py_obj;
}
......@@ -3556,9 +3556,13 @@ _pygi_marshal_out_interface_enum (PyGIInvokeState *state,
GIArgument *arg)
{
PyObject *py_obj = NULL;
PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache;
PyErr_Format(PyExc_NotImplementedError,
"Marshalling for this type is not implemented yet");
if (iface_cache->g_type == G_TYPE_NONE) {
py_obj = PyObject_CallFunction (iface_cache->py_type, "l", arg->v_long);
} else {
py_obj = pyg_enum_from_gtype(iface_cache->g_type, arg->v_long);
}
return py_obj;
}
......@@ -3569,9 +3573,9 @@ _pygi_marshal_out_interface_flags (PyGIInvokeState *state,
GIArgument *arg)
{
PyObject *py_obj = NULL;
PyGIInterfaceCache *iface_cache = (PyGIInterfaceCache *)arg_cache;
py_obj = pyg_flags_from_gtype(iface_cache->g_type, arg->v_long);
PyErr_Format(PyExc_NotImplementedError,
"Marshalling for this type is not implemented yet");
return py_obj;
}
......
......@@ -854,12 +854,11 @@ _arg_cache_new_for_out_interface_callback(void)
}
static inline PyGIArgCache *
_arg_cache_new_for_out_interface_enum(void)
_arg_cache_new_for_out_interface_enum(GIInterfaceInfo *iface_info,
GITransfer transfer)
{
PyGIArgCache *arg_cache = NULL;
/*arg_cache->in_marshaller = _pygi_marshal_in_enum;*/
PyErr_Format(PyExc_NotImplementedError,
"Caching for Out Interface ENum is not fully implemented yet");
PyGIArgCache *arg_cache = (PyGIArgCache *)_interface_cache_new_from_interface_info(iface_info);
arg_cache->out_marshaller = _pygi_marshal_out_interface_enum;
return arg_cache;
}
......@@ -873,12 +872,11 @@ _arg_cache_new_for_out_interface_union(GIInterfaceInfo *iface_info,
}
static inline PyGIArgCache *
_arg_cache_new_for_out_interface_flags(void)
_arg_cache_new_for_out_interface_flags(GIInterfaceInfo *iface_info,
GITransfer transfer)
{
PyGIArgCache *arg_cache = NULL;
/*arg_cache->in_marshaller = _pygi_marshal_in_flags;*/
PyErr_Format(PyExc_NotImplementedError,
"Caching for Out Interface Flags is not fully implemented yet");
PyGIArgCache *arg_cache = (PyGIArgCache *)_interface_cache_new_from_interface_info(iface_info);
arg_cache->out_marshaller = _pygi_marshal_out_interface_flags;
return arg_cache;
}
......@@ -913,10 +911,12 @@ _arg_cache_out_new_from_interface_info (GIInterfaceInfo *iface_info,
arg_cache = _arg_cache_new_for_out_interface_callback();
break;
case GI_INFO_TYPE_ENUM:
arg_cache = _arg_cache_new_for_out_interface_enum();
arg_cache = _arg_cache_new_for_out_interface_enum(iface_info,
transfer);
break;
case GI_INFO_TYPE_FLAGS:
arg_cache = _arg_cache_new_for_out_interface_flags();
arg_cache = _arg_cache_new_for_out_interface_flags(iface_info,
transfer);
break;
default:
g_assert_not_reached();
......
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