chiark / gitweb /
tree-wide: drop 'This file is part of systemd' blurb
[elogind.git] / src / login / logind-inhibit.h
index 6364b00586a22ece7a253822c463dc16265c29e8..bf39955e102fb9fe423574ac57c66cbcd3714142 100644 (file)
@@ -1,39 +1,21 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
-#ifndef foologindinhibithfoo
-#define foologindinhibithfoo
+/* SPDX-License-Identifier: LGPL-2.1+ */
+#pragma once
 
 /***
-  This file is part of systemd.
-
   Copyright 2012 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
 typedef struct Inhibitor Inhibitor;
 
-#include "list.h"
-#include "util.h"
-#include "logind.h"
-#include "logind-seat.h"
-
 typedef enum InhibitWhat {
         INHIBIT_SHUTDOWN = 1,
         INHIBIT_SLEEP = 2,
         INHIBIT_IDLE = 4,
-        _INHIBIT_WHAT_MAX = 8,
+        INHIBIT_HANDLE_POWER_KEY = 8,
+        INHIBIT_HANDLE_SUSPEND_KEY = 16,
+        INHIBIT_HANDLE_HIBERNATE_KEY = 32,
+        INHIBIT_HANDLE_LID_SWITCH = 64,
+        _INHIBIT_WHAT_MAX = 128,
         _INHIBIT_WHAT_INVALID = -1
 } InhibitWhat;
 
@@ -44,9 +26,13 @@ typedef enum InhibitMode {
         _INHIBIT_MODE_INVALID = -1
 } InhibitMode;
 
+#include "logind.h"
+
 struct Inhibitor {
         Manager *manager;
 
+        sd_event_source *event_source;
+
         char *id;
         char *state_file;
 
@@ -79,12 +65,10 @@ int inhibitor_create_fifo(Inhibitor *i);
 void inhibitor_remove_fifo(Inhibitor *i);
 
 InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm);
-bool manager_is_inhibited(Manager *m, InhibitWhat w, InhibitMode mm, dual_timestamp *since);
+bool manager_is_inhibited(Manager *m, InhibitWhat w, InhibitMode mm, dual_timestamp *since, bool ignore_inactive, bool ignore_uid, uid_t uid, Inhibitor **offending);
 
 const char *inhibit_what_to_string(InhibitWhat k);
 InhibitWhat inhibit_what_from_string(const char *s);
 
 const char *inhibit_mode_to_string(InhibitMode k);
 InhibitMode inhibit_mode_from_string(const char *s);
-
-#endif