logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

wl_signal - A source of a type of observable event.

Author

       Generated automatically by Doxygen for Wayland from the source code.

Version 1.23.1                              Thu May 22 2025 08:23:52                                wl_signal(3)

Detailed Description

       A source of a type of observable event.

       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).

       Seealsowl_listener for more information on using wl_signal

Field Documentation

structwl_listwl_signal::listener_list

Member Function Documentation

staticvoidwl_signal_add(structwl_signal*signal,structwl_listener*listener)[inline],[static]
       Add the specified listener to this signal.

       Parameterssignal The signal that will emit events to the listener
           listener The listener to add

   staticvoidwl_signal_emit(structwl_signal*signal,void*data)[inline],[static]
       Emits this signal, notifying all registered listeners.

       Parameterssignal The signal object that will emit the signal
           data The data that will be emitted with the signal

   voidwl_signal_emit_mutable(structwl_signal*signal,void*data)
       Emits this signal, notifying all registered listeners.

       A safer version of wl_signal_emit() which can gracefully handle additions and deletions of any signal
       listener from within listener notification callbacks.

       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.

       Parameterssignal The signal object that will emit the signal
           data The data that will be emitted with the signal

       Since
           1.20.90

   staticstructwl_listener*wl_signal_get(structwl_signal*signal,wl_notify_func_tnotify)[inline],[static]
       Gets the listener struct for the specified callback.

       Parameterssignal 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

   staticvoidwl_signal_init(structwl_signal*signal)[inline],[static]
       Initialize a new wl_signal for use.

       Parameterssignal The signal that will be initialized

Name

       wl_signal - A source of a type of observable event.

Synopsis

       #include <wayland-server-core.h>

   PublicMemberFunctions
       void wl_signal_emit_mutable (struct wl_signal *signal, void *data)

   StaticPublicMemberFunctions
       static void wl_signal_init (struct wl_signal *signal)
       static void wl_signal_add (struct wl_signal *signal, struct wl_listener *listener)
       static struct wl_listener * wl_signal_get (struct wl_signal *signal, wl_notify_func_t notify)
       static void wl_signal_emit (struct wl_signal *signal, void *data)

   DataFields
       struct wl_listlistener_list

See Also