Function

GObjectsignal_new_class_handler

since: 2.18

Declaration

guint
g_signal_new_class_handler (
  const gchar* signal_name,
  GType itype,
  GSignalFlags signal_flags,
  GCallback class_handler,
  GSignalAccumulator accumulator,
  gpointer accu_data,
  GSignalCMarshaller c_marshaller,
  GType return_type,
  guint n_params,
  ...
)

Description

Creates a new signal. (This is usually done in the class initializer.)

This is a variant of g_signal_new() that takes a C callback instead of a class offset for the signal’s class handler. This function doesn’t need a function pointer exposed in the class structure of an object definition, instead the function pointer is passed directly and can be overridden by derived classes with g_signal_override_class_closure() or g_signal_override_class_handler() and chained to with g_signal_chain_from_overridden() or g_signal_chain_from_overridden_handler().

See g_signal_new() for information about signal names.

If c_marshaller is NULL, g_cclosure_marshal_generic() will be used as the marshaller for this signal.

Available since: 2.18

This function is not directly available to language bindings.

Parameters

signal_name

Type: const gchar*

The name for the signal.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
itype

Type: GType

The type this signal pertains to. It will also pertain to types which are derived from this type.

signal_flags

Type: GSignalFlags

A combination of GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify G_SIGNAL_RUN_FIRST or G_SIGNAL_RUN_LAST.

class_handler

Type: GCallback

A GCallback which acts as class implementation of this signal. Used to invoke a class method generically. Pass NULL to not associate a class method with this signal.

The argument can be NULL.
accumulator

Type: GSignalAccumulator

The accumulator for this signal; may be NULL.

The argument can be NULL.
accu_data

Type: gpointer

User data for the accumulator.

The argument can be NULL.
The data is owned by the caller of the function.
c_marshaller

Type: GSignalCMarshaller

The function to translate arrays of parameter values to signal emissions into C language callback invocations or NULL.

The argument can be NULL.
return_type

Type: GType

The type of return value, or G_TYPE_NONE for a signal without a return value.

n_params

Type: guint

The number of parameter types to follow.

...

Type: 

A list of types, one for each parameter.

Return value

Type: guint

The signal id.