Annotation Interface Signal
Register the annotated type as a GObject signal on the enclosing class.
The signal declaration must be a functional interface. Example usage:
public class Example extends GObject {
@Signal
public interface ExampleSignal {
public boolean run();
}
}
Alternatively, extend an existing functional interface:
public class Example extends GObject {
@Signal
public interface ExampleSignal extends BooleanSupplier {};
}
When the enclosing class is registered as a GObject using
Types#register()
, the signal will be registered for that class, using
the parameters of the annotated type.
The default name of the signal is derived from the type name, translating
camel-case ("ExampleSignal") to kebab-case ("example-signal"). It is possible
to override this with the name()
parameter.
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Action signals are signals that may freely be emitted on alive objects from user code viag_signal_emit()
and friends, without the need of being embedded into extra code that performs pre or post emission adjustments on the object.boolean
The signal is deprecated and will be removed in a future version.boolean
This signal supports “::detail” appendices to the signal name upon handler connections and emissions.boolean
Varargs signal emission will always collect the arguments, even if there are no signal handlers connected.The name of the signal.boolean
No emissions hooks are supported for this signal.boolean
Signals being emitted for an object while currently being in emission for this very object will not be emitted recursively, but instead cause the first emission to be restarted.boolean
Invoke the object method handler in the last emission stage.boolean
Invoke the object method handler in the first emission stage.boolean
Invoke the object method handler in the third emission stage.
-
Element Details
-
name
-
runFirst
boolean runFirstInvoke the object method handler in the first emission stage.- Default:
false
-
runLast
boolean runLastInvoke the object method handler in the third emission stage.- Default:
false
-
runCleanup
boolean runCleanupInvoke the object method handler in the last emission stage.- Default:
false
-
noRecurse
boolean noRecurseSignals being emitted for an object while currently being in emission for this very object will not be emitted recursively, but instead cause the first emission to be restarted.- Default:
false
-
detailed
boolean detailedThis signal supports “::detail” appendices to the signal name upon handler connections and emissions.- Default:
false
-
action
boolean actionAction signals are signals that may freely be emitted on alive objects from user code viag_signal_emit()
and friends, without the need of being embedded into extra code that performs pre or post emission adjustments on the object. They can also be thought of as object methods which can be called generically by third-party code.- Default:
false
-
noHooks
boolean noHooksNo emissions hooks are supported for this signal.- Default:
false
-
mustCollect
boolean mustCollectVarargs signal emission will always collect the arguments, even if there are no signal handlers connected.- Since:
- 2.30
- Default:
false
-
deprecated
boolean deprecatedThe signal is deprecated and will be removed in a future version. A warning will be generated if it is connected while running with G_ENABLE_DIAGNOSTIC=1.- Since:
- 2.32
- Default:
false
-