1 #ifndef EL__BFU_LEDS_H
2 #define EL__BFU_LEDS_H
3 
4 #ifdef CONFIG_LEDS
5 
6 #include "main/module.h"
7 #include "util/color.h"
8 
9 struct session;
10 struct terminal;
11 
12 /* TODO: Variable count! */
13 #define LEDS_COUNT	6
14 
15 /* We use struct in order to at least somehow 'authorize' client to use certain
16  * LED, preventing possible mess i.e. with conflicting patches or Lua scripts.
17  */
18 
19 /* See header of bfu/leds.c for LEDs assignment. If you are planning to use
20  * some LED in your script/patch, please tell us on the list so that we can
21  * register the LED for you. Always check latest sources for actual LED
22  * assignment scheme in order to prevent conflicts. */
23 
24 struct led {
25 	/* Private data. */
26 	/* 32 bits */
27 	unsigned int used__:1;
28 	unsigned int value_changed__:1;
29 	unsigned int value__:8;
30 };
31 
32 /* Per-session led panel structure. */
33 struct led_panel {
34 	struct led leds[LEDS_COUNT];
35 };
36 
37 
38 extern struct module leds_module;
39 
40 void init_led_panel(struct led_panel *leds);
41 
42 void draw_leds(struct session *ses);
43 
44 void menu_leds_info(struct terminal *term, void *xxx, void *xxxx);
45 
46 struct led *register_led(struct session *ses, int number);
47 void unregister_led(struct led *);
48 void set_led_value(struct led *led, unsigned char value);
49 void unset_led_value(struct led *led);
50 
51 #endif
52 #endif
53