2013-05-03 13:51:22 -04: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 18:09:38 -04:00
|
|
|
#ifndef META_WAYLAND_POINTER_H
|
|
|
|
#define META_WAYLAND_POINTER_H
|
2013-05-03 13:51:22 -04:00
|
|
|
|
|
|
|
#include <wayland-server.h>
|
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include "meta-wayland-types.h"
|
2016-09-12 11:20:36 -04:00
|
|
|
#include "meta-wayland-seat.h"
|
2015-07-22 10:43:25 -04:00
|
|
|
#include "meta-wayland-pointer-gesture-swipe.h"
|
2015-07-22 10:46:55 -04:00
|
|
|
#include "meta-wayland-pointer-gesture-pinch.h"
|
2015-07-17 10:02:15 -04:00
|
|
|
#include "meta-wayland-surface.h"
|
2015-06-17 00:10:52 -04:00
|
|
|
#include "meta-wayland-pointer-constraints.h"
|
2013-08-30 12:03:30 -04:00
|
|
|
|
2014-04-17 16:54:30 -04:00
|
|
|
#include <meta/meta-cursor-tracker.h>
|
|
|
|
|
2016-04-01 04:39:30 -04:00
|
|
|
#define META_TYPE_WAYLAND_POINTER (meta_wayland_pointer_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (MetaWaylandPointer, meta_wayland_pointer,
|
2016-09-12 11:17:28 -04:00
|
|
|
META, WAYLAND_POINTER,
|
|
|
|
MetaWaylandInputDevice)
|
2016-04-01 04:39:30 -04:00
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
struct _MetaWaylandPointerGrabInterface
|
|
|
|
{
|
2013-09-11 08:06:05 -04:00
|
|
|
void (*focus) (MetaWaylandPointerGrab *grab,
|
2014-03-16 11:50:38 -04:00
|
|
|
MetaWaylandSurface *surface);
|
2013-09-11 08:06:05 -04:00
|
|
|
void (*motion) (MetaWaylandPointerGrab *grab,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
void (*button) (MetaWaylandPointerGrab *grab,
|
|
|
|
const ClutterEvent *event);
|
2016-09-21 02:33:47 -04:00
|
|
|
void (*cancel) (MetaWaylandPointerGrab *grab);
|
2013-08-30 12:03:30 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _MetaWaylandPointerGrab
|
|
|
|
{
|
|
|
|
const MetaWaylandPointerGrabInterface *interface;
|
|
|
|
MetaWaylandPointer *pointer;
|
|
|
|
};
|
|
|
|
|
2015-08-09 09:24:16 -04:00
|
|
|
struct _MetaWaylandPointerClient
|
|
|
|
{
|
|
|
|
struct wl_list pointer_resources;
|
2015-07-22 10:43:25 -04:00
|
|
|
struct wl_list swipe_gesture_resources;
|
2015-07-22 10:46:55 -04:00
|
|
|
struct wl_list pinch_gesture_resources;
|
2015-06-02 04:26:34 -04:00
|
|
|
struct wl_list relative_pointer_resources;
|
2015-08-09 09:24:16 -04:00
|
|
|
};
|
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
struct _MetaWaylandPointer
|
|
|
|
{
|
2016-09-12 11:17:28 -04:00
|
|
|
MetaWaylandInputDevice parent;
|
2016-04-01 04:39:30 -04:00
|
|
|
|
2015-08-09 09:24:16 -04:00
|
|
|
MetaWaylandPointerClient *focus_client;
|
|
|
|
GHashTable *pointer_clients;
|
2014-02-18 18:00:26 -05:00
|
|
|
|
|
|
|
MetaWaylandSurface *focus_surface;
|
2017-05-31 05:24:07 -04:00
|
|
|
gulong focus_surface_destroyed_handler_id;
|
2013-08-30 12:03:30 -04:00
|
|
|
guint32 focus_serial;
|
2013-09-10 09:53:31 -04:00
|
|
|
guint32 click_serial;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
2014-04-18 10:15:40 -04:00
|
|
|
MetaWaylandSurface *cursor_surface;
|
2015-10-21 10:36:44 -04:00
|
|
|
guint cursor_surface_destroy_id;
|
2014-04-18 10:15:40 -04:00
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
MetaWaylandPointerGrab *grab;
|
|
|
|
MetaWaylandPointerGrab default_grab;
|
|
|
|
guint32 grab_button;
|
|
|
|
guint32 grab_serial;
|
|
|
|
guint32 grab_time;
|
2014-04-18 10:27:48 -04:00
|
|
|
float grab_x, grab_y;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
2014-04-18 10:27:48 -04:00
|
|
|
ClutterInputDevice *device;
|
2013-08-30 12:03:30 -04:00
|
|
|
MetaWaylandSurface *current;
|
2017-05-31 05:27:52 -04:00
|
|
|
gulong current_surface_destroyed_handler_id;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
|
|
|
guint32 button_count;
|
|
|
|
};
|
2013-05-03 13:51:22 -04:00
|
|
|
|
2016-09-12 11:20:36 -04:00
|
|
|
void meta_wayland_pointer_enable (MetaWaylandPointer *pointer);
|
2013-05-03 13:51:22 -04:00
|
|
|
|
2016-04-01 04:39:30 -04:00
|
|
|
void meta_wayland_pointer_disable (MetaWaylandPointer *pointer);
|
2013-05-03 13:51:22 -04:00
|
|
|
|
2014-04-22 18:09:38 -04:00
|
|
|
void meta_wayland_pointer_update (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
2014-04-17 17:52:11 -04:00
|
|
|
|
2014-04-22 18:09:38 -04:00
|
|
|
gboolean meta_wayland_pointer_handle_event (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
2014-04-17 18:16:49 -04:00
|
|
|
|
2015-02-11 04:34:15 -05:00
|
|
|
void meta_wayland_pointer_send_motion (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
2015-06-17 00:10:52 -04:00
|
|
|
void meta_wayland_pointer_send_relative_motion (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
2015-02-11 04:34:15 -05:00
|
|
|
void meta_wayland_pointer_send_button (MetaWaylandPointer *pointer,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
2016-09-06 00:45:01 -04:00
|
|
|
void meta_wayland_pointer_broadcast_frame (MetaWaylandPointer *pointer);
|
|
|
|
|
2014-04-22 18:09:38 -04:00
|
|
|
void meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandSurface *surface);
|
2013-08-28 10:23:34 -04:00
|
|
|
|
2014-04-22 18:09:38 -04:00
|
|
|
void meta_wayland_pointer_start_grab (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandPointerGrab *grab);
|
2013-05-03 13:51:22 -04:00
|
|
|
|
2014-04-22 18:09:38 -04:00
|
|
|
void meta_wayland_pointer_end_grab (MetaWaylandPointer *pointer);
|
2013-05-03 13:51:22 -04:00
|
|
|
|
2016-01-21 04:01:08 -05:00
|
|
|
MetaWaylandPopup *meta_wayland_pointer_start_popup_grab (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandPopupSurface *popup_surface);
|
2013-09-10 09:53:31 -04:00
|
|
|
|
2015-02-11 04:34:15 -05:00
|
|
|
void meta_wayland_pointer_end_popup_grab (MetaWaylandPointer *pointer);
|
|
|
|
|
2014-04-22 18:09:38 -04:00
|
|
|
void meta_wayland_pointer_repick (MetaWaylandPointer *pointer);
|
2014-04-17 18:16:49 -04:00
|
|
|
|
2014-04-22 18:09:38 -04:00
|
|
|
void meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
wl_fixed_t *x,
|
|
|
|
wl_fixed_t *y);
|
2013-09-11 08:06:05 -04:00
|
|
|
|
2014-04-22 18:09:38 -04: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 17:00:59 -04:00
|
|
|
|
2014-05-22 10:57:02 -04:00
|
|
|
gboolean meta_wayland_pointer_can_grab_surface (MetaWaylandPointer *pointer,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
uint32_t serial);
|
|
|
|
|
2015-02-10 08:11:17 -05:00
|
|
|
gboolean meta_wayland_pointer_can_popup (MetaWaylandPointer *pointer,
|
|
|
|
uint32_t serial);
|
|
|
|
|
2015-02-11 22:20:52 -05:00
|
|
|
MetaWaylandSurface *meta_wayland_pointer_get_top_popup (MetaWaylandPointer *pointer);
|
|
|
|
|
2015-08-09 09:24:16 -04: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 04:26:34 -04:00
|
|
|
void meta_wayland_relative_pointer_init (MetaWaylandCompositor *compositor);
|
|
|
|
|
2015-06-17 00:10:52 -04:00
|
|
|
MetaWaylandSeat *meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer);
|
|
|
|
|
2015-10-21 10:36:44 -04:00
|
|
|
void meta_wayland_surface_cursor_update (MetaWaylandSurface *cursor_surface);
|
|
|
|
|
|
|
|
void meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer);
|
|
|
|
|
2014-04-22 18:09:38 -04:00
|
|
|
#endif /* META_WAYLAND_POINTER_H */
|