cellview: Port to Cairo rendering

This commit is contained in:
Benjamin Otte 2010-08-22 04:32:39 +02:00
parent 42947e3cdc
commit e9dd3dc46a

View File

@ -436,6 +436,7 @@ gtk_cell_view_expose (GtkWidget *widget,
GtkCellRendererState state;
gboolean rtl = (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL);
GtkPackType packing;
cairo_t *cr;
cellview = GTK_CELL_VIEW (widget);
@ -443,27 +444,29 @@ gtk_cell_view_expose (GtkWidget *widget,
return FALSE;
gtk_widget_get_allocation (widget, &allocation);
cr = gdk_cairo_create (event->window);
gdk_cairo_region (cr, event->region);
cairo_clip (cr);
/* "blank" background */
if (cellview->priv->background_set)
{
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (GTK_WIDGET (cellview)));
gdk_cairo_rectangle (cr, &allocation);
cairo_set_source_rgb (cr,
cellview->priv->background.red / 65535.,
cellview->priv->background.green / 65535.,
cellview->priv->background.blue / 65535.);
cairo_fill (cr);
cairo_destroy (cr);
}
/* set cell data (if available) */
if (cellview->priv->displayed_row)
gtk_cell_view_set_cell_data (cellview);
else if (cellview->priv->model)
{
cairo_destroy (cr);
return FALSE;
}
/* render cells */
area = allocation;
@ -501,11 +504,11 @@ gtk_cell_view_expose (GtkWidget *widget,
(packing == GTK_PACK_END && !rtl))
area.x -= area.width;
gtk_cell_renderer_render (info->cell,
event->window,
gtk_cell_renderer_render_cairo (info->cell,
cr,
widget,
/* FIXME! */
&area, &area, &event->area, state);
&area, &area, state);
if ((packing == GTK_PACK_START && !rtl) ||
(packing == GTK_PACK_END && rtl))
@ -518,6 +521,8 @@ gtk_cell_view_expose (GtkWidget *widget,
}
}
cairo_destroy (cr);
return FALSE;
}