2 * Copyright 1998 Alexandre Julliard
3 * Copyright 2001 Eric Pouech
4 * Copyright 2012 Detlef Riekenberg
5 * Copyright 2020 Jacek Caban
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
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 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #define WIN32_NO_STATUS
35 #include "wine/condrv.h"
36 #include "wine/rbtree.h"
49 short int pitch_family
;
56 NTSTATUS status
; /* edit status */
57 WCHAR
*buf
; /* the line being edited */
58 unsigned int len
; /* number of chars in line */
59 size_t size
; /* buffer size */
60 unsigned int cursor
; /* offset for cursor in current line */
61 WCHAR
*yanked
; /* yanked line */
62 unsigned int mark
; /* marked point (emacs mode only) */
63 unsigned int history_index
; /* history index */
64 WCHAR
*current_history
; /* buffer for the recent history entry */
65 BOOL insert_key
; /* insert key state */
66 BOOL insert_mode
; /* insert mode */
67 unsigned int update_begin
; /* update region */
68 unsigned int update_end
;
69 unsigned int end_offset
; /* offset of the last written char */
70 unsigned int home_x
; /* home position */
76 HANDLE server
; /* console server handle */
77 unsigned int mode
; /* input mode */
78 struct screen_buffer
*active
; /* active screen buffer */
79 int is_unix
; /* UNIX terminal mode */
80 INPUT_RECORD
*records
; /* input records */
81 unsigned int record_count
; /* number of input records */
82 unsigned int record_size
; /* size of input records buffer */
83 int signaled
; /* is server in signaled state */
84 WCHAR
*read_buffer
; /* buffer of data available for read */
85 size_t read_buffer_count
; /* size of available data */
86 size_t read_buffer_size
; /* size of buffer */
87 unsigned int read_ioctl
; /* current read ioctl */
88 size_t pending_read
; /* size of pending read buffer */
89 struct edit_line edit_line
; /* edit line context */
90 struct console_window
*window
;
91 WCHAR
*title
; /* console title */
92 struct history_line
**history
; /* lines history */
93 unsigned int history_size
; /* number of entries in history array */
94 unsigned int history_index
; /* number of used entries in history array */
95 unsigned int history_mode
; /* mode of history (non zero means remove doubled strings */
96 unsigned int edition_mode
; /* index to edition mode flavors */
97 unsigned int input_cp
; /* console input codepage */
98 unsigned int output_cp
; /* console output codepage */
99 HWND win
; /* window handle if backend supports it */
100 HANDLE input_thread
; /* input thread handle */
101 HANDLE tty_input
; /* handle to tty input stream */
102 HANDLE tty_output
; /* handle to tty output stream */
103 char tty_buffer
[4096]; /* tty output buffer */
104 size_t tty_buffer_count
; /* tty buffer size */
105 unsigned int tty_cursor_x
; /* tty cursor position */
106 unsigned int tty_cursor_y
;
107 unsigned int tty_attr
; /* current tty char attributes */
108 int tty_cursor_visible
; /* tty cursor visibility flag */
113 struct console
*console
; /* console reference */
114 unsigned int id
; /* screen buffer id */
115 unsigned int mode
; /* output mode */
116 unsigned int width
; /* size (w-h) of the screen buffer */
118 unsigned int cursor_size
; /* size of cursor (percentage filled) */
119 unsigned int cursor_visible
; /* cursor visibility flag */
120 unsigned int cursor_x
; /* position of cursor */
121 unsigned int cursor_y
; /* position of cursor */
122 unsigned short attr
; /* default fill attributes (screen colors) */
123 unsigned short popup_attr
; /* pop-up color attributes */
124 unsigned int max_width
; /* size (w-h) of the window given font size */
125 unsigned int max_height
;
126 char_info_t
*data
; /* the data for each cell - a width x height matrix */
127 unsigned int color_map
[16]; /* color table */
128 RECT win
; /* current visible window on the screen buffer */
129 struct font_info font
; /* console font information */
130 struct wine_rb_entry entry
; /* map entry */
133 BOOL
init_window( struct console
*console
);
134 void update_window_region( struct console
*console
, const RECT
*update
);
135 void update_window_config( struct console
*console
);
137 NTSTATUS
write_console_input( struct console
*console
, const INPUT_RECORD
*records
,
138 unsigned int count
, BOOL flush
);
139 NTSTATUS
change_screen_buffer_size( struct screen_buffer
*screen_buffer
, int new_width
, int new_height
);
141 static inline void empty_update_rect( struct screen_buffer
*screen_buffer
, RECT
*rect
)
143 SetRect( rect
, screen_buffer
->width
, screen_buffer
->height
, 0, 0 );
146 #endif /* RC_INVOKED */
149 #define IDS_EDIT 0x100
150 #define IDS_DEFAULT 0x101
151 #define IDS_PROPERTIES 0x102
153 #define IDS_MARK 0x110
154 #define IDS_COPY 0x111
155 #define IDS_PASTE 0x112
156 #define IDS_SELECTALL 0x113
157 #define IDS_SCROLL 0x114
158 #define IDS_SEARCH 0x115
160 #define IDS_DLG_TIT_DEFAULT 0x120
161 #define IDS_DLG_TIT_CURRENT 0x121
162 #define IDS_DLG_TIT_ERROR 0x122
164 #define IDS_DLG_ERR_SBWINSIZE 0x130
166 #define IDS_FNT_DISPLAY 0x200
167 #define IDS_FNT_PREVIEW 0x201
170 #define IDD_OPTION 0x0100
171 #define IDD_FONT 0x0200
172 #define IDD_CONFIG 0x0300
173 #define IDD_SAVE_SETTINGS 0x0400
175 /* dialog boxes controls */
176 #define IDC_OPT_CURSOR_SMALL 0x0101
177 #define IDC_OPT_CURSOR_MEDIUM 0x0102
178 #define IDC_OPT_CURSOR_LARGE 0x0103
179 #define IDC_OPT_HIST_SIZE 0x0104
180 #define IDC_OPT_HIST_SIZE_UD 0x0105
181 #define IDC_OPT_HIST_NODOUBLE 0x0106
182 #define IDC_OPT_CONF_CTRL 0x0107
183 #define IDC_OPT_CONF_SHIFT 0x0108
184 #define IDC_OPT_QUICK_EDIT 0x0109
185 #define IDC_OPT_INSERT_MODE 0x0110
187 #define IDC_FNT_LIST_FONT 0x0201
188 #define IDC_FNT_LIST_SIZE 0x0202
189 #define IDC_FNT_COLOR_BK 0x0203
190 #define IDC_FNT_COLOR_FG 0x0204
191 #define IDC_FNT_FONT_INFO 0x0205
192 #define IDC_FNT_PREVIEW 0x0206
194 #define IDC_CNF_SB_WIDTH 0x0301
195 #define IDC_CNF_SB_WIDTH_UD 0x0302
196 #define IDC_CNF_SB_HEIGHT 0x0303
197 #define IDC_CNF_SB_HEIGHT_UD 0x0304
198 #define IDC_CNF_WIN_WIDTH 0x0305
199 #define IDC_CNF_WIN_WIDTH_UD 0x0306
200 #define IDC_CNF_WIN_HEIGHT 0x0307
201 #define IDC_CNF_WIN_HEIGHT_UD 0x0308
202 #define IDC_CNF_CLOSE_EXIT 0x0309
203 #define IDC_CNF_EDITION_MODE 0x030a
205 #define IDC_SAV_SAVE 0x0401
206 #define IDC_SAV_SESSION 0x0402