Package org.javagi.gobject.types
Class Signals
java.lang.Object
org.javagi.gobject.types.Signals
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MethodHandleThe method handle for g_signal_connect_data is used by all generated signal-connection methods.static final MethodHandleThe method handle for g_signal_emit_by_name is used by all generated signal-emission methods. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ObjectEmits a signal from a GObject.static MethodgetSingleAbstractMethod(Class<?> cls) Get the single abstract method (SAM) implementation of a functional interface.installSignals(Class<?> cls) If the provided class contains inner interface declarations with a@Signal-annotation, this function will return a class initializer that registers these declarations as GObject signals (usingg_signal_newv) in the class initializer.
-
Field Details
-
g_signal_connect_data
The method handle for g_signal_connect_data is used by all generated signal-connection methods. -
g_signal_emit_by_name
The method handle for g_signal_emit_by_name is used by all generated signal-emission methods.
-
-
Constructor Details
-
Signals
public Signals()
-
-
Method Details
-
installSignals
If the provided class contains inner interface declarations with a@Signal-annotation, this function will return a class initializer that registers these declarations as GObject signals (usingg_signal_newv) in the class initializer.- Parameters:
cls- the class that possibly contains @Signal annotations- Returns:
- a class initializer that registers the signals
-
emit
Emits a signal from a GObject.- Parameters:
gobject- the object that emits the signaldetailedSignal- a string of the form "signal-name::detail"params- the parameters to emit for this signal- Returns:
- the return value of the signal, or
nullif the signal has no return value - Throws:
IllegalArgumentException- if a signal with this name is not found for the object
-
getSingleAbstractMethod
Get the single abstract method (SAM) implementation of a functional interface. A functional interface has exactly one abstract method.- Parameters:
cls- a functional interface- Returns:
- the Method reference to the method that implements the SAM
- Throws:
IllegalArgumentException- ifclsis not a functional interface
-