]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/login/logind-seat.h
Merge pull request #12753 from jrouleau/fix/hibernate-resume-timeout
[thirdparty/systemd.git] / src / login / logind-seat.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
c2f1db8f 2#pragma once
90821c93 3
90821c93
LP
4typedef struct Seat Seat;
5
6#include "list.h"
90821c93
LP
7#include "logind-session.h"
8
9struct Seat {
10 Manager *manager;
11 char *id;
12
13 char *state_file;
14
15 LIST_HEAD(Device, devices);
16
17 Session *active;
d7bd01b5 18 Session *pending_switch;
90821c93 19 LIST_HEAD(Session, sessions);
14c3baca 20
49e6fdbf
DH
21 Session **positions;
22 size_t position_count;
23
14c3baca 24 bool in_gc_queue:1;
3f49d45a 25 bool started:1;
14c3baca
LP
26
27 LIST_FIELDS(Seat, gc_queue);
90821c93
LP
28};
29
8c29a457
LP
30int seat_new(Seat **ret, Manager *m, const char *id);
31Seat* seat_free(Seat *s);
32
33DEFINE_TRIVIAL_CLEANUP_FUNC(Seat *, seat_free);
14c3baca 34
90821c93
LP
35int seat_save(Seat *s);
36int seat_load(Seat *s);
37
14c3baca 38int seat_apply_acls(Seat *s, Session *old_active);
9418f147 39int seat_set_active(Seat *s, Session *session);
14cb109d 40int seat_switch_to(Seat *s, unsigned num);
49e6fdbf
DH
41int seat_switch_to_next(Seat *s);
42int seat_switch_to_previous(Seat *s);
14cb109d 43int seat_active_vt_changed(Seat *s, unsigned vtnr);
14c3baca 44int seat_read_active_vt(Seat *s);
30ed21ce 45int seat_preallocate_vts(Seat *s);
14c3baca 46
a185c5aa 47int seat_attach_session(Seat *s, Session *session);
d7bd01b5 48void seat_complete_switch(Seat *s);
49e6fdbf 49void seat_evict_position(Seat *s, Session *session);
14cb109d 50void seat_claim_position(Seat *s, Session *session, unsigned pos);
a185c5aa 51
bf7825ae 52bool seat_has_vts(Seat *s);
92432fcc 53bool seat_is_seat0(Seat *s);
addedec4 54bool seat_can_multi_session(Seat *s);
f1a8e221 55bool seat_can_tty(Seat *s);
718d006a 56bool seat_has_master_device(Seat *s);
f1a8e221
LP
57bool seat_can_graphical(Seat *s);
58
a185c5aa
LP
59int seat_get_idle_hint(Seat *s, dual_timestamp *t);
60
14c3baca 61int seat_start(Seat *s);
9bb69af4
ZJS
62int seat_stop(Seat *s, bool force);
63int seat_stop_sessions(Seat *s, bool force);
14c3baca 64
5c093a23 65bool seat_may_gc(Seat *s, bool drop_not_started);
14c3baca
LP
66void seat_add_to_gc_queue(Seat *s);
67
3f49d45a 68bool seat_name_is_valid(const char *name);
3f49d45a 69
3b92c086
LP
70static inline bool SEAT_IS_SELF(const char *name) {
71 return isempty(name) || streq(name, "self");
72}
73
74static inline bool SEAT_IS_AUTO(const char *name) {
75 return streq_ptr(name, "auto");
76}