---
name: "wl_signal_emit"
section: "3"
platform: "linux"
package: "libwayland-doc"
version: "1.12.0-1+deb9u1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/wl_signal"
---

# wl\_signal\_emit(3)

A source of a type of observable event.

Part of [wl\_signal(3)](/wl_signal/3.md).

## NAME

wl\_signal - A source of a type of observable event.

## SYNOPSIS

`#include <wayland-server-core.h>`

### Public Member Functions

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

### Data Fields

struct **wl\_list** **listener\_list**\

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

**See also:**

**wl\_listener** for more information on using **wl\_signal**

## Member Function Documentation

### static void wl\_signal\_add (struct wl\_signal \* signal, struct wl\_listener \* listener)` [inline]`

Add the specified listener to this signal.

**Parameters:**

*signal* The signal that will emit events to the listener \
 *listener* The listener to add

### static void wl\_signal\_emit (struct wl\_signal \* signal, void \* data)` [inline]`

Emits this signal, notifying all registered listeners.

**Parameters:**

*signal* The signal object that will emit the signal \
 *data* The data that will be emitted with the signal

### static struct wl\_listener \* wl\_signal\_get (struct wl\_signal \* signal, wl\_notify\_func\_t notify)

Gets the listener struct for the specified callback.

**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

### static void wl\_signal\_init (struct wl\_signal \* signal)` [inline]`

Initialize a new **wl\_signal** for use.

**Parameters:**

*signal* The signal that will be initialized

## Field Documentation

### struct wl\_list wl\_signal::listener\_list

## Author

Generated automatically by Doxygen for Wayland from the source code.
