#include <glib.h>
#include <gdk/gdk.h>
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-bg.h>

main (int argc, char *argv[])
{
    GdkScreen *screen;
    GnomeBG *bg;
    GSettings *settings;
    GdkPixbuf *pixbuf;

                GdkWindow *root_window;
                cairo_surface_t *surface;
    gdk_init (&argc, &argv);

    screen = gdk_screen_get_default ();

    bg = gnome_bg_new ();
    settings = g_settings_new ("org.gnome.desktop.background");
    gnome_bg_load_from_preferences (bg, settings);

    surface = gnome_bg_create_surface (bg, gdk_get_default_root_window (),
                                                   gdk_screen_get_width (screen),
                                                   gdk_screen_get_height (screen),
                                                   TRUE);
    gnome_bg_set_surface_as_root (screen, surface);

    gtk_main();
    g_object_unref (settings);

    return (0);
}
