2014-04-24 08:50:47 -04:00
|
|
|
/*
|
|
|
|
* Wayland Support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Red Hat
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*
|
|
|
|
* Author: Carlos Garnacho <carlosg@gnome.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef META_WAYLAND_TOUCH_H
|
|
|
|
#define META_WAYLAND_TOUCH_H
|
|
|
|
|
|
|
|
#include <glib.h>
|
2018-07-10 04:36:24 -04:00
|
|
|
#include <wayland-server.h>
|
2014-04-24 08:50:47 -04:00
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "wayland/meta-wayland-types.h"
|
2014-04-24 08:50:47 -04:00
|
|
|
|
2016-04-01 04:39:30 -04:00
|
|
|
#define META_TYPE_WAYLAND_TOUCH (meta_wayland_touch_get_type ())
|
|
|
|
G_DECLARE_FINAL_TYPE (MetaWaylandTouch, meta_wayland_touch,
|
|
|
|
META, WAYLAND_TOUCH,
|
2016-09-12 11:17:28 -04:00
|
|
|
MetaWaylandInputDevice)
|
2016-04-01 04:39:30 -04:00
|
|
|
|
2014-04-24 08:50:47 -04:00
|
|
|
typedef struct _MetaWaylandTouchSurface MetaWaylandTouchSurface;
|
|
|
|
typedef struct _MetaWaylandTouchInfo MetaWaylandTouchInfo;
|
|
|
|
|
|
|
|
struct _MetaWaylandTouch
|
|
|
|
{
|
2016-09-12 11:17:28 -04:00
|
|
|
MetaWaylandInputDevice parent;
|
2016-04-01 04:39:30 -04:00
|
|
|
|
2014-04-24 08:50:47 -04:00
|
|
|
struct wl_list resource_list;
|
|
|
|
|
|
|
|
GHashTable *touch_surfaces; /* HT of MetaWaylandSurface->MetaWaylandTouchSurface */
|
|
|
|
GHashTable *touches; /* HT of sequence->MetaWaylandTouchInfo */
|
|
|
|
|
|
|
|
guint64 frame_slots;
|
|
|
|
};
|
|
|
|
|
2016-09-12 11:20:36 -04:00
|
|
|
void meta_wayland_touch_enable (MetaWaylandTouch *touch);
|
2014-04-24 08:50:47 -04:00
|
|
|
|
2016-04-01 04:39:30 -04:00
|
|
|
void meta_wayland_touch_disable (MetaWaylandTouch *touch);
|
2014-04-24 08:50:47 -04:00
|
|
|
|
|
|
|
void meta_wayland_touch_update (MetaWaylandTouch *touch,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
|
|
|
gboolean meta_wayland_touch_handle_event (MetaWaylandTouch *touch,
|
|
|
|
const ClutterEvent *event);
|
|
|
|
|
2014-06-11 15:57:45 -04:00
|
|
|
void meta_wayland_touch_create_new_resource (MetaWaylandTouch *touch,
|
|
|
|
struct wl_client *client,
|
|
|
|
struct wl_resource *seat_resource,
|
|
|
|
uint32_t id);
|
2014-06-19 16:15:32 -04:00
|
|
|
void meta_wayland_touch_cancel (MetaWaylandTouch *touch);
|
|
|
|
|
2014-06-11 15:57:45 -04:00
|
|
|
|
2014-07-21 19:28:39 -04:00
|
|
|
ClutterEventSequence * meta_wayland_touch_find_grab_sequence (MetaWaylandTouch *touch,
|
|
|
|
MetaWaylandSurface *surface,
|
|
|
|
uint32_t serial);
|
|
|
|
|
|
|
|
gboolean meta_wayland_touch_get_press_coords (MetaWaylandTouch *touch,
|
|
|
|
ClutterEventSequence *sequence,
|
|
|
|
gfloat *x,
|
|
|
|
gfloat *y);
|
|
|
|
|
2015-10-09 10:42:06 -04:00
|
|
|
gboolean meta_wayland_touch_can_popup (MetaWaylandTouch *touch,
|
|
|
|
uint32_t serial);
|
|
|
|
|
2014-04-24 08:50:47 -04:00
|
|
|
#endif /* META_WAYLAND_TOUCH_H */
|