2013-05-03 17:51:22 +00:00
|
|
|
/*
|
|
|
|
* Wayland Support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 Intel Corporation
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-07-21 13:37:20 +00:00
|
|
|
#pragma once
|
2013-05-03 17:51:22 +00:00
|
|
|
|
2013-08-30 16:03:30 +00:00
|
|
|
#include <glib.h>
|
2018-07-10 08:36:24 +00:00
|
|
|
#include <wayland-server.h>
|
2013-08-30 16:03:30 +00:00
|
|
|
|
2018-07-10 08:36:24 +00:00
|
|
|
#include "meta/meta-cursor-tracker.h"
|
|
|
|
#include "wayland/meta-wayland-pointer-constraints.h"
|
2021-04-18 18:24:52 +00:00
|
|
|
#include "wayland/meta-wayland-pointer-gesture-hold.h"
|
2018-07-10 08:36:24 +00:00
|
|
|
#include "wayland/meta-wayland-pointer-gesture-pinch.h"
|
|
|
|
#include "wayland/meta-wayland-pointer-gesture-swipe.h"
|
|
|
|
#include "wayland/meta-wayland-seat.h"
|
2023-10-23 21:59:19 +00:00
|
|
|
#include "wayland/meta-wayland-surface-private.h"
|
2018-07-10 08:36:24 +00:00
|
|
|
#include "wayland/meta-wayland-types.h"
|
2014-04-17 20:54:30 +00:00
|
|
|
|
2016-04-01 08:39:30 +00:00
|
|
|
#define META_TYPE_WAYLAND_POINTER (meta_wayland_pointer_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (MetaWaylandPointer, meta_wayland_pointer,
|
2016-09-12 15:17:28 +00:00
|
|
|
META, WAYLAND_POINTER,
|
|
|
|
MetaWaylandInputDevice)
|
2016-04-01 08:39:30 +00:00
|
|
|
|
2015-08-09 13:24:16 +00:00
|
|
|
struct _MetaWaylandPointerClient
|
|
|
|
{
|
|
|
|
struct wl_list pointer_resources;
|
2015-07-22 14:43:25 +00:00
|
|
|
struct wl_list swipe_gesture_resources;
|
2015-07-22 14:46:55 +00:00
|
|
|
struct wl_list pinch_gesture_resources;
|
2021-04-18 18:24:52 +00:00
|
|
|
struct wl_list hold_gesture_resources;
|
2015-06-02 08:26:34 +00:00
|
|
|
struct wl_list relative_pointer_resources;
|
2022-09-23 13:53:19 +00:00
|
|
|
ClutterEventType active_touchpad_gesture;
|
2015-08-09 13:24:16 +00:00
|
|
|
};
|
|
|
|
|
2013-08-30 16:03:30 +00:00
|
|
|
struct _MetaWaylandPointer
|
|
|
|
{
|
2016-09-12 15:17:28 +00:00
|
|
|
MetaWaylandInputDevice parent;
|
2016-04-01 08:39:30 +00:00
|
|
|
|
2015-08-09 13:24:16 +00:00
|
|
|
MetaWaylandPointerClient *focus_client;
|
|
|
|
GHashTable *pointer_clients;
|
2014-02-18 23:00:26 +00:00
|
|
|
|
|
|
|
MetaWaylandSurface *focus_surface;
|
2017-05-31 09:24:07 +00:00
|
|
|
gulong focus_surface_destroyed_handler_id;
|
2021-09-03 21:49:46 +00:00
|
|
|
gulong focus_surface_alive_notify_id;
|
2013-08-30 16:03:30 +00:00
|
|
|
guint32 focus_serial;
|
2013-09-10 13:53:31 +00:00
|
|
|
guint32 click_serial;
|
2013-08-30 16:03:30 +00:00
|
|
|
|
2014-04-18 14:15:40 +00:00
|
|
|
MetaWaylandSurface *cursor_surface;
|
2019-11-16 00:25:52 +00:00
|
|
|
gulong cursor_surface_destroy_id;
|
2014-04-18 14:15:40 +00:00
|
|
|
|
2013-08-30 16:03:30 +00:00
|
|
|
guint32 grab_button;
|
|
|
|
guint32 grab_serial;
|
|
|
|
guint32 grab_time;
|
2014-04-18 14:27:48 +00:00
|
|
|
float grab_x, grab_y;
|
2023-11-17 17:24:14 +00:00
|
|
|
float last_rel_x, last_rel_y;
|
2013-08-30 16:03:30 +00:00
|
|
|
|
2014-04-18 14:27:48 +00:00
|
|
|
ClutterInputDevice *device;
|
2013-08-30 16:03:30 +00:00
|
|
|
MetaWaylandSurface *current;
|
2017-05-31 09:27:52 +00:00
|
|
|
gulong current_surface_destroyed_handler_id;
|
2013-08-30 16:03:30 +00:00
|
|
|
|
|
|
|
guint32 button_count;
|
|
|
|
};
|
2013-05-03 17:51:22 +00:00
|
|
|
|
2016-09-12 15:20:36 +00:00
|
|
|
void meta_wayland_pointer_enable (MetaWaylandPointer *pointer);
|
2013-05-03 17:51:22 +00:00
|
|
|
|
2016-04-01 08:39:30 +00:00
|
|
|
void meta_wayland_pointer_disable (MetaWaylandPointer *pointer);
|
2013-05-03 17:51:22 +00:00
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
void meta_wayland_pointer_update (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
2014-04-17 21:52:11 +00:00
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
gboolean meta_wayland_pointer_handle_event (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
2014-04-17 22:16:49 +00:00
|
|
|
|
2015-06-17 04:10:52 +00:00
|
|
|
void meta_wayland_pointer_send_relative_motion (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
2016-09-06 04:45:01 +00:00
|
|
|
void meta_wayland_pointer_broadcast_frame (MetaWaylandPointer *pointer);
|
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
void meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
wl_fixed_t *x,
|
|
|
|
wl_fixed_t *y);
|
2013-09-11 12:06:05 +00:00
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
void meta_wayland_pointer_create_new_resource (MetaWaylandPointer *pointer,
|
|
|
|
struct wl_client *client,
|
|
|
|
struct wl_resource *seat_resource,
|
|
|
|
uint32_t id);
|
2014-04-17 21:00:59 +00:00
|
|
|
|
2014-05-22 14:57:02 +00:00
|
|
|
gboolean meta_wayland_pointer_can_grab_surface (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
uint32_t serial);
|
|
|
|
|
2015-02-10 13:11:17 +00:00
|
|
|
gboolean meta_wayland_pointer_can_popup (MetaWaylandPointer *pointer,
|
|
|
|
uint32_t serial);
|
|
|
|
|
2015-08-09 13:24:16 +00:00
|
|
|
MetaWaylandPointerClient * meta_wayland_pointer_get_pointer_client (MetaWaylandPointer *pointer,
|
|
|
|
struct wl_client *client);
|
|
|
|
void meta_wayland_pointer_unbind_pointer_client_resource (struct wl_resource *resource);
|
|
|
|
|
2015-06-02 08:26:34 +00:00
|
|
|
void meta_wayland_relative_pointer_init (MetaWaylandCompositor *compositor);
|
|
|
|
|
2015-06-17 04:10:52 +00:00
|
|
|
MetaWaylandSeat *meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer);
|
|
|
|
|
2015-10-21 14:36:44 +00:00
|
|
|
void meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer);
|
|
|
|
|
2023-11-14 22:22:53 +00:00
|
|
|
MetaWaylandSurface * meta_wayland_pointer_get_current_surface (MetaWaylandPointer *pointer);
|
2023-11-15 13:43:15 +00:00
|
|
|
|
|
|
|
void meta_wayland_pointer_focus_surface (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandSurface *surface);
|
2023-11-16 13:09:55 +00:00
|
|
|
|
|
|
|
MetaWaylandSurface * meta_wayland_pointer_get_implicit_grab_surface (MetaWaylandPointer *pointer);
|