CRT.h 2.32 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-2010 Hisham H. Muhammad
Hisham Muhammad's avatar
Hisham Muhammad committed
8
9
10
11
12
13
14
15
16
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/


#include <curses.h>
#include <signal.h>
#include <stdlib.h>
#include <stdbool.h>
17
#include <execinfo.h>
Hisham Muhammad's avatar
Hisham Muhammad committed
18
19
20

#include "String.h"

21
#include "config.h"
Hisham Muhammad's avatar
Hisham Muhammad committed
22
23
#include "debug.h"

Hisham Muhammad's avatar
Hisham Muhammad committed
24
25
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)

Hisham Muhammad's avatar
Hisham Muhammad committed
26
27
28
29
30
31
32
#define COLORSCHEME_DEFAULT 0
#define COLORSCHEME_MONOCHROME 1
#define COLORSCHEME_BLACKONWHITE 2
#define COLORSCHEME_BLACKONWHITE2 3
#define COLORSCHEME_MIDNIGHT 4
#define COLORSCHEME_BLACKNIGHT 5

Hisham Muhammad's avatar
Hisham Muhammad committed
33
34
35
36
37
38
39
40
41
#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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//#link curses

bool CRT_hasColors;


typedef enum ColorElements_ {
   RESET_COLOR,
   DEFAULT_COLOR,
   FUNCTION_BAR,
   FUNCTION_KEY,
   FAILED_SEARCH,
   PANEL_HEADER_FOCUS,
   PANEL_HEADER_UNFOCUS,
   PANEL_HIGHLIGHT_FOCUS,
   PANEL_HIGHLIGHT_UNFOCUS,
   LARGE_NUMBER,
   METER_TEXT,
   METER_VALUE,
   LED_COLOR,
   UPTIME,
Hisham Muhammad's avatar
Hisham Muhammad committed
62
   BATTERY,
Hisham Muhammad's avatar
Hisham Muhammad committed
63
64
65
66
67
68
69
70
71
72
73
   TASKS_RUNNING,
   SWAP,
   PROCESS,
   PROCESS_SHADOW,
   PROCESS_TAG,
   PROCESS_MEGABYTES,
   PROCESS_TREE,
   PROCESS_R_STATE,
   PROCESS_BASENAME,
   PROCESS_HIGH_PRIORITY,
   PROCESS_LOW_PRIORITY,
74
75
   PROCESS_THREAD,
   PROCESS_THREAD_BASENAME,
Hisham Muhammad's avatar
Hisham Muhammad committed
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
   BAR_BORDER,
   BAR_SHADOW,
   GRAPH_1,
   GRAPH_2,
   GRAPH_3,
   GRAPH_4,
   GRAPH_5,
   GRAPH_6,
   GRAPH_7,
   GRAPH_8,
   GRAPH_9,
   MEMORY_USED,
   MEMORY_BUFFERS,
   MEMORY_CACHE,
   LOAD,
   LOAD_AVERAGE_FIFTEEN,
   LOAD_AVERAGE_FIVE,
   LOAD_AVERAGE_ONE,
   CHECK_BOX,
   CHECK_MARK,
   CHECK_TEXT,
   CLOCK,
98
99
   HELP_BOLD,
   HOSTNAME,
Hisham Muhammad's avatar
Hisham Muhammad committed
100
101
102
   CPU_NICE,
   CPU_NORMAL,
   CPU_KERNEL,
103
104
105
   CPU_IOWAIT,
   CPU_IRQ,
   CPU_SOFTIRQ,
106
107
   CPU_STEAL,
   CPU_GUEST,
Hisham Muhammad's avatar
Hisham Muhammad committed
108
109
110
111
   LAST_COLORELEMENT
} ColorElements;


Hisham Muhammad's avatar
Hisham Muhammad committed
112
// TODO: centralize these in Settings.
Hisham Muhammad's avatar
Hisham Muhammad committed
113
114
115

extern int CRT_delay;

Hisham Muhammad's avatar
Hisham Muhammad committed
116
117
118
119
extern int CRT_colorScheme;

extern int CRT_colors[LAST_COLORELEMENT];

120
121
char* CRT_termType;

122
123
void *backtraceArray[128];

Hisham Muhammad's avatar
Hisham Muhammad committed
124
125
126
// TODO: pass an instance of Settings instead.

void CRT_init(int delay, int colorScheme);
Hisham Muhammad's avatar
Hisham Muhammad committed
127
128
129
130
131

void CRT_done();

int CRT_readKey();

Hisham Muhammad's avatar
Hisham Muhammad committed
132
133
134
135
void CRT_disableDelay();

void CRT_enableDelay();

Hisham Muhammad's avatar
Hisham Muhammad committed
136
137
138
void CRT_setColors(int colorScheme);

#endif