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