… | |
… | |
155 | } |
155 | } |
156 | |
156 | |
157 | x--; |
157 | x--; |
158 | } |
158 | } |
159 | } |
159 | } |
160 | #endif |
|
|
161 | |
160 | |
162 | void |
161 | void |
163 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
162 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
164 | { |
163 | { |
165 | #if ENABLE_OVERLAY |
|
|
166 | rxvt_fontset *fs = FONTSET (r); |
164 | rxvt_fontset *fs = FONTSET (r); |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
165 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
166 | wchar_t *chr, *alloc, ch2, *fname; |
169 | int len; |
167 | int len; |
170 | |
168 | |
… | |
… | |
189 | |
187 | |
190 | char attr[80]; // plenty |
188 | char attr[80]; // plenty |
191 | |
189 | |
192 | sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", |
190 | sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", |
193 | (int)r, |
191 | (int)r, |
194 | GET_FGCOLOR (r), GET_BGCOLOR (r), |
192 | fgcolor_of (r), bgcolor_of (r), |
195 | r & RS_Bold ? " bold" : "", |
193 | r & RS_Bold ? " bold" : "", |
196 | r & RS_Italic ? " italic" : "", |
194 | r & RS_Italic ? " italic" : "", |
197 | r & RS_Blink ? " blink" : "", |
195 | r & RS_Blink ? " blink" : "", |
198 | r & RS_RVid ? " rvid" : "", |
196 | r & RS_RVid ? " rvid" : "", |
199 | r & RS_Uline ? " uline" : "", |
197 | r & RS_Uline ? " uline" : "", |
… | |
… | |
238 | |
236 | |
239 | # if ENABLE_COMBINING |
237 | # if ENABLE_COMBINING |
240 | if (alloc) |
238 | if (alloc) |
241 | delete [] alloc; |
239 | delete [] alloc; |
242 | # endif |
240 | # endif |
243 | #endif |
|
|
244 | } |
241 | } |
|
|
242 | #endif |
245 | |
243 | |
246 | void |
244 | void |
247 | rxvt_term::commit_iso14755 () |
245 | rxvt_term::commit_iso14755 () |
248 | { |
246 | { |
249 | wchar_t ch[2]; |
247 | wchar_t ch[2]; |
… | |
… | |
866 | } |
864 | } |
867 | |
865 | |
868 | if (len <= 0) |
866 | if (len <= 0) |
869 | return; /* not mapped */ |
867 | return; /* not mapped */ |
870 | |
868 | |
871 | if (options & Opt_scrollTtyKeypress) |
869 | if (OPTION (Opt_scrollTtyKeypress)) |
872 | if (view_start) |
870 | if (view_start) |
873 | { |
871 | { |
874 | view_start = 0; |
872 | view_start = 0; |
875 | want_refresh = 1; |
873 | want_refresh = 1; |
876 | } |
874 | } |
… | |
… | |
1093 | } |
1091 | } |
1094 | else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0) |
1092 | else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0) |
1095 | { |
1093 | { |
1096 | pty_ev.stop (); |
1094 | pty_ev.stop (); |
1097 | |
1095 | |
1098 | if (!(options & Opt_hold)) |
1096 | if (!OPTION (Opt_hold)) |
1099 | destroy (); |
1097 | destroy (); |
1100 | } |
1098 | } |
1101 | |
1099 | |
1102 | return false; |
1100 | return false; |
1103 | } |
1101 | } |
… | |
… | |
1125 | recolour_cursor (); |
1123 | recolour_cursor (); |
1126 | |
1124 | |
1127 | #ifdef POINTER_BLANK |
1125 | #ifdef POINTER_BLANK |
1128 | hidden_pointer = 0; |
1126 | hidden_pointer = 0; |
1129 | |
1127 | |
1130 | if (options & Opt_pointerBlank) |
1128 | if (OPTION (Opt_pointerBlank)) |
1131 | pointer_ev.start (NOW + pointerBlankDelay); |
1129 | pointer_ev.start (NOW + pointerBlankDelay); |
1132 | #endif |
1130 | #endif |
1133 | } |
1131 | } |
1134 | |
1132 | |
1135 | #ifdef POINTER_BLANK |
1133 | #ifdef POINTER_BLANK |
1136 | void |
1134 | void |
1137 | rxvt_term::pointer_blank () |
1135 | rxvt_term::pointer_blank () |
1138 | { |
1136 | { |
1139 | if (! (options & Opt_pointerBlank)) |
1137 | if (! OPTION (Opt_pointerBlank)) |
1140 | return; |
1138 | return; |
1141 | |
1139 | |
1142 | XDefineCursor (display->display, vt, display->blank_cursor); |
1140 | XDefineCursor (display->display, vt, display->blank_cursor); |
1143 | XFlush (display->display); |
1141 | XFlush (display->display); |
1144 | |
1142 | |
… | |
… | |
1242 | |
1240 | |
1243 | SET_R (this); |
1241 | SET_R (this); |
1244 | SET_LOCALE (locale); |
1242 | SET_LOCALE (locale); |
1245 | |
1243 | |
1246 | #if defined(CURSOR_BLINK) |
1244 | #if defined(CURSOR_BLINK) |
1247 | if ((options & Opt_cursorBlink) && ev.type == KeyPress) |
1245 | if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) |
1248 | { |
1246 | { |
1249 | if (hidden_cursor) |
1247 | if (hidden_cursor) |
1250 | { |
1248 | { |
1251 | hidden_cursor = 0; |
1249 | hidden_cursor = 0; |
1252 | want_refresh = 1; |
1250 | want_refresh = 1; |
… | |
… | |
1255 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1253 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1256 | } |
1254 | } |
1257 | #endif |
1255 | #endif |
1258 | |
1256 | |
1259 | #if defined(POINTER_BLANK) |
1257 | #if defined(POINTER_BLANK) |
1260 | if ((options & Opt_pointerBlank) && pointerBlankDelay > 0) |
1258 | if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) |
1261 | { |
1259 | { |
1262 | if (ev.type == MotionNotify |
1260 | if (ev.type == MotionNotify |
1263 | || ev.type == ButtonPress |
1261 | || ev.type == ButtonPress |
1264 | || ev.type == ButtonRelease) |
1262 | || ev.type == ButtonRelease) |
1265 | if (hidden_pointer) |
1263 | if (hidden_pointer) |
… | |
… | |
1461 | seen_resize = 1; |
1459 | seen_resize = 1; |
1462 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1460 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1463 | } |
1461 | } |
1464 | |
1462 | |
1465 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1463 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1466 | if (options & Opt_transparent) |
1464 | if (OPTION (Opt_transparent)) |
1467 | check_our_parents (); |
1465 | check_our_parents (); |
1468 | #endif |
1466 | #endif |
1469 | } |
1467 | } |
1470 | break; |
1468 | break; |
1471 | |
1469 | |
… | |
… | |
1680 | IMSetStatusPosition (); |
1678 | IMSetStatusPosition (); |
1681 | XSetICFocus (Input_Context); |
1679 | XSetICFocus (Input_Context); |
1682 | } |
1680 | } |
1683 | #endif |
1681 | #endif |
1684 | #if CURSOR_BLINK |
1682 | #if CURSOR_BLINK |
1685 | if (options & Opt_cursorBlink) |
1683 | if (OPTION (Opt_cursorBlink)) |
1686 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1684 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
1687 | #endif |
1685 | #endif |
1688 | #if OFF_FOCUS_FADING |
1686 | #if OFF_FOCUS_FADING |
1689 | if (rs[Rs_fade]) |
1687 | if (rs[Rs_fade]) |
1690 | { |
1688 | { |
… | |
… | |
1712 | #if USE_XIM |
1710 | #if USE_XIM |
1713 | if (Input_Context != NULL) |
1711 | if (Input_Context != NULL) |
1714 | XUnsetICFocus (Input_Context); |
1712 | XUnsetICFocus (Input_Context); |
1715 | #endif |
1713 | #endif |
1716 | #if CURSOR_BLINK |
1714 | #if CURSOR_BLINK |
1717 | if (options & Opt_cursorBlink) |
1715 | if (OPTION (Opt_cursorBlink)) |
1718 | cursor_blink_ev.stop (); |
1716 | cursor_blink_ev.stop (); |
1719 | hidden_cursor = 0; |
1717 | hidden_cursor = 0; |
1720 | #endif |
1718 | #endif |
1721 | #if OFF_FOCUS_FADING |
1719 | #if OFF_FOCUS_FADING |
1722 | if (rs[Rs_fade]) |
1720 | if (rs[Rs_fade]) |
… | |
… | |
1746 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1744 | && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) |
1747 | return; |
1745 | return; |
1748 | |
1746 | |
1749 | /* FALLTHROUGH */ |
1747 | /* FALLTHROUGH */ |
1750 | case ReparentNotify: |
1748 | case ReparentNotify: |
1751 | if ((options & Opt_transparent) && check_our_parents () && am_transparent) |
1749 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1752 | want_refresh = want_full_refresh = 1; |
1750 | want_refresh = want_full_refresh = 1; |
1753 | break; |
1751 | break; |
1754 | } |
1752 | } |
1755 | } |
1753 | } |
1756 | #endif |
1754 | #endif |
… | |
… | |
2098 | |
2096 | |
2099 | v = ev.button == Button4 ? UP : DN; |
2097 | v = ev.button == Button4 ? UP : DN; |
2100 | |
2098 | |
2101 | if (ev.state & ShiftMask) |
2099 | if (ev.state & ShiftMask) |
2102 | i = 1; |
2100 | i = 1; |
2103 | else if (options & Opt_mouseWheelScrollPage) |
2101 | else if (OPTION (Opt_mouseWheelScrollPage)) |
2104 | i = nrow - 1; |
2102 | i = nrow - 1; |
2105 | else |
2103 | else |
2106 | i = 5; |
2104 | i = 5; |
2107 | |
2105 | |
2108 | # ifdef MOUSE_SLIP_WHEELING |
2106 | # ifdef MOUSE_SLIP_WHEELING |
… | |
… | |
2394 | XWindowAttributes wattr, wrootattr; |
2392 | XWindowAttributes wattr, wrootattr; |
2395 | dDisp; |
2393 | dDisp; |
2396 | |
2394 | |
2397 | pchanged = 0; |
2395 | pchanged = 0; |
2398 | |
2396 | |
2399 | if (!(options & Opt_transparent)) |
2397 | if (!OPTION (Opt_transparent)) |
2400 | return pchanged; /* Don't try any more */ |
2398 | return pchanged; /* Don't try any more */ |
2401 | |
2399 | |
2402 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2400 | XGetWindowAttributes (disp, display->root, &wrootattr); |
2403 | rootdepth = wrootattr.depth; |
2401 | rootdepth = wrootattr.depth; |
2404 | |
2402 | |
… | |
… | |
2682 | if (ch == C0_LF) |
2680 | if (ch == C0_LF) |
2683 | nlines++; |
2681 | nlines++; |
2684 | |
2682 | |
2685 | refresh_count++; |
2683 | refresh_count++; |
2686 | |
2684 | |
2687 | if (!(options & Opt_jumpScroll) |
2685 | if (!OPTION (Opt_jumpScroll) |
2688 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2686 | || (refresh_count >= refresh_limit * (nrow - 1))) |
2689 | { |
2687 | { |
2690 | refreshnow = true; |
2688 | refreshnow = true; |
2691 | ch = NOCHAR; |
2689 | ch = NOCHAR; |
2692 | break; |
2690 | break; |
… | |
… | |
2726 | * the number of pages between refreshes is refresh_limit, which |
2724 | * the number of pages between refreshes is refresh_limit, which |
2727 | * is incremented here because we must be doing flat-out scrolling. |
2725 | * is incremented here because we must be doing flat-out scrolling. |
2728 | */ |
2726 | */ |
2729 | if (refreshnow) |
2727 | if (refreshnow) |
2730 | { |
2728 | { |
2731 | if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2729 | if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) |
2732 | refresh_limit++; |
2730 | refresh_limit++; |
2733 | else |
2731 | else |
2734 | { |
2732 | { |
2735 | flag = true; |
2733 | flag = true; |
2736 | scr_refresh (refresh_type); |
2734 | scr_refresh (refresh_type); |
… | |
… | |
3400 | break; |
3398 | break; |
3401 | case 6: /* CPR requested */ |
3399 | case 6: /* CPR requested */ |
3402 | scr_report_position (); |
3400 | scr_report_position (); |
3403 | break; |
3401 | break; |
3404 | case 7: /* unofficial extension */ |
3402 | case 7: /* unofficial extension */ |
3405 | if (options & Opt_insecure) |
3403 | if (OPTION (Opt_insecure)) |
3406 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3404 | tt_printf ("%-.250s\012", rs[Rs_display_name]); |
3407 | break; |
3405 | break; |
3408 | case 8: /* unofficial extension */ |
3406 | case 8: /* unofficial extension */ |
3409 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3407 | process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); |
3410 | break; |
3408 | break; |
… | |
… | |
3574 | break; |
3572 | break; |
3575 | case 20: /* report icon label */ |
3573 | case 20: /* report icon label */ |
3576 | { |
3574 | { |
3577 | char *s; |
3575 | char *s; |
3578 | XGetIconName (disp, parent[0], &s); |
3576 | XGetIconName (disp, parent[0], &s); |
3579 | tt_printf ("\033]L%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3577 | tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3580 | XFree (s); |
3578 | XFree (s); |
3581 | } |
3579 | } |
3582 | break; |
3580 | break; |
3583 | case 21: /* report window title */ |
3581 | case 21: /* report window title */ |
3584 | { |
3582 | { |
3585 | char *s; |
3583 | char *s; |
3586 | XFetchName (disp, parent[0], &s); |
3584 | XFetchName (disp, parent[0], &s); |
3587 | tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3585 | tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ |
3588 | XFree (s); |
3586 | XFree (s); |
3589 | } |
3587 | } |
3590 | break; |
3588 | break; |
3591 | } |
3589 | } |
3592 | } |
3590 | } |
… | |
… | |
3868 | // TODO, when secure mode? |
3866 | // TODO, when secure mode? |
3869 | break; |
3867 | break; |
3870 | |
3868 | |
3871 | #ifdef MENUBAR |
3869 | #ifdef MENUBAR |
3872 | case URxvt_Menu: |
3870 | case URxvt_Menu: |
3873 | if (options & Opt_insecure) |
3871 | if (OPTION (Opt_insecure)) |
3874 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3872 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3875 | break; |
3873 | break; |
3876 | #endif |
3874 | #endif |
3877 | #if 0 |
3875 | #if 0 |
3878 | case XTerm_dumpscreen: /* no error notices */ |
3876 | case XTerm_dumpscreen: /* no error notices */ |
… | |
… | |
3894 | case URxvt_italicFont: |
3892 | case URxvt_italicFont: |
3895 | case URxvt_boldItalicFont: |
3893 | case URxvt_boldItalicFont: |
3896 | #endif |
3894 | #endif |
3897 | if (query) |
3895 | if (query) |
3898 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3896 | tt_printf ("\33]%d;%-.250s%c", saveop, |
3899 | (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3897 | OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc |
3900 | ? fontset[op - URxvt_font]->fontdesc : "", |
3898 | ? fontset[op - URxvt_font]->fontdesc : "", |
3901 | resp); |
3899 | resp); |
3902 | else |
3900 | else |
3903 | { |
3901 | { |
3904 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
3902 | const char *&res = rs[Rs_font + (op - URxvt_font)]; |
… | |
… | |
3910 | break; |
3908 | break; |
3911 | |
3909 | |
3912 | #if ENABLE_FRILLS |
3910 | #if ENABLE_FRILLS |
3913 | case URxvt_locale: |
3911 | case URxvt_locale: |
3914 | if (query) |
3912 | if (query) |
3915 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); |
3913 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp); |
3916 | else |
3914 | else |
3917 | { |
3915 | { |
3918 | set_locale (str); |
3916 | set_locale (str); |
3919 | pty.set_utf8_mode (enc_utf8); |
3917 | pty.set_utf8_mode (enc_utf8); |
3920 | init_xlocale (); |
3918 | init_xlocale (); |
… | |
… | |
4048 | } |
4046 | } |
4049 | |
4047 | |
4050 | /* extra handling for values with state unkept */ |
4048 | /* extra handling for values with state unkept */ |
4051 | switch (arg[i]) |
4049 | switch (arg[i]) |
4052 | { |
4050 | { |
|
|
4051 | #if ENABLE_STYLES |
|
|
4052 | case 1021: |
|
|
4053 | if (mode) |
|
|
4054 | SET_OPTION (Opt_intensityStyles); |
|
|
4055 | else |
|
|
4056 | CLR_OPTION (Opt_intensityStyles); |
|
|
4057 | #endif |
4053 | case 1048: /* alternative cursor save */ |
4058 | case 1048: /* alternative cursor save */ |
4054 | case 1049: |
4059 | case 1049: |
4055 | if (options & Opt_secondaryScreen) |
4060 | if (OPTION (Opt_secondaryScreen)) |
4056 | if (mode == 0) |
4061 | if (mode == 0) |
4057 | scr_cursor (RESTORE); |
4062 | scr_cursor (RESTORE); |
4058 | else if (mode == 1) |
4063 | else if (mode == 1) |
4059 | scr_cursor (SAVE); |
4064 | scr_cursor (SAVE); |
4060 | break; |
4065 | break; |
… | |
… | |
4075 | case 3: /* 80/132 */ |
4080 | case 3: /* 80/132 */ |
4076 | if (priv_modes & PrivMode_132OK) |
4081 | if (priv_modes & PrivMode_132OK) |
4077 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4082 | set_widthheight (((state ? 132 : 80) * fwidth), height); |
4078 | break; |
4083 | break; |
4079 | case 4: /* smooth scrolling */ |
4084 | case 4: /* smooth scrolling */ |
4080 | if (state) |
4085 | if (!state) |
4081 | options &= ~Opt_jumpScroll; |
4086 | SET_OPTION (Opt_jumpScroll); |
4082 | else |
4087 | else |
4083 | options |= Opt_jumpScroll; |
4088 | CLR_OPTION (Opt_jumpScroll); |
4084 | break; |
4089 | break; |
4085 | case 5: /* reverse video */ |
4090 | case 5: /* reverse video */ |
4086 | scr_rvideo_mode (state); |
4091 | scr_rvideo_mode (state); |
4087 | break; |
4092 | break; |
4088 | case 6: /* relative/absolute origins */ |
4093 | case 6: /* relative/absolute origins */ |
… | |
… | |
4129 | #if 0 |
4134 | #if 0 |
4130 | case 1001: |
4135 | case 1001: |
4131 | break; /* X11 mouse highlighting */ |
4136 | break; /* X11 mouse highlighting */ |
4132 | #endif |
4137 | #endif |
4133 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4138 | case 1010: /* scroll to bottom on TTY output inhibit */ |
4134 | if (state) |
4139 | if (!state) |
4135 | options &= ~Opt_scrollTtyOutput; |
4140 | SET_OPTION (Opt_scrollTtyOutput); |
4136 | else |
4141 | else |
4137 | options |= Opt_scrollTtyOutput; |
4142 | CLR_OPTION (Opt_scrollTtyOutput); |
4138 | break; |
4143 | break; |
4139 | case 1011: /* scroll to bottom on key press */ |
4144 | case 1011: /* scroll to bottom on key press */ |
4140 | if (state) |
4145 | if (state) |
4141 | options |= Opt_scrollTtyKeypress; |
4146 | SET_OPTION (Opt_scrollTtyKeypress); |
4142 | else |
4147 | else |
4143 | options &= ~Opt_scrollTtyKeypress; |
4148 | CLR_OPTION (Opt_scrollTtyKeypress); |
4144 | break; |
4149 | break; |
4145 | case 1047: /* secondary screen w/ clearing last */ |
4150 | case 1047: /* secondary screen w/ clearing last */ |
4146 | if (options & Opt_secondaryScreen) |
4151 | if (OPTION (Opt_secondaryScreen)) |
4147 | if (current_screen != PRIMARY) |
4152 | if (current_screen != PRIMARY) |
4148 | scr_erase_screen (2); |
4153 | scr_erase_screen (2); |
4149 | scr_change_screen (state); |
4154 | scr_change_screen (state); |
4150 | break; |
4155 | break; |
4151 | case 1049: /* secondary screen w/ clearing first */ |
4156 | case 1049: /* secondary screen w/ clearing first */ |
4152 | scr_change_screen (state); |
4157 | scr_change_screen (state); |
4153 | if (options & Opt_secondaryScreen) |
4158 | if (OPTION (Opt_secondaryScreen)) |
4154 | if (current_screen != PRIMARY) |
4159 | if (current_screen != PRIMARY) |
4155 | scr_erase_screen (2); |
4160 | scr_erase_screen (2); |
4156 | break; |
4161 | break; |
4157 | default: |
4162 | default: |
4158 | break; |
4163 | break; |