X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind.h;h=d1fabf5aa7f7905d78183a6df2cf0c0f73a92161;hb=d8a143df482f72fcbd408ffaef5c34aea6cdd655;hp=0344acc8bd513845b45ca6c4c4c85165178f389d;hpb=2d62c530d2b4c2730abff715b7342f1402114513;p=elogind.git diff --git a/src/login/logind.h b/src/login/logind.h index 0344acc8b..d1fabf5aa 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -22,12 +22,10 @@ ***/ #include -#include #include #include "sd-event.h" #include "sd-bus.h" -#include "util.h" #include "list.h" #include "hashmap.h" #include "set.h" @@ -35,9 +33,6 @@ typedef struct Manager Manager; #include "logind-device.h" -#include "logind-seat.h" -#include "logind-session.h" -#include "logind-user.h" #include "logind-inhibit.h" #include "logind-button.h" #include "logind-action.h" @@ -70,11 +65,6 @@ struct Manager { int console_active_fd; - unsigned n_autovts; - - unsigned reserve_vt; - int reserve_vt_fd; - Seat *seat0; char **kill_only_users, **kill_exclude_users; @@ -83,9 +73,6 @@ struct Manager { unsigned long session_counter; unsigned long inhibit_counter; - Hashmap *session_units; - Hashmap *user_units; - usec_t inhibit_delay_max; /* If an action is currently being executed or is delayed, @@ -93,13 +80,9 @@ struct Manager { InhibitWhat action_what; /* If a shutdown/suspend was delayed due to a inhibitor this - contains the unit name we are supposed to start after the + contains the action we are supposed to perform after the delay is over */ - const char *action_unit; - - /* If a shutdown/suspend is currently executed, then this is - * the job of it */ - char *action_job; + HandleAction pending_action; usec_t action_timestamp; sd_event_source *idle_action_event_source; @@ -111,13 +94,21 @@ struct Manager { HandleAction handle_suspend_key; HandleAction handle_hibernate_key; HandleAction handle_lid_switch; + HandleAction handle_lid_switch_docked; bool power_key_ignore_inhibited; bool suspend_key_ignore_inhibited; bool hibernate_key_ignore_inhibited; bool lid_switch_ignore_inhibited; + bool remove_ipc; + Hashmap *polkit_registry; + + usec_t holdoff_timeout_usec; + sd_event_source *lid_switch_ignore_event_source; + + size_t runtime_dir_size; }; Manager *manager_new(void); @@ -137,7 +128,6 @@ int manager_process_button_device(Manager *m, struct udev_device *d); int manager_startup(Manager *m); int manager_run(Manager *m); -int manager_spawn_autovt(Manager *m, unsigned int vtnr); void manager_gc(Manager *m, bool drop_not_started); @@ -148,17 +138,11 @@ int manager_get_idle_hint(Manager *m, dual_timestamp *t); int manager_get_user_by_pid(Manager *m, pid_t pid, User **user); int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session); -bool manager_is_docked(Manager *m); +bool manager_is_docked_or_external_displays(Manager *m); extern const sd_bus_vtable manager_vtable[]; -int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_unit_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_properties_changed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_reloading(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); -int match_name_owner_changed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error); - -int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, const char *unit_name, InhibitWhat w, sd_bus_error *error); +int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, HandleAction action, InhibitWhat w, sd_bus_error *error); int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_; @@ -177,3 +161,14 @@ const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned lengt int manager_watch_busname(Manager *manager, const char *name); void manager_drop_busname(Manager *manager, const char *name); + +int manager_set_lid_switch_ignore(Manager *m, usec_t until); + +int config_parse_tmpfs_size(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + +int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret); +int manager_get_user_from_creds(Manager *m, sd_bus_message *message, uid_t uid, sd_bus_error *error, User **ret); +int manager_get_seat_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Seat **ret); + + +int manager_dispatch_delayed(Manager *manager, bool timeout); \ No newline at end of file