CRT.h 2.86 KB
Newer Older
Hisham Muhammad's avatar
Hisham Muhammad committed
1
/* Do not edit this file. It was automatically generated. */
Hisham Muhammad's avatar
Hisham Muhammad committed
2
3
4
5
6

#ifndef HEADER_CRT
#define HEADER_CRT
/*
htop - CRT.h
Hisham Muhammad's avatar
Hisham Muhammad committed
7
(C) 2004-2011 Hisham H. Muhammad
Hisham Muhammad's avatar
Hisham Muhammad committed
8
9
10
11
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/

Hisham Muhammad's avatar
Hisham Muhammad committed
12
13
14
15
16
17
18
19
20
21
22
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)

#define Black COLOR_BLACK
#define Red COLOR_RED
#define Green COLOR_GREEN
#define Yellow COLOR_YELLOW
#define Blue COLOR_BLUE
#define Magenta COLOR_MAGENTA
#define Cyan COLOR_CYAN
#define White COLOR_WHITE

Hisham Muhammad's avatar
Hisham Muhammad committed
23
24
//#link curses

Hisham Muhammad's avatar
Hisham Muhammad committed
25
#include <stdbool.h>
Hisham Muhammad's avatar
Hisham Muhammad committed
26

Hisham Muhammad's avatar
Hisham Muhammad committed
27
28
29
30
31
32
33
34
35
36
37
typedef enum TreeStr_ {
   TREE_STR_HORZ,
   TREE_STR_VERT,
   TREE_STR_RTEE,
   TREE_STR_BEND,
   TREE_STR_TEND,
   TREE_STR_OPEN,
   TREE_STR_SHUT,
   TREE_STR_COUNT
} TreeStr;

38
39
40
41
42
43
44
typedef enum ColorSchemes_ {
   COLORSCHEME_DEFAULT = 0,
   COLORSCHEME_MONOCHROME = 1,
   COLORSCHEME_BLACKONWHITE = 2,
   COLORSCHEME_LIGHTTERMINAL = 3,
   COLORSCHEME_MIDNIGHT = 4,
   COLORSCHEME_BLACKNIGHT = 5,
45
46
   COLORSCHEME_BROKENGRAY = 6,
   LAST_COLORSCHEME = 7,
47
48
} ColorSchemes;

Hisham Muhammad's avatar
Hisham Muhammad committed
49
50
51
52
53
54
55
56
typedef enum ColorElements_ {
   RESET_COLOR,
   DEFAULT_COLOR,
   FUNCTION_BAR,
   FUNCTION_KEY,
   FAILED_SEARCH,
   PANEL_HEADER_FOCUS,
   PANEL_HEADER_UNFOCUS,
57
58
59
   PANEL_SELECTION_FOCUS,
   PANEL_SELECTION_FOLLOW,
   PANEL_SELECTION_UNFOCUS,
Hisham Muhammad's avatar
Hisham Muhammad committed
60
61
62
63
64
   LARGE_NUMBER,
   METER_TEXT,
   METER_VALUE,
   LED_COLOR,
   UPTIME,
Hisham Muhammad's avatar
Hisham Muhammad committed
65
   BATTERY,
Hisham Muhammad's avatar
Hisham Muhammad committed
66
67
68
69
70
71
72
73
   TASKS_RUNNING,
   SWAP,
   PROCESS,
   PROCESS_SHADOW,
   PROCESS_TAG,
   PROCESS_MEGABYTES,
   PROCESS_TREE,
   PROCESS_R_STATE,
74
   PROCESS_D_STATE,
Hisham Muhammad's avatar
Hisham Muhammad committed
75
76
77
   PROCESS_BASENAME,
   PROCESS_HIGH_PRIORITY,
   PROCESS_LOW_PRIORITY,
78
79
   PROCESS_THREAD,
   PROCESS_THREAD_BASENAME,
Hisham Muhammad's avatar
Hisham Muhammad committed
80
81
82
83
84
85
   BAR_BORDER,
   BAR_SHADOW,
   GRAPH_1,
   GRAPH_2,
   MEMORY_USED,
   MEMORY_BUFFERS,
86
   MEMORY_BUFFERS_TEXT,
Hisham Muhammad's avatar
Hisham Muhammad committed
87
88
89
90
91
92
93
94
95
   MEMORY_CACHE,
   LOAD,
   LOAD_AVERAGE_FIFTEEN,
   LOAD_AVERAGE_FIVE,
   LOAD_AVERAGE_ONE,
   CHECK_BOX,
   CHECK_MARK,
   CHECK_TEXT,
   CLOCK,
96
97
   HELP_BOLD,
   HOSTNAME,
Hisham Muhammad's avatar
Hisham Muhammad committed
98
   CPU_NICE,
99
   CPU_NICE_TEXT,
Hisham Muhammad's avatar
Hisham Muhammad committed
100
101
   CPU_NORMAL,
   CPU_KERNEL,
102
103
104
   CPU_IOWAIT,
   CPU_IRQ,
   CPU_SOFTIRQ,
105
106
   CPU_STEAL,
   CPU_GUEST,
Hisham Muhammad's avatar
Hisham Muhammad committed
107
108
109
   LAST_COLORELEMENT
} ColorElements;

Hisham Muhammad's avatar
Hisham Muhammad committed
110
111
void CRT_fatalError(const char* note) __attribute__ ((noreturn));

112
113
void CRT_handleSIGSEGV(int sgn);

Hisham Muhammad's avatar
Hisham Muhammad committed
114

Hisham Muhammad's avatar
Hisham Muhammad committed
115
extern const char *CRT_treeStrAscii[TREE_STR_COUNT];
Hisham Muhammad's avatar
Hisham Muhammad committed
116

117
118
#ifdef HAVE_LIBNCURSESW

Hisham Muhammad's avatar
Hisham Muhammad committed
119
120
extern const char *CRT_treeStrUtf8[TREE_STR_COUNT];

121
122
123
124
extern bool CRT_utf8;

#endif

Hisham Muhammad's avatar
Hisham Muhammad committed
125
extern const char **CRT_treeStr;
Hisham Muhammad's avatar
Hisham Muhammad committed
126

127
128
extern int CRT_delay;

129
130
131
int* CRT_colors;

extern int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT];
Hisham Muhammad's avatar
Hisham Muhammad committed
132

133
134
extern int CRT_cursorX;

Hisham Muhammad's avatar
Hisham Muhammad committed
135
136
extern int CRT_scrollHAmount;

137
138
char* CRT_termType;

Hisham Muhammad's avatar
Hisham Muhammad committed
139
140
141
142
// TODO move color scheme to Settings, perhaps?

extern int CRT_colorScheme;

143
144
void *backtraceArray[128];

Hisham Muhammad's avatar
Hisham Muhammad committed
145
146
147
// TODO: pass an instance of Settings instead.

void CRT_init(int delay, int colorScheme);
Hisham Muhammad's avatar
Hisham Muhammad committed
148
149
150

void CRT_done();

151
152
void CRT_fatalError(const char* note);

Hisham Muhammad's avatar
Hisham Muhammad committed
153
154
int CRT_readKey();

Hisham Muhammad's avatar
Hisham Muhammad committed
155
156
157
158
void CRT_disableDelay();

void CRT_enableDelay();

Hisham Muhammad's avatar
Hisham Muhammad committed
159
160
161
void CRT_setColors(int colorScheme);

#endif