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/>.
|
|
|
|
*/
|
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
#ifndef META_WAYLAND_POINTER_H
|
|
|
|
#define META_WAYLAND_POINTER_H
|
2013-05-03 17:51:22 +00:00
|
|
|
|
|
|
|
#include <wayland-server.h>
|
|
|
|
|
2013-08-30 16:03:30 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include "meta-wayland-types.h"
|
2016-09-12 15:20:36 +00:00
|
|
|
#include "meta-wayland-seat.h"
|
2015-07-22 14:43:25 +00:00
|
|
|
#include "meta-wayland-pointer-gesture-swipe.h"
|
2015-07-22 14:46:55 +00:00
|
|
|
#include "meta-wayland-pointer-gesture-pinch.h"
|
2015-07-17 14:02:15 +00:00
|
|
|
#include "meta-wayland-surface.h"
|
2015-06-17 04:10:52 +00:00
|
|
|
#include "meta-wayland-pointer-constraints.h"
|
2013-08-30 16:03:30 +00:00
|
|
|
|
2014-04-17 20:54:30 +00:00
|
|
|
#include <meta/meta-cursor-tracker.h>
|
|
|
|
|
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
|
|
|
|
2013-08-30 16:03:30 +00:00
|
|
|
struct _MetaWaylandPointerGrabInterface
|
|
|
|
{
|
2013-09-11 12:06:05 +00:00
|
|
|
void (*focus) (MetaWaylandPointerGrab *grab,
|
2014-03-16 15:50:38 +00:00
|
|
|
MetaWaylandSurface *surface);
|
2013-09-11 12:06:05 +00:00
|
|
|
void (*motion) (MetaWaylandPointerGrab *grab,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
void (*button) (MetaWaylandPointerGrab *grab,
|
|
|
|
const ClutterEvent *event);
|
2016-09-21 06:33:47 +00:00
|
|
|
void (*cancel) (MetaWaylandPointerGrab *grab);
|
2013-08-30 16:03:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _MetaWaylandPointerGrab
|
|
|
|
{
|
|
|
|
const MetaWaylandPointerGrabInterface *interface;
|
|
|
|
MetaWaylandPointer *pointer;
|
|
|
|
};
|
|
|
|
|
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;
|
2015-06-02 08:26:34 +00:00
|
|
|
struct wl_list relative_pointer_resources;
|
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;
|
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;
|
2015-10-21 14:36:44 +00:00
|
|
|
guint cursor_surface_destroy_id;
|
2014-04-18 14:15:40 +00:00
|
|
|
|
2013-08-30 16:03:30 +00:00
|
|
|
MetaWaylandPointerGrab *grab;
|
|
|
|
MetaWaylandPointerGrab default_grab;
|
|
|
|
guint32 grab_button;
|
|
|
|
guint32 grab_serial;
|
|
|
|
guint32 grab_time;
|
2014-04-18 14:27:48 +00:00
|
|
|
float grab_x, grab_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-02-11 09:34:15 +00:00
|
|
|
void meta_wayland_pointer_send_motion (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
2015-06-17 04:10:52 +00:00
|
|
|
void meta_wayland_pointer_send_relative_motion (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
2015-02-11 09:34:15 +00:00
|
|
|
void meta_wayland_pointer_send_button (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_set_focus (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandSurface *surface);
|
2013-08-28 14:23:34 +00:00
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
void meta_wayland_pointer_start_grab (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandPointerGrab *grab);
|
2013-05-03 17:51:22 +00:00
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
void meta_wayland_pointer_end_grab (MetaWaylandPointer *pointer);
|
2013-05-03 17:51:22 +00:00
|
|
|
|
2016-01-21 09:01:08 +00:00
|
|
|
MetaWaylandPopup *meta_wayland_pointer_start_popup_grab (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandPopupSurface *popup_surface);
|
2013-09-10 13:53:31 +00:00
|
|
|
|
2015-02-11 09:34:15 +00:00
|
|
|
void meta_wayland_pointer_end_popup_grab (MetaWaylandPointer *pointer);
|
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
void meta_wayland_pointer_repick (MetaWaylandPointer *pointer);
|
2014-04-17 22:16:49 +00:00
|
|
|
|
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-02-12 03:20:52 +00:00
|
|
|
MetaWaylandSurface *meta_wayland_pointer_get_top_popup (MetaWaylandPointer *pointer);
|
|
|
|
|
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_surface_cursor_update (MetaWaylandSurface *cursor_surface);
|
|
|
|
|
|
|
|
void meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer);
|
|
|
|
|
2014-04-22 22:09:38 +00:00
|
|
|
#endif /* META_WAYLAND_POINTER_H */
|