+
+
+void rectangle_pixmap(ProcessList *process_list, GdkGC *gc,
+ gboolean filled, gint x, gint y, gint width, gint height)
+{
+ RectanglePixmap rp = { filled, x, y, width, height, gc };
+
+ g_hash_table_foreach(process_list->process_hash,
+ (GHFunc)rectangle_pixmap_each,
+ &rp);
+}
+
+
+/* Renders each pixmaps into on big drawable */
+void copy_pixmap_to_screen(ProcessList *process_list,
+ GdkDrawable *dest,
+ GdkGC *gc,
+ gint x, gint y,
+ gint width, gint height)
+{
+ if(process_list->index_to_pixmap->len == 0) return;
+ guint cell_height = process_list->cell_height;
+
+ /* Get indexes */
+ gint begin = floor(y/(double)cell_height);
+ gint end = MIN(ceil((y+height)/(double)cell_height),
+ process_list->index_to_pixmap->len);
+ gint i;
+
+ for(i=begin; i<end; i++) {
+ g_assert(i<process_list->index_to_pixmap->len);
+ /* Render the pixmap to the screen */
+ GdkPixmap *pixmap =
+ (GdkPixmap*)g_ptr_array_index(process_list->index_to_pixmap, i);
+
+ gdk_draw_drawable (dest,
+ gc,
+ pixmap,
+ x, 0,
+ x, i*cell_height,
+ width, cell_height);
+
+ }
+
+
+}
+
+
+
+
+