ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvt.h
(Generate patch)

Comparing rxvt-unicode/src/rxvt.h (file contents):
Revision 1.552 by sf-exg, Thu Jul 14 05:33:26 2016 UTC vs.
Revision 1.556 by sf-exg, Thu May 13 19:40:19 2021 UTC

78 78
79#if XRENDER && (HAVE_PIXBUF || ENABLE_TRANSPARENCY) 79#if XRENDER && (HAVE_PIXBUF || ENABLE_TRANSPARENCY)
80# define HAVE_IMG 1 80# define HAVE_IMG 1
81#endif 81#endif
82 82
83#define ECB_NO_THREADS 1
83#include <ecb.h> 84#include "ecb.h"
85
84#include "encoding.h" 86#include "encoding.h"
85#include "rxvtutil.h" 87#include "rxvtutil.h"
86#include "rxvtfont.h" 88#include "rxvtfont.h"
87#include "rxvttoolkit.h" 89#include "rxvttoolkit.h"
88#include "rxvtimg.h" 90#include "rxvtimg.h"
133 * PROTOTYPES 135 * PROTOTYPES
134 ***************************************************************************** 136 *****************************************************************************
135 */ 137 */
136// main.C 138// main.C
137#define SET_LOCALE(locale) rxvt_set_locale (locale) 139#define SET_LOCALE(locale) rxvt_set_locale (locale)
138extern bool rxvt_set_locale (const char *locale) NOTHROW; 140extern bool rxvt_set_locale (const char *locale) noexcept;
139extern void rxvt_push_locale (const char *locale) NOTHROW; 141extern void rxvt_push_locale (const char *locale) noexcept;
140extern void rxvt_pop_locale () NOTHROW; 142extern void rxvt_pop_locale () noexcept;
141void rxvt_init (); 143void rxvt_init ();
142 144
143// misc.C 145// misc.C
144char * rxvt_wcstombs (const wchar_t *str, int len = -1); 146char * rxvt_wcstombs (const wchar_t *str, int len = -1);
145wchar_t * rxvt_mbstowcs (const char *str, int len = -1); 147wchar_t * rxvt_mbstowcs (const char *str, int len = -1);
146char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); 148char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1);
147wchar_t * rxvt_utf8towcs (const char *str, int len = -1); 149wchar_t * rxvt_utf8towcs (const char *str, int len = -1);
148 150
149const char * rxvt_basename (const char *str) NOTHROW; 151const char * rxvt_basename (const char *str) noexcept;
150void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; 152void rxvt_vlog (const char *fmt, va_list arg_ptr) noexcept;
151void rxvt_log (const char *fmt,...) NOTHROW; 153void rxvt_log (const char *fmt,...) noexcept;
152void rxvt_warn (const char *fmt,...) NOTHROW; 154void rxvt_warn (const char *fmt,...) noexcept;
153ecb_noreturn ecb_cold 155ecb_noreturn ecb_cold
154void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)); 156void rxvt_fatal (const char *fmt, ...);
155ecb_noreturn ecb_cold 157ecb_noreturn ecb_cold
156void rxvt_exit_failure () THROW ((class rxvt_failure_exception)); 158void rxvt_exit_failure ();
157 159
158void * rxvt_malloc (size_t size); 160void * rxvt_malloc (size_t size);
159void * rxvt_calloc (size_t number, size_t size); 161void * rxvt_calloc (size_t number, size_t size);
160void * rxvt_realloc (void *ptr, size_t size); 162void * rxvt_realloc (void *ptr, size_t size);
161 163
162char * rxvt_strtrim (char *str) NOTHROW; 164char * rxvt_strtrim (char *str) noexcept;
163char ** rxvt_strsplit (char delim, const char *str) NOTHROW; 165char ** rxvt_strsplit (char delim, const char *str) noexcept;
164 166
165static inline void 167static inline void
166rxvt_free_strsplit (char **ptr) NOTHROW 168rxvt_free_strsplit (char **ptr) noexcept
167{ 169{
168 free (ptr[0]); 170 free (ptr[0]);
169 free (ptr); 171 free (ptr);
170} 172}
171 173
570#define PrivMode_vt52 (1UL<<18) 572#define PrivMode_vt52 (1UL<<18)
571#define PrivMode_LFNL (1UL<<19) 573#define PrivMode_LFNL (1UL<<19)
572#define PrivMode_MouseBtnEvent (1UL<<20) 574#define PrivMode_MouseBtnEvent (1UL<<20)
573#define PrivMode_MouseAnyEvent (1UL<<21) 575#define PrivMode_MouseAnyEvent (1UL<<21)
574#define PrivMode_BracketPaste (1UL<<22) 576#define PrivMode_BracketPaste (1UL<<22)
575#define PrivMode_ExtModeMouse (1UL<<23) // xterm pseudo-utf-8 hack 577#define PrivMode_ExtMouseUTF8 (1UL<<23) // xterm pseudo-utf-8 hack
576#define PrivMode_ExtMouseRight (1UL<<24) // xterm pseudo-utf-8, but works in non-utf-8-locales 578#define PrivMode_ExtMouseUrxvt (1UL<<24) // xterm pseudo-utf-8, but works in non-utf-8-locales
577#define PrivMode_BlinkingCursor (1UL<<25) 579#define PrivMode_BlinkingCursor (1UL<<25)
578#define PrivMode_FocusEvent (1UL<<26) 580#define PrivMode_FocusEvent (1UL<<26)
581#define PrivMode_ExtMouseSGR (1UL<<27)
579 582
580#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent) 583#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent)
581 584
582#ifdef ALLOW_132_MODE 585#ifdef ALLOW_132_MODE
583# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) 586# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK)
1113#endif 1116#endif
1114 1117
1115#if ENABLE_OVERLAY 1118#if ENABLE_OVERLAY
1116 overlay_base ov; 1119 overlay_base ov;
1117 1120
1118 void scr_swap_overlay () NOTHROW; 1121 void scr_swap_overlay () noexcept;
1119 void scr_overlay_new (int x, int y, int w, int h) NOTHROW; 1122 void scr_overlay_new (int x, int y, int w, int h) noexcept;
1120 void scr_overlay_off () NOTHROW; 1123 void scr_overlay_off () noexcept;
1121 void scr_overlay_set (int x, int y, 1124 void scr_overlay_set (int x, int y,
1122 text_t text, 1125 text_t text,
1123 rend_t rend = OVERLAY_RSTYLE) NOTHROW; 1126 rend_t rend = OVERLAY_RSTYLE) noexcept;
1124 void scr_overlay_set (int x, int y, const char *s) NOTHROW; 1127 void scr_overlay_set (int x, int y, const char *s) noexcept;
1125 void scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW; 1128 void scr_overlay_set (int x, int y, const wchar_t *s) noexcept;
1126#endif 1129#endif
1127 1130
1128 vector<void *> allocated; // free these memory blocks with free() 1131 vector<void *> allocated; // free these memory blocks with free()
1129 1132
1130 int parent_x, parent_y; // parent window position relative to root, only updated on demand 1133 int parent_x, parent_y; // parent window position relative to root, only updated on demand
1171# endif 1174# endif
1172#endif 1175#endif
1173 1176
1174 long vt_emask, vt_emask_perl, vt_emask_xim, vt_emask_mouse; 1177 long vt_emask, vt_emask_perl, vt_emask_xim, vt_emask_mouse;
1175 1178
1176 void vt_select_input () const NOTHROW 1179 void vt_select_input () const noexcept
1177 { 1180 {
1178 XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim | vt_emask_mouse); 1181 XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim | vt_emask_mouse);
1179 } 1182 }
1180 1183
1181#if ENABLE_PERL 1184#if ENABLE_PERL
1245 XPoint spot; // most recently sent spot position 1248 XPoint spot; // most recently sent spot position
1246 1249
1247 void im_destroy (); 1250 void im_destroy ();
1248 void im_cb (); im_watcher im_ev; 1251 void im_cb (); im_watcher im_ev;
1249 void im_set_size (XRectangle &size); 1252 void im_set_size (XRectangle &size);
1250 void im_set_position (XPoint &pos) NOTHROW; 1253 void im_set_position (XPoint &pos) noexcept;
1251 void im_set_color (unsigned long &fg, unsigned long &bg); 1254 void im_set_color (unsigned long &fg, unsigned long &bg);
1252 void im_set_preedit_area (XRectangle &preedit_rect, XRectangle &status_rect, const XRectangle &needed_rect); 1255 void im_set_preedit_area (XRectangle &preedit_rect, XRectangle &status_rect, const XRectangle &needed_rect);
1253 1256
1254 bool im_is_running (); 1257 bool im_is_running ();
1255 void im_send_spot (); 1258 void im_send_spot ();
1259 1262
1260 // command.C 1263 // command.C
1261 void key_press (XKeyEvent &ev); 1264 void key_press (XKeyEvent &ev);
1262 void key_release (XKeyEvent &ev); 1265 void key_release (XKeyEvent &ev);
1263 1266
1264 wchar_t next_char () NOTHROW; 1267 wchar_t next_char () noexcept;
1265 wchar_t cmd_getc () THROW ((class out_of_input)); 1268 wchar_t cmd_getc ();
1266 uint32_t next_octet () NOTHROW; 1269 uint32_t next_octet () noexcept;
1267 uint32_t cmd_get8 () THROW ((class out_of_input)); 1270 uint32_t cmd_get8 ();
1268 1271
1269 void cmd_parse (); 1272 void cmd_parse ();
1270 void mouse_report (XButtonEvent &ev); 1273 void mouse_report (XButtonEvent &ev);
1271 void button_press (XButtonEvent &ev); 1274 void button_press (XButtonEvent &ev);
1272 void button_release (XButtonEvent &ev); 1275 void button_release (XButtonEvent &ev);
1337 void set_widthheight (unsigned int newwidth, unsigned int newheight); 1340 void set_widthheight (unsigned int newwidth, unsigned int newheight);
1338 void get_window_origin (int &x, int &y); 1341 void get_window_origin (int &x, int &y);
1339 1342
1340 // screen.C 1343 // screen.C
1341 1344
1342 bool option (uint8_t opt) const NOTHROW 1345 bool option (uint8_t opt) const noexcept
1343 { 1346 {
1344 return options[opt >> 3] & (1 << (opt & 7)); 1347 return options[opt >> 3] & (1 << (opt & 7));
1345 } 1348 }
1346 1349
1347 void set_option (uint8_t opt, bool set = true) NOTHROW; 1350 void set_option (uint8_t opt, bool set = true) noexcept;
1348 1351
1349 int fgcolor_of (rend_t r) const NOTHROW 1352 int fgcolor_of (rend_t r) const noexcept
1350 { 1353 {
1351 int base = GET_BASEFG (r); 1354 int base = GET_BASEFG (r);
1352#ifndef NO_BRIGHTCOLOR 1355#ifndef NO_BRIGHTCOLOR
1353 if (r & RS_Bold 1356 if (r & RS_Bold
1354# if ENABLE_STYLES 1357# if ENABLE_STYLES
1358 base += minBrightCOLOR - minCOLOR; 1361 base += minBrightCOLOR - minCOLOR;
1359#endif 1362#endif
1360 return base; 1363 return base;
1361 } 1364 }
1362 1365
1363 int bgcolor_of (rend_t r) const NOTHROW 1366 int bgcolor_of (rend_t r) const noexcept
1364 { 1367 {
1365 int base = GET_BASEBG (r); 1368 int base = GET_BASEBG (r);
1366#ifndef NO_BRIGHTCOLOR 1369#ifndef NO_BRIGHTCOLOR
1367 if (r & RS_Blink 1370 if (r & RS_Blink
1368# if ENABLE_STYLES 1371# if ENABLE_STYLES
1373#endif 1376#endif
1374 return base; 1377 return base;
1375 } 1378 }
1376 1379
1377 // modifies first argument(!) 1380 // modifies first argument(!)
1378 void tt_paste (char *data, unsigned int len) NOTHROW; 1381 void tt_paste (char *data, unsigned int len) noexcept;
1379 void paste (char *data, unsigned int len) NOTHROW; 1382 void paste (char *data, unsigned int len) noexcept;
1380 void scr_alloc () NOTHROW; 1383 void scr_alloc () noexcept;
1381 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; 1384 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const noexcept;
1382 void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; 1385 void scr_blank_screen_mem (line_t &l, rend_t efs) const noexcept;
1383 void scr_kill_char (line_t &l, int col) const NOTHROW; 1386 void scr_kill_char (line_t &l, int col) const noexcept;
1384 void scr_set_char_rend (line_t &l, int col, rend_t rend); 1387 void scr_set_char_rend (line_t &l, int col, rend_t rend);
1385 int scr_scroll_text (int row1, int row2, int count) NOTHROW; 1388 int scr_scroll_text (int row1, int row2, int count) noexcept;
1386 void copy_line (line_t &dst, line_t &src); 1389 void copy_line (line_t &dst, line_t &src);
1387 void scr_reset (); 1390 void scr_reset ();
1388 void scr_release () NOTHROW; 1391 void scr_release () noexcept;
1389 void scr_clear (bool really = false) NOTHROW; 1392 void scr_clear (bool really = false) noexcept;
1390 void scr_refresh () NOTHROW; 1393 void scr_refresh () noexcept;
1391 bool scr_refresh_rend (rend_t mask, rend_t value) NOTHROW; 1394 bool scr_refresh_rend (rend_t mask, rend_t value) noexcept;
1392 void scr_erase_screen (int mode) NOTHROW; 1395 void scr_erase_screen (int mode) noexcept;
1393#if ENABLE_FRILLS 1396#if ENABLE_FRILLS
1394 void scr_erase_savelines () NOTHROW; 1397 void scr_erase_savelines () noexcept;
1395 void scr_backindex () NOTHROW; 1398 void scr_backindex () noexcept;
1396 void scr_forwardindex () NOTHROW; 1399 void scr_forwardindex () noexcept;
1397#endif 1400#endif
1398 void scr_touch (bool refresh) NOTHROW; 1401 void scr_touch (bool refresh) noexcept;
1399 void scr_expose (int x, int y, int width, int height, bool refresh) NOTHROW; 1402 void scr_expose (int x, int y, int width, int height, bool refresh) noexcept;
1400 void scr_recolor (bool refresh = true) NOTHROW; 1403 void scr_recolor (bool refresh = true) noexcept;
1401 void scr_remap_chars () NOTHROW; 1404 void scr_remap_chars () noexcept;
1402 void scr_remap_chars (line_t &l) NOTHROW; 1405 void scr_remap_chars (line_t &l) noexcept;
1403 1406
1404 enum cursor_mode { SAVE, RESTORE }; 1407 enum cursor_mode { SAVE, RESTORE };
1405 1408
1406 void scr_poweron (); 1409 void scr_poweron ();
1407 void scr_soft_reset () NOTHROW; 1410 void scr_soft_reset () noexcept;
1408 void scr_cursor (cursor_mode mode) NOTHROW; 1411 void scr_cursor (cursor_mode mode) noexcept;
1409 void scr_do_wrap () NOTHROW; 1412 void scr_do_wrap () noexcept;
1410 void scr_swap_screen () NOTHROW; 1413 void scr_swap_screen () noexcept;
1411 void scr_change_screen (int scrn); 1414 void scr_change_screen (int scrn);
1412 void scr_color (unsigned int color, int fgbg) NOTHROW; 1415 void scr_color (unsigned int color, int fgbg) noexcept;
1413 void scr_rendition (int set, int style) NOTHROW; 1416 void scr_rendition (int set, int style) noexcept;
1414 void scr_add_lines (const wchar_t *str, int len, int minlines = 0) NOTHROW; 1417 void scr_add_lines (const wchar_t *str, int len, int minlines = 0) noexcept;
1415 void scr_backspace () NOTHROW; 1418 void scr_backspace () noexcept;
1416 void scr_tab (int count, bool ht = false) NOTHROW; 1419 void scr_tab (int count, bool ht = false) noexcept;
1417 void scr_gotorc (int row, int col, int relative) NOTHROW; 1420 void scr_gotorc (int row, int col, int relative) noexcept;
1418 void scr_index (enum page_dirn direction) NOTHROW; 1421 void scr_index (enum page_dirn direction) noexcept;
1419 void scr_erase_line (int mode) NOTHROW; 1422 void scr_erase_line (int mode) noexcept;
1420 void scr_E () NOTHROW; 1423 void scr_E () noexcept;
1421 void scr_insdel_lines (int count, int insdel) NOTHROW; 1424 void scr_insdel_lines (int count, int insdel) noexcept;
1422 void scr_insdel_chars (int count, int insdel) NOTHROW; 1425 void scr_insdel_chars (int count, int insdel) noexcept;
1423 void scr_scroll_region (int top, int bot) NOTHROW; 1426 void scr_scroll_region (int top, int bot) noexcept;
1424 void scr_cursor_visible (int mode) NOTHROW; 1427 void scr_cursor_visible (int mode) noexcept;
1425 void scr_autowrap (int mode) NOTHROW; 1428 void scr_autowrap (int mode) noexcept;
1426 void scr_relative_origin (int mode) NOTHROW; 1429 void scr_relative_origin (int mode) noexcept;
1427 void scr_insert_mode (int mode) NOTHROW; 1430 void scr_insert_mode (int mode) noexcept;
1428 void scr_set_tab (int mode) NOTHROW; 1431 void scr_set_tab (int mode) noexcept;
1429 void scr_rvideo_mode (bool on) NOTHROW; 1432 void scr_rvideo_mode (bool on) noexcept;
1430 void scr_report_position () NOTHROW; 1433 void scr_report_position () noexcept;
1431 void set_font_style () NOTHROW; 1434 void set_font_style () noexcept;
1432 void scr_charset_choose (int set) NOTHROW; 1435 void scr_charset_choose (int set) noexcept;
1433 void scr_charset_set (int set, unsigned int ch) NOTHROW; 1436 void scr_charset_set (int set, unsigned int ch) noexcept;
1434 void scr_move_to (int y, int len) NOTHROW; 1437 void scr_move_to (int y, int len) noexcept;
1435 bool scr_page (int nlines) NOTHROW; 1438 bool scr_page (int nlines) noexcept;
1436 bool scr_page (enum page_dirn direction, int nlines) NOTHROW 1439 bool scr_page (enum page_dirn direction, int nlines) noexcept
1437 { 1440 {
1438 return scr_page (direction * nlines); 1441 return scr_page (direction * nlines);
1439 } 1442 }
1440 bool scr_changeview (int new_view_start) NOTHROW; 1443 bool scr_changeview (int new_view_start) noexcept;
1441 void scr_bell () NOTHROW; 1444 void scr_bell () noexcept;
1442 void scr_printscreen (int fullhist) NOTHROW; 1445 void scr_printscreen (int fullhist) noexcept;
1443 void scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle1, rend_t rstyle2) NOTHROW; 1446 void scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle1, rend_t rstyle2) noexcept;
1444 void scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle) NOTHROW; 1447 void scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, rend_t rstyle) noexcept;
1445 void scr_reverse_selection () NOTHROW; 1448 void scr_reverse_selection () noexcept;
1446 void scr_dump (int fd) NOTHROW; 1449 void scr_dump (int fd) noexcept;
1447 1450
1448 void selection_check (int check_more) NOTHROW; 1451 void selection_check (int check_more) noexcept;
1449 void selection_changed () NOTHROW; /* sets want_refresh, corrects coordinates */ 1452 void selection_changed () noexcept; /* sets want_refresh, corrects coordinates */
1450 void selection_request (Time tm, int selnum = Sel_Primary) NOTHROW; 1453 void selection_request (Time tm, int selnum = Sel_Primary) noexcept;
1451 void selection_clear (bool clipboard = false) NOTHROW; 1454 void selection_clear (bool clipboard = false) noexcept;
1452 void selection_make (Time tm); 1455 void selection_make (Time tm);
1453 bool selection_grab (Time tm, bool clipboard = false) NOTHROW; 1456 bool selection_grab (Time tm, bool clipboard = false) noexcept;
1454 void selection_start_colrow (int col, int row) NOTHROW; 1457 void selection_start_colrow (int col, int row) noexcept;
1455 void selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, row_col_t *ret) NOTHROW; 1458 void selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, row_col_t *ret) noexcept;
1456 void selection_extend_colrow (int32_t col, int32_t row, int button3, int buttonpress, int clickchange) NOTHROW; 1459 void selection_extend_colrow (int32_t col, int32_t row, int button3, int buttonpress, int clickchange) noexcept;
1457 void selection_remove_trailing_spaces () NOTHROW; 1460 void selection_remove_trailing_spaces () noexcept;
1458 void selection_send (const XSelectionRequestEvent &rq) NOTHROW; 1461 void selection_send (const XSelectionRequestEvent &rq) noexcept;
1459 void selection_click (int clicks, int x, int y) NOTHROW; 1462 void selection_click (int clicks, int x, int y) noexcept;
1460 void selection_extend (int x, int y, int flag) NOTHROW; 1463 void selection_extend (int x, int y, int flag) noexcept;
1461 void selection_rotate (int x, int y) NOTHROW; 1464 void selection_rotate (int x, int y) noexcept;
1462 1465
1463 // xdefaults.C 1466 // xdefaults.C
1464 void rxvt_usage (int type); 1467 void rxvt_usage (int type);
1465 const char **get_options (int argc, const char *const *argv); 1468 const char **get_options (int argc, const char *const *argv);
1466 int parse_keysym (const char *str, unsigned int &state); 1469 int parse_keysym (const char *str, unsigned int &state);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines