autodim.h 974 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef BACKEND_AUTODIM_H_
  2. #define BACKEND_AUTODIM_H_
  3. #include "backlight.h"
  4. #include "timer.h"
  5. #include "conf.h"
  6. struct autodim_step {
  7. unsigned int second;
  8. unsigned int percent;
  9. };
  10. struct autodim {
  11. struct backlight *bl;
  12. int *fds;
  13. unsigned int nr_fds;
  14. struct sleeptimer timer;
  15. int suspended;
  16. unsigned int state;
  17. unsigned int bl_percent;
  18. unsigned int max_percent;
  19. struct autodim_step *steps;
  20. unsigned int nr_allocated_steps;
  21. unsigned int nr_steps;
  22. };
  23. struct autodim * autodim_alloc(void);
  24. int autodim_init(struct autodim *ad, struct backlight *bl,
  25. struct config_file *config);
  26. void autodim_destroy(struct autodim *ad);
  27. void autodim_free(struct autodim *ad);
  28. void autodim_suspend(struct autodim *ad);
  29. void autodim_resume(struct autodim *ad);
  30. void autodim_set_max_percent(struct autodim *ad, int max_percent);
  31. void autodim_handle_input_event(struct autodim *ad);
  32. void autodim_handle_battery_event(struct autodim *ad);
  33. #endif /* BACKEND_AUTODIM_H_ */