summaryrefslogtreecommitdiffstats
path: root/backend/autodim.h
blob: 515c9ecb8aed56b5cd2c6c97e25e88e416091eb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef BACKEND_AUTODIM_H_
#define BACKEND_AUTODIM_H_

#include "backlight.h"
#include "timer.h"
#include "conf.h"


struct autodim_step {
	unsigned int second;
	unsigned int percent;
};

struct autodim {
	struct backlight *bl;
	int *fds;
	unsigned int nr_fds;
	struct sleeptimer timer;

	int suspended;
	unsigned int state;
	unsigned int bl_percent;
	unsigned int max_percent;
	struct autodim_step *steps;
	unsigned int nr_allocated_steps;
	unsigned int nr_steps;
};

struct autodim * autodim_alloc(void);
int autodim_init(struct autodim *ad, struct backlight *bl,
		 struct config_file *config);

void autodim_destroy(struct autodim *ad);
void autodim_free(struct autodim *ad);

void autodim_suspend(struct autodim *ad);
void autodim_resume(struct autodim *ad);

void autodim_set_max_percent(struct autodim *ad, int max_percent);

void autodim_handle_input_event(struct autodim *ad);
void autodim_handle_battery_event(struct autodim *ad);

#endif /* BACKEND_AUTODIM_H_ */
bues.ch cgit interface