libcommonc++  0.7
TerminalAttr.h++
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------------
2  commonc++ - A C++ Common Class Library
3  Copyright (C) 2005-2014 Mark A Lindner
4 
5  This file is part of commonc++.
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public
18  License along with this library; if not, write to the Free
19  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  ---------------------------------------------------------------------------
21 */
22 
23 #ifndef __ccxx_TerminalAttr_hxx
24 #define __ccxx_TerminalAttr_hxx
25 
26 #include <commonc++/Common.h++>
27 
28 namespace ccxx {
29 
114 #define TERMATTR_ESC "\033"
115 
116 #define TERMATTR_NORMAL TERMATTR_ESC "[0m"
117 #define TERMATTR_BOLD TERMATTR_ESC "[1m"
118 #define TERMATTR_DIM TERMATTR_ESC "[2m"
119 #define TERMATTR_UNDERLINE TERMATTR_ESC "[4m"
120 #define TERMATTR_BLINK TERMATTR_ESC "[5m"
121 #define TERMATTR_INVERSE TERMATTR_ESC "[7m"
122 
123 #define TERMATTR_FG_BLACK TERMATTR_ESC "[30m"
124 #define TERMATTR_FG_RED TERMATTR_ESC "[31m"
125 #define TERMATTR_FG_GREEN TERMATTR_ESC "[32m"
126 #define TERMATTR_FG_YELLOW TERMATTR_ESC "[33m"
127 #define TERMATTR_FG_BLUE TERMATTR_ESC "[34m"
128 #define TERMATTR_FG_MAGENTA TERMATTR_ESC "[35m"
129 #define TERMATTR_FG_CYAN TERMATTR_ESC "[36m"
130 #define TERMATTR_FG_WHITE TERMATTR_ESC "[37m"
131 #define TERMATTR_FG_NORMAL TERMATTR_ESC "[39m"
132 
133 #define TERMATTR_BG_BLACK TERMATTR_ESC "[40m"
134 #define TERMATTR_BG_RED TERMATTR_ESC "[41m"
135 #define TERMATTR_BG_GREEN TERMATTR_ESC "[42m"
136 #define TERMATTR_BG_YELLOW TERMATTR_ESC "[43m"
137 #define TERMATTR_BG_BLUE TERMATTR_ESC "[44m"
138 #define TERMATTR_BG_MAGENTA TERMATTR_ESC "[45m"
139 #define TERMATTR_BG_CYAN TERMATTR_ESC "[46m"
140 #define TERMATTR_BG_WHITE TERMATTR_ESC "[47m"
141 #define TERMATTR_BG_NORMAL TERMATTR_ESC "[49m"
142 
143 #define TERMATTR_LINECHARS_ON TERMATTR_ESC "(0"
144 #define TERMATTR_LINECHARS_OFF TERMATTR_ESC "(B"
145 
146 #define TERMATTR_CLEAR_SCREEN TERMATTR_ESC "[2J"
147 #define TERMATTR_CLEAR_LINE TERMATTR_ESC "[2K"
148 
149 #define TERMATTR_CURSOR(Y, X) TERMATTR_ESC "[" #Y ";" #X "H"
150 #define TERMATTR_CURSOR_UP(N) TERMATTR_ESC "[" #N "A"
151 #define TERMATTR_CURSOR_DOWN(N) TERMATTR_ESC "[" #N "B"
152 #define TERMATTR_CURSOR_RIGHT(N) TERMATTR_ESC "[" #N "C"
153 #define TERMATTR_CURSOR_LEFT(N) TERMATTR_ESC "[" #N "D"
154 #define TERMATTR_CURSOR_HOME TERMATTR_ESC "[H"
155 
156 #define TERMATTR_SCROLL_UP TERMATTR_ESC "D"
157 #define TERMATTR_SCROLL_DOWN TERMATTR_ESC "M"
158 
159 } // namespace ccxx
160 
161 #endif // __ccxx_TerminalAttr_hxx
Definition: AllocationMap.c++:25