Added Debianization stuff.
[cboard.git] / src / colors.c
blob61303ddc0e0d49f1e6f3aa6e63212a15ba61853e
1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
2 /*
3 Copyright (C) 2002-2006 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifdef HAVE_CONFIG_H
20 #include <config.h>
21 #endif
23 #ifdef HAVE_NCURSES_H
24 #include <ncurses.h>
25 #endif
27 #include "chess.h"
28 #include "conf.h"
29 #include "colors.h"
31 #ifdef WITH_DMALLOC
32 #include <dmalloc.h>
33 #endif
35 void init_color_pairs()
37 init_pair(1, config.color[CONF_BCOORDS].fg,
38 config.color[CONF_BCOORDS].bg);
39 init_pair(2, config.color[CONF_BGRAPHICS].fg,
40 config.color[CONF_BGRAPHICS].bg);
41 init_pair(3, config.color[CONF_BWHITE].fg,
42 config.color[CONF_BWHITE].bg);
43 init_pair(4, config.color[CONF_BBLACK].fg,
44 config.color[CONF_BBLACK].bg);
45 init_pair(5, config.color[CONF_BSELECTED].fg,
46 config.color[CONF_BSELECTED].bg);
47 init_pair(6, config.color[CONF_BCURSOR].fg,
48 config.color[CONF_BCURSOR].bg);
49 init_pair(7, config.color[CONF_SWINDOW].fg,
50 config.color[CONF_SWINDOW].bg);
51 init_pair(8, config.color[CONF_SBORDER].fg,
52 config.color[CONF_SBORDER].bg);
53 init_pair(9, config.color[CONF_STITLE].fg,
54 config.color[CONF_STITLE].bg);
55 init_pair(10, config.color[CONF_SENGINE].fg,
56 config.color[CONF_SENGINE].bg);
57 init_pair(11, config.color[CONF_SNOTIFY].fg,
58 config.color[CONF_SNOTIFY].bg);
59 init_pair(12, config.color[CONF_TWINDOW].fg,
60 config.color[CONF_TWINDOW].bg);
61 init_pair(13, config.color[CONF_TBORDER].fg,
62 config.color[CONF_TBORDER].bg);
63 init_pair(14, config.color[CONF_TTITLE].fg,
64 config.color[CONF_TTITLE].bg);
65 init_pair(15, config.color[CONF_HWINDOW].fg,
66 config.color[CONF_HWINDOW].bg);
67 init_pair(16, config.color[CONF_HBORDER].fg,
68 config.color[CONF_HBORDER].bg);
69 init_pair(17, config.color[CONF_HTITLE].fg,
70 config.color[CONF_HTITLE].bg);
71 init_pair(18, config.color[CONF_MWINDOW].fg,
72 config.color[CONF_MWINDOW].bg);
73 init_pair(19, config.color[CONF_MBORDER].fg,
74 config.color[CONF_MBORDER].bg);
75 init_pair(20, config.color[CONF_MTITLE].fg,
76 config.color[CONF_MTITLE].bg);
77 init_pair(21, config.color[CONF_MPROMPT].fg,
78 config.color[CONF_MPROMPT].bg);
79 init_pair(22, config.color[CONF_IWINDOW].fg,
80 config.color[CONF_IWINDOW].bg);
81 init_pair(23, config.color[CONF_IBORDER].fg,
82 config.color[CONF_IBORDER].bg);
83 init_pair(24, config.color[CONF_ITITLE].fg,
84 config.color[CONF_ITITLE].bg);
85 init_pair(25, config.color[CONF_IPROMPT].fg,
86 config.color[CONF_IPROMPT].bg);
87 init_pair(26, config.color[CONF_BMOVESW].fg,
88 config.color[CONF_BMOVESW].bg);
89 init_pair(27, config.color[CONF_BMOVESB].fg,
90 config.color[CONF_BMOVESB].bg);
91 init_pair(28, config.color[CONF_BCOUNT].fg,
92 config.color[CONF_BCOUNT].bg);
93 init_pair(29, config.color[CONF_BDWINDOW].fg,
94 config.color[CONF_BDWINDOW].bg);
95 init_pair(30, config.color[CONF_MENU].fg,
96 config.color[CONF_MENU].bg);
97 init_pair(31, config.color[CONF_MENUS].fg,
98 config.color[CONF_MENUS].bg);
99 init_pair(32, config.color[CONF_MENUH].fg,
100 config.color[CONF_MENUH].bg);
103 void set_default_colors()
105 config.color[CONF_BDWINDOW].fg = COLOR_WHITE;
106 config.color[CONF_BDWINDOW].bg = COLOR_BLACK;
107 config.color[CONF_BCOORDS].fg = COLOR_YELLOW;
108 config.color[CONF_BCOORDS].bg = COLOR_BLACK;
109 config.color[CONF_BMOVESW].fg = COLOR_WHITE;
110 config.color[CONF_BMOVESW].bg = COLOR_MAGENTA;
111 config.color[CONF_BMOVESW].nattrs = A_REVERSE;
112 config.color[CONF_BMOVESB].fg = COLOR_WHITE;
113 config.color[CONF_BMOVESB].bg = COLOR_BLUE;
114 config.color[CONF_BMOVESB].nattrs = A_REVERSE;
115 config.color[CONF_BCOUNT].fg = COLOR_MAGENTA;
116 config.color[CONF_BCOUNT].bg = COLOR_CYAN;
117 config.color[CONF_BCOUNT].attrs = A_BOLD;
118 config.color[CONF_BCOUNT].nattrs = A_REVERSE;
119 config.color[CONF_BGRAPHICS].fg = COLOR_WHITE;
120 config.color[CONF_BGRAPHICS].bg = COLOR_BLACK;
121 config.color[CONF_BWHITE].fg = COLOR_WHITE;
122 config.color[CONF_BWHITE].bg = COLOR_RED;
123 config.color[CONF_BWHITE].nattrs = A_REVERSE;
124 config.color[CONF_BBLACK].fg = COLOR_WHITE;
125 config.color[CONF_BBLACK].bg = COLOR_BLACK;
126 config.color[CONF_BSELECTED].fg = COLOR_WHITE;
127 config.color[CONF_BSELECTED].bg = COLOR_YELLOW;
128 config.color[CONF_BSELECTED].nattrs = A_BOLD|A_REVERSE;
129 config.color[CONF_BCURSOR].fg = COLOR_WHITE;
130 config.color[CONF_BCURSOR].bg = COLOR_GREEN;
131 config.color[CONF_BCURSOR].nattrs = A_BOLD|A_REVERSE;
132 config.color[CONF_SWINDOW].fg = COLOR_WHITE;
133 config.color[CONF_SWINDOW].bg = COLOR_BLACK;
134 config.color[CONF_SBORDER].fg = COLOR_CYAN;
135 config.color[CONF_SBORDER].bg = COLOR_BLACK;
136 config.color[CONF_STITLE].fg = COLOR_WHITE;
137 config.color[CONF_STITLE].bg = COLOR_BLUE;
138 config.color[CONF_STITLE].nattrs = A_REVERSE;
139 config.color[CONF_SENGINE].fg = COLOR_YELLOW;
140 config.color[CONF_SENGINE].bg = COLOR_BLACK;
141 config.color[CONF_SENGINE].nattrs = A_BOLD;
142 config.color[CONF_SNOTIFY].fg = COLOR_GREEN;
143 config.color[CONF_SNOTIFY].bg = COLOR_BLACK;
144 config.color[CONF_SNOTIFY].nattrs = A_BOLD;
145 config.color[CONF_TWINDOW].fg = COLOR_WHITE;
146 config.color[CONF_TWINDOW].bg = COLOR_BLACK;
147 config.color[CONF_TBORDER].fg = COLOR_CYAN;
148 config.color[CONF_TBORDER].bg = COLOR_BLACK;
149 config.color[CONF_TTITLE].fg = COLOR_WHITE;
150 config.color[CONF_TTITLE].bg = COLOR_BLUE;
151 config.color[CONF_TTITLE].nattrs = A_REVERSE;
152 config.color[CONF_HWINDOW].fg = COLOR_WHITE;
153 config.color[CONF_HWINDOW].bg = COLOR_BLACK;
154 config.color[CONF_HBORDER].fg = COLOR_CYAN;
155 config.color[CONF_HBORDER].bg = COLOR_BLACK;
156 config.color[CONF_HTITLE].fg = COLOR_WHITE;
157 config.color[CONF_HTITLE].bg = COLOR_BLUE;
158 config.color[CONF_HTITLE].nattrs = A_REVERSE;
159 config.color[CONF_MWINDOW].fg = COLOR_WHITE;
160 config.color[CONF_MWINDOW].bg = COLOR_BLACK;
161 config.color[CONF_MBORDER].fg = COLOR_CYAN;
162 config.color[CONF_MBORDER].bg = COLOR_BLACK;
163 config.color[CONF_MTITLE].fg = COLOR_WHITE;
164 config.color[CONF_MTITLE].bg = COLOR_MAGENTA;
165 config.color[CONF_MTITLE].nattrs = A_REVERSE;
166 config.color[CONF_MPROMPT].fg = COLOR_WHITE;
167 config.color[CONF_MPROMPT].bg = COLOR_MAGENTA;
168 config.color[CONF_MPROMPT].nattrs = A_BOLD;
169 config.color[CONF_IWINDOW].fg = COLOR_WHITE;
170 config.color[CONF_IWINDOW].bg = COLOR_BLACK;
171 config.color[CONF_IBORDER].fg = COLOR_CYAN;
172 config.color[CONF_IBORDER].bg = COLOR_BLACK;
173 config.color[CONF_ITITLE].fg = COLOR_WHITE;
174 config.color[CONF_ITITLE].bg = COLOR_MAGENTA;
175 config.color[CONF_ITITLE].nattrs = A_REVERSE;
176 config.color[CONF_IPROMPT].fg = COLOR_WHITE;
177 config.color[CONF_IPROMPT].bg = COLOR_MAGENTA;
178 config.color[CONF_IPROMPT].nattrs = A_BOLD;
179 config.color[CONF_MENU].fg = COLOR_WHITE;
180 config.color[CONF_MENU].bg = COLOR_BLUE;
181 config.color[CONF_MENUS].fg = COLOR_WHITE;
182 config.color[CONF_MENUS].bg = COLOR_RED;
183 config.color[CONF_MENUS].nattrs = A_BOLD;
184 config.color[CONF_MENUH].fg = COLOR_YELLOW;
185 config.color[CONF_MENUH].bg = COLOR_RED;
186 config.color[CONF_MENUH].attrs = A_BOLD;
187 config.color[CONF_MENUH].nattrs = A_BOLD;