ELinks 0.18.0
leds.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "elinks.h"
#include "bfu/leds.h"
#include "config/options.h"
#include "document/document.h"
#include "document/view.h"
#include "intl/libintl.h"
#include "main/module.h"
#include "main/timer.h"
#include "osdep/osdep.h"
#include "session/session.h"
#include "terminal/draw.h"
#include "terminal/tab.h"
#include "terminal/terminal.h"
#include "terminal/window.h"
#include "util/color.h"
#include "util/error.h"
#include "viewer/timer.h"
Include dependency graph for leds.c:

Macros

#define get_opt_leds(which)   led_options[(which)].option.value
 
#define get_leds_clock_enable()   get_opt_leds(LEDS_CLOCK_ENABLE).number
 
#define get_leds_clock_format()   get_opt_leds(LEDS_CLOCK_FORMAT).string
 
#define get_leds_panel_enable()   get_opt_leds(LEDS_PANEL_ENABLE).number
 
#define get_leds_show_ip_enable()   get_opt_leds(LEDS_SHOW_IP_ENABLE).number
 
#define get_leds_show_mem_enable()   get_opt_leds(LEDS_SHOW_MEM_ENABLE).number
 
#define get_leds_temperature_enable()   get_opt_leds(LEDS_TEMPERATURE_ENABLE).number
 
#define get_leds_temperature_filename()   get_opt_leds(LEDS_TEMPERATURE_FILENAME).string
 

Enumerations

enum  led_option {
  LEDS_CLOCK_TREE , LEDS_CLOCK_ENABLE , LEDS_CLOCK_FORMAT , LEDS_CLOCK_ALIAS ,
  LEDS_SHOW_IP_ENABLE , LEDS_SHOW_MEM_ENABLE , LEDS_TEMPERATURE_TREE , LEDS_TEMPERATURE_ENABLE ,
  LEDS_TEMPERATURE_FILENAME , LEDS_PANEL_TREE , LEDS_PANEL_ENABLE , LEDS_OPTIONS
}
 

Functions

static void redraw_leds (void *)
 
void init_leds (struct module *module)
 
void done_leds (struct module *module)
 
void set_led_value (struct led *led, unsigned char value)
 
unsigned char get_led_value (struct led *led)
 
void unset_led_value (struct led *led)
 
void init_led_panel (struct led_panel *leds)
 
static int draw_timer (struct terminal *term, int xpos, int ypos, struct color_pair *color)
 
static int draw_show_ip (struct session *ses, int xpos, int ypos, struct color_pair *color)
 
static int draw_show_mem (struct session *ses, int xpos, int ypos, struct color_pair *color)
 
static int draw_temperature (struct session *ses, int xpos, int ypos, struct color_pair *color)
 
static milliseconds_T compute_redraw_interval (void)
 
void draw_leds (struct session *ses)
 
static int sync_leds (struct session *ses)
 
static void update_download_led (struct session *ses)
 
void menu_leds_info (struct terminal *term, void *xxx, void *xxxx)
 
struct led * register_led (struct session *ses, int number)
 
void unregister_led (struct led *led)
 

Variables

static int timer_duration_backup = 0
 
static timer_id_T redraw_timer = TIMER_ID_UNDEF
 
static int drawing = 0
 
static union option_info led_options []
 
struct module leds_module
 

Macro Definition Documentation

◆ get_leds_clock_enable

#define get_leds_clock_enable ( )    get_opt_leds(LEDS_CLOCK_ENABLE).number

◆ get_leds_clock_format

#define get_leds_clock_format ( )    get_opt_leds(LEDS_CLOCK_FORMAT).string

◆ get_leds_panel_enable

#define get_leds_panel_enable ( )    get_opt_leds(LEDS_PANEL_ENABLE).number

◆ get_leds_show_ip_enable

#define get_leds_show_ip_enable ( )    get_opt_leds(LEDS_SHOW_IP_ENABLE).number

◆ get_leds_show_mem_enable

#define get_leds_show_mem_enable ( )    get_opt_leds(LEDS_SHOW_MEM_ENABLE).number

◆ get_leds_temperature_enable

#define get_leds_temperature_enable ( )    get_opt_leds(LEDS_TEMPERATURE_ENABLE).number

◆ get_leds_temperature_filename

#define get_leds_temperature_filename ( )    get_opt_leds(LEDS_TEMPERATURE_FILENAME).string

◆ get_opt_leds

#define get_opt_leds ( which)    led_options[(which)].option.value

Enumeration Type Documentation

◆ led_option

enum led_option
Enumerator
LEDS_CLOCK_TREE 
LEDS_CLOCK_ENABLE 
LEDS_CLOCK_FORMAT 
LEDS_CLOCK_ALIAS 
LEDS_SHOW_IP_ENABLE 
LEDS_SHOW_MEM_ENABLE 
LEDS_TEMPERATURE_TREE 
LEDS_TEMPERATURE_ENABLE 
LEDS_TEMPERATURE_FILENAME 
LEDS_PANEL_TREE 
LEDS_PANEL_ENABLE 
LEDS_OPTIONS 

Function Documentation

◆ compute_redraw_interval()

static milliseconds_T compute_redraw_interval ( void )
static

◆ done_leds()

void done_leds ( struct module * module)

◆ draw_leds()

void draw_leds ( struct session * ses)

◆ draw_show_ip()

static int draw_show_ip ( struct session * ses,
int xpos,
int ypos,
struct color_pair * color )
static

◆ draw_show_mem()

static int draw_show_mem ( struct session * ses,
int xpos,
int ypos,
struct color_pair * color )
static

◆ draw_temperature()

static int draw_temperature ( struct session * ses,
int xpos,
int ypos,
struct color_pair * color )
static

◆ draw_timer()

static int draw_timer ( struct terminal * term,
int xpos,
int ypos,
struct color_pair * color )
static

◆ get_led_value()

unsigned char get_led_value ( struct led * led)

◆ init_led_panel()

void init_led_panel ( struct led_panel * leds)

◆ init_leds()

void init_leds ( struct module * module)

◆ menu_leds_info()

void menu_leds_info ( struct terminal * term,
void * xxx,
void * xxxx )

◆ redraw_leds()

static void redraw_leds ( void * xxx)
static

◆ register_led()

struct led * register_led ( struct session * ses,
int number )

◆ set_led_value()

void set_led_value ( struct led * led,
unsigned char value )

◆ sync_leds()

static int sync_leds ( struct session * ses)
static

◆ unregister_led()

void unregister_led ( struct led * led)

◆ unset_led_value()

void unset_led_value ( struct led * led)

◆ update_download_led()

static void update_download_led ( struct session * ses)
static

Variable Documentation

◆ drawing

int drawing = 0
static

◆ led_options

union option_info led_options[]
static

◆ leds_module

struct module leds_module
Initial value:
N_("LED indicators"),
)
#define NULL
Definition explodename.c:35
#define N_(msg)
Definition libintl.h:25
void done_leds(struct module *module)
Definition leds.c:149
void init_leds(struct module *module)
Definition leds.c:139
static union option_info led_options[]
Definition leds.c:80
#define struct_module(name, options, hooks, submods, data, init, done, getname)
Definition module.h:47

◆ redraw_timer

timer_id_T redraw_timer = TIMER_ID_UNDEF
static

◆ timer_duration_backup

int timer_duration_backup = 0
static