2 * Copyright (c)2004 Cat's Eye Technologies. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
16 * Neither the name of Cat's Eye Technologies nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31 * OF THE POSSIBILITY OF SUCH DAMAGE.
36 * $Id: curses_util.h,v 1.5 2005/02/08 07:49:03 cpressey Exp $
39 #ifndef __CURSES_UTIL_H
40 #define __CURSES_UTIL_H
45 extern unsigned int ymax, xmax; /* Size of the user's terminal. */
46 extern int monochrome;
48 #define CURSES_COLORS_NORMAL 0 /* usual text inside forms */
49 #define CURSES_COLORS_BACKDROP 1 /* backdrop behind all forms */
50 #define CURSES_COLORS_MENUBAR 2 /* line at top of screen */
51 #define CURSES_COLORS_STATUSBAR 3 /* line at bottom of screen */
52 #define CURSES_COLORS_BORDER 4 /* border of forms */
53 #define CURSES_COLORS_FORMTITLE 5 /* title of forms */
54 #define CURSES_COLORS_LABEL 6 /* labels of controls */
55 #define CURSES_COLORS_CONTROL 7 /* ambient parts of a control */
56 #define CURSES_COLORS_TEXT 8 /* text in a control */
57 #define CURSES_COLORS_FOCUS 9 /* control, when it has focus */
58 #define CURSES_COLORS_SCROLLAREA 10 /* background of scrollbar */
59 #define CURSES_COLORS_SCROLLBAR 11 /* foreground of scrollbar */
60 #define CURSES_COLORS_ACCEL 12 /* shortcut keys in labels */
61 #define CURSES_COLORS_ACCELFOCUS 13 /* shortcut keys, with focus */
63 #define CURSES_COLORS_MAX 14
65 #define COLOR_GREY COLOR_WHITE
66 #define COLOR_BROWN COLOR_YELLOW
68 void curses_colors_init(int);
69 void curses_colors_set(WINDOW *, int);
71 void curses_window_blank(WINDOW *);
72 void curses_frame_draw(int, int, int, int);
73 void curses_load_backdrop(WINDOW *, const char *);
75 void curses_debug_str(const char *);
76 void curses_debug_int(int);
77 void curses_debug_key(int);
78 void curses_debug_float(float);
80 int extract_wrapped_line(const char *, char *, int, int *);
82 #endif /* !__CURSES_UTIL_H */