]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/login/logind-session-device.h
Merge pull request #2495 from heftig/master
[thirdparty/systemd.git] / src / login / logind-session-device.h
CommitLineData
118ecf32
DH
1#pragma once
2
3/***
4 This file is part of systemd.
5
6 Copyright 2013 David Herrmann
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
22typedef enum DeviceType DeviceType;
23typedef struct SessionDevice SessionDevice;
24
25#include "list.h"
118ecf32 26#include "logind.h"
118ecf32
DH
27
28enum DeviceType {
29 DEVICE_TYPE_UNKNOWN,
118ecf32
DH
30 DEVICE_TYPE_DRM,
31 DEVICE_TYPE_EVDEV,
32};
33
34struct SessionDevice {
35 Session *session;
36 Device *device;
37
38 dev_t dev;
39 char *node;
40 int fd;
41 bool active;
42 DeviceType type;
43
44 LIST_FIELDS(struct SessionDevice, sd_by_device);
45};
46
47int session_device_new(Session *s, dev_t dev, SessionDevice **out);
48void session_device_free(SessionDevice *sd);
49void session_device_complete_pause(SessionDevice *sd);
50
51void session_device_resume_all(Session *s);
52void session_device_pause_all(Session *s);
d7bd01b5 53unsigned int session_device_try_pause_all(Session *s);