File: main.h

package info (click to toggle)
lcdproc 0.5.9-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 5,064 kB
  • sloc: ansic: 59,645; sh: 1,740; perl: 681; makefile: 417
file content (78 lines) | stat: -rw-r--r-- 1,916 bytes parent folder | download | duplicates (4)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/** \file clients/lcdproc/main.h
 * Contains mode related defines and structures.
 */

/*-
 * This file is part of lcdproc, the lcdproc client.
 *
 * This file is released under the GNU General Public License.
 * Refer to the COPYING file distributed with this package.
 */

#ifndef MAIN_H
#define MAIN_H

#include "shared/defines.h"

#ifndef TRUE
# define TRUE    1
#endif
#ifndef FALSE
# define FALSE   0
#endif

#define LCDP_BATT_HIGH		0x00
#define LCDP_BATT_LOW		0x01
#define LCDP_BATT_CRITICAL	0x02
#define LCDP_BATT_CHARGING	0x03
#define LCDP_BATT_ABSENT	0x04
#define LCDP_BATT_UNKNOWN	0xFF

#define LCDP_AC_OFF		0x00
#define LCDP_AC_ON		0x01
#define LCDP_AC_BACKUP		0x02
#define LCDP_AC_UNKNOWN		0x03

extern int Quit;
extern int sock;
extern char *version;
extern char *build_date;

extern int lcd_wid;
extern int lcd_hgt;
extern int lcd_cellwid;
extern int lcd_cellhgt;

/** Screen data structure */
typedef struct _screen_mode
{
	char *longname;		/**< Which screen is it (long name)? */
	char which;		/**< Which screen is it (short name)? */
	int on_time;		/**< How often to update while visible? */
	int off_time;		/**< How often to get stats while not visible? */
	int show_invisible;	/**< Send stats while not visible? */
	int timer;		/**< Time since last update */
	int flags;		/**< See mode flags defines */
	int (*func)(int,int,int *);	/**< Pointer to init / update function */
} ScreenMode;

/* mode flags */
#define VISIBLE 	0x00000001	/**< currently visible */
#define ACTIVE 		0x00000002	/**< selected for display */
#define INITIALIZED	0x00000004	/**< screen had already been initialized */

#define BLINK_ON	0x10
#define BLINK_OFF	0x11
#define BACKLIGHT_OFF	0x20
#define BACKLIGHT_ON	0x21
#define HOLD_SCREEN	0x30
#define CONTINUE	0x31

#define LCD_MAX_WIDTH	80
#define LCD_MAX_HEIGHT	80

const char *get_hostname(void);
const char *get_sysname(void);
const char *get_sysrelease(void);

#endif