// Build with, for instance:
// gcc test_goocanvas_image.c `pkg-config goocanvas-2.0 --libs --cflags`
#include <gtk/gtk.h>
#include <goocanvas.h>

static gboolean
on_delete_event (GtkWidget *window,
		 GdkEvent *event,
		 gpointer unused_data)
{
  gtk_main_quit ();
  return FALSE;
}

int
main (int argc, char *argv[])
{
  GtkWidget *window = 0;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window), 640, 600);
  gtk_widget_show (window);
  g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event),
		    NULL);

  GtkWidget *canvas = goo_canvas_new ();
  goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 10000, 10000);
  gtk_container_add (GTK_CONTAINER(window), canvas);
  gtk_widget_show (canvas);
  
  g_object_set (canvas,
    "units", GTK_UNIT_MM,
    NULL);

  GooCanvasItem *root = goo_canvas_get_root_item (GOO_CANVAS (canvas));

  GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file ("test.jpg", NULL);
  
  GooCanvasItem *image = goo_canvas_image_new (root, pixbuf,
    10.0f, 
    10.0f,
    NULL);

  gtk_main ();
  return 0;
}
