chiark / gitweb /
Major cleanup of all leftovers after rebasing on master.
[elogind.git] / src / login / logind.h
index a74a3e4835acfc9f27c7d08afc426e8660b01d0a..4783ea3b2106dc1d77222eca1f47638b07dc1a2d 100644 (file)
@@ -78,10 +78,13 @@ struct Manager {
 
         int console_active_fd;
 
 
         int console_active_fd;
 
+/// elogind does not support autospawning of vts
+#if 0
         unsigned n_autovts;
 
         unsigned reserve_vt;
         int reserve_vt_fd;
         unsigned n_autovts;
 
         unsigned reserve_vt;
         int reserve_vt_fd;
+#endif // 0
 
         Seat *seat0;
 
 
         Seat *seat0;
 
@@ -100,6 +103,8 @@ struct Manager {
          * this is != 0 and encodes what is being done */
         InhibitWhat action_what;
 
          * this is != 0 and encodes what is being done */
         InhibitWhat action_what;
 
+/// elogind does all relevant actions on its own. No systemd jobs and units.
+#if 0
         /* If a shutdown/suspend was delayed due to a inhibitor this
            contains the unit name we are supposed to start after the
            delay is over */
         /* If a shutdown/suspend was delayed due to a inhibitor this
            contains the unit name we are supposed to start after the
            delay is over */
@@ -108,6 +113,13 @@ struct Manager {
         /* If a shutdown/suspend is currently executed, then this is
          * the job of it */
         char *action_job;
         /* If a shutdown/suspend is currently executed, then this is
          * the job of it */
         char *action_job;
+#else
+        /* If a shutdown/suspend was delayed due to a inhibitor this
+           contains the action we are supposed to perform after the
+           delay is over */
+        HandleAction pending_action;
+#endif // 0
+
         sd_event_source *inhibit_timeout_source;
 
         char *scheduled_shutdown_type;
         sd_event_source *inhibit_timeout_source;
 
         char *scheduled_shutdown_type;
@@ -140,6 +152,10 @@ struct Manager {
 
         bool remove_ipc;
 
 
         bool remove_ipc;
 
+        char **suspend_state,      **suspend_mode;
+        char **hibernate_state,    **hibernate_mode;
+        char **hybrid_sleep_state, **hybrid_sleep_mode;
+
         Hashmap *polkit_registry;
 
         usec_t holdoff_timeout_usec;
         Hashmap *polkit_registry;
 
         usec_t holdoff_timeout_usec;
@@ -160,7 +176,7 @@ int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **_inhibitor);
 int manager_process_seat_device(Manager *m, struct udev_device *d);
 int manager_process_button_device(Manager *m, struct udev_device *d);
 
 int manager_process_seat_device(Manager *m, struct udev_device *d);
 int manager_process_button_device(Manager *m, struct udev_device *d);
 
-int manager_spawn_autovt(Manager *m, unsigned int vtnr);
+// UNNEEDED int manager_spawn_autovt(Manager *m, unsigned int vtnr);
 
 bool manager_shall_kill(Manager *m, const char *user);
 
 
 bool manager_shall_kill(Manager *m, const char *user);
 
@@ -169,19 +185,22 @@ 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);
 
 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);
-int manager_count_displays(Manager *m);
-bool manager_is_docked_or_multiple_displays(Manager *m);
+bool manager_is_docked_or_external_displays(Manager *m);
 
 extern const sd_bus_vtable manager_vtable[];
 
 
 extern const sd_bus_vtable manager_vtable[];
 
-int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
-int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
-int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error);
-int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error);
-int match_name_owner_changed(sd_bus_message *message, void *userdata, sd_bus_error *error);
+// UNNEEDED int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
+// UNNEEDED int match_unit_removed(sd_bus_message *message, void *userdata, sd_bus_error *error);
+// UNNEEDED int match_properties_changed(sd_bus_message *message, void *userdata, sd_bus_error *error);
+// UNNEEDED int match_reloading(sd_bus_message *message, void *userdata, sd_bus_error *error);
+// UNNEEDED int match_name_owner_changed(sd_bus_message *message, void *userdata, sd_bus_error *error);
 
 
+/// eloginds own version does the action itself
+#if 0
 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, const char *unit_name, InhibitWhat w, sd_bus_error *error);
+#else
+int bus_manager_shutdown_or_sleep_now_or_later(Manager *m, HandleAction action, InhibitWhat w, sd_bus_error *error);
+#endif // 0
 
 int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_;
 
 
 int manager_send_changed(Manager *manager, const char *property, ...) _sentinel_;
 
@@ -206,3 +225,5 @@ int manager_get_seat_from_creds(Manager *m, sd_bus_message *message, const char
 
 int manager_setup_wall_message_timer(Manager *m);
 bool logind_wall_tty_filter(const char *tty, void *userdata);
 
 int manager_setup_wall_message_timer(Manager *m);
 bool logind_wall_tty_filter(const char *tty, void *userdata);
+
+int manager_dispatch_delayed(Manager *manager, bool timeout);