| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "list.h" |
| 5 |
#include "logind-forward.h" |
| 6 |
|
| 7 |
typedef struct Seat { |
| 8 |
Manager *manager; |
| 9 |
char *id; |
| 10 |
|
| 11 |
char *state_file; |
| 12 |
|
| 13 |
LIST_HEAD(Device, devices); |
| 14 |
|
| 15 |
Set *uevents; |
| 16 |
|
| 17 |
Session *active; |
| 18 |
Session *pending_switch; |
| 19 |
LIST_HEAD(Session, sessions); |
| 20 |
|
| 21 |
Session **positions; |
| 22 |
|
| 23 |
bool in_gc_queue:1; |
| 24 |
bool started:1; |
| 25 |
|
| 26 |
LIST_FIELDS(Seat, gc_queue); |
| 27 |
} Seat; |
| 28 |
|
| 29 |
int seat_new(Manager *m, const char *id, Seat **ret); |
| 30 |
Seat* seat_free(Seat *s); |
| 31 |
|
| 32 |
DEFINE_TRIVIAL_CLEANUP_FUNC(Seat*, seat_free); |
| 33 |
|
| 34 |
int seat_save(Seat *s); |
| 35 |
int seat_load(Seat *s); |
| 36 |
|
| 37 |
int manager_process_device_triggered_by_seat(Manager *m, sd_device *dev); |
| 38 |
|
| 39 |
int seat_set_active(Seat *s, Session *session); |
| 40 |
int seat_switch_to(Seat *s, unsigned num); |
| 41 |
int seat_switch_to_next(Seat *s); |
| 42 |
int seat_switch_to_previous(Seat *s); |
| 43 |
int seat_active_vt_changed(Seat *s, unsigned vtnr); |
| 44 |
int seat_read_active_vt(Seat *s); |
| 45 |
int seat_preallocate_vts(Seat *s); |
| 46 |
|
| 47 |
int seat_attach_session(Seat *s, Session *session); |
| 48 |
void seat_complete_switch(Seat *s); |
| 49 |
void seat_evict_position(Seat *s, Session *session); |
| 50 |
void seat_claim_position(Seat *s, Session *session, unsigned pos); |
| 51 |
|
| 52 |
bool seat_has_vts(Seat *s); |
| 53 |
bool seat_is_seat0(Seat *s); |
| 54 |
bool seat_can_tty(Seat *s); |
| 55 |
bool seat_has_master_device(Seat *s); |
| 56 |
bool seat_can_graphical(Seat *s); |
| 57 |
|
| 58 |
bool seat_get_idle_hint(Seat *s, dual_timestamp *ret_timestamp); |
| 59 |
|
| 60 |
int seat_start(Seat *s); |
| 61 |
int seat_stop(Seat *s, bool force); |
| 62 |
int seat_stop_sessions(Seat *s, bool force); |
| 63 |
|
| 64 |
bool seat_may_gc(Seat *s, bool drop_not_started); |
| 65 |
void seat_add_to_gc_queue(Seat *s); |
| 66 |
|
| 67 |
int seat_build_json(Seat *s, sd_json_variant **ret); |
| 68 |
|
| 69 |
bool seat_name_is_valid(const char *name); |
| 70 |
bool seat_is_self(const char *name); |
| 71 |
bool seat_is_auto(const char *name); |