mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-14 08:22:25 -04:00
input-device: add addons
This commit is contained in:
parent
f1762f428b
commit
179d6efb19
2 changed files with 6 additions and 0 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#define WLR_TYPES_WLR_INPUT_DEVICE_H
|
||||
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/util/addon.h>
|
||||
|
||||
enum wlr_button_state {
|
||||
WLR_BUTTON_RELEASED,
|
||||
|
|
@ -34,6 +35,8 @@ struct wlr_input_device {
|
|||
struct wl_signal destroy;
|
||||
} events;
|
||||
|
||||
struct wlr_addon_set addons;
|
||||
|
||||
void *data;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wlr/util/addon.h>
|
||||
#include "interfaces/wlr_input_device.h"
|
||||
|
||||
void wlr_input_device_init(struct wlr_input_device *dev,
|
||||
|
|
@ -11,6 +12,7 @@ void wlr_input_device_init(struct wlr_input_device *dev,
|
|||
.name = strdup(name),
|
||||
};
|
||||
|
||||
wlr_addon_set_init(&dev->addons);
|
||||
wl_signal_init(&dev->events.destroy);
|
||||
}
|
||||
|
||||
|
|
@ -21,6 +23,7 @@ void wlr_input_device_finish(struct wlr_input_device *wlr_device) {
|
|||
|
||||
wl_signal_emit_mutable(&wlr_device->events.destroy, wlr_device);
|
||||
|
||||
wlr_addon_set_finish(&wlr_device->addons);
|
||||
wl_list_remove(&wlr_device->events.destroy.listener_list);
|
||||
|
||||
free(wlr_device->name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue