File: wlr_output_layer.c

package info (click to toggle)
wlroots 0.19.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,592 kB
  • sloc: ansic: 75,766; xml: 2,739; sh: 33; makefile: 23
file content (30 lines) | stat: -rw-r--r-- 659 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <assert.h>
#include <stdlib.h>
#include <wlr/types/wlr_output_layer.h>

struct wlr_output_layer *wlr_output_layer_create(struct wlr_output *output) {
	struct wlr_output_layer *layer = calloc(1, sizeof(*layer));
	if (layer == NULL) {
		return NULL;
	}

	wl_list_insert(&output->layers, &layer->link);
	wlr_addon_set_init(&layer->addons);

	wl_signal_init(&layer->events.feedback);

	return layer;
}

void wlr_output_layer_destroy(struct wlr_output_layer *layer) {
	if (layer == NULL) {
		return;
	}

	wlr_addon_set_finish(&layer->addons);

	assert(wl_list_empty(&layer->events.feedback.listener_list));

	wl_list_remove(&layer->link);
	free(layer);
}