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

Comparing rxvt-unicode/src/misc.C (file contents):
Revision 1.30 by root, Tue Jan 3 02:43:33 2006 UTC vs.
Revision 1.34 by root, Mon Jan 16 16:19:19 2006 UTC

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 }
437 * file searching 438 * file searching
438 */ 439 */
439 440
440/* #define DEBUG_SEARCH_PATH */ 441/* #define DEBUG_SEARCH_PATH */
441 442
442#if defined (XPM_BACKGROUND) || (MENUBAR_MAX) 443#ifdef XPM_BACKGROUND
443/* 444/*
444 * search for FILE in the current working directory, and within the 445 * search for FILE in the current working directory, and within the
445 * colon-delimited PATHLIST, adding the file extension EXT if required. 446 * colon-delimited PATHLIST, adding the file extension EXT if required.
446 * 447 *
447 * FILE is either semi-colon or zero terminated 448 * FILE is either semi-colon or zero terminated
524 char *f; 525 char *f;
525 526
526 if (file == NULL || *file == '\0') 527 if (file == NULL || *file == '\0')
527 return NULL; 528 return NULL;
528 529
529 /* search environment variables here too */
530 if ((f = rxvt_File_search_path (path, file, ext)) == NULL) 530 f = rxvt_File_search_path (path, file, ext);
531#ifdef PATH_ENV
532 if ((f = rxvt_File_search_path (getenv (PATH_ENV), file, ext)) == NULL)
533#endif
534 f = rxvt_File_search_path (getenv ("PATH"), file, ext);
535 531
536#ifdef DEBUG_SEARCH_PATH 532#ifdef DEBUG_SEARCH_PATH
537 if (f) 533 if (f)
538 fprintf (stderr, "found: \"%s\"\n", f); 534 fprintf (stderr, "found: \"%s\"\n", f);
539#endif 535#endif
540 536
541 return f; 537 return f;
542} 538}
543#endif /* defined (XPM_BACKGROUND) || (MENUBAR_MAX) */ 539#endif
544 540
545/*----------------------------------------------------------------------* 541/*----------------------------------------------------------------------*
546 * miscellaneous drawing routines 542 * miscellaneous drawing routines
547 */ 543 */
548 544
549/* 545/*
550 * Draw top/left and bottom/right border shadows around windows 546 * Draw top/left and bottom/right border shadows around windows
551 */ 547 */
552#if defined(RXVT_SCROLLBAR) || defined(MENUBAR) 548#ifdef RXVT_SCROLLBAR
553void 549void
554rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) 550rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h)
555{ 551{
556 int shadow; 552 int shadow;
557 553
558 shadow = (w == 0 || h == 0) ? 1 : MENU_SHADOW; 554 shadow = (w == 0 || h == 0) ? 1 : 2;
559 w += x - 1; 555 w += x - 1;
560 h += y - 1; 556 h += y - 1;
561 for (; shadow-- > 0; x++, y++, w--, h--) 557 for (; shadow-- > 0; x++, y++, w--, h--)
562 { 558 {
563 XDrawLine (display, win, topShadow, x, y, w, y); 559 XDrawLine (display, win, topShadow, x, y, w, y);
564 XDrawLine (display, win, topShadow, x, y, x, h); 560 XDrawLine (display, win, topShadow, x, y, x, h);
565 XDrawLine (display, win, botShadow, w, h, w, y + 1); 561 XDrawLine (display, win, botShadow, w, h, w, y + 1);
566 XDrawLine (display, win, botShadow, w, h, x + 1, h); 562 XDrawLine (display, win, botShadow, w, h, x + 1, h);
567 }
568}
569#endif
570
571/* button shapes */
572#ifdef MENUBAR
573void
574rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type)
575{
576 switch (type)
577 {
578 case 'r': /* right triangle */
579 XDrawLine (display, win, topShadow, x, y, x, y + w);
580 XDrawLine (display, win, topShadow, x, y, x + w, y + w / 2);
581 XDrawLine (display, win, botShadow, x, y + w, x + w, y + w / 2);
582 break;
583
584 case 'l': /* left triangle */
585 XDrawLine (display, win, botShadow, x + w, y + w, x + w, y);
586 XDrawLine (display, win, botShadow, x + w, y + w, x, y + w / 2);
587 XDrawLine (display, win, topShadow, x, y + w / 2, x + w, y);
588 break;
589
590 case 'd': /* down triangle */
591 XDrawLine (display, win, topShadow, x, y, x + w / 2, y + w);
592 XDrawLine (display, win, topShadow, x, y, x + w, y);
593 XDrawLine (display, win, botShadow, x + w, y, x + w / 2, y + w);
594 break;
595
596 case 'u': /* up triangle */
597 XDrawLine (display, win, botShadow, x + w, y + w, x + w / 2, y);
598 XDrawLine (display, win, botShadow, x + w, y + w, x, y + w);
599 XDrawLine (display, win, topShadow, x, y + w, x + w / 2, y);
600 break;
601#if 0
602 case 's': /* square */
603 XDrawLine (display, win, topShadow, x + w, y, x, y);
604 XDrawLine (display, win, topShadow, x, y, x, y + w);
605 XDrawLine (display, win, botShadow, x, y + w, x + w, y + w);
606 XDrawLine (display, win, botShadow, x + w, y + w, x + w, y);
607 break;
608#endif
609
610 } 563 }
611} 564}
612#endif 565#endif
613 566
614// should not be used in interactive programs, for obvious reasons 567// should not be used in interactive programs, for obvious reasons

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines