Blame alsamixer/colors.c

Packit 229ac0
/*
Packit 229ac0
 * colors.c - color and attribute definitions
Packit 229ac0
 * Copyright (c) 1998,1999 Tim Janik
Packit 229ac0
 *                         Jaroslav Kysela <perex@perex.cz>
Packit 229ac0
 * Copyright (c) 2009      Clemens Ladisch <clemens@ladisch.de>
Packit 229ac0
 *
Packit 229ac0
 * This program is free software: you can redistribute it and/or modify
Packit 229ac0
 * it under the terms of the GNU General Public License as published by
Packit 229ac0
 * the Free Software Foundation, either version 2 of the License, or
Packit 229ac0
 * (at your option) any later version.
Packit 229ac0
 *
Packit 229ac0
 * This program is distributed in the hope that it will be useful,
Packit 229ac0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 229ac0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 229ac0
 * GNU General Public License for more details.
Packit 229ac0
 *
Packit 229ac0
 * You should have received a copy of the GNU General Public License
Packit 229ac0
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 229ac0
 */
Packit 229ac0
Packit 229ac0
#include "aconfig.h"
Packit 229ac0
#include CURSESINC
Packit 229ac0
#include "colors.h"
Packit 229ac0
Packit 229ac0
int attr_mixer_frame;
Packit 229ac0
int attr_mixer_text;
Packit 229ac0
int attr_mixer_active;
Packit 229ac0
int attr_ctl_frame;
Packit 229ac0
int attr_ctl_mute;
Packit 229ac0
int attr_ctl_nomute;
Packit 229ac0
int attr_ctl_capture;
Packit 229ac0
int attr_ctl_nocapture;
Packit 229ac0
int attr_ctl_label;
Packit 229ac0
int attr_ctl_label_focus;
Packit 229ac0
int attr_ctl_mark_focus;
Packit 229ac0
int attr_ctl_bar_lo;
Packit 229ac0
#ifdef TRICOLOR_VOLUME_BAR
Packit 229ac0
int attr_ctl_bar_mi;
Packit 229ac0
int attr_ctl_bar_hi;
Packit 229ac0
#endif
Packit 229ac0
int attr_ctl_inactive;
Packit 229ac0
int attr_ctl_label_inactive;
Packit 229ac0
int attr_errormsg;
Packit 229ac0
int attr_infomsg;
Packit 229ac0
int attr_textbox;
Packit 229ac0
int attr_textfield;
Packit 229ac0
int attr_menu;
Packit 229ac0
int attr_menu_selected;
Packit 229ac0
Packit 229ac0
void init_colors(int use_color)
Packit 229ac0
{
Packit 229ac0
	if (!!has_colors() == !!use_color) {
Packit 229ac0
		start_color();
Packit 229ac0
Packit 229ac0
		init_pair(1, COLOR_CYAN, COLOR_BLACK);
Packit 229ac0
		init_pair(2, COLOR_YELLOW, COLOR_BLACK);
Packit 229ac0
		init_pair(3, COLOR_WHITE, COLOR_GREEN);
Packit 229ac0
		init_pair(4, COLOR_RED, COLOR_BLACK);
Packit 229ac0
		init_pair(5, COLOR_WHITE, COLOR_BLACK);
Packit 229ac0
		init_pair(6, COLOR_WHITE, COLOR_BLUE);
Packit 229ac0
		init_pair(7, COLOR_RED, COLOR_BLUE);
Packit 229ac0
		init_pair(8, COLOR_GREEN, COLOR_GREEN);
Packit 229ac0
		init_pair(9, COLOR_WHITE, COLOR_RED);
Packit 229ac0
#ifdef TRICOLOR_VOLUME_BAR
Packit 229ac0
		init_pair(10, COLOR_WHITE, COLOR_WHITE);
Packit 229ac0
		init_pair(11, COLOR_RED, COLOR_RED);
Packit 229ac0
#endif
Packit 229ac0
Packit 229ac0
		attr_mixer_frame = COLOR_PAIR(1);
Packit 229ac0
		attr_mixer_text = COLOR_PAIR(1);
Packit 229ac0
		attr_mixer_active = A_BOLD | COLOR_PAIR(2);
Packit 229ac0
		attr_ctl_frame = A_BOLD | COLOR_PAIR(1);
Packit 229ac0
		attr_ctl_mute = COLOR_PAIR(1);
Packit 229ac0
		attr_ctl_nomute = A_BOLD | COLOR_PAIR(3);
Packit 229ac0
		attr_ctl_capture = A_BOLD | COLOR_PAIR(4);
Packit 229ac0
		attr_ctl_nocapture = COLOR_PAIR(5);
Packit 229ac0
		attr_ctl_label = A_BOLD | COLOR_PAIR(6);
Packit 229ac0
		attr_ctl_label_focus = A_BOLD | COLOR_PAIR(7);
Packit 229ac0
		attr_ctl_mark_focus = A_BOLD | COLOR_PAIR(4);
Packit 229ac0
		attr_ctl_bar_lo = A_BOLD | COLOR_PAIR(8);
Packit 229ac0
#ifdef TRICOLOR_VOLUME_BAR
Packit 229ac0
		attr_ctl_bar_mi = A_BOLD | COLOR_PAIR(10);
Packit 229ac0
		attr_ctl_bar_hi = A_BOLD | COLOR_PAIR(11);
Packit 229ac0
#endif
Packit 229ac0
		attr_ctl_inactive = COLOR_PAIR(5);
Packit 229ac0
		attr_ctl_label_inactive = A_REVERSE | COLOR_PAIR(5);
Packit 229ac0
		attr_errormsg = A_BOLD | COLOR_PAIR(9);
Packit 229ac0
		attr_infomsg = A_BOLD | COLOR_PAIR(6);
Packit 229ac0
		attr_textbox = A_BOLD | COLOR_PAIR(6);
Packit 229ac0
		attr_textfield = A_REVERSE | COLOR_PAIR(5);
Packit 229ac0
		attr_menu = A_BOLD | COLOR_PAIR(6);
Packit 229ac0
		attr_menu_selected = A_REVERSE | COLOR_PAIR(6);
Packit 229ac0
	} else {
Packit 229ac0
		attr_mixer_frame = A_NORMAL;
Packit 229ac0
		attr_mixer_text = A_NORMAL;
Packit 229ac0
		attr_mixer_active = A_BOLD;
Packit 229ac0
		attr_ctl_frame = A_BOLD;
Packit 229ac0
		attr_ctl_mute = A_NORMAL;
Packit 229ac0
		attr_ctl_nomute = A_BOLD;
Packit 229ac0
		attr_ctl_capture = A_BOLD;
Packit 229ac0
		attr_ctl_nocapture = A_NORMAL;
Packit 229ac0
		attr_ctl_label = A_REVERSE;
Packit 229ac0
		attr_ctl_label_focus = A_REVERSE | A_BOLD;
Packit 229ac0
		attr_ctl_mark_focus = A_BOLD;
Packit 229ac0
		attr_ctl_bar_lo = A_BOLD;
Packit 229ac0
#ifdef TRICOLOR_VOLUME_BAR
Packit 229ac0
		attr_ctl_bar_mi = A_BOLD;
Packit 229ac0
		attr_ctl_bar_hi = A_BOLD;
Packit 229ac0
#endif
Packit 229ac0
		attr_ctl_inactive = A_NORMAL;
Packit 229ac0
		attr_ctl_label_inactive = A_REVERSE;
Packit 229ac0
		attr_errormsg = A_STANDOUT;
Packit 229ac0
		attr_infomsg = A_NORMAL;
Packit 229ac0
		attr_textbox = A_NORMAL;
Packit 229ac0
		attr_textfield = A_REVERSE;
Packit 229ac0
		attr_menu = A_NORMAL;
Packit 229ac0
		attr_menu_selected = A_REVERSE;
Packit 229ac0
	}
Packit 229ac0
}