--- rxvt-unicode/src/command.C 2012/04/11 10:20:00 1.506 +++ rxvt-unicode/src/command.C 2012/05/28 16:40:03 1.512 @@ -133,7 +133,7 @@ 0, }; -void +void ecb_cold rxvt_term::iso14755_54 (int x, int y) { x = Pixel2Col (x); @@ -160,7 +160,7 @@ } } -void +void ecb_cold rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) { rxvt_fontset *fs = FONTSET (r); @@ -256,7 +256,7 @@ } #endif -void +void ecb_cold rxvt_term::commit_iso14755 () { wchar_t ch = iso14755buf & ISO_14755_MASK; @@ -284,7 +284,7 @@ iso14755buf = 0; } -static int +static int ecb_cold hex_keyval (XKeyEvent &ev) { // check whether this event corresponds to a hex digit @@ -303,7 +303,7 @@ } #endif -static inline KeySym +static inline KeySym ecb_cold translate_keypad (KeySym keysym, bool kp) { #ifdef XK_KP_Home @@ -339,7 +339,7 @@ return keysym; } -static inline int +static inline int ecb_cold map_function_key (KeySym keysym) { int param = 0; @@ -398,7 +398,7 @@ return param; } -void +void ecb_cold rxvt_term::key_press (XKeyEvent &ev) { int ctrl, meta, shft, len; @@ -857,7 +857,7 @@ tt_write (kbuf, (unsigned int)len); } -void +void ecb_cold rxvt_term::key_release (XKeyEvent &ev) { #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 || ENABLE_PERL @@ -1020,16 +1020,16 @@ void rxvt_term::cursor_blink_reset () { - if (hidden_cursor) - { - hidden_cursor = 0; - want_refresh = 1; - } + if (hidden_cursor) + { + hidden_cursor = 0; + want_refresh = 1; + } - if (option (Opt_cursorBlink)) - cursor_blink_ev.again (); - else - cursor_blink_ev.stop (); + if (option (Opt_cursorBlink)) + cursor_blink_ev.again (); + else + cursor_blink_ev.stop (); } void @@ -1221,7 +1221,7 @@ refresh_check (); } -void +void ecb_cold rxvt_term::pointer_unblank () { XDefineCursor (dpy, vt, TermWin_cursor); @@ -1236,7 +1236,7 @@ } #ifdef POINTER_BLANK -void +void ecb_cold rxvt_term::pointer_blank () { if (!option (Opt_pointerBlank)) @@ -1248,7 +1248,7 @@ hidden_pointer = 1; } -void +void ecb_cold rxvt_term::pointer_cb (ev::timer &w, int revents) { make_current (); @@ -1350,7 +1350,7 @@ } /*{{{ process an X event */ -void +void ecb_hot rxvt_term::x_cb (XEvent &ev) { make_current (); @@ -1715,7 +1715,7 @@ } #if ENABLE_FRILLS -void +void ecb_cold rxvt_term::set_urgency (bool enable) { if (enable == urgency_hint) @@ -1731,7 +1731,7 @@ } #endif -void +void ecb_cold rxvt_term::focus_in () { if (!focus) @@ -1766,7 +1766,7 @@ } } -void +void ecb_cold rxvt_term::focus_out () { if (focus) @@ -1809,7 +1809,7 @@ } } -void +void ecb_cold rxvt_term::update_fade_color (unsigned int idx) { #if OFF_FOCUS_FADING @@ -1823,7 +1823,7 @@ } #if ENABLE_TRANSPARENCY || ENABLE_PERL -void +void ecb_hot rxvt_term::rootwin_cb (XEvent &ev) { make_current (); @@ -2217,7 +2217,7 @@ /*}}} */ -void +void ecb_hot rxvt_term::cmd_parse () { wchar_t ch = NOCHAR; @@ -2346,7 +2346,7 @@ } // read the next character -wchar_t +wchar_t ecb_hot rxvt_term::next_char () NOTHROW { while (cmdbuf_ptr < cmdbuf_endp) @@ -2380,7 +2380,7 @@ } // read the next octet -uint32_t +uint32_t ecb_hot rxvt_term::next_octet () NOTHROW { return cmdbuf_ptr < cmdbuf_endp @@ -2390,7 +2390,7 @@ static class out_of_input out_of_input; -wchar_t +wchar_t ecb_hot rxvt_term::cmd_getc () THROW ((class out_of_input)) { wchar_t c = next_char (); @@ -2401,7 +2401,7 @@ return c; } -uint32_t +uint32_t ecb_hot rxvt_term::cmd_get8 () THROW ((class out_of_input)) { uint32_t c = next_octet (); @@ -2415,7 +2415,7 @@ /*{{{ print pipe */ /*----------------------------------------------------------------------*/ #ifdef PRINTPIPE -FILE * +FILE * ecb_cold rxvt_term::popen_printer () { FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w"); @@ -2426,7 +2426,7 @@ return stream; } -int +int ecb_cold rxvt_term::pclose_printer (FILE *stream) { fflush (stream); @@ -2436,7 +2436,7 @@ /* * simulate attached vt100 printer */ -void +void ecb_cold rxvt_term::process_print_pipe () { FILE *fd = popen_printer (); @@ -2501,7 +2501,7 @@ }; /*{{{ process non-printing single characters */ -void +void ecb_hot rxvt_term::process_nonprinting (unicode_t ch) { switch (ch) @@ -2557,7 +2557,7 @@ /*{{{ process VT52 escape sequences */ -void +void ecb_cold rxvt_term::process_escape_vt52 (unicode_t ch) { int row, col; @@ -2617,7 +2617,7 @@ /*{{{ process escape sequences */ -void +void ecb_hot rxvt_term::process_escape_seq () { unicode_t ch = cmd_getc (); @@ -2779,7 +2779,7 @@ make_byte (0,0,0,0,0,0,0,0), /* x, y, z, {, |, }, ~, */ }; -void +void ecb_hot rxvt_term::process_csi_seq () { unicode_t ch, priv, i; @@ -3453,10 +3453,19 @@ if (!strcmp (str, "?")) { char str[256]; + int h_scale = 0, v_scale = 0; + int h_align = 0, v_align = 0; + if (image_vec.size () > 0) + { + h_scale = image_vec[0].h_scale; + v_scale = image_vec[0].v_scale; + h_align = image_vec[0].h_align; + v_align = image_vec[0].v_align; + } sprintf (str, "[%dx%d+%d+%d]", - min (h_scale, 32767), min (v_scale, 32767), - min (h_align, 32767), min (v_align, 32767)); + h_scale, v_scale, + h_align, v_align); process_xterm_seq (XTerm_title, str, CHAR_ST); } else @@ -3465,14 +3474,22 @@ if (*str != ';') { - if (bg_set_file (str)) /* change pixmap */ - changed = true; + if (image_vec.size () > 0) + changed = image_vec[0].set_file_geometry (str); + else + { + rxvt_image *image = new_image (); + if (!image->set_file_geometry (str)) + image_vec.pop_back (); + else + changed = true; + } } else { str++; - if (bg_set_geometry (str, true)) - changed = true; + if (image_vec.size () > 0) + changed = image_vec[0].set_geometry (str, true); } if (changed) @@ -3581,14 +3598,17 @@ * 't' = toggle * so no need for fancy checking */ -int +int ecb_cold rxvt_term::privcases (int mode, unsigned long bit) { int state; if (mode == 's') { - SavedModes |= (priv_modes & bit); + if (priv_modes & bit) + SavedModes |= bit; + else + SavedModes &= ~bit; return -1; } else @@ -3808,7 +3828,7 @@ /*}}} */ /*{{{ process sgr sequences */ -void +void ecb_hot rxvt_term::process_sgr_mode (unsigned int nargs, const int *arg) { unsigned int i;