@new
Description:
Creates a new signal.
(This is usually done in the class initializer.)
A signal name consists of segments consisting of ASCII letters and digits, separated by either the `-` or `_` character. The first character of a signal name must be a letter. Names which violate these rules lead to undefined behaviour. These are the same rules as for property naming ( see ParamSpec.internal).
When registering a signal and looking up a signal, either separator can be used, but they cannot be mixed. Using `-` is considerably more efficient. Using `_` is discouraged.
If 0 is used for class_offset
subclasses cannot override the class handler in their class_init method by doing super_class->
signal_handler = my_signal_handler. Instead they will have to use
override_class_handler.
If c_marshaller
is null, g_cclosure_marshal_generic
will be used as the marshaller
for this signal. In some simple cases, @new will use a more optimized c_marshaller and va_marshaller for the
signal instead of g_cclosure_marshal_generic
.
If c_marshaller
is non-null, you need to also specify a va_marshaller using
g_signal_set_va_marshaller
or the generic va_marshaller will be used.
Parameters:
signal_name |
the name for the signal |
itype |
the type this signal pertains to. It will also pertain to types which are derived from this type. |
signal_flags |
a combination of SignalFlags 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_offset |
The offset of the function pointer in the class structure for this type. Used to invoke a class method generically. Pass 0 to not associate a class method slot with this signal. |
accumulator |
the accumulator for this signal; may be null. |
c_marshaller |
the function to translate arrays of parameter values to signal emissions into C language callback invocations or null. |
return_type |
the type of return value, or g_type_none for a signal without a return value. |
n_params |
the number of parameter types to follow. |
... |
a list of types, one for each parameter. |
accu_data |
user data for the |
Returns:
the signal id |