static void sctp_graph_redraw(struct sctp_udata *u_data) { sctp_graph_t *ios; u_data->io->needs_redraw = TRUE; sctp_graph_draw(u_data); switch (u_data->io->graph_type) { case 0: draw_sack_graph(u_data); draw_tsn_graph(u_data); break; case 1: draw_tsn_graph(u_data); break; case 2: draw_sack_graph(u_data); break; } ios=(sctp_graph_t *)g_object_get_data(G_OBJECT(u_data->io->draw_area), "sctp_graph_t"); if(!ios){ exit(10); } gdk_draw_pixmap(u_data->io->draw_area->window, u_data->io->draw_area->style->fg_gc[GTK_WIDGET_STATE(u_data->io->draw_area)], ios->pixmap, 0,0, 0, 0, u_data->io->draw_area->allocation.width, u_data->io->draw_area->allocation.height); }
static void sctp_graph_redraw(struct sctp_udata *u_data) { sctp_graph_t *ios; GtkAllocation widget_alloc; cairo_t *cr; u_data->io->needs_redraw = TRUE; sctp_graph_draw(u_data); switch (u_data->io->graph_type) { case 0: draw_sack_graph(u_data); draw_tsn_graph(u_data); break; case 1: draw_tsn_graph(u_data); break; case 2: draw_sack_graph(u_data); break; } ios=(sctp_graph_t *)g_object_get_data(G_OBJECT(u_data->io->draw_area), "sctp_graph_t"); g_assert(ios != NULL); cr = gdk_cairo_create (gtk_widget_get_window(u_data->io->draw_area)); #if GTK_CHECK_VERSION(2,22,0) cairo_set_source_surface (cr, ios->surface, 0, 0); #else gdk_cairo_set_source_pixmap (cr, ios->pixmap, 0, 0); #endif gtk_widget_get_allocation(u_data->io->draw_area, &widget_alloc); cairo_rectangle (cr, 0, 0, widget_alloc.width, widget_alloc.height); cairo_fill (cr); cairo_destroy (cr); }