Back to index

tetex-bin  3.0
colors.h
Go to the documentation of this file.
00001 /*
00002  *  colors.h -- color attribute definitions
00003  *
00004  *  AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
00005  *
00006  *  This program is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  as published by the Free Software Foundation; either version 2
00009  *  of the License, or (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 
00022 /*
00023  *   Default color definitions
00024  *
00025  *   *_FG = foreground
00026  *   *_BG = background
00027  *   *_HL = highlight?
00028  */
00029 #define SCREEN_FG                    COLOR_CYAN
00030 #define SCREEN_BG                    COLOR_BLUE
00031 #define SCREEN_HL                    TRUE
00032 
00033 #define SHADOW_FG                    COLOR_BLACK
00034 #define SHADOW_BG                    COLOR_BLACK
00035 #define SHADOW_HL                    TRUE
00036 
00037 #define DIALOG_FG                    COLOR_BLACK
00038 #define DIALOG_BG                    COLOR_WHITE
00039 #define DIALOG_HL                    FALSE
00040 
00041 #define TITLE_FG                     COLOR_YELLOW
00042 #define TITLE_BG                     COLOR_WHITE
00043 #define TITLE_HL                     TRUE
00044 
00045 #define BORDER_FG                    COLOR_WHITE
00046 #define BORDER_BG                    COLOR_WHITE
00047 #define BORDER_HL                    TRUE
00048 
00049 #define BUTTON_ACTIVE_FG             COLOR_WHITE
00050 #define BUTTON_ACTIVE_BG             COLOR_BLUE
00051 #define BUTTON_ACTIVE_HL             TRUE
00052 
00053 #define BUTTON_INACTIVE_FG           COLOR_BLACK
00054 #define BUTTON_INACTIVE_BG           COLOR_WHITE
00055 #define BUTTON_INACTIVE_HL           FALSE
00056 
00057 #define BUTTON_KEY_ACTIVE_FG         COLOR_WHITE
00058 #define BUTTON_KEY_ACTIVE_BG         COLOR_BLUE
00059 #define BUTTON_KEY_ACTIVE_HL         TRUE
00060 
00061 #define BUTTON_KEY_INACTIVE_FG       COLOR_RED
00062 #define BUTTON_KEY_INACTIVE_BG       COLOR_WHITE
00063 #define BUTTON_KEY_INACTIVE_HL       FALSE
00064 
00065 #define BUTTON_LABEL_ACTIVE_FG       COLOR_YELLOW
00066 #define BUTTON_LABEL_ACTIVE_BG       COLOR_BLUE
00067 #define BUTTON_LABEL_ACTIVE_HL       TRUE
00068 
00069 #define BUTTON_LABEL_INACTIVE_FG     COLOR_BLACK
00070 #define BUTTON_LABEL_INACTIVE_BG     COLOR_WHITE
00071 #define BUTTON_LABEL_INACTIVE_HL     TRUE
00072 
00073 #define INPUTBOX_FG                  COLOR_BLACK
00074 #define INPUTBOX_BG                  COLOR_WHITE
00075 #define INPUTBOX_HL                  FALSE
00076 
00077 #define INPUTBOX_BORDER_FG           COLOR_BLACK
00078 #define INPUTBOX_BORDER_BG           COLOR_WHITE
00079 #define INPUTBOX_BORDER_HL           FALSE
00080 
00081 #define SEARCHBOX_FG                 COLOR_BLACK
00082 #define SEARCHBOX_BG                 COLOR_WHITE
00083 #define SEARCHBOX_HL                 FALSE
00084 
00085 #define SEARCHBOX_TITLE_FG           COLOR_YELLOW
00086 #define SEARCHBOX_TITLE_BG           COLOR_WHITE
00087 #define SEARCHBOX_TITLE_HL           TRUE
00088 
00089 #define SEARCHBOX_BORDER_FG          COLOR_WHITE
00090 #define SEARCHBOX_BORDER_BG          COLOR_WHITE
00091 #define SEARCHBOX_BORDER_HL          TRUE
00092 
00093 #define POSITION_INDICATOR_FG        COLOR_YELLOW
00094 #define POSITION_INDICATOR_BG        COLOR_WHITE
00095 #define POSITION_INDICATOR_HL        TRUE
00096 
00097 #define MENUBOX_FG                   COLOR_BLACK
00098 #define MENUBOX_BG                   COLOR_WHITE
00099 #define MENUBOX_HL                   FALSE
00100 
00101 #define MENUBOX_BORDER_FG            COLOR_WHITE
00102 #define MENUBOX_BORDER_BG            COLOR_WHITE
00103 #define MENUBOX_BORDER_HL            TRUE
00104 
00105 #define ITEM_FG                      COLOR_BLACK
00106 #define ITEM_BG                      COLOR_WHITE
00107 #define ITEM_HL                      FALSE
00108 
00109 #define ITEM_SELECTED_FG             COLOR_WHITE
00110 #define ITEM_SELECTED_BG             COLOR_BLUE
00111 #define ITEM_SELECTED_HL             TRUE
00112 
00113 #define TAG_FG                       COLOR_YELLOW
00114 #define TAG_BG                       COLOR_WHITE
00115 #define TAG_HL                       TRUE
00116 
00117 #define TAG_SELECTED_FG              COLOR_YELLOW
00118 #define TAG_SELECTED_BG              COLOR_BLUE
00119 #define TAG_SELECTED_HL              TRUE
00120 
00121 #define TAG_KEY_FG                   COLOR_RED
00122 #define TAG_KEY_BG                   COLOR_WHITE
00123 #define TAG_KEY_HL                   TRUE
00124 
00125 #define TAG_KEY_SELECTED_FG          COLOR_RED
00126 #define TAG_KEY_SELECTED_BG          COLOR_BLUE
00127 #define TAG_KEY_SELECTED_HL          TRUE
00128 
00129 #define CHECK_FG                     COLOR_BLACK
00130 #define CHECK_BG                     COLOR_WHITE
00131 #define CHECK_HL                     FALSE
00132 
00133 #define CHECK_SELECTED_FG            COLOR_WHITE
00134 #define CHECK_SELECTED_BG            COLOR_BLUE
00135 #define CHECK_SELECTED_HL            TRUE
00136 
00137 #define UARROW_FG                    COLOR_GREEN
00138 #define UARROW_BG                    COLOR_WHITE
00139 #define UARROW_HL                    TRUE
00140 
00141 #define DARROW_FG                    COLOR_GREEN
00142 #define DARROW_BG                    COLOR_WHITE
00143 #define DARROW_HL                    TRUE
00144 
00145 /* End of default color definitions */
00146 
00147 #define C_ATTR(x,y)                  ((x ? A_BOLD : 0) | COLOR_PAIR((y)))
00148 #define COLOR_NAME_LEN               10
00149 #define COLOR_COUNT                  8
00150 
00151 
00152 /*
00153  * Global variables
00154  */
00155 
00156 typedef struct {
00157   char name[COLOR_NAME_LEN];
00158   int  value;
00159 } color_names_st;
00160 
00161 
00162 #ifdef __DIALOG_MAIN__
00163 
00164 /*
00165  * For matching color names with color values
00166  */
00167 color_names_st color_names[] = {
00168   {"BLACK",   COLOR_BLACK},
00169   {"RED",     COLOR_RED},
00170   {"GREEN",   COLOR_GREEN},
00171   {"YELLOW",  COLOR_YELLOW},
00172   {"BLUE",    COLOR_BLUE},
00173   {"MAGENTA", COLOR_MAGENTA},
00174   {"CYAN",    COLOR_CYAN},
00175   {"WHITE",   COLOR_WHITE},
00176 };    /* color names */
00177 
00178 
00179 /*
00180  * Table of color values
00181  */
00182 int color_table[][3] = {
00183   {SCREEN_FG,               SCREEN_BG,               SCREEN_HL               },
00184   {SHADOW_FG,               SHADOW_BG,               SHADOW_HL               },
00185   {DIALOG_FG,               DIALOG_BG,               DIALOG_HL               },
00186   {TITLE_FG,                TITLE_BG,                TITLE_HL                },
00187   {BORDER_FG,               BORDER_BG,               BORDER_HL               },
00188   {BUTTON_ACTIVE_FG,        BUTTON_ACTIVE_BG,        BUTTON_ACTIVE_HL        },
00189   {BUTTON_INACTIVE_FG,      BUTTON_INACTIVE_BG,      BUTTON_INACTIVE_HL      },
00190   {BUTTON_KEY_ACTIVE_FG,    BUTTON_KEY_ACTIVE_BG,    BUTTON_KEY_ACTIVE_HL    },
00191   {BUTTON_KEY_INACTIVE_FG,  BUTTON_KEY_INACTIVE_BG,  BUTTON_KEY_INACTIVE_HL  },
00192   {BUTTON_LABEL_ACTIVE_FG,  BUTTON_LABEL_ACTIVE_BG,  BUTTON_LABEL_ACTIVE_HL  },
00193   {BUTTON_LABEL_INACTIVE_FG,BUTTON_LABEL_INACTIVE_BG,BUTTON_LABEL_INACTIVE_HL},
00194   {INPUTBOX_FG,             INPUTBOX_BG,             INPUTBOX_HL             },
00195   {INPUTBOX_BORDER_FG,      INPUTBOX_BORDER_BG,      INPUTBOX_BORDER_HL      },
00196   {SEARCHBOX_FG,            SEARCHBOX_BG,            SEARCHBOX_HL            },
00197   {SEARCHBOX_TITLE_FG,      SEARCHBOX_TITLE_BG,      SEARCHBOX_TITLE_HL      },
00198   {SEARCHBOX_BORDER_FG,     SEARCHBOX_BORDER_BG,     SEARCHBOX_BORDER_HL     },
00199   {POSITION_INDICATOR_FG,   POSITION_INDICATOR_BG,   POSITION_INDICATOR_HL   },
00200   {MENUBOX_FG,              MENUBOX_BG,              MENUBOX_HL              },
00201   {MENUBOX_BORDER_FG,       MENUBOX_BORDER_BG,       MENUBOX_BORDER_HL       },
00202   {ITEM_FG,                 ITEM_BG,                 ITEM_HL                 },
00203   {ITEM_SELECTED_FG,        ITEM_SELECTED_BG,        ITEM_SELECTED_HL        },
00204   {TAG_FG,                  TAG_BG,                  TAG_HL                  },
00205   {TAG_SELECTED_FG,         TAG_SELECTED_BG,         TAG_SELECTED_HL         },
00206   {TAG_KEY_FG,              TAG_KEY_BG,              TAG_KEY_HL              },
00207   {TAG_KEY_SELECTED_FG,     TAG_KEY_SELECTED_BG,     TAG_KEY_SELECTED_HL     },
00208   {CHECK_FG,                CHECK_BG,                CHECK_HL                },
00209   {CHECK_SELECTED_FG,       CHECK_SELECTED_BG,       CHECK_SELECTED_HL       },
00210   {UARROW_FG,               UARROW_BG,               UARROW_HL               },
00211   {DARROW_FG,               DARROW_BG,               DARROW_HL               },
00212 };    /* color_table */
00213 
00214 #else
00215 
00216 extern color_names_st color_names[];
00217 extern int color_table[][3];
00218 
00219 #endif    /* __DIALOG_MAIN__ */