diff --git a/meson.build b/meson.build index 6b64d827..914c6bdb 100644 --- a/meson.build +++ b/meson.build @@ -93,8 +93,8 @@ glib_req_version = '>= 2.53.4' peas_req_version = '>= 0.7.4' gio_dep = dependency('gio-2.0', version: glib_req_version) -gio_unix_dep = dependency('gio-unix-2.0', version: glib_req_version) -gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>= 2.91.2') +gio_unix_dep = dependency('gio-unix-2.0', version: glib_req_version, required: false) +gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>= 2.91.2', required: false) libpeas_gtk_dep = dependency('libpeas-gtk-1.0', version: peas_req_version) m_dep = cc.find_library('m') diff --git a/src/eog-error-message-area.c b/src/eog-error-message-area.c index 70618d88..2ac44b78 100644 --- a/src/eog-error-message-area.c +++ b/src/eog-error-message-area.c @@ -34,7 +34,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif /* gboolean <-> gpointer conversion macros taken from gedit */ #ifndef GBOOLEAN_TO_POINTER @@ -324,6 +326,7 @@ static gpointer _check_evince_availability(gpointer data) { gboolean result = FALSE; +#ifndef _WIN32 GDesktopAppInfo *app_info; app_info = g_desktop_app_info_new ("evince.desktop"); @@ -331,6 +334,7 @@ _check_evince_availability(gpointer data) result = TRUE; g_object_unref (app_info); } +#endif return GBOOLEAN_TO_POINTER(result); } diff --git a/src/eog-file-chooser.c b/src/eog-file-chooser.c index 03052549..3b2b4410 100644 --- a/src/eog-file-chooser.c +++ b/src/eog-file-chooser.c @@ -28,6 +28,8 @@ #include #include +#ifndef _WIN32 + /* We must define GNOME_DESKTOP_USE_UNSTABLE_API to be able to use GnomeDesktopThumbnail */ #ifndef GNOME_DESKTOP_USE_UNSTABLE_API @@ -35,14 +37,17 @@ #endif #include +#endif + static char *last_dir[] = { NULL, NULL, NULL, NULL }; #define FILE_FORMAT_KEY "file-format" struct _EogFileChooserPrivate { +#ifndef _WIN32 GnomeDesktopThumbnailFactory *thumb_factory; - +#endif GtkWidget *image; GtkWidget *size_label; GtkWidget *dim_label; @@ -57,10 +62,10 @@ eog_file_chooser_finalize (GObject *object) EogFileChooserPrivate *priv; priv = EOG_FILE_CHOOSER (object)->priv; - +#ifndef _WIN32 if (priv->thumb_factory != NULL) g_object_unref (priv->thumb_factory); - +#endif (* G_OBJECT_CLASS (eog_file_chooser_parent_class)->finalize) (object); } @@ -344,7 +349,7 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data) G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, NULL, NULL); g_object_unref (file); - +#ifndef _WIN32 if ((file_info != NULL) && (priv->thumb_factory != NULL) && g_file_info_get_file_type (file_info) != G_FILE_TYPE_SPECIAL) { guint64 mtime; @@ -392,7 +397,7 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data) } } } - +#endif if (thumb_path != NULL) { g_free (thumb_path); } @@ -431,9 +436,9 @@ eog_file_chooser_add_preview (GtkWidget *widget) gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (widget), vbox); gtk_file_chooser_set_preview_widget_active (GTK_FILE_CHOOSER (widget), FALSE); - +#ifndef _WIN32 priv->thumb_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL); - +#endif g_signal_connect (widget, "update-preview", G_CALLBACK (update_preview_cb), NULL); } diff --git a/src/eog-thumbnail.c b/src/eog-thumbnail.c index 8fd2c7cf..5e5eeea6 100644 --- a/src/eog-thumbnail.c +++ b/src/eog-thumbnail.c @@ -25,21 +25,22 @@ #ifdef HAVE_CONFIG_H #include #endif - +#ifndef _WIN32 /* We must define GNOME_DESKTOP_USE_UNSTABLE_API to be able to use GnomeDesktopThumbnail */ #ifndef GNOME_DESKTOP_USE_UNSTABLE_API #define GNOME_DESKTOP_USE_UNSTABLE_API #endif #include - +#endif #include "eog-thumbnail.h" #include "eog-list-store.h" #include "eog-debug.h" #define EOG_THUMB_ERROR eog_thumb_error_quark () - +#ifndef _WIN32 static GnomeDesktopThumbnailFactory *factory = NULL; +#endif static GdkPixbuf *frame = NULL; typedef enum { @@ -97,13 +98,13 @@ get_valid_thumbnail (EogThumbData *data, GError **error) /* It's no error if the thumbnail does not exist */ if (error && g_error_matches (*error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) g_clear_error (error); - +#ifndef _WIN32 /* is this thumbnail file up to date? */ if (thumb != NULL && !gnome_desktop_thumbnail_is_valid (thumb, data->uri_str, data->mtime)) { g_object_unref (thumb); thumb = NULL; } - +#endif return thumb; } @@ -115,9 +116,9 @@ create_thumbnail_from_pixbuf (EogThumbData *data, GdkPixbuf *thumb; gint width, height; gfloat perc; - +#ifndef _WIN32 g_assert (factory != NULL); - +#endif width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); @@ -157,7 +158,11 @@ eog_thumb_data_new (GFile *file, GError **error) data = g_slice_new0 (EogThumbData); data->uri_str = g_file_get_uri (file); +#ifndef _WIN32 data->thumb_path = gnome_desktop_thumbnail_path_for_uri (data->uri_str, GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL); +#else + data->thumb_path = ""; +#endif file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "," @@ -478,7 +483,7 @@ eog_thumbnail_load (EogImage *image, GError **error) if (data == NULL) return NULL; - +#ifndef _WIN32 if (!data->can_read || (data->failed_thumb_exists && gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail (factory, data->uri_str, data->mtime))) { eog_debug_message (DEBUG_THUMBNAIL, "%s: bad permissions or valid failed thumbnail present",data->uri_str); @@ -523,15 +528,19 @@ eog_thumbnail_load (EogImage *image, GError **error) eog_thumb_data_free (data); return thumb; +#else + return NULL; +#endif } void eog_thumbnail_init (void) { +#ifndef _WIN32 if (factory == NULL) { factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL); } - +#endif if (frame == NULL) { frame = gdk_pixbuf_new_from_resource ( "/org/gnome/eog/ui/pixmaps/thumbnail-frame.png", diff --git a/src/eog-window.c b/src/eog-window.c index 7fd2fd83..01fe4fb8 100644 --- a/src/eog-window.c +++ b/src/eog-window.c @@ -65,7 +65,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include #include @@ -1356,6 +1358,7 @@ eog_window_error_message_area_response (GtkInfoBar *message_area, break; case EOG_ERROR_MESSAGE_AREA_RESPONSE_OPEN_WITH_EVINCE: { +#ifndef _WIN32 GDesktopAppInfo *app_info; GFile *img_file; GList *img_files = NULL; @@ -1372,6 +1375,7 @@ eog_window_error_message_area_response (GtkInfoBar *message_area, img_files); g_list_free_full (img_files, g_object_unref); } +#endif } break; } diff --git a/src/meson.build b/src/meson.build index 7416a208..d4cebb20 100644 --- a/src/meson.build +++ b/src/meson.build @@ -163,7 +163,6 @@ libeog = shared_library( link_args: ldflags, link_depends: symbol_map, install: true, - install_dir: eog_pkglibdir, ) libeog_dep = declare_dependency(