]>
Commit | Line | Data |
---|---|---|
c2f1db8f | 1 | #pragma once |
90821c93 LP |
2 | |
3 | /*** | |
4 | This file is part of systemd. | |
5 | ||
6 | Copyright 2011 Lennart Poettering | |
7 | ||
8 | systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
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 | |
90821c93 LP |
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 | |
5430f7f2 | 16 | Lesser General Public License for more details. |
90821c93 | 17 | |
5430f7f2 | 18 | You should have received a copy of the GNU Lesser General Public License |
90821c93 LP |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
20 | ***/ | |
21 | ||
22 | typedef struct Seat Seat; | |
23 | ||
24 | #include "list.h" | |
90821c93 LP |
25 | #include "logind-session.h" |
26 | ||
27 | struct Seat { | |
28 | Manager *manager; | |
29 | char *id; | |
30 | ||
31 | char *state_file; | |
32 | ||
33 | LIST_HEAD(Device, devices); | |
34 | ||
35 | Session *active; | |
d7bd01b5 | 36 | Session *pending_switch; |
90821c93 | 37 | LIST_HEAD(Session, sessions); |
14c3baca | 38 | |
49e6fdbf DH |
39 | Session **positions; |
40 | size_t position_count; | |
41 | ||
14c3baca | 42 | bool in_gc_queue:1; |
3f49d45a | 43 | bool started:1; |
14c3baca LP |
44 | |
45 | LIST_FIELDS(Seat, gc_queue); | |
90821c93 LP |
46 | }; |
47 | ||
48 | Seat *seat_new(Manager *m, const char *id); | |
49 | void seat_free(Seat *s); | |
14c3baca | 50 | |
90821c93 LP |
51 | int seat_save(Seat *s); |
52 | int seat_load(Seat *s); | |
53 | ||
14c3baca | 54 | int seat_apply_acls(Seat *s, Session *old_active); |
9418f147 | 55 | int seat_set_active(Seat *s, Session *session); |
49e6fdbf DH |
56 | int seat_switch_to(Seat *s, unsigned int num); |
57 | int seat_switch_to_next(Seat *s); | |
58 | int seat_switch_to_previous(Seat *s); | |
92bd5ff3 | 59 | int seat_active_vt_changed(Seat *s, unsigned int vtnr); |
14c3baca | 60 | int seat_read_active_vt(Seat *s); |
30ed21ce | 61 | int seat_preallocate_vts(Seat *s); |
14c3baca | 62 | |
a185c5aa | 63 | int seat_attach_session(Seat *s, Session *session); |
d7bd01b5 | 64 | void seat_complete_switch(Seat *s); |
49e6fdbf DH |
65 | void seat_evict_position(Seat *s, Session *session); |
66 | void seat_claim_position(Seat *s, Session *session, unsigned int pos); | |
a185c5aa | 67 | |
bf7825ae | 68 | bool seat_has_vts(Seat *s); |
92432fcc | 69 | bool seat_is_seat0(Seat *s); |
addedec4 | 70 | bool seat_can_multi_session(Seat *s); |
f1a8e221 | 71 | bool seat_can_tty(Seat *s); |
718d006a | 72 | bool seat_has_master_device(Seat *s); |
f1a8e221 LP |
73 | bool seat_can_graphical(Seat *s); |
74 | ||
a185c5aa LP |
75 | int seat_get_idle_hint(Seat *s, dual_timestamp *t); |
76 | ||
14c3baca | 77 | int seat_start(Seat *s); |
9bb69af4 ZJS |
78 | int seat_stop(Seat *s, bool force); |
79 | int seat_stop_sessions(Seat *s, bool force); | |
14c3baca | 80 | |
cc377381 | 81 | bool seat_check_gc(Seat *s, bool drop_not_started); |
14c3baca LP |
82 | void seat_add_to_gc_queue(Seat *s); |
83 | ||
3f49d45a | 84 | bool seat_name_is_valid(const char *name); |
3f49d45a | 85 | |
cc377381 LP |
86 | extern const sd_bus_vtable seat_vtable[]; |
87 | ||
f00c3121 LP |
88 | int seat_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error); |
89 | int seat_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error); | |
cc377381 | 90 | char *seat_bus_path(Seat *s); |
3f49d45a | 91 | |
da119395 | 92 | int seat_send_signal(Seat *s, bool new_seat); |
cc377381 | 93 | int seat_send_changed(Seat *s, const char *properties, ...) _sentinel_; |
c529695e | 94 | |
19070062 | 95 | int bus_seat_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error); |