… | |
… | |
36 | |
36 | |
37 | char *dst = r; |
37 | char *dst = r; |
38 | while (len--) |
38 | while (len--) |
39 | { |
39 | { |
40 | ssize_t l = wcrtomb (dst, *str++, mbs); |
40 | ssize_t l = wcrtomb (dst, *str++, mbs); |
|
|
41 | |
41 | if (l < 0) |
42 | if (l < 0) |
42 | *dst++ = '?'; |
43 | *dst++ = '?'; |
43 | else |
44 | else |
44 | dst += l; |
45 | dst += l; |
45 | } |
46 | } |
… | |
… | |
553 | void |
554 | void |
554 | rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) |
555 | rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) |
555 | { |
556 | { |
556 | int shadow; |
557 | int shadow; |
557 | |
558 | |
558 | shadow = (w == 0 || h == 0) ? 1 : SHADOW; |
559 | shadow = (w == 0 || h == 0) ? 1 : MENU_SHADOW; |
559 | w += x - 1; |
560 | w += x - 1; |
560 | h += y - 1; |
561 | h += y - 1; |
561 | for (; shadow-- > 0; x++, y++, w--, h--) |
562 | for (; shadow-- > 0; x++, y++, w--, h--) |
562 | { |
563 | { |
563 | XDrawLine (display, win, topShadow, x, y, w, y); |
564 | XDrawLine (display, win, topShadow, x, y, w, y); |
… | |
… | |
608 | #endif |
609 | #endif |
609 | |
610 | |
610 | } |
611 | } |
611 | } |
612 | } |
612 | #endif |
613 | #endif |
|
|
614 | |
|
|
615 | // should not be used in interactive programs, for obvious reasons |
|
|
616 | void rxvt_usleep (int usecs) |
|
|
617 | { |
|
|
618 | #if HAVE_NANOSLEEP |
|
|
619 | struct timespec ts; |
|
|
620 | |
|
|
621 | ts.tv_sec = 0; |
|
|
622 | ts.tv_nsec = usecs * 1000; |
|
|
623 | nanosleep (&ts, NULL); |
|
|
624 | #else |
|
|
625 | /* use select for timing */ |
|
|
626 | struct timeval tv; |
|
|
627 | |
|
|
628 | tv.tv_sec = 0; |
|
|
629 | tv.tv_usec = usecs; |
|
|
630 | select (0, NULL, NULL, NULL, &tv); |
|
|
631 | #endif |
|
|
632 | } |
|
|
633 | |
613 | /*----------------------- end-of-file (C source) -----------------------*/ |
634 | /*----------------------- end-of-file (C source) -----------------------*/ |
|
|
635 | |