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

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.370 by sf-exg, Thu Jan 19 15:08:55 2012 UTC vs.
Revision 1.375 by sf-exg, Sun Jun 3 17:48:28 2012 UTC

374 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) 374 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++)
375 (*t)->emergency_cleanup (); 375 (*t)->emergency_cleanup ();
376} 376}
377 377
378#if !ENABLE_MINIMAL 378#if !ENABLE_MINIMAL
379static void 379static void ecb_cold
380print_x_error (Display *dpy, XErrorEvent *event) 380print_x_error (Display *dpy, XErrorEvent *event)
381{ 381{
382 char buffer[BUFSIZ]; 382 char buffer[BUFSIZ];
383 char mesg[BUFSIZ]; 383 char mesg[BUFSIZ];
384 char number[32]; 384 char number[32];
422 mesg, BUFSIZ); 422 mesg, BUFSIZ);
423 rxvt_warn (strncat (mesg, "\n", BUFSIZ), event->serial); 423 rxvt_warn (strncat (mesg, "\n", BUFSIZ), event->serial);
424} 424}
425#endif 425#endif
426 426
427int 427int ecb_cold
428rxvt_xerror_handler (Display *display, XErrorEvent *event) 428rxvt_xerror_handler (Display *display, XErrorEvent *event)
429{ 429{
430 if (GET_R->allowedxerror == -1) 430 if (GET_R->allowedxerror == -1)
431 GET_R->allowedxerror = event->error_code; 431 GET_R->allowedxerror = event->error_code;
432 else 432 else
441 } 441 }
442 442
443 return 0; 443 return 0;
444} 444}
445 445
446int 446int ecb_cold
447rxvt_xioerror_handler (Display *display) 447rxvt_xioerror_handler (Display *display)
448{ 448{
449 rxvt_warn ("X connection to '%s' broken, unable to recover, exiting.\n", 449 rxvt_warn ("X connection to '%s' broken, unable to recover, exiting.\n",
450 DisplayString (display)); 450 DisplayString (display));
451 rxvt_emergency_cleanup (); 451 rxvt_emergency_cleanup ();
571 old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); 571 old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler);
572 // TODO: handle this with exceptions and tolerate the memory loss 572 // TODO: handle this with exceptions and tolerate the memory loss
573 XSetIOErrorHandler (rxvt_xioerror_handler); 573 XSetIOErrorHandler (rxvt_xioerror_handler);
574 574
575 XrmInitialize (); 575 XrmInitialize ();
576
577#ifdef HAVE_PIXBUF
578 g_type_init ();
579#endif
576} 580}
577 581
578/*----------------------------------------------------------------------*/ 582/*----------------------------------------------------------------------*/
579/* 583/*
580 * window size/position calculations for XSizeHint and other storage. 584 * window size/position calculations for XSizeHint and other storage.
764 768
765 delete fontset[0]; 769 delete fontset[0];
766 fontset[0] = fs; 770 fontset[0] = fs;
767 771
768 prop = (*fs)[rxvt_fontset::firstFont]->properties (); 772 prop = (*fs)[rxvt_fontset::firstFont]->properties ();
769 prop.height += lineSpace;
770 prop.width += letterSpace; 773 prop.width += letterSpace;
771 774
772 fs->set_prop (prop, false); 775 fs->set_prop (prop, false);
773 776
774 fwidth = prop.width; 777 fwidth = prop.width;
775 fheight = prop.height; 778 fheight = prop.height + lineSpace;
776 fbase = prop.ascent; 779 fbase = prop.ascent;
777 780
778 for (int style = 1; style < 4; style++) 781 for (int style = 1; style < 4; style++)
779 { 782 {
780#if ENABLE_STYLES 783#if ENABLE_STYLES
1564 1567
1565 /* try with no modifiers base IF the user didn't specify an IM */ 1568 /* try with no modifiers base IF the user didn't specify an IM */
1566 if (im_get_ic ("@im=none")) 1569 if (im_get_ic ("@im=none"))
1567 goto done; 1570 goto done;
1568 1571
1569done: ; 1572done:
1570 if (rs[Rs_imLocale]) 1573 if (rs[Rs_imLocale])
1571 SET_LOCALE (locale); 1574 SET_LOCALE (locale);
1572} 1575}
1573 1576
1574void 1577void
1621{ 1624{
1622 Window cr; 1625 Window cr;
1623 XTranslateCoordinates (dpy, parent, display->root, 0, 0, &x, &y, &cr); 1626 XTranslateCoordinates (dpy, parent, display->root, 0, 0, &x, &y, &cr);
1624} 1627}
1625 1628
1626Pixmap
1627rxvt_term::get_pixmap_property (Atom property)
1628{
1629 Pixmap pixmap = None;
1630
1631 int aformat;
1632 unsigned long nitems, bytes_after;
1633 Atom atype;
1634 unsigned char *prop;
1635 int result = XGetWindowProperty (dpy, display->root, property,
1636 0L, 1L, False, XA_PIXMAP, &atype, &aformat,
1637 &nitems, &bytes_after, &prop);
1638 if (result == Success)
1639 {
1640 if (atype == XA_PIXMAP)
1641 pixmap = *(Pixmap *)prop;
1642 XFree (prop);
1643 }
1644
1645 return pixmap;
1646}
1647
1648#ifdef HAVE_BG_PIXMAP 1629#ifdef HAVE_BG_PIXMAP
1649 1630
1650void 1631void
1651rxvt_term::update_background () 1632rxvt_term::update_background ()
1652{ 1633{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines