]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/login/logind-seat.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / login / logind-seat.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
c2f1db8f 2#pragma once
90821c93
LP
3
4/***
5 This file is part of systemd.
6
7 Copyright 2011 Lennart Poettering
8
9 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
90821c93
LP
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 17 Lesser General Public License for more details.
90821c93 18
5430f7f2 19 You should have received a copy of the GNU Lesser General Public License
90821c93
LP
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21***/
22
23typedef struct Seat Seat;
24
25#include "list.h"
90821c93
LP
26#include "logind-session.h"
27
28struct Seat {
29 Manager *manager;
30 char *id;
31
32 char *state_file;
33
34 LIST_HEAD(Device, devices);
35
36 Session *active;
d7bd01b5 37 Session *pending_switch;
90821c93 38 LIST_HEAD(Session, sessions);
14c3baca 39
49e6fdbf
DH
40 Session **positions;
41 size_t position_count;
42
14c3baca 43 bool in_gc_queue:1;
3f49d45a 44 bool started:1;
14c3baca
LP
45
46 LIST_FIELDS(Seat, gc_queue);
90821c93
LP
47};
48
49Seat *seat_new(Manager *m, const char *id);
50void seat_free(Seat *s);
14c3baca 51
90821c93
LP
52int seat_save(Seat *s);
53int seat_load(Seat *s);
54
14c3baca 55int seat_apply_acls(Seat *s, Session *old_active);
9418f147 56int seat_set_active(Seat *s, Session *session);
49e6fdbf
DH
57int seat_switch_to(Seat *s, unsigned int num);
58int seat_switch_to_next(Seat *s);
59int seat_switch_to_previous(Seat *s);
92bd5ff3 60int seat_active_vt_changed(Seat *s, unsigned int vtnr);
14c3baca 61int seat_read_active_vt(Seat *s);
30ed21ce 62int seat_preallocate_vts(Seat *s);
14c3baca 63
a185c5aa 64int seat_attach_session(Seat *s, Session *session);
d7bd01b5 65void seat_complete_switch(Seat *s);
49e6fdbf
DH
66void seat_evict_position(Seat *s, Session *session);
67void seat_claim_position(Seat *s, Session *session, unsigned int pos);
a185c5aa 68
bf7825ae 69bool seat_has_vts(Seat *s);
92432fcc 70bool seat_is_seat0(Seat *s);
addedec4 71bool seat_can_multi_session(Seat *s);
f1a8e221 72bool seat_can_tty(Seat *s);
718d006a 73bool seat_has_master_device(Seat *s);
f1a8e221
LP
74bool seat_can_graphical(Seat *s);
75
a185c5aa
LP
76int seat_get_idle_hint(Seat *s, dual_timestamp *t);
77
14c3baca 78int seat_start(Seat *s);
9bb69af4
ZJS
79int seat_stop(Seat *s, bool force);
80int seat_stop_sessions(Seat *s, bool force);
14c3baca 81
cc377381 82bool seat_check_gc(Seat *s, bool drop_not_started);
14c3baca
LP
83void seat_add_to_gc_queue(Seat *s);
84
3f49d45a 85bool seat_name_is_valid(const char *name);
3f49d45a 86
cc377381
LP
87extern const sd_bus_vtable seat_vtable[];
88
f00c3121
LP
89int seat_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
90int seat_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
cc377381 91char *seat_bus_path(Seat *s);
3f49d45a 92
da119395 93int seat_send_signal(Seat *s, bool new_seat);
cc377381 94int seat_send_changed(Seat *s, const char *properties, ...) _sentinel_;
c529695e 95
19070062 96int bus_seat_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error);