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