[PATCH] Screen buffers ESC keypresses indefinitely since sgr support
[screen.git] / src / winmsg.h
blob4841bc9de24faab220aae1f6c5776ce693c36906
1 /* Copyright (c) 2013
2 * Mike Gerwitz (mtg@gnu.org)
3 * Copyright (c) 2010
4 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
5 * Sadrul Habib Chowdhury (sadrul@users.sourceforge.net)
6 * Copyright (c) 2008, 2009
7 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
8 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
9 * Micah Cowan (micah@cowan.name)
10 * Sadrul Habib Chowdhury (sadrul@users.sourceforge.net)
11 * Copyright (c) 1993-2002, 2003, 2005, 2006, 2007
12 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
13 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
14 * Copyright (c) 1987 Oliver Laumann
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 3, or (at your option)
19 * any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program (see the file COPYING); if not, see
28 * https://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
29 * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
31 ****************************************************************
34 #ifndef SCREEN_WINMSG_H
35 #define SCREEN_WINMSG_H
37 #include <stdint.h>
38 #include <stdbool.h>
40 #include "window.h"
41 #include "winmsgbuf.h"
42 #include "winmsgcond.h"
43 #include "backtick.h"
45 #define RENDBUF_SIZE 128 /* max rendition byte count */
47 /* escape characters */
48 typedef enum {
49 WINESC_WFLAGS = 'f',
50 WINESC_ESC_SEEN = 'E',
51 WINESC_FOCUS = 'F',
52 WINESC_HSTATUS = 'h',
53 WINESC_HOST = 'H',
54 WINESC_WIN_COUNT = 'C',
55 WINESC_WIN_NUM = 'n',
56 WINESC_WIN_LOGNAME = 'N',
57 WINESC_PID = 'p',
58 WINESC_COPY_MODE = 'P', /* copy/_P_aste mode */
59 WINESC_WIN_SIZE = 's',
60 WINESC_SESS_NAME = 'S',
61 WINESC_WIN_TITLE = 't',
62 WINESC_WIN_GROUP = 'g',
63 WINESC_WIN_NAMES = 'w',
64 WINESC_WIN_NAMES_NOCUR = 'W',
65 WINESC_CMD_ARGS = 'x',
66 WINESC_CMD = 'X',
67 WINESC_REND_START = '{',
68 WINESC_REND_END = '}',
69 WINESC_REND_POP = '-',
70 WINESC_COND = '?', /* start and end delimiter */
71 WINESC_COND_ELSE = ':',
72 WINESC_BACKTICK = '`',
73 WINESC_PAD = '=',
74 WINESC_TRUNC = '<',
75 WINESC_TRUNC_POS = '>',
76 WINESC_WIN_TTY = 'T',
77 } WinMsgEscapeChar;
79 /* escape sequence */
80 typedef struct {
81 int num;
82 struct {
83 bool zero : 1;
84 bool lng : 1;
85 bool minus : 1;
86 bool plus : 1;
87 } flags;
88 } WinMsgEsc;
90 char *MakeWinMsg(char *, Window *, int);
91 char *MakeWinMsgEv(WinMsgBuf *, char *, Window *, int, int, Event *, int);
92 int AddWinMsgRend(WinMsgBuf *, const char *, uint64_t);
93 void WindowChanged (Window *, WinMsgEscapeChar);
95 extern WinMsgBuf *g_winmsg;
97 #endif