Macro glib_signal::impl_signal
source · macro_rules! impl_signal { (impl Notifies<$signal_str:literal as $signal:path> for $obj:path { $(impl $imp:tt;)* $(FLAGS = $flags:expr;)* fn $($handler:tt)* }) => { ... }; }
Expand description
A helper that impls Signal and its related traits.
§Syntax
use glib_signal::{impl_signal, SignalFlags};
impl_signal! { impl Notifies<"signal-name" as SignalType> for AnObject {
//impl {const SIGNAL_NAME}; // provide a convenient accessor for the default signal handler
impl BuildSignal; // provide a default impl to facilitate GObject type construction
FLAGS = SignalFlags::NO_RECURSE; // optionally specify flags for the signal when building
fn(&self, String) // finally, specify the callback handler signature (with optional return type)
} }
§Implements
- Notifies<
SignalType
> forAnObject
- Signal for
SignalType
- BuildSignal for
SignalType
, for use with glib::ObjectImpl (opt-in)