wl_signal(3)
π wl_signal(3) β Library Functions Manual π
okay bestie, sit down, hydrate, and let's talk about wl_signal β she's a source of a type of observable event. That's the whole name, that's the whole vibe. She's from the Wayland library functions crew and she's here to let you know when stuff happens. periodt.
β¨ NAME β¨
wl_signal β A source of a type of observable event. that's her π
π¦ SYNOPSIS π¦
#include <wayland-server-core.h>
π Public Member Functions
void wl_signal_emit_mutable (struct wl_signal *signal, void *data)β the fancy safe emitter, we'll get to her
πΈ Static Public Member Functions
static void wl_signal_init (struct wl_signal *signal)β set a signal up so she's ready to gostatic void wl_signal_add (struct wl_signal *signal, struct wl_listener *listener)β adopt a listener into the signal's little familystatic struct wl_listener * wl_signal_get (struct wl_signal *signal, wl_notify_func_t notify)β find the listener tied to a specific callbackstatic void wl_signal_emit (struct wl_signal *signal, void *data)β fire the signal, ping everybody
π Data Fields
struct wl_list listener_listβ the guest list π
π Detailed Description π
A source of a type of observable event. (Yes, she says it twice. She's consistent. We love that for her.)
Signals are recognized points where significant events can be observed. Compositors as well as the server can provide signals. Observers are wl_listener's that are added through wl_signal_add. Signals are emitted using wl_signal_emit, which will invoke all listeners until that listener is removed by wl_list_remove() (or whenever the signal is destroyed).
fr fr, "until that listener is removed" is doing a LOT of heavy lifting in that sentence, bestie. Read it twice. π
See also wl_listener for more information on using wl_signal β go read her page too, she's iconic π
π Member Function Documentation π
π void wl_signal_add (struct wl_signal * signal, struct wl_listener * listener) [inline], [static]
Add the specified listener to this signal. Welcome to the group chat, you're in it now. π«Ά
Parameters
- signal β The signal that will emit events to the listener
- listener β The listener to add
π§ void wl_signal_emit (struct wl_signal * signal, void * data) [inline], [static]
Emits this signal, notifying all registered listeners. Everybody gets the notification, no one gets left on read. β¨
Parameters
- signal β The signal object that will emit the signal
- data β The data that will be emitted with the signal
π₯ void wl_signal_emit_mutable (struct wl_signal * signal, void * data)
Emits this signal, notifying all registered listeners. Same energy as her sister above, but she's built different.
A safer version of wl_signal_emit() which can gracefully handle additions and deletions of any signal listener from within listener notification callbacks. gracefully is the keyword. She does not panic. She is unbothered. π
Listeners deleted during a signal emission and which have not already been notified at the time of deletion are not notified by that emission.
Listeners added (or readded) during signal emission are ignored by that emission.
β οΈ Note that repurposing a listener without explicitly removing it and readding it is not supported and can lead to unexpected behavior. Not me warning you and you doing it anyway π
Parameters
- signal β The signal object that will emit the signal
- data β The data that will be emitted with the signal
Since 1.20.90
π struct wl_listener * wl_signal_get (struct wl_signal * signal, wl_notify_func_t notify) [inline], [static]
Gets the listener struct for the specified callback. Basically a "where is she" search for one specific listener. π
Parameters
- signal β The signal that contains the specified listener
- notify β The listener that is the target of this search
Returns the list item that corresponds to the specified listener, or NULL if none was found
π void wl_signal_init (struct wl_signal * signal) [inline], [static]
Initialize a new wl_signal for use. Glow-up complete, she's ready to be deployed. π
Parameters
- signal β The signal that will be initialized
πΈ Field Documentation πΈ
struct wl_list wl_signal::listener_list
That's the list of listeners. That's the whole field. That's it. That's the note. π¦
β Author β
Generated automatically by Doxygen for Wayland from the source code. (not a human, but honestly? she ate. no notes.)
and that's the page, bestie π this was wl_signal(3) from Wayland, Version 1.26.0 β go forth, emit your signals, treat your listeners with respect, and remember: always remove before you repurpose. mwah π«Άβ¨
π¦ where this page comes from
- arch rolling: wayland-docs 1.26.0-1 Β· MIT
- fedora 43: wayland-devel 1.26.0-1.fc43 Β· MIT
- fedora 43: wayland-devel 1.26.0-1.fc43 Β· MIT
- fedora 44: wayland-devel 1.26.0-1.fc44 Β· MIT
- fedora 44: wayland-devel 1.26.0-1.fc44 Β· MIT
- nixpkgs unstable: wayland 1.26.0
- ubuntu stonking: libwayland-doc 1.26.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms