summaryrefslogtreecommitdiff
path: root/src/ck-inhibit.h
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2014-10-13 19:57:21 +0300
committerEric Koegel <eric.koegel@gmail.com>2014-10-13 19:57:21 +0300
commitd04e8e60fa428e2871ee07bbb3ffbf329417c5c0 (patch)
tree2634617119ffcf78cfff3de92584ac92e9eccf83 /src/ck-inhibit.h
parentb65cb6f48bfa768acafdb7b6dcee32f600925688 (diff)
downloadConsoleKit2-d04e8e60fa428e2871ee07bbb3ffbf329417c5c0.tar.gz
Start working on the inhibit files
Might need an inhibit manager at some point in the future to track all these locks and prevent duplicates. We'll see how complex it needs to be.
Diffstat (limited to 'src/ck-inhibit.h')
-rw-r--r--src/ck-inhibit.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/ck-inhibit.h b/src/ck-inhibit.h
new file mode 100644
index 0000000..c2e6191
--- /dev/null
+++ b/src/ck-inhibit.h
@@ -0,0 +1,78 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2014 Eric Koegel <eric.koegel@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __CK_INHIBIT_H
+#define __CK_INHIBIT_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define CK_TYPE_INHIBIT (ck_inhibit_get_type ())
+#define CK_INHIBIT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CK_TYPE_INHIBIT, CkInhibit))
+#define CK_INHIBIT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CK_TYPE_INHIBIT, CkInhibitClass))
+#define CK_IS_INHIBIT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CK_TYPE_INHIBIT))
+#define CK_IS_INHIBIT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CK_TYPE_INHIBIT))
+#define CK_INHIBIT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CK_TYPE_INHIBIT, CkInhibitClass))
+
+typedef struct CkInhibitPrivate CkInhibitPrivate;
+
+typedef struct
+{
+ GObject parent;
+ CkInhibitPrivate *priv;
+} CkInhibit;
+
+typedef struct
+{
+ GObjectClass parent_class;
+} CkInhibitClass;
+
+typedef enum
+{
+ CK_INHIBIT_EVENT_SHUTDOWN = 1,
+ CK_INHIBIT_EVENT_SUSPEND,
+ CK_INHIBIT_EVENT_IDLE,
+ CK_INHIBIT_EVENT_POWER_KEY,
+ CK_INHIBIT_EVENT_SUSPEND_KEY,
+ CK_INHIBIT_EVENT_HIBERNATE_KEY,
+ CK_INHIBIT_EVENT_LAST
+} CkInhibitEvent;
+
+typedef enum
+{
+ CK_INHIBIT_ERROR_NO_ERROR = 1,
+ CK_INHIBIT_ERROR_GENERAL = -10,
+ CK_INHIBIT_ERROR_INVALID_INPUT = -20,
+ CK_INHIBIT_ERROR_OOM = -30,
+} CkInhbitError;
+
+
+GType ck_inhibit_get_type (void);
+
+CkInhibit *ck_create_inhibit_lock (CkManager *manager,
+ CkInhibit *inhibit,
+ const gchar *who,
+ const gchar *what,
+ const gchar *why);
+
+G_END_DECLS
+
+#endif /* __CK_INHIBIT_H */