--- rxvt-unicode/src/screen.C 2005/12/31 19:30:25 1.203 +++ rxvt-unicode/src/screen.C 2006/01/03 17:34:44 1.206 @@ -26,6 +26,7 @@ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ +#include "rxvtperl.h" /* NECESSARY */ #include /* get the typedef for CARD32 */ @@ -419,6 +420,8 @@ tabs [col] = col % TABSIZE == 0; tt_winch (); + + PERL_INVOKE ((this, HOOK_RESET, DT_END)); } /* ------------------------------------------------------------------------- */ @@ -621,6 +624,9 @@ && (current_screen == PRIMARY || OPTION (Opt_secondaryScroll))) { nsaved = min (nsaved + count, saveLines); + + PERL_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, nsaved, DT_END)); + term_start = (term_start + count) % total_rows; if (selection.op && current_screen == selection.screen) @@ -1821,6 +1827,8 @@ int rxvt_term::scr_changeview (unsigned int oldviewstart) { + PERL_INVOKE ((this, HOOK_VIEW_CHANGE, DT_INT, view_start, DT_END)); + if (view_start != oldviewstart) { want_refresh = 1; @@ -2041,6 +2049,7 @@ } } + PERL_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); #if ENABLE_OVERLAY scr_swap_overlay (); #endif @@ -2313,6 +2322,7 @@ #if ENABLE_OVERLAY scr_swap_overlay (); #endif + PERL_INVOKE ((this, HOOK_REFRESH_END, DT_END)); /* * G: cleanup cursor and display outline cursor if necessary @@ -2874,6 +2884,9 @@ if (selection.clicks == 4) return; /* nothing selected, go away */ + if (PERL_INVOKE ((this, HOOK_SEL_MAKE, DT_LONG, (long)tm, DT_END))) + return; + i = (selection.end.row - selection.beg.row + 1) * (ncol + 1); new_selection_text = (wchar_t *)rxvt_malloc ((i + 4) * sizeof (wchar_t)); @@ -2965,11 +2978,25 @@ selection.len = ofs; selection.text = (wchar_t *)rxvt_realloc (new_selection_text, (ofs + 1) * sizeof (wchar_t)); + if (PERL_INVOKE ((this, HOOK_SEL_GRAB, DT_LONG, (long)tm, DT_END))) + return; + + selection_grab (tm); +} + +bool +rxvt_term::selection_grab (Time tm) +{ + selection_time = tm; + XSetSelectionOwner (display->display, XA_PRIMARY, vt, tm); if (XGetSelectionOwner (display->display, XA_PRIMARY) == vt) - display->set_selection_owner (this); + { + display->set_selection_owner (this); + return true; + } else - rxvt_warn ("can't get primary selection, ignoring.\n"); + return false; #if 0 XTextProperty ct; @@ -2980,8 +3007,6 @@ XFree (ct.value); } #endif - - selection_time = tm; } /* ------------------------------------------------------------------------- */ @@ -3300,8 +3325,11 @@ if (ROWCOL_IS_AFTER (selection.end, selection.beg)) selection.end.col--; - selection_delimit_word (UP, &selection.beg, &selection.beg); - selection_delimit_word (DN, &selection.end, &selection.end); + if (!PERL_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) + { + selection_delimit_word (UP, &selection.beg, &selection.beg); + selection_delimit_word (DN, &selection.end, &selection.end); + } } else if (selection.clicks == 3) { @@ -3587,7 +3615,7 @@ void rxvt_term::scr_overlay_new (int x, int y, int w, int h) { - if (nrow < 3 || ncol < 3) + if (nrow < 1 || ncol < 1) return; want_refresh = 1;