1 /*
2  * Wayland Support
3  *
4  * Copyright (C) 2015 Red Hat
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Author: Carlos Garnacho <carlosg@gnome.org>
20  */
21 
22 #ifndef META_WAYLAND_TABLET_SEAT_H
23 #define META_WAYLAND_TABLET_SEAT_H
24 
25 #include <glib.h>
26 #include <wayland-server.h>
27 
28 #include "wayland/meta-wayland-types.h"
29 
30 struct _MetaWaylandTabletSeat
31 {
32   MetaWaylandTabletManager *manager;
33   MetaWaylandSeat *seat;
34   ClutterSeat *clutter_seat;
35   struct wl_list resource_list;
36 
37   GHashTable *tablets;
38   GHashTable *tools;
39   GHashTable *pads;
40 };
41 
42 MetaWaylandTabletSeat *meta_wayland_tablet_seat_new  (MetaWaylandTabletManager *tablet_manager,
43                                                       MetaWaylandSeat          *seat);
44 void                   meta_wayland_tablet_seat_free (MetaWaylandTabletSeat    *tablet_seat);
45 
46 struct wl_resource    *meta_wayland_tablet_seat_create_new_resource (MetaWaylandTabletSeat *tablet_seat,
47                                                                      struct wl_client      *client,
48                                                                      struct wl_resource    *seat_resource,
49                                                                      uint32_t               id);
50 struct wl_resource    *meta_wayland_tablet_seat_lookup_resource     (MetaWaylandTabletSeat *tablet_seat,
51                                                                      struct wl_client      *client);
52 
53 MetaWaylandTablet     *meta_wayland_tablet_seat_lookup_tablet       (MetaWaylandTabletSeat *tablet_seat,
54                                                                      ClutterInputDevice    *device);
55 
56 MetaWaylandTabletTool *meta_wayland_tablet_seat_lookup_tool         (MetaWaylandTabletSeat  *tablet_seat,
57                                                                      ClutterInputDeviceTool *tool);
58 
59 MetaWaylandTabletPad  *meta_wayland_tablet_seat_lookup_pad          (MetaWaylandTabletSeat *tablet_seat,
60                                                                      ClutterInputDevice    *device);
61 
62 void                   meta_wayland_tablet_seat_update              (MetaWaylandTabletSeat *tablet_seat,
63                                                                      const ClutterEvent    *event);
64 gboolean               meta_wayland_tablet_seat_handle_event        (MetaWaylandTabletSeat *tablet_seat,
65                                                                      const ClutterEvent    *event);
66 
67 void                   meta_wayland_tablet_seat_notify_tool         (MetaWaylandTabletSeat *tablet_seat,
68                                                                      MetaWaylandTabletTool *tool,
69                                                                      struct wl_client      *client);
70 
71 void                   meta_wayland_tablet_seat_set_pad_focus       (MetaWaylandTabletSeat *tablet_seat,
72                                                                      MetaWaylandSurface    *surface);
73 
74 MetaWaylandTablet     *meta_wayland_tablet_seat_lookup_paired_tablet (MetaWaylandTabletSeat *tablet_seat,
75                                                                       MetaWaylandTabletPad  *pad);
76 GList                 *meta_wayland_tablet_seat_lookup_paired_pads   (MetaWaylandTabletSeat *tablet_seat,
77                                                                       MetaWaylandTablet     *tablet);
78 gboolean               meta_wayland_tablet_seat_can_popup            (MetaWaylandTabletSeat *tablet_seat,
79                                                                       uint32_t               serial);
80 
81 #endif /* META_WAYLAND_TABLET_SEAT_H */
82