rewrite: update default dumb and smart prefixes
[elinks/elinks-j605.git] / src / bfu / leds.h
blob4ed6c65f87f8692c71bb58c03758efba96fd29be
1 #ifndef EL__BFU_LEDS_H
2 #define EL__BFU_LEDS_H
4 #ifdef CONFIG_LEDS
6 #include "main/module.h"
7 #include "util/color.h"
9 struct session;
10 struct terminal;
12 /* TODO: Variable count! */
13 #define LEDS_COUNT 6
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.
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. */
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;
32 /* Per-session led panel structure. */
33 struct led_panel {
34 struct led leds[LEDS_COUNT];
38 extern struct module leds_module;
40 void init_led_panel(struct led_panel *leds);
42 void draw_leds(struct session *ses);
44 void menu_leds_info(struct terminal *term, void *xxx, void *xxxx);
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 unsigned char get_led_value(struct led *led);
50 void unset_led_value(struct led *led);
52 #endif
53 #endif