Klasse CClosure

Alle implementierten Schnittstellen:
PointerInterface

public class CClosure extends Record
A #GCClosure is a specialization of #GClosure for C function callbacks.

https://docs.gtk.org/gobject/struct.CClosure.html

  • Felddetails

  • Konstruktordetails

    • CClosure

      public CClosure(PointerContainer pointer)
    • CClosure

      public CClosure()
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • setFieldCallback

      public void setFieldCallback(Pointer callback)
      the callback function
    • getFieldCallback

      public Pointer getFieldCallback()
      the callback function
    • marshalBooleanBoxedBoxed

      public static void marshalBooleanBoxedBoxed(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal 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 g_signal_accumulator_true_handled().
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalBooleanFlags

      public static void marshalBooleanFlags(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal 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 g_signal_accumulator_true_handled().
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalStringObjectPointer

      public static void marshalStringObjectPointer(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with handlers that
      take a #GObject and a pointer and produce a string. It is highly
      unlikely that your signal handler fits this description.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidBoolean

      public static void marshalVoidBoolean(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      boolean argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidBoxed

      public static void marshalVoidBoxed(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      argument which is any boxed pointer type.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidChar

      public static void marshalVoidChar(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      character argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidDouble

      public static void marshalVoidDouble(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with one
      double-precision floating point argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidEnum

      public static void marshalVoidEnum(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      argument with an enumerated type.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidFlags

      public static void marshalVoidFlags(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      argument with a flags types.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidFloat

      public static void marshalVoidFloat(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with one
      single-precision floating point argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidInt

      public static void marshalVoidInt(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      integer argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidLong

      public static void marshalVoidLong(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with with a single
      long integer argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidObject

      public static void marshalVoidObject(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      #GObject argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidParam

      public static void marshalVoidParam(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      argument of type #GParamSpec.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidPointer

      public static void marshalVoidPointer(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal 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 g_cclosure_marshal_VOID__OBJECT() or
      g_cclosure_marshal_VOID__OBJECT().
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidString

      public static void marshalVoidString(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single string
      argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidUchar

      public static void marshalVoidUchar(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      unsigned character argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidUint

      public static void marshalVoidUint(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with with a single
      unsigned integer argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidUintPointer

      public static void marshalVoidUintPointer(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with an unsigned int
      and a pointer as arguments.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidUlong

      public static void marshalVoidUlong(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      unsigned long integer argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidVariant

      public static void marshalVoidVariant(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with a single
      #GVariant argument.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalVoidVoid

      public static void marshalVoidVoid(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A #GClosureMarshal function for use with signals with no arguments.
      Parameter:
      closure - A #GClosure.
      return_value - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • marshalGeneric

      public static void marshalGeneric(@Nonnull Closure closure, @Nonnull Value return_gvalue, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data)
      A generic marshaller function implemented via
      [libffi](http://sourceware.org/libffi/).

      Normally this function is not passed explicitly to g_signal_new(),
      but used automatically by GLib when specifying a %NULL marshaller.
      Parameter:
      closure - A #GClosure.
      return_gvalue - A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.
      n_param_values - The length of the @param_values array.
      param_values - An array of #GValues holding the arguments on which to invoke the callback of closure.
      invocation_hint - The invocation hint given as the last argument to g_closure_invoke().
      marshal_data - Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
    • _new

      public static Closure _new(CClosure.OnCallback callback_func, @Nullable Pointer user_data, CClosure.OnClosureNotify destroy_data)
      Creates a new closure which invokes @callback_func with @user_data as
      the last parameter.

      @destroy_data will be called as a finalize notifier on the #GClosure.
      Parameter:
      callback_func - the function to invoke
      user_data - user data to pass to @callback_func
      destroy_data - destroy notify to be called when @user_data is no longer used
      Gibt zurück:
      a floating reference to a new #GCClosure
    • newObject

      public static Closure newObject(CClosure.OnCallback callback_func, @Nonnull Object object)
      A variant of g_cclosure_new() which uses @object as @user_data and
      calls g_object_watch_closure() on @object and the created
      closure. This function is useful when you have a callback closely
      associated with a #GObject, and want the callback to no longer run
      after the object is is freed.
      Parameter:
      callback_func - the function to invoke
      object - a #GObject pointer to pass to @callback_func
      Gibt zurück:
      a new #GCClosure
    • newObjectSwap

      public static Closure newObjectSwap(CClosure.OnCallback callback_func, @Nonnull Object object)
      A variant of g_cclosure_new_swap() which uses @object as @user_data
      and calls g_object_watch_closure() on @object and the created
      closure. This function is useful when you have a callback closely
      associated with a #GObject, and want the callback to no longer run
      after the object is is freed.
      Parameter:
      callback_func - the function to invoke
      object - a #GObject pointer to pass to @callback_func
      Gibt zurück:
      a new #GCClosure
    • newSwap

      public static Closure newSwap(CClosure.OnCallback callback_func, @Nullable Pointer user_data, CClosure.OnClosureNotify destroy_data)
      Creates a new closure which invokes @callback_func with @user_data as
      the first parameter.

      @destroy_data will be called as a finalize notifier on the #GClosure.
      Parameter:
      callback_func - the function to invoke
      user_data - user data to pass to @callback_func
      destroy_data - destroy notify to be called when @user_data is no longer used
      Gibt zurück:
      a floating reference to a new #GCClosure