… | |
… | |
140 | valid_keysym = keysym != NoSymbol; |
140 | valid_keysym = keysym != NoSymbol; |
141 | } |
141 | } |
142 | |
142 | |
143 | if (valid_keysym) |
143 | if (valid_keysym) |
144 | { |
144 | { |
145 | /* for some backwards compatibility */ |
|
|
146 | #if defined(HOTKEY_CTRL) || defined(HOTKEY_META) |
|
|
147 | # ifdef HOTKEY_CTRL |
|
|
148 | if (ctrl) |
|
|
149 | # else |
|
|
150 | if (meta) |
|
|
151 | # endif |
|
|
152 | { |
|
|
153 | if (keysym == ks_bigfont) |
|
|
154 | { |
|
|
155 | change_font (FONT_UP); |
|
|
156 | return; |
|
|
157 | } |
|
|
158 | else if (keysym == ks_smallfont) |
|
|
159 | { |
|
|
160 | change_font (FONT_DN); |
|
|
161 | return; |
|
|
162 | } |
|
|
163 | } |
|
|
164 | #endif |
|
|
165 | |
|
|
166 | if (TermWin.saveLines) |
145 | if (TermWin.saveLines) |
167 | { |
146 | { |
168 | #ifdef UNSHIFTED_SCROLLKEYS |
147 | #ifdef UNSHIFTED_SCROLLKEYS |
169 | if (!ctrl && !meta) |
148 | if (!ctrl && !meta) |
170 | { |
149 | { |
… | |
… | |
261 | #ifdef KEYSYM_RESOURCE |
240 | #ifdef KEYSYM_RESOURCE |
262 | if (! (shft | ctrl) && Keysym_map[keysym & 0xFF] != NULL) |
241 | if (! (shft | ctrl) && Keysym_map[keysym & 0xFF] != NULL) |
263 | { |
242 | { |
264 | unsigned int l; |
243 | unsigned int l; |
265 | const unsigned char *kbuf0; |
244 | const unsigned char *kbuf0; |
266 | const unsigned char ch = C0_ESC; |
|
|
267 | |
245 | |
268 | kbuf0 = (Keysym_map[keysym & 0xFF]); |
246 | kbuf0 = (Keysym_map[keysym & 0xFF]); |
269 | l = (unsigned int)*kbuf0++; |
247 | l = (unsigned int)*kbuf0++; |
270 | |
248 | |
271 | /* escape prefix */ |
249 | /* escape prefix */ |
272 | if (meta) |
250 | if (meta |
273 | # ifdef META8_OPTION |
251 | # ifdef META8_OPTION |
274 | if (meta_char == C0_ESC) |
252 | && meta_char == C0_ESC |
275 | # endif |
253 | # endif |
|
|
254 | ) |
|
|
255 | { |
|
|
256 | const unsigned char ch = C0_ESC; |
276 | tt_write (&ch, 1); |
257 | tt_write (&ch, 1); |
|
|
258 | } |
|
|
259 | |
277 | tt_write (kbuf0, l); |
260 | tt_write (kbuf0, l); |
278 | return; |
261 | return; |
279 | } |
262 | } |
280 | else |
263 | else |
281 | #endif |
264 | #endif |
… | |
… | |
545 | break; |
528 | break; |
546 | } |
529 | } |
547 | if (newlen) |
530 | if (newlen) |
548 | len = STRLEN (kbuf); |
531 | len = STRLEN (kbuf); |
549 | } |
532 | } |
|
|
533 | |
550 | /* |
534 | /* |
551 | * Pass meta for all function keys, if 'meta' option set |
535 | * Pass meta for all function keys, if 'meta' option set |
552 | */ |
536 | */ |
553 | #ifdef META8_OPTION |
537 | #ifdef META8_OPTION |
554 | if (meta && (meta_char == 0x80) && len > 0) |
538 | if (meta && (meta_char == 0x80) && len > 0) |
… | |
… | |
569 | { |
553 | { |
570 | unsigned char *ch; |
554 | unsigned char *ch; |
571 | |
555 | |
572 | for (ch = kbuf; ch < kbuf + len; ch++) |
556 | for (ch = kbuf; ch < kbuf + len; ch++) |
573 | *ch |= 0x80; |
557 | *ch |= 0x80; |
|
|
558 | |
574 | meta = 0; |
559 | meta = 0; |
575 | } |
560 | } |
576 | #endif |
561 | #endif |
577 | /* nil */ ; |
562 | /* nil */ ; |
578 | } |
563 | } |
… | |
… | |
1934 | if (have_pixmap) |
1919 | if (have_pixmap) |
1935 | { |
1920 | { |
1936 | /* |
1921 | /* |
1937 | * Copy display->root pixmap transparency |
1922 | * Copy display->root pixmap transparency |
1938 | */ |
1923 | */ |
1939 | int sx, sy, nx, ny; |
1924 | int sx, sy, nx, ny; |
1940 | unsigned int nw, nh; |
1925 | unsigned int nw, nh; |
1941 | Window cr; |
1926 | Window cr; |
1942 | XImage *image; |
1927 | XImage *image; |
1943 | GC gc; |
1928 | GC gc; |
1944 | XGCValues gcvalue; |
1929 | XGCValues gcvalue; |
1945 | |
1930 | |
1946 | XTranslateCoordinates (display->display, TermWin.parent[0], display->root, |
1931 | XTranslateCoordinates (display->display, TermWin.parent[0], display->root, |
1947 | 0, 0, &sx, &sy, &cr); |
1932 | 0, 0, &sx, &sy, &cr); |
1948 | nw = (unsigned int)szHint.width; |
1933 | nw = (unsigned int)szHint.width; |
1949 | nh = (unsigned int)szHint.height; |
1934 | nh = (unsigned int)szHint.height; |
1950 | nx = ny = 0; |
1935 | nx = ny = 0; |
|
|
1936 | |
1951 | if (sx < 0) |
1937 | if (sx < 0) |
1952 | { |
1938 | { |
1953 | nw += sx; |
1939 | nw += sx; |
1954 | nx = -sx; |
1940 | nx = -sx; |
1955 | sx = 0; |
1941 | sx = 0; |
1956 | } |
1942 | } |
|
|
1943 | |
1957 | if (sy < 0) |
1944 | if (sy < 0) |
1958 | { |
1945 | { |
1959 | nh += sy; |
1946 | nh += sy; |
1960 | ny = -sy; |
1947 | ny = -sy; |
1961 | sy = 0; |
1948 | sy = 0; |
1962 | } |
1949 | } |
|
|
1950 | |
1963 | MIN_IT (nw, (unsigned int) (wrootattr.width - sx)); |
1951 | MIN_IT (nw, (unsigned int) (wrootattr.width - sx)); |
1964 | MIN_IT (nh, (unsigned int) (wrootattr.height - sy)); |
1952 | MIN_IT (nh, (unsigned int) (wrootattr.height - sy)); |
1965 | allowedxerror = -1; |
1953 | allowedxerror = -1; |
1966 | image = XGetImage (display->display, rootpixmap, sx, sy, nw, nh, AllPlanes, |
1954 | image = XGetImage (display->display, rootpixmap, sx, sy, nw, nh, AllPlanes, |
1967 | ZPixmap); |
1955 | ZPixmap); |
… | |
… | |
2000 | if (!am_transparent || !am_pixmap_trans) |
1988 | if (!am_transparent || !am_pixmap_trans) |
2001 | pchanged = 1; |
1989 | pchanged = 1; |
2002 | am_transparent = am_pixmap_trans = 1; |
1990 | am_transparent = am_pixmap_trans = 1; |
2003 | } |
1991 | } |
2004 | } |
1992 | } |
|
|
1993 | |
2005 | if (!am_pixmap_trans) |
1994 | if (!am_pixmap_trans) |
2006 | { |
1995 | { |
2007 | unsigned int n; |
1996 | unsigned int n; |
2008 | /* |
1997 | /* |
2009 | * InheritPixmap transparency |
1998 | * InheritPixmap transparency |
… | |
… | |
2024 | break; |
2013 | break; |
2025 | } |
2014 | } |
2026 | if (oldp != TermWin.parent[i]) |
2015 | if (oldp != TermWin.parent[i]) |
2027 | pchanged = 1; |
2016 | pchanged = 1; |
2028 | } |
2017 | } |
|
|
2018 | |
2029 | n = 0; |
2019 | n = 0; |
|
|
2020 | |
2030 | if (pchanged) |
2021 | if (pchanged) |
2031 | { |
2022 | { |
2032 | for (; n < (unsigned int)i; n++) |
2023 | for (; n < (unsigned int)i; n++) |
2033 | { |
2024 | { |
2034 | XGetWindowAttributes (display->display, TermWin.parent[n], &wattr); |
2025 | XGetWindowAttributes (display->display, TermWin.parent[n], &wattr); |
… | |
… | |
2038 | n = (int) (sizeof (TermWin.parent) / sizeof (Window)) + 1; |
2029 | n = (int) (sizeof (TermWin.parent) / sizeof (Window)) + 1; |
2039 | break; |
2030 | break; |
2040 | } |
2031 | } |
2041 | } |
2032 | } |
2042 | } |
2033 | } |
|
|
2034 | |
2043 | if (n > (int) (sizeof (TermWin.parent) |
2035 | if (n > (int) (sizeof (TermWin.parent) |
2044 | / sizeof (TermWin.parent[0]))) |
2036 | / sizeof (TermWin.parent[0]))) |
2045 | { |
2037 | { |
2046 | D_X ((stderr, "InheritPixmap Turning off")); |
2038 | D_X ((stderr, "InheritPixmap Turning off")); |
2047 | XSetWindowBackground (display->display, TermWin.parent[0], |
2039 | XSetWindowBackground (display->display, TermWin.parent[0], |
… | |
… | |
2070 | ParentRelative); |
2062 | ParentRelative); |
2071 | XSetWindowBackgroundPixmap (display->display, TermWin.vt, |
2063 | XSetWindowBackgroundPixmap (display->display, TermWin.vt, |
2072 | ParentRelative); |
2064 | ParentRelative); |
2073 | am_transparent = 1; |
2065 | am_transparent = 1; |
2074 | } |
2066 | } |
|
|
2067 | |
2075 | for (; i < (int) (sizeof (TermWin.parent) / sizeof (Window)); i++) |
2068 | for (; i < (int) (sizeof (TermWin.parent) / sizeof (Window)); i++) |
2076 | TermWin.parent[i] = None; |
2069 | TermWin.parent[i] = None; |
2077 | } |
2070 | } |
2078 | return pchanged; |
2071 | return pchanged; |
2079 | } |
2072 | } |
… | |
… | |
2085 | /*----------------------------------------------------------------------*/ |
2078 | /*----------------------------------------------------------------------*/ |
2086 | #ifdef PRINTPIPE |
2079 | #ifdef PRINTPIPE |
2087 | FILE * |
2080 | FILE * |
2088 | rxvt_term::popen_printer () |
2081 | rxvt_term::popen_printer () |
2089 | { |
2082 | { |
2090 | FILE *stream = popen (rs[Rs_print_pipe], "w"); |
2083 | FILE *stream = popen (rs[Rs_print_pipe], "w"); |
2091 | |
2084 | |
2092 | if (stream == NULL) |
2085 | if (stream == NULL) |
2093 | rxvt_print_error ("can't open printer pipe"); |
2086 | rxvt_print_error ("can't open printer pipe"); |
2094 | return stream; |
2087 | return stream; |
2095 | } |
2088 | } |
… | |
… | |
2936 | * 19 = change underlined character color |
2929 | * 19 = change underlined character color |
2937 | * 46 = change logfile (not implemented) |
2930 | * 46 = change logfile (not implemented) |
2938 | * 50 = change font |
2931 | * 50 = change font |
2939 | * |
2932 | * |
2940 | * rxvt extensions: |
2933 | * rxvt extensions: |
2941 | * 9 = change locale (NYI) |
|
|
2942 | * 10 = menu (may change in future) |
2934 | * 10 = menu (may change in future) |
2943 | * 20 = bg pixmap |
2935 | * 20 = bg pixmap |
2944 | * 39 = change default fg color |
2936 | * 39 = change default fg color |
2945 | * 49 = change default bg color |
2937 | * 49 = change default bg color |
2946 | * 55 = dump scrollback buffer and all of screen |
2938 | * 55 = dump scrollback buffer and all of screen |
|
|
2939 | * 701 = change locale |
|
|
2940 | * 702 = find font |
2947 | */ |
2941 | */ |
2948 | void |
2942 | void |
2949 | rxvt_term::xterm_seq (int op, const char *str, unsigned char resp __attribute__ ((unused))) |
2943 | rxvt_term::xterm_seq (int op, const char *str, unsigned char resp __attribute__ ((unused))) |
2950 | { |
2944 | { |
2951 | int changed = 0; |
2945 | int changed = 0; |
… | |
… | |
3049 | { |
3043 | { |
3050 | set_locale (str); |
3044 | set_locale (str); |
3051 | # ifdef USE_XIM |
3045 | # ifdef USE_XIM |
3052 | im_cb (); |
3046 | im_cb (); |
3053 | # endif |
3047 | # endif |
3054 | // TODO: call selection_make with the right values set |
|
|
3055 | // to re-fresh the selection. |
|
|
3056 | if (display->selection_owner == this) |
|
|
3057 | display->set_selection_owner (0); |
|
|
3058 | } |
3048 | } |
|
|
3049 | break; |
|
|
3050 | case XTerm_findfont: |
|
|
3051 | { |
|
|
3052 | int fid = TermWin.fontset->find_font (atoi (str)); |
|
|
3053 | tt_printf ("%d %-.250s\n", fid, (*TermWin.fontset)[fid]->name); |
|
|
3054 | } |
3059 | break; |
3055 | break; |
3060 | #endif |
3056 | #endif |
3061 | #if 0 |
3057 | #if 0 |
3062 | case XTerm_dumpscreen: /* no error notices */ |
3058 | case XTerm_dumpscreen: /* no error notices */ |
3063 | { |
3059 | { |
… | |
… | |
3193 | */ |
3189 | */ |
3194 | PrivMode (1, PrivMode_vt52); |
3190 | PrivMode (1, PrivMode_vt52); |
3195 | break; |
3191 | break; |
3196 | case 3: /* 80/132 */ |
3192 | case 3: /* 80/132 */ |
3197 | if (PrivateModes & PrivMode_132OK) |
3193 | if (PrivateModes & PrivMode_132OK) |
3198 | set_widthheight ( (unsigned int) ((state ? 132 : 80) * TermWin.fwidth), |
3194 | set_widthheight (((state ? 132 : 80) * TermWin.fwidth), TermWin.height); |
3199 | (unsigned int)TermWin.height); |
|
|
3200 | break; |
3195 | break; |
3201 | case 4: /* smooth scrolling */ |
3196 | case 4: /* smooth scrolling */ |
3202 | if (state) |
3197 | if (state) |
3203 | Options &= ~Opt_jumpScroll; |
3198 | Options &= ~Opt_jumpScroll; |
3204 | else |
3199 | else |