Beispiel #1
0
static void
_vte_pango_x_set_background_image(struct _vte_draw *draw,
				  enum VteBgSourceType type,
				  GdkPixbuf *pixbuf,
				  const char *file,
				  const GdkColor *color,
				  double saturation)
{
	GdkPixmap *pixmap;
	struct _vte_pango_x_data *data;
	GdkScreen *screen;

	screen = gtk_widget_get_screen (draw->widget);

	data = (struct _vte_pango_x_data*) draw->impl_data;
	pixmap = vte_bg_get_pixmap(vte_bg_get_for_screen(screen),
				   type, pixbuf, file,
				   color, saturation,
				   _vte_draw_get_colormap(draw, TRUE));
	if (data->pixmap != NULL) {
		g_object_unref(data->pixmap);
	}
	draw->requires_clear = FALSE;
	data->pixmap = NULL;
	data->pixmapw = data->pixmaph = 0;
	if (pixmap != NULL) {
		data->pixmap = pixmap;
		gdk_drawable_get_size(pixmap, &data->pixmapw, &data->pixmaph);
		draw->requires_clear =
			data->pixmapw > 0 && data->pixmaph > 0;
	}
}
Beispiel #2
0
static void
_vte_gl_set_background_image(struct _vte_draw *draw,
			     enum VteBgSourceType type,
			     GdkPixbuf *pixbuf,
			     const char *file,
			     const GdkColor *tint,
			     double saturation)
{
	struct _vte_gl_data *data = draw->impl_data;
	GdkPixbuf *bgpixbuf;
	GdkScreen *screen;

	screen = gtk_widget_get_screen(draw->widget);

	bgpixbuf = vte_bg_get_pixbuf(vte_bg_get_for_screen(screen),
				     type, pixbuf, file,
				     tint, saturation);
	if (data->bgpixbuf != NULL) {
		g_object_unref(data->bgpixbuf);
	}
	data->bgpixbuf = bgpixbuf;
}