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

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.284 by sf-exg, Fri Oct 15 21:59:25 2010 UTC vs.
Revision 1.294 by sf-exg, Thu Apr 7 12:19:40 2011 UTC

10 * Copyright (c) 1996 Chuck Blake <cblake@BBN.COM> 10 * Copyright (c) 1996 Chuck Blake <cblake@BBN.COM>
11 * Copyright (c) 1997 mj olesen <olesen@me.queensu.ca> 11 * Copyright (c) 1997 mj olesen <olesen@me.queensu.ca>
12 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> 12 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de>
13 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> 13 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com>
14 * - extensive modifications 14 * - extensive modifications
15 * Copyright (c) 2003-2008 Marc Lehmann <pcg@goof.com> 15 * Copyright (c) 2003-2008 Marc Lehmann <schmorp@schmorp.de>
16 * 16 *
17 * This program is free software; you can redistribute it and/or modify 17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by 18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or 19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version. 20 * (at your option) any later version.
143 143
144 return rval; 144 return rval;
145} 145}
146#endif 146#endif
147 147
148const char *const def_colorName[] = 148static const char *const def_colorName[] =
149 { 149 {
150 COLOR_FOREGROUND, 150 COLOR_FOREGROUND,
151 COLOR_BACKGROUND, 151 COLOR_BACKGROUND,
152 /* low-intensity colors */ 152 /* low-intensity colors */
153 "rgb:00/00/00", // 0: black (Black) 153 "rgb:00/00/00", // 0: black (Black)
634 set_output_threshold (OUTPUT_LEVEL_WARNING); 634 set_output_threshold (OUTPUT_LEVEL_WARNING);
635#endif 635#endif
636 636
637#ifdef HAVE_PIXBUF 637#ifdef HAVE_PIXBUF
638 g_type_init (); 638 g_type_init ();
639 gdk_pixbuf_xlib_init_with_depth (dpy, display->screen, depth);
640#endif 639#endif
641 640
642#if ENABLE_PERL 641#if ENABLE_PERL
643 if (!rs[Rs_perl_ext_1]) 642 if (!rs[Rs_perl_ext_1])
644 rs[Rs_perl_ext_1] = "default"; 643 rs[Rs_perl_ext_1] = "default";
812 811
813 if (option (Opt_scrollBar)) 812 if (option (Opt_scrollBar))
814 scrollBar.resize (); /* create and map scrollbar */ 813 scrollBar.resize (); /* create and map scrollbar */
815#ifdef HAVE_BG_PIXMAP 814#ifdef HAVE_BG_PIXMAP
816 { 815 {
817 bgPixmap.set_target (this); 816 bg_init ();
818 bgPixmap.invalidate ();
819 817
820#ifdef ENABLE_TRANSPARENCY 818#ifdef ENABLE_TRANSPARENCY
821 if (option (Opt_transparent)) 819 if (option (Opt_transparent))
822 { 820 {
823 bgPixmap.set_transparent (); 821 bg_set_transparent ();
824 822
825 if (rs [Rs_blurradius]) 823 if (rs [Rs_blurradius])
826 bgPixmap.set_blur_radius (rs [Rs_blurradius]); 824 bg_set_blur (rs [Rs_blurradius]);
827 825
828 if (ISSET_PIXCOLOR (Color_tint)) 826 if (ISSET_PIXCOLOR (Color_tint))
829 bgPixmap.set_tint (pix_colors_focused [Color_tint]); 827 bg_set_tint (pix_colors_focused [Color_tint]);
830 828
831 if (rs [Rs_shade]) 829 if (rs [Rs_shade])
832 bgPixmap.set_shade (rs [Rs_shade]); 830 bg_set_shade (rs [Rs_shade]);
833 831
834 bgPixmap.set_root_pixmap (); 832 bg_set_root_pixmap ();
835 XSelectInput (dpy, display->root, PropertyChangeMask); 833 XSelectInput (dpy, display->root, PropertyChangeMask);
836 rootwin_ev.start (display, display->root); 834 rootwin_ev.start (display, display->root);
837 } 835 }
838#endif 836#endif
839 837
843 const char *p = rs[Rs_backgroundPixmap]; 841 const char *p = rs[Rs_backgroundPixmap];
844 842
845 if ((p = strchr (p, ';')) != 0) 843 if ((p = strchr (p, ';')) != 0)
846 { 844 {
847 p++; 845 p++;
848 bgPixmap.set_geometry (p); 846 bg_set_geometry (p);
849 } 847 }
850 else 848 else
851 bgPixmap.set_defaultGeometry (); 849 bg_set_default_geometry ();
852 850
853 if (bgPixmap.set_file (rs[Rs_backgroundPixmap])) 851 if (bg_set_file (rs[Rs_backgroundPixmap]))
854 if (!bgPixmap.window_position_sensitive ()) 852 if (!bg_window_position_sensitive ())
855 update_background (); 853 update_background ();
856 } 854 }
857#endif 855#endif
858 } 856 }
859#endif 857#endif
876#if ENABLE_XEMBED 874#if ENABLE_XEMBED
877 if (rs[Rs_embed]) 875 if (rs[Rs_embed])
878 { 876 {
879 long info[2] = { 0, XEMBED_MAPPED }; 877 long info[2] = { 0, XEMBED_MAPPED };
880 878
881 XChangeProperty (dpy, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], 879 XChangeProperty (dpy, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO],
882 32, PropModeReplace, (unsigned char *)&info, 2); 880 32, PropModeReplace, (unsigned char *)&info, 2);
883 } 881 }
884#endif 882#endif
885 883
886 XMapWindow (dpy, vt); 884 XMapWindow (dpy, vt);
887 XMapWindow (dpy, parent[0]); 885 XMapWindow (dpy, parent);
888 886
889 refresh_check (); 887 refresh_check ();
890} 888}
891 889
892/*----------------------------------------------------------------------*/ 890/*----------------------------------------------------------------------*/
893void 891void
894rxvt_term::init_env () 892rxvt_term::init_env ()
895{ 893{
896 int i;
897 char *val; 894 char *val;
898 895
899#ifdef DISPLAY_IS_IP 896#ifdef DISPLAY_IS_IP
900 /* Fixup display_name for export over pty to any interested terminal 897 /* Fixup display_name for export over pty to any interested terminal
901 * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number 898 * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number
915 val = XDisplayString (dpy); 912 val = XDisplayString (dpy);
916 913
917 if (rs[Rs_display_name] == NULL) 914 if (rs[Rs_display_name] == NULL)
918 rs[Rs_display_name] = val; /* use broken `:0' value */ 915 rs[Rs_display_name] = val; /* use broken `:0' value */
919 916
920 i = strlen (val);
921 env_display = (char *)rxvt_malloc (i + 9); 917 env_display = (char *)rxvt_malloc (strlen (val) + 9);
922 918
923 sprintf (env_display, "DISPLAY=%s", val); 919 sprintf (env_display, "DISPLAY=%s", val);
924 920
925 sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent[0]); 921 sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent);
926 922
927 /* add entries to the environment: 923 /* add entries to the environment:
928 * @ DISPLAY: in case we started with -display 924 * @ DISPLAY: in case we started with -display
929 * @ WINDOWID: X window id number of the window 925 * @ WINDOWID: X window id number of the window
930 * @ COLORTERM: terminal sub-name and also indicates its color 926 * @ COLORTERM: terminal sub-name and also indicates its color
1327 buffer [1] = h; 1323 buffer [1] = h;
1328 1324
1329 for (unsigned int i = 0; i < w * h; ++i) 1325 for (unsigned int i = 0; i < w * h; ++i)
1330 buffer [i + 2] = asbuf [i]; 1326 buffer [i + 2] = asbuf [i];
1331 1327
1332 XChangeProperty (dpy, parent[0], xa[XA_NET_WM_ICON], XA_CARDINAL, 32, 1328 XChangeProperty (dpy, parent, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1333 PropModeReplace, (const unsigned char *) buffer, 2 + w * h); 1329 PropModeReplace, (const unsigned char *) buffer, 2 + w * h);
1334 free (buffer); 1330 free (buffer);
1335 } 1331 }
1336 else 1332 else
1337 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); 1333 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n");
1384 } 1380 }
1385 1381
1386 row += rowstride; 1382 row += rowstride;
1387 } 1383 }
1388 1384
1389 XChangeProperty (dpy, parent[0], xa[XA_NET_WM_ICON], XA_CARDINAL, 32, 1385 XChangeProperty (dpy, parent, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1390 PropModeReplace, (const unsigned char *) buffer, 2 + w * h); 1386 PropModeReplace, (const unsigned char *) buffer, 2 + w * h);
1391 free (buffer); 1387 free (buffer);
1392 } 1388 }
1393 else 1389 else
1394 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); 1390 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n");
1465 ext_bwidth, 1461 ext_bwidth,
1466 depth, InputOutput, visual, 1462 depth, InputOutput, visual,
1467 CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect, 1463 CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect,
1468 &attributes); 1464 &attributes);
1469 1465
1470 this->parent[0] = top; 1466 this->parent = top;
1471 1467
1472 old_width = szHint.width; 1468 old_width = szHint.width;
1473 old_height = szHint.height; 1469 old_height = szHint.height;
1474 1470
1475 set_title (rs [Rs_title]); 1471 set_title (rs [Rs_title]);
1508#if ENABLE_EWMH 1504#if ENABLE_EWMH
1509 xa[XA_NET_WM_PING], 1505 xa[XA_NET_WM_PING],
1510#endif 1506#endif
1511 }; 1507 };
1512 1508
1513 XSetWMProtocols (dpy, top, protocols, sizeof (protocols) / sizeof (protocols[0])); 1509 XSetWMProtocols (dpy, top, protocols, ARRAY_LENGTH(protocols));
1514 1510
1515#if ENABLE_FRILLS 1511#if ENABLE_FRILLS
1516 if (rs[Rs_transient_for]) 1512 if (rs[Rs_transient_for])
1517 XSetTransientForHint (dpy, top, (Window)strtol (rs[Rs_transient_for], 0, 0)); 1513 XSetTransientForHint (dpy, top, (Window)strtol (rs[Rs_transient_for], 0, 0));
1518#endif 1514#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines