#include <stdio.h>
#include <stdlib.h>
#include <libnotify/notify.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

static NotifyNotification *note;
static GdkPixbuf *pixbuf;

int main()
{
  if (!notify_init("notify-test")) {
    printf("Failed to init notifications\n");
    exit(1);
  }

  /*
  char *version;

  if (!notify_get_server_info (NULL, NULL, NULL, &version)) {
    printf("Failed to get version\n");
    exit(1);
  }

  printf("Version = %s\n", version);
  g_free(version);
  */

  note = notify_notification_new("Test Notification", "This is a test", NULL);

  pixbuf = gdk_pixbuf_new_from_file("/usr/share/pixmaps/firefox.png", NULL);

  if (pixbuf == NULL) {
    printf("Failed to load pixbuf\n");
    exit(1);
  }

  notify_notification_set_image_from_pixbuf(note, pixbuf);

  if (!notify_notification_show(note, NULL)) {
    printf("Failed to show notification\n");
  }

  g_object_unref(note);
  g_object_unref(pixbuf);

  notify_uninit();

  return 0;
}
