… | |
… | |
2032 | ############################################################################# |
2032 | ############################################################################# |
2033 | # fancy bg bloatstuff (TODO: should be moved up somewhere) |
2033 | # fancy bg bloatstuff (TODO: should be moved up somewhere) |
2034 | |
2034 | |
2035 | # TODO: ugly |
2035 | # TODO: ugly |
2036 | void |
2036 | void |
2037 | rxvt_term::get_geometry () |
2037 | rxvt_term::background_geometry (bool border = false) |
2038 | PPCODE: |
2038 | PPCODE: |
2039 | EXTEND (SP, 4); |
2039 | EXTEND (SP, 4); |
2040 | PUSHs (sv_2mortal (newSViv (THIS->parent_x))); |
2040 | PUSHs (sv_2mortal (newSViv (THIS->parent_x + (border ? THIS->window_vt_x : 0)))); |
2041 | PUSHs (sv_2mortal (newSViv (THIS->parent_y))); |
2041 | PUSHs (sv_2mortal (newSViv (THIS->parent_y + (border ? THIS->window_vt_y : 0)))); |
2042 | PUSHs (sv_2mortal (newSViv (THIS->szHint.width))); |
2042 | PUSHs (sv_2mortal (newSViv (border ? THIS->vt_width : THIS->szHint.width ))); |
2043 | PUSHs (sv_2mortal (newSViv (THIS->szHint.height))); |
2043 | PUSHs (sv_2mortal (newSViv (border ? THIS->vt_height : THIS->szHint.height))); |
2044 | |
2044 | |
2045 | #if HAVE_IMG |
2045 | #if HAVE_IMG |
2046 | |
2046 | |
2047 | #if 0 |
2047 | #if 0 |
2048 | |
2048 | |
… | |
… | |
2088 | #endif |
2088 | #endif |
2089 | |
2089 | |
2090 | #if HAVE_BG_PIXMAP |
2090 | #if HAVE_BG_PIXMAP |
2091 | |
2091 | |
2092 | void |
2092 | void |
2093 | rxvt_term::set_background (rxvt_img *img) |
2093 | rxvt_term::set_background (rxvt_img *img, bool border = false) |
2094 | CODE: |
2094 | CODE: |
2095 | THIS->bg_destroy (); |
2095 | THIS->bg_destroy (); |
2096 | THIS->bg_pixmap = None; |
2096 | THIS->bg_pixmap = None; |
2097 | THIS->bg_flags &= ~(rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER); |
2097 | THIS->bg_flags &= ~(rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER | rxvt_term::BG_IS_TRANSPARENT); |
2098 | |
2098 | |
2099 | if (img) // TODO: cannot be false |
2099 | if (img) // TODO: cannot be false |
2100 | { |
2100 | { |
2101 | img = img->reify (); |
2101 | img = img->reify (); |
2102 | rxvt_img *img2 = img->convert_to (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]); |
2102 | rxvt_img *img2 = img->convert_to (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]); |
2103 | delete img; |
2103 | delete img; |
2104 | THIS->bg_pixmap = img2->steal (); |
2104 | THIS->bg_pixmap = img2->steal (); |
2105 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; |
2105 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; |
|
|
2106 | |
|
|
2107 | if (!border) |
|
|
2108 | THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; |
|
|
2109 | |
2106 | THIS->bg_valid_since = ev::now (); // TODO: extra bloat |
2110 | THIS->bg_valid_since = ev::now (); // TODO: extra bloat |
2107 | } |
2111 | } |
2108 | |
2112 | |
2109 | #endif |
2113 | #endif |
2110 | |
2114 | |