color.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)color.h    3.4     1992/02/02      */
00002 /* Copyright (c) Steve Linhart, Eric Raymond, 1989. */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifndef COLOR_H
00006 #define COLOR_H
00007 
00008 #ifdef MENU_COLOR
00009 # ifdef MENU_COLOR_REGEX
00010 #  include <regex.h>
00011 # endif
00012 #endif
00013 
00014 /*
00015  * The color scheme used is tailored for an IBM PC.  It consists of the
00016  * standard 8 colors, folowed by their bright counterparts.  There are
00017  * exceptions, these are listed below.  Bright black doesn't mean very
00018  * much, so it is used as the "default" foreground color of the screen.
00019  */
00020 
00021 #if !defined(VIDEOSHADES) || defined(WIN32CON)
00022 #define CLR_BLACK               0
00023 #else
00024 # define CLR_BLACK              8
00025 #endif
00026 #define CLR_RED                 1
00027 #define CLR_GREEN               2
00028 #define CLR_BROWN               3 /* on IBM, low-intensity yellow is brown */
00029 #define CLR_BLUE                4
00030 #define CLR_MAGENTA             5
00031 #define CLR_CYAN                6
00032 #define CLR_GRAY                7 /* low-intensity white */
00033 #if !defined(VIDEOSHADES) || defined(WIN32CON)
00034 #define NO_COLOR                8
00035 #else
00036 # define NO_COLOR               0
00037 #endif
00038 #define CLR_ORANGE              9
00039 #define CLR_BRIGHT_GREEN        10
00040 #define CLR_YELLOW              11
00041 #define CLR_BRIGHT_BLUE         12
00042 #define CLR_BRIGHT_MAGENTA      13
00043 #define CLR_BRIGHT_CYAN         14
00044 #define CLR_WHITE               15
00045 #define CLR_MAX                 16
00046 
00047 /* The "half-way" point for tty based color systems.  This is used in */
00048 /* the tty color setup code.  (IMHO, it should be removed - dean).    */
00049 #define BRIGHT          8
00050 
00051 /* these can be configured */
00052 #define HI_OBJ          CLR_MAGENTA
00053 #define HI_METAL        CLR_CYAN
00054 #define HI_COPPER       CLR_YELLOW
00055 #define HI_SILVER       CLR_GRAY
00056 #define HI_GOLD         CLR_YELLOW
00057 #define HI_LEATHER      CLR_BROWN
00058 #define HI_CLOTH        CLR_BROWN
00059 #define HI_ORGANIC      CLR_BROWN
00060 #define HI_WOOD         CLR_BROWN
00061 #define HI_PAPER        CLR_WHITE
00062 #define HI_GLASS        CLR_BRIGHT_CYAN
00063 #define HI_MINERAL      CLR_GRAY
00064 #define DRAGON_SILVER   CLR_BRIGHT_CYAN
00065 #define HI_ZAP          CLR_BRIGHT_BLUE
00066 
00067 #ifdef MENU_COLOR
00068 struct menucoloring {
00069 # ifdef MENU_COLOR_REGEX
00070 #  ifdef MENU_COLOR_REGEX_POSIX
00071     regex_t match;
00072 #  else
00073     struct re_pattern_buffer match;
00074 #  endif
00075 # else
00076     char *match;
00077 # endif
00078     int color, attr;
00079     struct menucoloring *next;
00080 };
00081 #endif /* MENU_COLOR */
00082 
00083 #ifdef STATUS_COLORS
00084 struct color_option {
00085     int color;
00086     int attr_bits;
00087 };
00088 
00089 struct percent_color_option {
00090         int percentage;
00091         struct color_option color_option;
00092         const struct percent_color_option *next;
00093 };
00094 
00095 struct text_color_option {
00096         const char *text;
00097         struct color_option color_option;
00098         const struct text_color_option *next;
00099 };
00100 #endif
00101 
00102 #ifndef MSDOS
00103 extern int ttycolors[CLR_MAX];
00104 #endif
00105 
00106 #endif /* COLOR_H */