2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2013-11-18 16:58:43 +01:00
|
|
|
#pragma once
|
2012-05-30 15:07:19 +02:00
|
|
|
|
|
|
|
typedef struct Button Button;
|
|
|
|
|
|
|
|
#include "logind.h"
|
|
|
|
|
|
|
|
struct Button {
|
|
|
|
Manager *manager;
|
|
|
|
|
2014-02-21 21:10:00 +01:00
|
|
|
sd_event_source *io_event_source;
|
|
|
|
sd_event_source *check_event_source;
|
2013-11-05 01:10:21 +01:00
|
|
|
|
2012-05-30 15:07:19 +02:00
|
|
|
char *name;
|
|
|
|
char *seat;
|
|
|
|
int fd;
|
2012-09-19 15:42:29 +02:00
|
|
|
|
2014-02-21 21:10:00 +01:00
|
|
|
bool lid_closed;
|
2014-02-24 16:22:23 +01:00
|
|
|
bool docked;
|
2012-05-30 15:07:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
Button* button_new(Manager *m, const char *name);
|
2018-12-04 09:29:54 +01:00
|
|
|
void button_free(Button *b);
|
2012-05-30 15:07:19 +02:00
|
|
|
int button_open(Button *b);
|
|
|
|
int button_set_seat(Button *b, const char *sn);
|
2014-02-24 16:22:23 +01:00
|
|
|
int button_check_switches(Button *b);
|