GCC Code Coverage Report


Directory: ./
File: server/selection_device_manager_p.h
Date: 2024-01-22 17:25:27
Exec Total Coverage
Lines: 7 7 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*
2 SPDX-FileCopyrightText: 2020 Roman Gilg <subdiff@gmail.com>
3 SPDX-FileCopyrightText: 2021 Francesco Sorrentino <francesco.sorr@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only
6 */
7 #pragma once
8
9 #include "seat.h"
10 #include "seat_p.h"
11 #include "wayland/bind.h"
12 #include "wayland/global.h"
13
14 #include <wayland-server.h>
15
16 namespace Wrapland::Server
17 {
18
19 template<typename Global>
20 class device_manager : public Global
21 {
22 public:
23 using Bind = Wayland::Bind<Global>;
24
25 using Global::Global;
26
27 static void get_device(Bind* bind, uint32_t id, wl_resource* wlSeat);
28 static void create_source(Bind* bind, uint32_t id);
29 };
30
31 template<typename Global>
32 42 void device_manager<Global>::get_device(Bind* bind, uint32_t id, wl_resource* wlSeat)
33 {
34 42 auto seat = SeatGlobal::get_handle(wlSeat);
35 42 bind->global()->handle->get_device(bind->client->handle, bind->version, id, seat);
36 42 }
37
38 template<typename Global>
39 44 void device_manager<Global>::create_source(Bind* bind, uint32_t id)
40 {
41 44 bind->global()->handle->create_source(bind->client->handle, bind->version, id);
42 44 }
43
44 }
45