- if (entity->type == SOM_TABLE)
- {
- GdkWindow *window = GTK_WIDGET (the_output_viewer)->window;
- cairo_t *cairo = gdk_cairo_create (GDK_DRAWABLE (window));
- struct outp_driver *driver = xr_create_driver (cairo); /* XXX can fail */
- struct tab_table *t = entity->ext;
- GtkTreeStore *store;
- GtkTreeIter item;
- GtkTreePath *path;
- GtkWidget *drawing_area;
- void *rendering;
- struct string title;
- int tw, th;
-
- tab_ref (t);
- rendering = entity->class->render_init (entity, driver, tab_l (t),
- tab_r (t), tab_t (t), tab_b (t));
- entity->class->area (rendering, &tw, &th);
-
- drawing_area = gtk_drawing_area_new ();
- gtk_widget_modify_bg (GTK_WIDGET (drawing_area), GTK_STATE_NORMAL,
- >k_widget_get_style (drawing_area)->base[GTK_STATE_NORMAL]);
- g_object_set_data (G_OBJECT (drawing_area),
- "entity", som_entity_clone (entity));
- gtk_widget_set_size_request (drawing_area, tw / 1024, th / 1024);
- gtk_layout_put (the_output_viewer->output, drawing_area,
- 0, the_output_viewer->y);
- gtk_widget_show (drawing_area);
- g_signal_connect (G_OBJECT (drawing_area), "expose_event",
- G_CALLBACK (expose_event_callback), NULL);
-
- entity->class->render_free (rendering);
- driver->class->close_driver (driver);
- outp_free_driver (driver);
-
- store = GTK_TREE_STORE (gtk_tree_view_get_model (
- the_output_viewer->overview));
-
- ds_init_empty (&title);
- if (entity->table_num != the_output_viewer->last_table_num)
- {
- gtk_tree_store_append (store, &item, NULL);
-
- ds_put_format (&title, "%d %s",
- entity->table_num, entity->command_name);
- gtk_tree_store_set (store, &item,
- COL_TITLE, ds_cstr (&title),
- COL_Y, the_output_viewer->y,
- -1);
-
- /* XXX shouldn't save a GtkTreeIter */
- the_output_viewer->last_table_num = entity->table_num;
- the_output_viewer->last_top_level = item;
- }