xref: /freebsd/contrib/bsddialog/lib/bsddialog_theme.h (revision 52d973f52c07b94909a6487be373c269988dc151)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2021 Alfonso Sabato Siciliano
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  */
27 
28 #ifndef _LIBBSDDIALOG_THEME_H_
29 #define _LIBBSDDIALOG_THEME_H_
30 
31 enum bsddialog_color {
32 	BSDDIALOG_BLACK = 0,
33 	BSDDIALOG_RED,
34 	BSDDIALOG_GREEN,
35 	BSDDIALOG_YELLOW,
36 	BSDDIALOG_BLUE,
37 	BSDDIALOG_MAGENTA,
38 	BSDDIALOG_CYAN,
39 	BSDDIALOG_WHITE,
40 };
41 
42 struct bsddialog_theme {
43 	int shadowcolor;
44 	unsigned int shadowrows;
45 	unsigned int shadowcols;
46 
47 	int backgroundcolor;
48 	bool surroundtitle;
49 	int titlecolor;
50 	int lineraisecolor;
51 	int linelowercolor;
52 	int widgetcolor;
53 
54 	unsigned int texthmargin;
55 
56 	int curritemcolor;
57 	int itemcolor;
58 	int currtagcolor;
59 	int tagcolor;
60 	int namesepcolor;
61 	int descsepcolor;
62 
63 	int currfieldcolor;
64 	int fieldcolor;
65 	int fieldreadonlycolor;
66 
67 	int currbarcolor;
68 	int barcolor;
69 
70 	unsigned int buttonspace;
71 	int buttleftch;
72 	int buttrightchar;
73 	int currbuttdelimcolor;
74 	int buttdelimcolor;
75 	int currbuttoncolor;
76 	int buttoncolor;
77 	int currshortkeycolor;
78 	int shortkeycolor;
79 
80 	int bottomtitlecolor;
81 };
82 
83 enum bsddialog_default_theme {
84 	BSDDIALOG_THEME_BLACKWHITE,
85 	BSDDIALOG_THEME_BSDDIALOG,
86 	BSDDIALOG_THEME_DEFAULT,
87 	BSDDIALOG_THEME_DIALOG,
88 	BSDDIALOG_THEME_MAGENTA,
89 };
90 
91 int bsddialog_color(enum bsddialog_color background, enum bsddialog_color foreground);
92 struct bsddialog_theme bsddialog_get_theme();
93 void bsddialog_set_theme(struct bsddialog_theme theme);
94 int bsddialog_set_default_theme(enum bsddialog_default_theme theme);
95 
96 #endif
97