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