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

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.118 by sf-exg, Sat Feb 12 00:50:04 2011 UTC vs.
Revision 1.119 by root, Mon Feb 21 07:12:03 2011 UTC

892 lerp (c.a, to.a, percent) 892 lerp (c.a, to.a, percent)
893 ) 893 )
894 ); 894 );
895} 895}
896 896
897rxvt_selection::rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, sel_cb cb, void *ptr) 897rxvt_selection::rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, rxvt_term *term, void *cb_sv)
898: display (disp), request_time (tm), request_win (win), request_prop (prop), request_cb (cb), user_data (ptr) 898: display (disp), request_time (tm), request_win (win), request_prop (prop), term (term), cb_sv (cb_sv)
899{ 899{
900 assert (selnum >= Sel_Primary && selnum <= Sel_Clipboard); 900 assert (selnum >= Sel_Primary && selnum <= Sel_Clipboard);
901 901
902 timer_ev.set<rxvt_selection, &rxvt_selection::timer_cb> (this); 902 timer_ev.set<rxvt_selection, &rxvt_selection::timer_cb> (this);
903 timer_ev.repeat = 10.; 903 timer_ev.repeat = 10.;
932{ 932{
933 stop (); 933 stop ();
934} 934}
935 935
936void 936void
937rxvt_selection::finish (char *data, unsigned int len)
938{
939 if (term)
940 {
941 if (data)
942 term->paste (data, len);
943
944 term->selection_req = 0;
945 delete this;
946 }
947#if ENABLE_PERL
948 else
949 {
950 stop ();
951 abort (); //TODO
952 }
953#endif
954}
955
956void
937rxvt_selection::stop () 957rxvt_selection::stop ()
938{ 958{
939 free (incr_buf); 959 free (incr_buf);
940 incr_buf = 0; 960 incr_buf = 0;
941 timer_ev.stop (); 961 timer_ev.stop ();
1112bailout: 1132bailout:
1113 XFree (ct.value); 1133 XFree (ct.value);
1114 1134
1115 if (selection_wait == Sel_normal) 1135 if (selection_wait == Sel_normal)
1116 { 1136 {
1117 stop (); 1137 finish (data, data_len);
1118 request_cb (data, data_len, this);
1119 free (data); 1138 free (data);
1120 } 1139 }
1121} 1140}
1122 1141
1123void 1142void
1124rxvt_selection::timer_cb (ev::timer &w, int revents) 1143rxvt_selection::timer_cb (ev::timer &w, int revents)
1125{ 1144{
1126 if (selection_wait == Sel_incr) 1145 if (selection_wait == Sel_incr)
1127 rxvt_warn ("data loss: timeout on INCR selection paste, ignoring.\n"); 1146 rxvt_warn ("data loss: timeout on INCR selection paste, ignoring.\n");
1128 1147
1129 stop (); 1148 finish ();
1130 request_cb (NULL, 0, this);
1131} 1149}
1132 1150
1133void 1151void
1134rxvt_selection::x_cb (XEvent &xev) 1152rxvt_selection::x_cb (XEvent &xev)
1135{ 1153{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines