logind-button.h revision cc3773810855956bad92337cee8fa193584ab62e
ab4ab2edaac480f68b476dc19e015c54cd4f1978Lubos Kosco/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
ab4ab2edaac480f68b476dc19e015c54cd4f1978Lubos Kosco
b227f89b8c13b15a9372ce56713c024f7f73be35Lubos Kosco#ifndef foologindbuttonhfoo
ab4ab2edaac480f68b476dc19e015c54cd4f1978Lubos Kosco#define foologindbuttonhfoo
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen/***
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen This file is part of systemd.
551b849ce88d596dc52dda2f78229a932b339c78Lubos Kosco
551b849ce88d596dc52dda2f78229a932b339c78Lubos Kosco Copyright 2012 Lennart Poettering
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen
e7b21c8124ec55ffacc49c1e28a8685834715484Lubos Kosco systemd is free software; you can redistribute it and/or modify it
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye under the terms of the GNU Lesser General Public License as published by
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye the Free Software Foundation; either version 2.1 of the License, or
7224b1456affc41e89cf46eda1e0b74a044bcc93Lubos Kosco (at your option) any later version.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco systemd is distributed in the hope that it will be useful, but
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye WITHOUT ANY WARRANTY; without even the implied warranty of
bcae302a5f4b516d2f3c05f657df054e1a0efde7Knut Anders Hatlen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye Lesser General Public License for more details.
98774b0b90e4da0f3f2c5e4856bcbbf366ed0fe0Knut Anders Hatlen
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye You should have received a copy of the GNU Lesser General Public License
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye along with systemd; If not, see <http://www.gnu.org/licenses/>.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye***/
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
afb218f076cae538126a5f931299a82a114a075aKnut Anders Hatlentypedef struct Button Button;
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#include "list.h"
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#include "util.h"
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#include "logind.h"
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyestruct Button {
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye Manager *manager;
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye sd_event_source *event_source;
ab4ab2edaac480f68b476dc19e015c54cd4f1978Lubos Kosco
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye char *name;
9661674ed58ba62a40e43d1a4b38d5e77c3c6545Knut Anders Hatlen char *seat;
bbb39d08c0e5b73c89ba813a7c1789842c60f961Lubos Kosco int fd;
2ba599c0d79caf59996d8b54a0490bb968442134Knut Anders Hatlen
67b14513c549ae0027ba7590e736b3dd3281db7cLubos Kosco bool lid_close_queued;
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco};
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos KoscoButton* button_new(Manager *m, const char *name);
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Koscovoid button_free(Button*b);
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Koscoint button_open(Button *b);
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Koscoint button_recheck(Button *b);
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Koscoint button_set_seat(Button *b, const char *sn);
3dc379d98a11243103242e2b43b1ab1322795b7eLubos Kosco
6d7c6f82e644c205bc679ee5b1fa2929ec949963Lubos Kosco#endif
f9fd2b96d1c5ea62664f74da0e34a04b6511a8ffLubos Kosco