Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
64e0d945
Commit
64e0d945
authored
Oct 14, 2014
by
Valmiky Arquissandas
Browse files
Added new color for 'D' state.
parent
0e8a0236
Changes
3
Hide whitespace changes
Inline
Side-by-side
CRT.c
View file @
64e0d945
...
...
@@ -67,6 +67,7 @@ typedef enum ColorElements_ {
PROCESS_MEGABYTES,
PROCESS_TREE,
PROCESS_R_STATE,
PROCESS_D_STATE,
PROCESS_BASENAME,
PROCESS_HIGH_PRIORITY,
PROCESS_LOW_PRIORITY,
...
...
@@ -280,6 +281,7 @@ void CRT_setColors(int colorScheme) {
CRT_colors
[
PROCESS_BASENAME
]
=
A_BOLD
;
CRT_colors
[
PROCESS_TREE
]
=
A_BOLD
;
CRT_colors
[
PROCESS_R_STATE
]
=
A_BOLD
;
CRT_colors
[
PROCESS_D_STATE
]
=
A_BOLD
;
CRT_colors
[
PROCESS_HIGH_PRIORITY
]
=
A_BOLD
;
CRT_colors
[
PROCESS_LOW_PRIORITY
]
=
A_DIM
;
CRT_colors
[
PROCESS_THREAD
]
=
A_BOLD
;
...
...
@@ -343,6 +345,7 @@ void CRT_setColors(int colorScheme) {
CRT_colors
[
PROCESS_BASENAME
]
=
ColorPair
(
Blue
,
White
);
CRT_colors
[
PROCESS_TREE
]
=
ColorPair
(
Green
,
White
);
CRT_colors
[
PROCESS_R_STATE
]
=
ColorPair
(
Green
,
White
);
CRT_colors
[
PROCESS_D_STATE
]
=
A_BOLD
|
ColorPair
(
Red
,
White
);
CRT_colors
[
PROCESS_HIGH_PRIORITY
]
=
ColorPair
(
Red
,
White
);
CRT_colors
[
PROCESS_LOW_PRIORITY
]
=
ColorPair
(
Red
,
White
);
CRT_colors
[
PROCESS_THREAD
]
=
ColorPair
(
Blue
,
White
);
...
...
@@ -406,6 +409,7 @@ void CRT_setColors(int colorScheme) {
CRT_colors
[
PROCESS_BASENAME
]
=
ColorPair
(
Green
,
Black
);
CRT_colors
[
PROCESS_TREE
]
=
ColorPair
(
Blue
,
Black
);
CRT_colors
[
PROCESS_R_STATE
]
=
ColorPair
(
Green
,
Black
);
CRT_colors
[
PROCESS_D_STATE
]
=
A_BOLD
|
ColorPair
(
Red
,
Black
);
CRT_colors
[
PROCESS_HIGH_PRIORITY
]
=
ColorPair
(
Red
,
Black
);
CRT_colors
[
PROCESS_LOW_PRIORITY
]
=
ColorPair
(
Red
,
Black
);
CRT_colors
[
PROCESS_THREAD
]
=
ColorPair
(
Blue
,
Black
);
...
...
@@ -469,6 +473,7 @@ void CRT_setColors(int colorScheme) {
CRT_colors
[
PROCESS_BASENAME
]
=
A_BOLD
|
ColorPair
(
Cyan
,
Blue
);
CRT_colors
[
PROCESS_TREE
]
=
ColorPair
(
Cyan
,
Blue
);
CRT_colors
[
PROCESS_R_STATE
]
=
ColorPair
(
Green
,
Blue
);
CRT_colors
[
PROCESS_D_STATE
]
=
A_BOLD
|
ColorPair
(
Red
,
Blue
);
CRT_colors
[
PROCESS_HIGH_PRIORITY
]
=
ColorPair
(
Red
,
Blue
);
CRT_colors
[
PROCESS_LOW_PRIORITY
]
=
ColorPair
(
Red
,
Blue
);
CRT_colors
[
PROCESS_THREAD
]
=
ColorPair
(
Green
,
Blue
);
...
...
@@ -534,6 +539,7 @@ void CRT_setColors(int colorScheme) {
CRT_colors
[
PROCESS_THREAD
]
=
ColorPair
(
Green
,
Black
);
CRT_colors
[
PROCESS_THREAD_BASENAME
]
=
A_BOLD
|
ColorPair
(
Blue
,
Black
);
CRT_colors
[
PROCESS_R_STATE
]
=
ColorPair
(
Green
,
Black
);
CRT_colors
[
PROCESS_D_STATE
]
=
A_BOLD
|
ColorPair
(
Red
,
Black
);
CRT_colors
[
PROCESS_HIGH_PRIORITY
]
=
ColorPair
(
Red
,
Black
);
CRT_colors
[
PROCESS_LOW_PRIORITY
]
=
ColorPair
(
Red
,
Black
);
CRT_colors
[
BAR_BORDER
]
=
A_BOLD
|
ColorPair
(
Green
,
Black
);
...
...
@@ -596,6 +602,7 @@ void CRT_setColors(int colorScheme) {
CRT_colors
[
PROCESS_BASENAME
]
=
A_BOLD
|
ColorPair
(
Cyan
,
Black
);
CRT_colors
[
PROCESS_TREE
]
=
ColorPair
(
Cyan
,
Black
);
CRT_colors
[
PROCESS_R_STATE
]
=
ColorPair
(
Green
,
Black
);
CRT_colors
[
PROCESS_D_STATE
]
=
A_BOLD
|
ColorPair
(
Red
,
Black
);
CRT_colors
[
PROCESS_HIGH_PRIORITY
]
=
ColorPair
(
Red
,
Black
);
CRT_colors
[
PROCESS_LOW_PRIORITY
]
=
ColorPair
(
Red
,
Black
);
CRT_colors
[
PROCESS_THREAD
]
=
ColorPair
(
Green
,
Black
);
...
...
CRT.h
View file @
64e0d945
...
...
@@ -58,6 +58,7 @@ typedef enum ColorElements_ {
PROCESS_MEGABYTES
,
PROCESS_TREE
,
PROCESS_R_STATE
,
PROCESS_D_STATE
,
PROCESS_BASENAME
,
PROCESS_HIGH_PRIORITY
,
PROCESS_LOW_PRIORITY
,
...
...
Process.c
View file @
64e0d945
...
...
@@ -533,9 +533,16 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
}
case
STATE
:
{
snprintf
(
buffer
,
n
,
"%c "
,
this
->
state
);
attr
=
this
->
state
==
'R'
?
CRT_colors
[
PROCESS_R_STATE
]
:
attr
;
switch
(
this
->
state
)
{
case
'R'
:
attr
=
CRT_colors
[
PROCESS_R_STATE
];
break
;
case
'D'
:
attr
=
CRT_colors
[
PROCESS_D_STATE
];
break
;
default:
attr
=
this
->
state
;
}
break
;
}
case
PRIORITY
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment