예제 #1
0
void
rxvt_term::bg_render ()
{
  if (bg_flags & BG_INHIBIT_RENDER)
    return;

  delete bg_img;
  bg_img = 0;
  bg_flags = 0;

  if (!mapped)
    return;

# if BG_IMAGE_FROM_ROOT
  if (root_img)
    {
      render_root_image ();
      bg_flags |= BG_IS_TRANSPARENT;
    }
# endif

# if BG_IMAGE_FROM_FILE
  if (fimage.img)
    render_image (fimage);
# endif

  scr_recolour (false);
  bg_flags |= BG_NEEDS_REFRESH;

  bg_valid_since = ev::now ();
}
예제 #2
0
파일: main.C 프로젝트: nneonneo/rxvt-js
void
rxvt_term::set_window_color (int idx, const char *color)
{
#ifdef XTERM_COLOR_CHANGE
  rxvt_color xcol;

  if (color == NULL || *color == '\0')
    return;

  color = strdup (color);
  allocated.push_back ((void *)color);
  rs[Rs_color + idx] = color;

  /* handle color aliases */
  if (isdigit (*color))
    {
      int i = atoi (color);

      if (i >= 8 && i <= 15)
        {
          /* bright colors */
          pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i - 8];
          goto done;
        }

      if (i >= 0 && i <= 7)
        {
          /* normal colors */
          pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i];
          goto done;
        }
    }

  set_color (xcol, color);

  /*
   * FIXME: should free colors here, but no idea how to do it so instead,
   * so just keep gobbling up the colormap
   */

  pix_colors_focused[idx] = xcol;

done:
  /*TODO: handle Color_BD, scrollbar background, etc. */

  update_fade_color (idx);
  recolour_cursor ();
  scr_recolour ();
#endif /* XTERM_COLOR_CHANGE */
}