#include <stdlib.h>
#include <string.h>
+#ifdef G_OS_WIN32
+#ifdef DATADIR
+#undef DATADIR
+#endif
+#include <io.h>
+#include <conio.h>
+#define _WIN32_WINNT 0x0500
+#include <windows.h>
+#endif
+
#define THUMBNAIL_SIZE 128
static gint size = THUMBNAIL_SIZE;
page = ev_document_get_page (document, 0);
- ev_document_get_page_size (document, page, &width, &height);
+ ev_document_get_page_size (document, 0, &width, &height);
rc = ev_render_context_new (page, 0, size / width);
pixbuf = ev_document_thumbnails_get_thumbnail (EV_DOCUMENT_THUMBNAILS (document),
if (overlaid_icon_name) {
GdkPixbuf *overlaid_pixbuf;
+#ifdef G_OS_WIN32
+ gchar *dir = g_win32_get_package_installation_directory_of_module (NULL);
+ gchar *overlaid_icon_path = g_build_filename (dir, "share", "evince", overlaid_icon_name, NULL);
+ g_free (dir);
+#else
gchar *overlaid_icon_path = g_strdup_printf ("%s/%s", DATADIR, overlaid_icon_name);
+#endif
overlaid_pixbuf = gdk_pixbuf_new_from_file (overlaid_icon_path, NULL);
g_free (overlaid_icon_path);
if (overlaid_pixbuf != NULL) {
g_option_context_free (context);
- if (size < 40) {
- g_print ("Size cannot be smaller than 40 pixels\n");
+ if (size < 1) {
+ g_print ("Size cannot be smaller than 1 pixel\n");
return -1;
}