Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
1b61f9b4
Commit
1b61f9b4
authored
Oct 25, 2010
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncurses: Use a table to store color pairs
parent
9886670b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
33 deletions
+39
-33
modules/gui/ncurses.c
modules/gui/ncurses.c
+39
-33
No files found.
modules/gui/ncurses.c
View file @
1b61f9b4
...
@@ -119,13 +119,49 @@ enum
...
@@ -119,13 +119,49 @@ enum
C_PLAYLIST_3
,
C_PLAYLIST_3
,
C_BOX
,
C_BOX
,
C_STATUS
,
C_STATUS
,
#if 0
C_INFO,
C_INFO,
C_ERROR,
C_ERROR,
C_WARNING,
C_WARNING,
C_DEBUG,
C_DEBUG,
#endif
C_CATEGORY
,
C_CATEGORY
,
C_FOLDER
C_FOLDER
,
/* new elements here ! */
C_MAX
};
};
/* Available colors: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE */
static
const
struct
{
short
f
;
short
b
;
}
color_pairs
[]
=
{
/* element */
/* foreground*/
/* background*/
[
C_TITLE
]
=
{
COLOR_YELLOW
,
COLOR_BLACK
},
/* jamaican playlist */
[
C_PLAYLIST_1
]
=
{
COLOR_GREEN
,
COLOR_BLACK
},
[
C_PLAYLIST_2
]
=
{
COLOR_YELLOW
,
COLOR_BLACK
},
[
C_PLAYLIST_3
]
=
{
COLOR_RED
,
COLOR_BLACK
},
/* used in DrawBox() */
[
C_BOX
]
=
{
COLOR_CYAN
,
COLOR_BLACK
},
/* Source: State, Position, Volume, Chapters, etc...*/
[
C_STATUS
]
=
{
COLOR_BLUE
,
COLOR_BLACK
},
#if 0
/* VLC messages, keep the order from highest priority to lowest */
[C_INFO] = { COLOR_BLACK, COLOR_WHITE },
[C_ERROR] = { COLOR_RED, COLOR_BLACK },
[C_WARNING] = { COLOR_YELLOW, COLOR_BLACK },
[C_DEBUG] = { COLOR_WHITE, COLOR_BLACK },
#endif
/* Category title: help, info, metadata */
[
C_CATEGORY
]
=
{
COLOR_MAGENTA
,
COLOR_BLACK
},
/* Folder (BOX_BROWSE) */
[
C_FOLDER
]
=
{
COLOR_RED
,
COLOR_BLACK
},
};
enum
enum
{
{
VIEW_CATEGORY
,
VIEW_CATEGORY
,
...
@@ -493,43 +529,13 @@ static void start_color_and_pairs(intf_thread_t *p_intf)
...
@@ -493,43 +529,13 @@ static void start_color_and_pairs(intf_thread_t *p_intf)
}
}
start_color
();
start_color
();
for
(
int
i
=
C_DEFAULT
+
1
;
i
<
C_MAX
;
i
++
)
/* Available colors: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE */
init_pair
(
i
,
color_pairs
[
i
].
f
,
color_pairs
[
i
].
b
);
/* untested, in all my terminals, !can_change_color() --funman */
/* untested, in all my terminals, !can_change_color() --funman */
if
(
can_change_color
())
if
(
can_change_color
())
init_color
(
COLOR_YELLOW
,
960
,
500
,
0
);
/* YELLOW -> ORANGE */
init_color
(
COLOR_YELLOW
,
960
,
500
,
0
);
/* YELLOW -> ORANGE */
/* title */
init_pair
(
C_TITLE
,
COLOR_YELLOW
,
COLOR_BLACK
);
/* jamaican playlist */
init_pair
(
C_PLAYLIST_1
,
COLOR_GREEN
,
COLOR_BLACK
);
init_pair
(
C_PLAYLIST_2
,
COLOR_YELLOW
,
COLOR_BLACK
);
init_pair
(
C_PLAYLIST_3
,
COLOR_RED
,
COLOR_BLACK
);
/* used in DrawBox() */
init_pair
(
C_BOX
,
COLOR_CYAN
,
COLOR_BLACK
);
/* Source, State, Position, Volume, Chapters, etc...*/
init_pair
(
C_STATUS
,
COLOR_BLUE
,
COLOR_BLACK
);
/* VLC messages, keep the order from highest priority to lowest */
/* infos */
init_pair
(
C_INFO
,
COLOR_BLACK
,
COLOR_WHITE
);
/* errors */
init_pair
(
C_ERROR
,
COLOR_RED
,
COLOR_BLACK
);
/* warnings */
init_pair
(
C_WARNING
,
COLOR_YELLOW
,
COLOR_BLACK
);
/* debug */
init_pair
(
C_DEBUG
,
COLOR_WHITE
,
COLOR_BLACK
);
/* Category title (help, info, metadata) */
init_pair
(
C_CATEGORY
,
COLOR_MAGENTA
,
COLOR_BLACK
);
/* Folder (BOX_BROWSE) */
init_pair
(
C_FOLDER
,
COLOR_RED
,
COLOR_BLACK
);
p_intf
->
p_sys
->
b_color_started
=
true
;
p_intf
->
p_sys
->
b_color_started
=
true
;
}
}
...
...
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