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.371 by sf-exg, Thu Jan 19 15:44:49 2012 UTC vs.
Revision 1.376 by root, Mon Jun 4 15:18:52 2012 UTC

172#endif 172#endif
173#if ENABLE_TRANSPARENCY || ENABLE_PERL 173#if ENABLE_TRANSPARENCY || ENABLE_PERL
174 rootwin_ev.set <rxvt_term, &rxvt_term::rootwin_cb> (this), 174 rootwin_ev.set <rxvt_term, &rxvt_term::rootwin_cb> (this),
175#endif 175#endif
176 scrollbar_ev.set <rxvt_term, &rxvt_term::x_cb> (this), 176 scrollbar_ev.set <rxvt_term, &rxvt_term::x_cb> (this),
177#ifdef USE_XIM 177#if USE_XIM
178 im_ev.set <rxvt_term, &rxvt_term::im_cb> (this), 178 im_ev.set <rxvt_term, &rxvt_term::im_cb> (this),
179#endif 179#endif
180#ifdef POINTER_BLANK 180#ifdef POINTER_BLANK
181 pointer_ev.set <rxvt_term, &rxvt_term::pointer_cb> (this); 181 pointer_ev.set <rxvt_term, &rxvt_term::pointer_cb> (this);
182#endif 182#endif
231 if (display) 231 if (display)
232 { 232 {
233 selection_clear (); 233 selection_clear ();
234 selection_clear (true); 234 selection_clear (true);
235 235
236#ifdef USE_XIM 236#if USE_XIM
237 im_destroy (); 237 im_destroy ();
238#endif 238#endif
239 scrollBar.destroy (); 239 scrollBar.destroy ();
240 if (gc) XFreeGC (dpy, gc); 240 if (gc) XFreeGC (dpy, gc);
241 241
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#if 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
962 965
963 for (i = Color_Black; i <= Color_White; i++) 966 for (i = Color_Black; i <= Color_White; i++)
964 if (pix_colors[Color_bg] == pix_colors[i]) 967 if (pix_colors[Color_bg] == pix_colors[i])
965 { 968 {
966 sprintf (bstr, "%d", i - Color_Black); 969 sprintf (bstr, "%d", i - Color_Black);
967#ifdef BG_IMAGE_FROM_FILE 970#if BG_IMAGE_FROM_FILE
968 xpmb = "default;"; 971 xpmb = "default;";
969#endif 972#endif
970 break; 973 break;
971 } 974 }
972 975
1084 } 1087 }
1085 1088
1086 if (fix_screen || old_height == 0) 1089 if (fix_screen || old_height == 0)
1087 scr_reset (); 1090 scr_reset ();
1088 1091
1089#ifdef USE_XIM 1092#if USE_XIM
1090 im_set_position (); 1093 im_set_position ();
1091#endif 1094#endif
1092} 1095}
1093 1096
1094/* 1097/*
1119} 1122}
1120 1123
1121/* -------------------------------------------------------------------- * 1124/* -------------------------------------------------------------------- *
1122 * - X INPUT METHOD ROUTINES - * 1125 * - X INPUT METHOD ROUTINES - *
1123 * -------------------------------------------------------------------- */ 1126 * -------------------------------------------------------------------- */
1124#ifdef USE_XIM 1127#if USE_XIM
1125 1128
1126void 1129void
1127rxvt_term::im_set_color (unsigned long &fg, unsigned long &bg) 1130rxvt_term::im_set_color (unsigned long &fg, unsigned long &bg)
1128{ 1131{
1129 fg = pix_colors [Color_fg]; 1132 fg = pix_colors [Color_fg];
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