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.288 by sf-exg, Sat Dec 18 18:17:38 2010 UTC vs.
Revision 1.295 by sf-exg, Tue Apr 26 16:19:45 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.
811 811
812 if (option (Opt_scrollBar)) 812 if (option (Opt_scrollBar))
813 scrollBar.resize (); /* create and map scrollbar */ 813 scrollBar.resize (); /* create and map scrollbar */
814#ifdef HAVE_BG_PIXMAP 814#ifdef HAVE_BG_PIXMAP
815 { 815 {
816 bgPixmap.set_target (this); 816 bg_init ();
817 bgPixmap.invalidate ();
818 817
819#ifdef ENABLE_TRANSPARENCY 818#ifdef ENABLE_TRANSPARENCY
820 if (option (Opt_transparent)) 819 if (option (Opt_transparent))
821 { 820 {
822 bgPixmap.set_transparent (); 821 bg_set_transparent ();
823 822
824 if (rs [Rs_blurradius]) 823 if (rs [Rs_blurradius])
825 bgPixmap.set_blur_radius (rs [Rs_blurradius]); 824 bg_set_blur (rs [Rs_blurradius]);
826 825
827 if (ISSET_PIXCOLOR (Color_tint)) 826 if (ISSET_PIXCOLOR (Color_tint))
828 bgPixmap.set_tint (pix_colors_focused [Color_tint]); 827 bg_set_tint (pix_colors_focused [Color_tint]);
829 828
830 if (rs [Rs_shade]) 829 if (rs [Rs_shade])
831 bgPixmap.set_shade (rs [Rs_shade]); 830 bg_set_shade (rs [Rs_shade]);
832 831
833 bgPixmap.set_root_pixmap (); 832 bg_set_root_pixmap ();
834 XSelectInput (dpy, display->root, PropertyChangeMask); 833 XSelectInput (dpy, display->root, PropertyChangeMask);
835 rootwin_ev.start (display, display->root); 834 rootwin_ev.start (display, display->root);
836 } 835 }
837#endif 836#endif
838 837
842 const char *p = rs[Rs_backgroundPixmap]; 841 const char *p = rs[Rs_backgroundPixmap];
843 842
844 if ((p = strchr (p, ';')) != 0) 843 if ((p = strchr (p, ';')) != 0)
845 { 844 {
846 p++; 845 p++;
847 bgPixmap.set_geometry (p); 846 bg_set_geometry (p);
848 } 847 }
849 else 848 else
850 bgPixmap.set_defaultGeometry (); 849 bg_set_default_geometry ();
851 850
852 if (bgPixmap.set_file (rs[Rs_backgroundPixmap])) 851 if (bg_set_file (rs[Rs_backgroundPixmap]))
853 if (!bgPixmap.window_position_sensitive ()) 852 if (!bg_window_position_sensitive ())
854 update_background (); 853 update_background ();
855 } 854 }
856#endif 855#endif
857 } 856 }
858#endif 857#endif
875#if ENABLE_XEMBED 874#if ENABLE_XEMBED
876 if (rs[Rs_embed]) 875 if (rs[Rs_embed])
877 { 876 {
878 long info[2] = { 0, XEMBED_MAPPED }; 877 long info[2] = { 0, XEMBED_MAPPED };
879 878
880 XChangeProperty (dpy, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], 879 XChangeProperty (dpy, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO],
881 32, PropModeReplace, (unsigned char *)&info, 2); 880 32, PropModeReplace, (unsigned char *)&info, 2);
882 } 881 }
883#endif 882#endif
884 883
885 XMapWindow (dpy, vt); 884 XMapWindow (dpy, vt);
886 XMapWindow (dpy, parent[0]); 885 XMapWindow (dpy, parent);
887 886
888 refresh_check (); 887 refresh_check ();
889} 888}
890 889
891/*----------------------------------------------------------------------*/ 890/*----------------------------------------------------------------------*/
917 916
918 env_display = (char *)rxvt_malloc (strlen (val) + 9); 917 env_display = (char *)rxvt_malloc (strlen (val) + 9);
919 918
920 sprintf (env_display, "DISPLAY=%s", val); 919 sprintf (env_display, "DISPLAY=%s", val);
921 920
922 sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent[0]); 921 sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent);
923 922
924 /* add entries to the environment: 923 /* add entries to the environment:
925 * @ DISPLAY: in case we started with -display 924 * @ DISPLAY: in case we started with -display
926 * @ WINDOWID: X window id number of the window 925 * @ WINDOWID: X window id number of the window
927 * @ COLORTERM: terminal sub-name and also indicates its color 926 * @ COLORTERM: terminal sub-name and also indicates its color
1324 buffer [1] = h; 1323 buffer [1] = h;
1325 1324
1326 for (unsigned int i = 0; i < w * h; ++i) 1325 for (unsigned int i = 0; i < w * h; ++i)
1327 buffer [i + 2] = asbuf [i]; 1326 buffer [i + 2] = asbuf [i];
1328 1327
1329 XChangeProperty (dpy, parent[0], xa[XA_NET_WM_ICON], XA_CARDINAL, 32, 1328 XChangeProperty (dpy, parent, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1330 PropModeReplace, (const unsigned char *) buffer, 2 + w * h); 1329 PropModeReplace, (const unsigned char *) buffer, 2 + w * h);
1331 free (buffer); 1330 free (buffer);
1332 } 1331 }
1333 else 1332 else
1334 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); 1333 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n");
1381 } 1380 }
1382 1381
1383 row += rowstride; 1382 row += rowstride;
1384 } 1383 }
1385 1384
1386 XChangeProperty (dpy, parent[0], xa[XA_NET_WM_ICON], XA_CARDINAL, 32, 1385 XChangeProperty (dpy, parent, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1387 PropModeReplace, (const unsigned char *) buffer, 2 + w * h); 1386 PropModeReplace, (const unsigned char *) buffer, 2 + w * h);
1388 free (buffer); 1387 free (buffer);
1389 } 1388 }
1390 else 1389 else
1391 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n"); 1390 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n");
1393 g_object_unref (pixbuf); 1392 g_object_unref (pixbuf);
1394#endif 1393#endif
1395} 1394}
1396 1395
1397/*----------------------------------------------------------------------*/ 1396/*----------------------------------------------------------------------*/
1398/* rxvt_Create_Windows () - Open and map the window */ 1397/* Open and map the window */
1399void 1398void
1400rxvt_term::create_windows (int argc, const char *const *argv) 1399rxvt_term::create_windows (int argc, const char *const *argv)
1401{ 1400{
1402 XClassHint classHint; 1401 XClassHint classHint;
1403 XWMHints wmHint; 1402 XWMHints wmHint;
1449 } 1448 }
1450#endif 1449#endif
1451 1450
1452 window_calc (0, 0); 1451 window_calc (0, 0);
1453 1452
1454 /* sub-window placement & size in rxvt_resize_subwindows () */ 1453 /* sub-window placement & size in rxvt_term::resize_all_windows () */
1455 attributes.background_pixel = pix_colors_focused [Color_border]; 1454 attributes.background_pixel = pix_colors_focused [Color_border];
1456 attributes.border_pixel = pix_colors_focused [Color_border]; 1455 attributes.border_pixel = pix_colors_focused [Color_border];
1457 attributes.colormap = cmap; 1456 attributes.colormap = cmap;
1458 1457
1459 top = XCreateWindow (dpy, parent, 1458 top = XCreateWindow (dpy, parent,
1462 ext_bwidth, 1461 ext_bwidth,
1463 depth, InputOutput, visual, 1462 depth, InputOutput, visual,
1464 CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect, 1463 CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect,
1465 &attributes); 1464 &attributes);
1466 1465
1467 this->parent[0] = top; 1466 this->parent = top;
1468 1467
1469 old_width = szHint.width; 1468 old_width = szHint.width;
1470 old_height = szHint.height; 1469 old_height = szHint.height;
1471 1470
1472 set_title (rs [Rs_title]); 1471 set_title (rs [Rs_title]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines