… | |
… | |
82 | if (len != 1 && len != 3 && len != 4) |
82 | if (len != 1 && len != 3 && len != 4) |
83 | croak ("component colour array must have 1, 3 or 4 components,"); |
83 | croak ("component colour array must have 1, 3 or 4 components,"); |
84 | |
84 | |
85 | c.a = rgba::MAX_CC; |
85 | c.a = rgba::MAX_CC; |
86 | |
86 | |
87 | c.r = c.g = c.b = float_to_component (SvIV (*av_fetch (av, 0, 0))); |
87 | c.r = c.g = c.b = float_to_component (SvNV (*av_fetch (av, 0, 0))); |
88 | |
88 | |
89 | if (len >= 3) |
89 | if (len >= 3) |
90 | { |
90 | { |
91 | c.g = float_to_component (SvIV (*av_fetch (av, 1, 0))); |
91 | c.g = float_to_component (SvNV (*av_fetch (av, 1, 0))); |
92 | c.b = float_to_component (SvIV (*av_fetch (av, 2, 0))); |
92 | c.b = float_to_component (SvNV (*av_fetch (av, 2, 0))); |
93 | |
93 | |
94 | if (len >= 4) |
94 | if (len >= 4) |
95 | c.a = float_to_component (SvIV (*av_fetch (av, 3, 0))); |
95 | c.a = float_to_component (SvNV (*av_fetch (av, 3, 0))); |
96 | } |
96 | } |
97 | } |
97 | } |
98 | else if (s) |
98 | else if (s) |
99 | { |
99 | { |
100 | rxvt_color rc; |
100 | rxvt_color rc; |
… | |
… | |
2312 | RETVAL |
2312 | RETVAL |
2313 | |
2313 | |
2314 | #endif |
2314 | #endif |
2315 | |
2315 | |
2316 | void |
2316 | void |
2317 | rxvt_term::set_background (rxvt_img *img, bool border = false) |
2317 | rxvt_term::clr_background () |
2318 | CODE: |
2318 | CODE: |
2319 | delete THIS->bg_img; |
2319 | delete THIS->bg_img; |
2320 | THIS->bg_img = 0; |
2320 | THIS->bg_img = 0; |
|
|
2321 | THIS->bg_flags = rxvt_term::BG_NEEDS_REFRESH; |
|
|
2322 | |
|
|
2323 | void |
|
|
2324 | rxvt_term::set_background (rxvt_img *img, bool border = false) |
|
|
2325 | CODE: |
|
|
2326 | delete THIS->bg_img; |
2321 | THIS->bg_flags = 0; |
2327 | THIS->bg_img = 0; |
|
|
2328 | THIS->bg_flags = rxvt_term::BG_NEEDS_REFRESH; |
2322 | |
2329 | |
2323 | if (img) // TODO: cannot be false |
2330 | //if (img) // TODO: cannot be false, maybe allow and get rid of clr_background? |
2324 | { |
2331 | { |
2325 | img = img->clone (); // own the img |
2332 | img = img->clone (); // own the img |
2326 | |
2333 | |
2327 | if (img->repeat != RepeatNormal) // X11 only supports RepeatNormal as bg pixmap |
2334 | if (img->repeat != RepeatNormal) // X11 only supports RepeatNormal as bg pixmap |
2328 | img->sub_rect (0, 0, |
2335 | img->sub_rect (0, 0, |
… | |
… | |
2336 | |
2343 | |
2337 | img->convert_format (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]) |
2344 | img->convert_format (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]) |
2338 | ->replace (img); |
2345 | ->replace (img); |
2339 | |
2346 | |
2340 | THIS->bg_img = img; |
2347 | THIS->bg_img = img; |
2341 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH; |
|
|
2342 | |
2348 | |
2343 | if (!border) |
2349 | if (!border) |
2344 | THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; |
2350 | THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; |
2345 | } |
2351 | } |
2346 | |
2352 | |