xref: /haiku/src/apps/terminal/TermConst.h (revision 52c4471a3024d2eb81fe88e2c3982b9f8daa5e56)
1 /*
2  * Copyright 2001-2015, Haiku.
3  * Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
4  * Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
5  *
6  * Distributed under the terms of the MIT License.
7  *
8  * Authors:
9  *		Kian Duffy, myob@users.sourceforge.net
10  *		Simon South, simon@simonsouth.net
11  *		Siarzhuk Zharski, zharik@gmx.li
12  */
13 #ifndef TERMCONST_H_INCLUDED
14 #define TERMCONST_H_INCLUDED
15 
16 // Application signature (Must same in Terminal.rdef)
17 #define TERM_SIGNATURE "application/x-vnd.Haiku-Terminal"
18 #define PREFFILE_MIMETYPE "text/x-terminal-pref"
19 
20 // Signature of R5's Terminal. Needed for proper drop-in window count support
21 #define R5_TERM_SIGNATURE "application/x-vnd.Be-SHEL"
22 
23 // Name of the clipboard used for mouse copy'n'paste.
24 #define MOUSE_CLIPBOARD_NAME TERM_SIGNATURE "/mouse"
25 
26 // Message constants for menu items
27 
28 #include <SupportDefs.h>
29 
30 
31 // define to get Ctrl-Cmd-S / Ctrl-Cmd-C shortcuts
32 // to get the debug buffers snapshots and control
33 // sequences capture logging
34 #define USE_DEBUG_SNAPSHOTS
35 #ifdef USE_DEBUG_SNAPSHOTS
36 const uint32 SHORTCUT_DEBUG_SNAPSHOTS	= 'sdbs';
37 const uint32 SHORTCUT_DEBUG_CAPTURE		= 'srdc';
38 #endif
39 
40 // Menu Message
41 static const uint32 MENU_SWITCH_TERM	= 'MSWT';
42 static const uint32 MENU_NEW_TERM		= 'MNTE';
43 static const uint32 MENU_PREF_OPEN		= 'MPre';
44 static const uint32 MENU_CLEAR_ALL		= 'MCAl';
45 static const uint32 MENU_HELP			= 'Mhlp';
46 static const uint32 MENU_COMMAND_HELP	= 'Mchp';
47 static const uint32 MENU_SHOW_GPL		= 'Mgpl';
48 static const uint32 MENU_ENCODING		= 'Menc';
49 static const uint32 MENU_PAGE_SETUP		= 'Mpst';
50 static const uint32 MENU_PRINT			= 'Mpnt';
51 static const uint32 MENU_FIND_STRING	= 'Mfpr';
52 static const uint32 MENU_FIND_NEXT		= 'Mfnx';
53 static const uint32 MENU_FIND_PREVIOUS	= 'Mfbw';
54 static const uint32 MENU_SHOW_COLOR		= 'Mcol';
55 
56 static const uint32 M_GET_DEVICE_NUM	= 'Mgdn';
57 
58 
59 // Preference Message
60 static const ulong PSET__COLS							= 'pcol';
61 static const ulong PSET__ROWS							= 'prow';
62 static const ulong PSET__HFONT							= 'phfn';
63 static const ulong PSET__HFONT_SIZE						= 'phfs';
64 static const ulong PSET_FORE_COLOR						= 'pfcl';
65 static const ulong PSET_BACK_COLOR						= 'pbcl';
66 static const ulong PSET__CODING							= 'pcod';
67 
68 // Terminal Size Messages
69 static const uint32 EIGHTYTWENTYFIVE					= 'etfv';
70 static const uint32 EIGHTYFORTY							= 'efor';
71 static const uint32 ONETHREETWOTWENTYFIVE				= 'hunv';
72 static const uint32 FULLSCREEN							= 'fscr';
73 
74 static const uint32 MSG_FONT_CHANGED					= 'fntc';
75 static const uint32 MSG_SAVE_AS_DEFAULT					= 'sadf';
76 static const uint32 MSG_CHECK_CHILDREN					= 'ckch';
77 static const uint32 MSG_REMOVE_RESIZE_VIEW_IF_NEEDED	= 'rmrv';
78 static const uint32 MSG_TERMINAL_BUFFER_CHANGED			= 'bufc';
79 static const uint32 MSG_SET_TERMINAL_TITLE				= 'sett';
80 static const uint32 MSG_SET_TERMINAL_COLORS				= 'setc';
81 static const uint32 MSG_RESET_TERMINAL_COLORS			= 'rstc';
82 static const uint32 MSG_QUIT_TERMNAL					= 'qutt';
83 static const uint32 MSG_ENABLE_META_KEY					= 'emtk';
84 static const uint32 MSG_REPORT_MOUSE_EVENT				= 'mous';
85 static const uint32 MSG_SAVE_WINDOW_POSITION			= 'swps';
86 static const uint32 MSG_MOVE_TAB_LEFT					= 'mvtl';
87 static const uint32 MSG_MOVE_TAB_RIGHT					= 'mvtr';
88 static const uint32 MSG_ACTIVATE_TERM					= 'msat';
89 static const uint32 MSG_SET_CURSOR_STYLE				= 'mscs';
90 static const uint32 MSG_GET_TERMINAL_COLOR				= 'getc';
91 
92 
93 // Preference Read/Write Keys
94 static const char* const PREF_THEME_NAME = "Theme name";
95 static const char* const PREF_HALF_FONT_FAMILY = "Half Font Family";
96 static const char* const PREF_HALF_FONT_STYLE = "Half Font Style";
97 static const char* const PREF_HALF_FONT_SIZE = "Half Font Size";
98 
99 static const char* const PREF_TEXT_FORE_COLOR = "Text";
100 static const char* const PREF_TEXT_BACK_COLOR = "Background";
101 static const char* const PREF_CURSOR_FORE_COLOR = "Text under cursor";
102 static const char* const PREF_CURSOR_BACK_COLOR = "Cursor";
103 static const char* const PREF_SELECT_FORE_COLOR = "Selected text";
104 static const char* const PREF_SELECT_BACK_COLOR = "Selected background";
105 
106 static const char* const PREF_IM_FORE_COLOR = "IM foreground color";
107 static const char* const PREF_IM_BACK_COLOR = "IM background color";
108 static const char* const PREF_IM_SELECT_COLOR = "IM selection color";
109 
110 static const char* const PREF_ANSI_BLACK_COLOR = "ANSI black color";
111 static const char* const PREF_ANSI_RED_COLOR = "ANSI red color";
112 static const char* const PREF_ANSI_GREEN_COLOR = "ANSI green color";
113 static const char* const PREF_ANSI_YELLOW_COLOR = "ANSI yellow color";
114 static const char* const PREF_ANSI_BLUE_COLOR = "ANSI blue color";
115 static const char* const PREF_ANSI_MAGENTA_COLOR = "ANSI magenta color";
116 static const char* const PREF_ANSI_CYAN_COLOR = "ANSI cyan color";
117 static const char* const PREF_ANSI_WHITE_COLOR = "ANSI white color";
118 
119 static const char* const PREF_ANSI_BLACK_HCOLOR = "ANSI bright black color";
120 static const char* const PREF_ANSI_RED_HCOLOR = "ANSI bright red color";
121 static const char* const PREF_ANSI_GREEN_HCOLOR = "ANSI bright green color";
122 static const char* const PREF_ANSI_YELLOW_HCOLOR = "ANSI bright yellow color";
123 static const char* const PREF_ANSI_BLUE_HCOLOR = "ANSI bright blue color";
124 static const char* const PREF_ANSI_MAGENTA_HCOLOR = "ANSI bright magenta color";
125 static const char* const PREF_ANSI_CYAN_HCOLOR = "ANSI bright cyan color";
126 static const char* const PREF_ANSI_WHITE_HCOLOR = "ANSI bright white color";
127 
128 static const char* const PREF_HISTORY_SIZE = "History size";
129 static const char* const PREF_CURSOR_BLINKING = "Cursor blinking rate";
130 
131 static const char* const PREF_IM_AWARE = "Input method aware";
132 
133 static const char* const PREF_COLS = "Cols";
134 static const char* const PREF_ROWS = "Rows";
135 
136 static const char* const PREF_TEXT_ENCODING = "Text encoding";
137 
138 static const char* const PREF_BLINK_CURSOR = "Blinking cursor";
139 static const char* const PREF_ALLOW_BOLD = "Allow bold text";
140 static const char* const PREF_USE_OPTION_AS_META =
141 	"Use left Option as Meta key";
142 static const char* const PREF_WARN_ON_EXIT = "Warn on exit";
143 static const char* const PREF_CURSOR_STYLE = "Cursor style";
144 static const char* const PREF_EMULATE_BOLD = "Emulate bold";
145 
146 static const char* const PREF_TAB_TITLE = "Tab title";
147 static const char* const PREF_WINDOW_TITLE = "Window title";
148 
149 // shared strings
150 extern const char* const kToolTipSetTabTitlePlaceholders;
151 extern const char* const kToolTipSetWindowTitlePlaceholders;
152 extern const char* const kToolTipCommonTitlePlaceholders;
153 
154 extern const char* const kShellEscapeCharacters;
155 extern const char* const kDefaultAdditionalWordCharacters;
156 extern const char* const kURLAdditionalWordCharacters;
157 
158 
159 // Cursor style
160 enum {
161 	BLOCK_CURSOR,
162 	UNDERLINE_CURSOR,
163 	IBEAM_CURSOR
164 };
165 
166 
167 // Preference Folder and setting path
168 
169 static const int32 DEFAULT = -1;
170 
171 // Font Width
172 enum {
173 	HALF_WIDTH = 1,
174 	FULL_WIDTH = 2
175 };
176 
177 #define M_UTF8 -1
178 
179 #define TAB_WIDTH 8
180 
181 #define MIN_COLS 10
182 #define MAX_COLS 999
183 #define MIN_ROWS 10
184 #define MAX_ROWS 999
185 
186 // Insert mode flag
187 #define MODE_OVER 0
188 #define MODE_INSERT 1
189 
190 // Define TermBuffer internal code
191 #define NO_CHAR 0x00
192 #define A_CHAR 0x01
193 #define IN_STRING 0xFF
194 
195 // TermBuffer extended attribute
196 #define A_WIDTH			0x8000
197 #define BOLD			0x4000
198 #define UNDERLINE		0x2000
199 #define INVERSE			0x1000
200 #define MOUSE			0x0800
201 #define FORESET			0x0400
202 #define BACKSET			0x0200
203 #define FONT			0x0100
204 #define RESERVE			0x0080
205 #define DUMPCR			0x0040
206 #define FORECOLOR		0xFF0000
207 #define BACKCOLOR		0xFF000000
208 #define CHAR_ATTRIBUTES	0xFFFF7700
209 
210 #define FORECOLORED(x) ((x) << 16)
211 #define BACKCOLORED(x) ((x) << 24)
212 
213 
214 #endif	// TERMCONST_H_INCLUDED
215