mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
input: use CONNECT_SIGNAL macro
This commit is contained in:
parent
6687640665
commit
538eb3ee83
1 changed files with 9 additions and 13 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
#include <wayland-util.h>
|
#include <wayland-util.h>
|
||||||
#include <wlr/types/wlr_touch.h>
|
#include <wlr/types/wlr_touch.h>
|
||||||
#include <linux/input-event-codes.h>
|
#include <linux/input-event-codes.h>
|
||||||
|
#include "common/macros.h"
|
||||||
#include "common/mem.h"
|
#include "common/mem.h"
|
||||||
#include "common/scene-helpers.h"
|
#include "common/scene-helpers.h"
|
||||||
#include "idle.h"
|
#include "idle.h"
|
||||||
|
|
@ -9,7 +10,6 @@
|
||||||
#include "labwc.h"
|
#include "labwc.h"
|
||||||
#include "config/mousebind.h"
|
#include "config/mousebind.h"
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "view.h"
|
|
||||||
|
|
||||||
/* Holds layout -> surface offsets to report motion events in relative coords */
|
/* Holds layout -> surface offsets to report motion events in relative coords */
|
||||||
struct touch_point {
|
struct touch_point {
|
||||||
|
|
@ -46,7 +46,7 @@ touch_get_coords(struct seat *seat, struct wlr_touch *touch, double x, double y,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
touch_motion(struct wl_listener *listener, void *data)
|
handle_touch_motion(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct seat *seat = wl_container_of(listener, seat, touch_motion);
|
struct seat *seat = wl_container_of(listener, seat, touch_motion);
|
||||||
struct wlr_touch_motion_event *event = data;
|
struct wlr_touch_motion_event *event = data;
|
||||||
|
|
@ -78,7 +78,7 @@ touch_motion(struct wl_listener *listener, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
touch_frame(struct wl_listener *listener, void *data)
|
handle_touch_frame(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct seat *seat = wl_container_of(listener, seat, touch_frame);
|
struct seat *seat = wl_container_of(listener, seat, touch_frame);
|
||||||
|
|
||||||
|
|
@ -86,7 +86,7 @@ touch_frame(struct wl_listener *listener, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
touch_down(struct wl_listener *listener, void *data)
|
handle_touch_down(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct seat *seat = wl_container_of(listener, seat, touch_down);
|
struct seat *seat = wl_container_of(listener, seat, touch_down);
|
||||||
struct wlr_touch_down_event *event = data;
|
struct wlr_touch_down_event *event = data;
|
||||||
|
|
@ -133,7 +133,7 @@ touch_down(struct wl_listener *listener, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
touch_up(struct wl_listener *listener, void *data)
|
handle_touch_up(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct seat *seat = wl_container_of(listener, seat, touch_up);
|
struct seat *seat = wl_container_of(listener, seat, touch_up);
|
||||||
struct wlr_touch_up_event *event = data;
|
struct wlr_touch_up_event *event = data;
|
||||||
|
|
@ -159,14 +159,10 @@ touch_up(struct wl_listener *listener, void *data)
|
||||||
void
|
void
|
||||||
touch_init(struct seat *seat)
|
touch_init(struct seat *seat)
|
||||||
{
|
{
|
||||||
seat->touch_down.notify = touch_down;
|
CONNECT_SIGNAL(seat->cursor, seat, touch_down);
|
||||||
wl_signal_add(&seat->cursor->events.touch_down, &seat->touch_down);
|
CONNECT_SIGNAL(seat->cursor, seat, touch_up);
|
||||||
seat->touch_up.notify = touch_up;
|
CONNECT_SIGNAL(seat->cursor, seat, touch_motion);
|
||||||
wl_signal_add(&seat->cursor->events.touch_up, &seat->touch_up);
|
CONNECT_SIGNAL(seat->cursor, seat, touch_frame);
|
||||||
seat->touch_motion.notify = touch_motion;
|
|
||||||
wl_signal_add(&seat->cursor->events.touch_motion, &seat->touch_motion);
|
|
||||||
seat->touch_frame.notify = touch_frame;
|
|
||||||
wl_signal_add(&seat->cursor->events.touch_frame, &seat->touch_frame);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue