--- rxvt-unicode/src/init.C 2006/01/25 21:03:04 1.156 +++ rxvt-unicode/src/init.C 2006/01/31 16:19:16 1.162 @@ -45,31 +45,31 @@ COLOR_FOREGROUND, COLOR_BACKGROUND, /* low-intensity colors */ - "Black", /* 0: black (#000000) */ - "Red3", /* 1: red (#CD0000) */ - "Green3", /* 2: green (#00CD00) */ - "Yellow3", /* 3: yellow (#CDCD00) */ - "Blue3", /* 4: blue (#0000CD) */ - "Magenta3", /* 5: magenta (#CD00CD) */ - "Cyan3", /* 6: cyan (#00CDCD) */ -# ifdef XTERM_COLORS - "Grey90", /* 7: white (#E5E5E5) */ -# else - "AntiqueWhite", /* 7: white (#FAEBD7) */ + "rgb:00/00/00", // 0: black (Black) + "rgb:cd/00/00", // 1: red (Red3) + "rgb:00/cd/00", // 2: green (Green3) + "rgb:cd/cd/00", // 3: ywlloe (Yellow3) + "rgb:00/00/cd", // 4: blue (Blue3) + "rgb:cd/00/cd", // 5: magenta (Magenta3) + "rgb:00/cd/cd", // 6: cyan (Cyan3) +# ifdef XTERM_COLORS + "rgb:e5/e5/e5", // 7: white (Grey90) +# else + "rgb:fa/eb/d7", // 7: white (AntiqueWhite) # endif /* high-intensity colors */ # ifdef XTERM_COLORS - "Grey30", /* 8: bright black (#4D4D4D) */ + "rgb:4d/4d/4d", // 8: bright black (Grey30) # else - "Grey25", /* 8: bright black (#404040) */ + "rgb:40/40/40", // 8: bright black (Grey25) # endif - "Red", /* 1/9: bright red (#FF0000) */ - "Green", /* 2/10: bright green (#00FF00) */ - "Yellow", /* 3/11: bright yellow (#FFFF00) */ - "Blue", /* 4/12: bright blue (#0000FF) */ - "Magenta", /* 5/13: bright magenta (#FF00FF) */ - "Cyan", /* 6/14: bright cyan (#00FFFF) */ - "White", /* 7/15: bright white (#FFFFFF) */ + "rgb:ff/00/00", // 1/9: bright red (Reed) + "rgb:00/ff/00", // 2/10: bright green (Green) + "rgb:ff/ff/00", // 3/11: bright yellow (Yellow) + "rgb:00/00/ff", // 4/12: bright blue (Blue) + "rgb:ff/00/ff", // 5/13: bright magenta (Magenta) + "rgb:00/ff/ff", // 6/14: bright cyan (Cyan) + "rgb:ff/ff/ff", // 7/15: bright white (White) // 88 xterm colours "rgb:00/00/00", @@ -172,7 +172,7 @@ NULL, #endif #if OFF_FOCUS_FADING - "black", + "rgb:00/00/00", #endif }; @@ -299,6 +299,15 @@ if (!(display = displays.get (rs[Rs_display_name]))) rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); + xa = display->xa; + +#if XFT + if (rs[Rs_depth]) + set (display, strtol (rs[Rs_depth], 0, 0)); + else +#endif + set (display); + extract_resources (); free (r_argv); @@ -316,15 +325,6 @@ } #endif - xa = display->xa; - -#if ENABLE_FRILLS - if (rs[Rs_depth]) - set (display, strtol (rs[Rs_depth], 0, 0)); - else -#endif - set (display); - /* * set any defaults not already set */ @@ -484,7 +484,7 @@ if (val == NULL) #endif /* DISPLAY_IS_IP */ - val = XDisplayString (display->display); + val = XDisplayString (xdisp); if (rs[Rs_display_name] == NULL) rs[Rs_display_name] = val; /* use broken `:0' value */ @@ -662,7 +662,7 @@ if (!rs[Rs_color + i]) continue; - if (!rXParseAllocColor (&xcol, rs[Rs_color + i])) + if (!set_color (xcol, rs[Rs_color + i])) { #ifndef XTERM_REVERSE_VIDEO if (i < 2 && OPTION (Opt_reverseVideo)) @@ -674,15 +674,14 @@ if (!rs[Rs_color + i]) continue; - if (!rXParseAllocColor (&xcol, rs[Rs_color + i])) + if (!set_color (xcol, rs[Rs_color + i])) { switch (i) { case Color_fg: case Color_bg: /* fatal: need bg/fg color */ - rxvt_fatal ("unable to get foreground/background colour, aborting.\n"); - /* NOTREACHED */ + rxvt_warn ("unable to get foreground/background colour, continuing.\n"); break; #ifndef NO_CURSORCOLOR case Color_cursor2: @@ -706,7 +705,11 @@ #ifdef OFF_FOCUS_FADING if (rs[Rs_fade]) for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) - pix_colors_unfocused[i] = pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors[Color_fade]); + { + rxvt_rgba c; + pix_colors[Color_fade].get (this, c); + pix_colors_unfocused[i] = pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), c); + } #endif if (depth <= 2) @@ -739,20 +742,23 @@ * xcol[2] == bot shadow */ xcol[1] = pix_colors[Color_scroll]; - xcol[0].set (this, 65535, 65535, 65535); + xcol[0].set (this, rxvt_rgba (rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC)); - unsigned short pr1, pg1, pb1, pr0, pg0, pb0; + rxvt_rgba c0, c1; - xcol[0].get (this, pr0, pg0, pb0); - xcol[1].get (this, pr1, pg1, pb1); + xcol[0].get (this, c0); + xcol[1].get (this, c1); pix_colors[Color_bottomShadow] = xcol[1].fade (this, 50); /* topShadowColor */ if (!xcol[1].set (this, - min (pr0, max (pr0 / 5, pr1) * 7 / 5), - min (pg0, max (pg0 / 5, pg1) * 7 / 5), - min (pb0, max (pb0 / 5, pb1) * 7 / 5))) + rxvt_rgba ( + min (c0.r, max (c1.r / 5, c1.r) * 7 / 5), + min (c0.g, max (c1.g / 5, c1.g) * 7 / 5), + min (c0.b, max (c1.b / 5, c1.b) * 7 / 5), + c1.a) // pa1 vs. pa0: arbitrary + )); xcol[1] = pix_colors[Color_White]; pix_colors[Color_topShadow] = xcol[1]; @@ -806,7 +812,7 @@ && strcasecmp (rsmod, "mod1") >= 0 && strcasecmp (rsmod, "mod5") <= 0) requestedmeta = rsmod[3] - '0'; - map = XGetModifierMapping (display->display); + map = XGetModifierMapping (xdisp); kc = map->modifiermap; for (i = 1; i < 6; i++) @@ -818,7 +824,7 @@ if (kc[k] == 0) break; - switch (XKeycodeToKeysym (display->display, kc[k], 0)) + switch (XKeycodeToKeysym (xdisp, kc[k], 0)) { case XK_Num_Lock: ModNumLockMask = modmasks[i - 1]; @@ -902,7 +908,7 @@ if (XInternAtom (xdisp, "_MOTIF_WM_INFO", True) == None) { /* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/ - attributes.override_redirect = TRUE; + attributes.override_redirect = true; mwmhints.flags = 0; } else