:right-sidebar: True CClosure =================================================================== .. currentmodule:: gi.repository.GObject .. class:: CClosure(*args, **kwargs) :no-contents-entry: A ``GCClosure`` is a specialization of :obj:`~gi.repository.GObject.Closure` for C function callbacks. Methods ------- .. rst-class:: interim-class .. class:: CClosure :no-index: .. classmethod:: marshal_BOOLEAN__BOXED_BOXED(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with handlers that take two boxed pointers as arguments and return a boolean. If you have such a signal, you will probably also need to use an accumulator, such as :func:`~gi.repository.GObject.signal_accumulator_true_handled`. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_BOOLEAN__FLAGS(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with handlers that take a flags type as an argument and return a boolean. If you have such a signal, you will probably also need to use an accumulator, such as :func:`~gi.repository.GObject.signal_accumulator_true_handled`. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_STRING__OBJECT_POINTER(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with handlers that take a :obj:`~gi.repository.GObject.Object` and a pointer and produce a string. It is highly unlikely that your signal handler fits this description. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__BOOLEAN(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single boolean argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__BOXED(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single argument which is any boxed pointer type. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__CHAR(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single character argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__DOUBLE(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with one double-precision floating point argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__ENUM(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single argument with an enumerated type. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__FLAGS(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single argument with a flags types. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__FLOAT(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with one single-precision floating point argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__INT(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single integer argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__LONG(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with with a single long integer argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__OBJECT(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single :obj:`~gi.repository.GObject.Object` argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__PARAM(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single argument of type :obj:`~gi.repository.GObject.ParamSpec`\. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__POINTER(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single raw pointer argument type. If it is possible, it is better to use one of the more specific functions such as :func:`~gi.repository.GObject.CClosure.marshal_VOID__OBJECT` or :func:`~gi.repository.GObject.CClosure.marshal_VOID__OBJECT`. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__STRING(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single string argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__UCHAR(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single unsigned character argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__UINT(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with with a single unsigned integer argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__UINT_POINTER(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with an unsigned int and a pointer as arguments. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__ULONG(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single unsigned long integer argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__VARIANT(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with a single :obj:`~gi.repository.GLib.Variant` argument. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_VOID__VOID(return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A :obj:`~gi.repository.GObject.ClosureMarshal` function for use with signals with no arguments. :param return_value: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` .. classmethod:: marshal_generic(return_gvalue: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None A generic marshaller function implemented via `libffi `__\. Normally this function is not passed explicitly to :func:`~gi.repository.GObject.signal_new`, but used automatically by GLib when specifying a :const:`None` marshaller. .. versionadded:: 2.30 :param return_gvalue: A :obj:`~gi.repository.GObject.Value` to store the return value. May be :const:`None` if the callback of closure doesn't return a value. :param n_param_values: The length of the ``param_values`` array. :param param_values: An array of :obj:`~gi.repository.GObject.Value` holding the arguments on which to invoke the callback of closure. :param invocation_hint: The invocation hint given as the last argument to :func:`~gi.repository.GObject.Closure.invoke`. :param marshal_data: Additional data specified when registering the marshaller, see :func:`~gi.repository.GObject.Closure.set_marshal` and :func:`~gi.repository.GObject.Closure.set_meta_marshal` Fields ------ .. rst-class:: interim-class .. class:: CClosure :no-index: .. attribute:: callback The callback function .. attribute:: closure The :obj:`~gi.repository.GObject.Closure`