summaryrefslogtreecommitdiff
path: root/src/wayland/meta-wayland-tablet-seat.h
blob: e8b5a2439e7896ebb9c759318bffb009970104ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * Wayland Support
 *
 * Copyright (C) 2015 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_TABLET_SEAT_H
#define META_WAYLAND_TABLET_SEAT_H

#include <glib.h>
#include <wayland-server.h>

#include "wayland/meta-wayland-types.h"

struct _MetaWaylandTabletSeat
{
  MetaWaylandTabletManager *manager;
  MetaWaylandSeat *seat;
  ClutterSeat *clutter_seat;
  struct wl_list resource_list;

  GHashTable *tablets;
  GHashTable *tools;
  GHashTable *pads;
};

MetaWaylandTabletSeat *meta_wayland_tablet_seat_new  (MetaWaylandTabletManager *tablet_manager,
                                                      MetaWaylandSeat          *seat);
void                   meta_wayland_tablet_seat_free (MetaWaylandTabletSeat    *tablet_seat);

struct wl_resource    *meta_wayland_tablet_seat_create_new_resource (MetaWaylandTabletSeat *tablet_seat,
                                                                     struct wl_client      *client,
                                                                     struct wl_resource    *seat_resource,
                                                                     uint32_t               id);
struct wl_resource    *meta_wayland_tablet_seat_lookup_resource     (MetaWaylandTabletSeat *tablet_seat,
                                                                     struct wl_client      *client);

MetaWaylandTablet     *meta_wayland_tablet_seat_lookup_tablet       (MetaWaylandTabletSeat *tablet_seat,
                                                                     ClutterInputDevice    *device);

MetaWaylandTabletTool *meta_wayland_tablet_seat_lookup_tool         (MetaWaylandTabletSeat  *tablet_seat,
                                                                     ClutterInputDeviceTool *tool);

MetaWaylandTabletPad  *meta_wayland_tablet_seat_lookup_pad          (MetaWaylandTabletSeat *tablet_seat,
                                                                     ClutterInputDevice    *device);

void                   meta_wayland_tablet_seat_update              (MetaWaylandTabletSeat *tablet_seat,
                                                                     const ClutterEvent    *event);
gboolean               meta_wayland_tablet_seat_handle_event        (MetaWaylandTabletSeat *tablet_seat,
                                                                     const ClutterEvent    *event);

void                   meta_wayland_tablet_seat_notify_tool         (MetaWaylandTabletSeat *tablet_seat,
                                                                     MetaWaylandTabletTool *tool,
                                                                     struct wl_client      *client);

void                   meta_wayland_tablet_seat_set_pad_focus       (MetaWaylandTabletSeat *tablet_seat,
                                                                     MetaWaylandSurface    *surface);

MetaWaylandTablet     *meta_wayland_tablet_seat_lookup_paired_tablet (MetaWaylandTabletSeat *tablet_seat,
                                                                      MetaWaylandTabletPad  *pad);
GList                 *meta_wayland_tablet_seat_lookup_paired_pads   (MetaWaylandTabletSeat *tablet_seat,
                                                                      MetaWaylandTablet     *tablet);
gboolean               meta_wayland_tablet_seat_can_popup            (MetaWaylandTabletSeat *tablet_seat,
                                                                      uint32_t               serial);

#endif /* META_WAYLAND_TABLET_SEAT_H */