--- modules/text-highlight/e-mail-formatter-text-highlight.c	2013-12-31 13:35:19 +0000
+++ modules/text-highlight/e-mail-formatter-text-highlight.c	2013-12-31 13:38:04 +0000
@@ -35,7 +35,11 @@
 #include <libedataserver/libedataserver.h>
 
 #include <glib/gi18n-lib.h>
+
+#ifdef GDK_WINDOWING_X11
 #include <X11/Xlib.h>
+#endif
+
 #include <camel/camel.h>
 
 typedef struct _EMailFormatterTextHighlight EMailFormatterTextHighlight;
--- modules/spamassassin/evolution-spamassassin.c	2013-12-31 12:14:35 +0000
+++ modules/spamassassin/evolution-spamassassin.c	2013-12-31 12:53:22 +0000
@@ -19,7 +19,12 @@
 #include <config.h>
 #include <errno.h>
 #include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
 #include <glib/gstdio.h>
 #include <glib/gi18n-lib.h>
 
@@ -134,10 +139,14 @@
 		gint exit_code;
 	} *source_data = user_data;
 
+#ifndef G_OS_WIN32
 	if (WIFEXITED (status))
 		source_data->exit_code = WEXITSTATUS (status);
 	else
 		source_data->exit_code = SPAM_ASSASSIN_EXIT_STATUS_ERROR;
+#else
+	source_data->exit_code = status;
+#endif
 
 	g_main_loop_quit (source_data->loop);
 }
@@ -561,8 +570,14 @@
 	pid = atoi (contents);
 	g_free (contents);
 
+#ifdef G_OS_WIN32
+	HANDLE phandle = OpenProcess (PROCESS_TERMINATE, FALSE, pid);
+	if (pid > 0 && (TerminateProcess (phandle, 0) != 0))
+		WaitForSingleObject (phandle, INFINITE);
+#else
 	if (pid > 0 && kill (pid, SIGTERM) == 0)
 		waitpid (pid, NULL, 0);
+#endif
 }
 
 static void
--- modules/cal-config-caldav/e-caldav-chooser.c	2013-12-31 11:49:29 +0000
+++ modules/cal-config-caldav/e-caldav-chooser.c	2013-12-31 11:53:02 +0000
@@ -22,7 +22,9 @@
 #include <glib/gi18n-lib.h>
 
 #include <libsoup/soup.h>
+#ifdef HAVE_SOUP_GNOME
 #include <libsoup/soup-gnome.h>
+#endif
 
 #include <libxml/tree.h>
 #include <libxml/xpath.h>
@@ -363,9 +365,11 @@
 
 	g_object_set (session, SOUP_SESSION_TIMEOUT, 90, NULL);
 
+#ifdef HAVE_SOUP_GNOME
 	/* This adds proxy support. */
 	soup_session_add_feature_by_type (
 		session, SOUP_TYPE_GNOME_FEATURES_2_26);
+#endif
 
 	g_signal_connect (
 		session, "authenticate",
--- modules/bogofilter/evolution-bogofilter.c	2013-12-31 11:30:37 +0000
+++ modules/bogofilter/evolution-bogofilter.c	2013-12-31 11:35:13 +0000
@@ -22,7 +22,9 @@
 
 #include <config.h>
 #include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif
 #include <glib/gi18n-lib.h>
 
 #include <camel/camel.h>
@@ -99,12 +101,17 @@
 		gint exit_code;
 	} *source_data = user_data;
 
+#ifndef G_OS_WIN32
 	if (WIFEXITED (status))
 		source_data->exit_code = WEXITSTATUS (status);
 	else
 		source_data->exit_code = BOGOFILTER_EXIT_STATUS_ERROR;
+#else
+	source_data->exit_code = status;
+#endif
 
 	g_main_loop_quit (source_data->loop);
+
 }
 
 static gint
--- mail/e-mail-autoconfig.c	2013-01-19 17:35:13 +0000
+++ mail/e-mail-autoconfig.c	2013-12-31 01:27:53 +0000
@@ -23,6 +23,10 @@
 #include <glib/gi18n-lib.h>
 
 /* Stuff for DNS querying and message parsing. */
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <windns.h>
+#else
 #include <netdb.h>
 #include <netinet/in.h>
 #include <resolv.h>
@@ -30,6 +34,7 @@
 #if defined(HAVE_ARPA_NAMESER_COMPAT_H) && !defined(GETSHORT)
 #include <arpa/nameser_compat.h>
 #endif
+#endif
 
 /* For error codes. */
 #include <libsoup/soup.h>
@@ -166,17 +171,86 @@
 mail_autoconfig_resolver_thread (gpointer user_data)
 {
 	ResolverClosure *closure = user_data;
+
+#ifdef G_OS_WIN32
+	DNS_STATUS status;
+	PDNS_RECORD answer;
+#else
 	HEADER *header;
 	guchar answer[1024];
 	gchar namebuf[1024];
 	guchar *end, *cp;
-	gint count;
 	gint length;
 	gint herr;
+	gint count;
+#endif
 
 	/* Query DNS for the MX record for the domain name given in the
 	 * email address.  We need an authoritative name server for it. */
+#ifdef G_OS_WIN32
+	status = DnsQuery (
+		closure->domain_name, DNS_TYPE_MX, DNS_QUERY_STANDARD,
+		NULL, &answer, NULL);
 
+	if (status) {
+		if (status == 9501)
+			g_set_error (
+				&closure->error,
+				G_RESOLVER_ERROR,
+				G_RESOLVER_ERROR_NOT_FOUND,
+				_("No mail exchanger record for '%s'"),
+				closure->domain_name);
+		else if (status == 1406)
+			g_set_error (
+				&closure->error,
+				G_RESOLVER_ERROR,
+				G_RESOLVER_ERROR_TEMPORARY_FAILURE,
+				_("Temporarily unable to resolve '%s'"),
+				closure->domain_name);
+		else
+			g_set_error (
+				&closure->error,
+				G_RESOLVER_ERROR,
+				G_RESOLVER_ERROR_INTERNAL,
+				_("Error resolving '%s'"),
+				closure->domain_name);
+		goto exit;
+	}
+
+	/* Re-query and get the authorative server */
+	status = DnsQuery (
+		closure->domain_name, DNS_TYPE_SOA, DNS_QUERY_STANDARD,
+		NULL, &answer, NULL);
+
+	if (status) {
+		if (status == 9501)
+			g_set_error (
+				&closure->error,
+				G_RESOLVER_ERROR,
+				G_RESOLVER_ERROR_NOT_FOUND,
+				"No state of authority record for '%s'",
+				closure->domain_name);
+		else if (status == 1406)
+			g_set_error (
+				&closure->error,
+				G_RESOLVER_ERROR,
+				G_RESOLVER_ERROR_TEMPORARY_FAILURE,
+				_("Temporarily unable to resolve '%s'"),
+				closure->domain_name);
+		else
+			g_set_error (
+				&closure->error,
+				G_RESOLVER_ERROR,
+				G_RESOLVER_ERROR_INTERNAL,
+				_("Error resolving '%s'"),
+				closure->domain_name);
+		goto exit;
+	}
+
+	closure->name_server = g_strdup (answer->Data.SOA.pNamePrimaryServer);
+	DnsRecordListFree (answer, DnsFreeRecordList);
+
+#else
 	length = res_query (
 		closure->domain_name, C_IN, T_MX,
 		answer, sizeof (answer));
@@ -263,6 +337,7 @@
 			G_RESOLVER_ERROR_NOT_FOUND,
 			_("No authoritative name server for '%s'"),
 			closure->domain_name);
+#endif
 
 exit:
 	g_main_loop_quit (closure->main_loop);
--- mail/e-mail-account-store.c	2013-12-30 08:44:31 +0000
+++ mail/e-mail-account-store.c	2013-12-30 08:49:28 +0000
@@ -64,7 +64,7 @@
 	SERVICE_ADDED,
 	SERVICE_REMOVED,
 	SERVICE_ENABLED,
-	SERVICE_DISABLED,
+	SERVICE_DISENABLED,
 	SERVICES_REORDERED,
 	REMOVE_REQUESTED,
 	ENABLE_REQUESTED,
@@ -898,7 +898,7 @@
 		G_TYPE_NONE, 1,
 		CAMEL_TYPE_SERVICE);
 
-	signals[SERVICE_DISABLED] = g_signal_new (
+	signals[SERVICE_DISENABLED] = g_signal_new (
 		"service-disabled",
 		G_TYPE_FROM_CLASS (class),
 		G_SIGNAL_RUN_LAST,
@@ -1198,7 +1198,7 @@
 	if (enabled)
 		g_signal_emit (store, signals[SERVICE_ENABLED], 0, service);
 	else
-		g_signal_emit (store, signals[SERVICE_DISABLED], 0, service);
+		g_signal_emit (store, signals[SERVICE_DISENABLED], 0, service);
 
 	filename = store->priv->sort_order_filename;
 
@@ -1297,7 +1297,7 @@
 		gtk_list_store_set (
 			GTK_LIST_STORE (store), &iter,
 			E_MAIL_ACCOUNT_STORE_COLUMN_ENABLED, FALSE, -1);
-		g_signal_emit (store, signals[SERVICE_DISABLED], 0, service);
+		g_signal_emit (store, signals[SERVICE_DISENABLED], 0, service);
 	}
 }
 
--- addressbook/gui/widgets/eab-contact-formatter.c	2013-12-29 00:17:19 +0000
+++ addressbook/gui/widgets/eab-contact-formatter.c	2013-12-30 08:15:38 +0000
@@ -91,9 +91,10 @@
 
 #define MAX_COMPACT_IMAGE_DIMENSION 48
 
-#define HTML_HEADER "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n"  \
+#define HTML_HEADER_BEGIN "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n"  \
 "<head>\n<meta name=\"generator\" content=\"Evolution Addressbook Component\">\n" \
-"<link type=\"text/css\" rel=\"stylesheet\" href=\"evo-file://" EVOLUTION_PRIVDATADIR "/theme/webview.css\">" \
+"<link type=\"text/css\" rel=\"stylesheet\" href=\"evo-file://"
+#define HTML_HEADER_END "/theme/webview.css\">" \
 "<style type=\"text/css\">\n" \
 "  div#header { width:100%; clear: both; }\n" \
 "  div#columns { width: 100%; clear: both; }\n" \
@@ -770,7 +771,9 @@
 render_normal (EABContactFormatter *formatter,
                GString *buffer)
 {
-	g_string_append (buffer, HTML_HEADER);
+	g_string_append (buffer, HTML_HEADER_BEGIN);
+	g_string_append (buffer, EVOLUTION_PRIVDATADIR);
+	g_string_append (buffer, HTML_HEADER_END);
 	g_string_append_printf (
 		buffer, "<body bgcolor=\"#%06x\" text=\"#%06x\">",
 		e_color_to_value (
@@ -804,7 +807,9 @@
 	gchar *html;
 	EContactPhoto *photo;
 
-	g_string_append (buffer, HTML_HEADER);
+	g_string_append (buffer, HTML_HEADER_BEGIN);
+	g_string_append (buffer, EVOLUTION_PRIVDATADIR);
+	g_string_append (buffer, HTML_HEADER_END);
 	g_string_append (buffer, "<body>\n");
 
 	if (!contact) {
--- shell/e-shell-window-private.c	2013-01-19 17:35:14 +0000
+++ shell/e-shell-window-private.c	2013-12-28 07:37:41 +0000
@@ -404,6 +404,7 @@
 		action, "sensitive",
 		G_BINDING_SYNC_CREATE);
 
+#ifndef G_OS_WIN32
 	/* Bind GObject properties to GSettings keys. */
 
 	settings = g_settings_new ("org.gnome.evolution.shell");
@@ -446,6 +447,7 @@
 		settings, "toolbar-visible",
 		shell_window, "toolbar-visible",
 		G_SETTINGS_BIND_DEFAULT);
+#endif
 
 	/* Configure the initial size and position of the window by way
 	 * of either a user-supplied geometry string or the last recorded
@@ -473,7 +475,9 @@
 
 	gtk_application_add_window (GTK_APPLICATION (shell), window);
 
+#ifndef G_OS_WIN32
 	g_object_unref (settings);
+#endif
 }
 
 void
--- widgets/table/e-tree.c	2013-01-19 17:35:14 +0000
+++ widgets/table/e-tree.c	2013-12-28 07:08:41 +0000
@@ -66,7 +66,7 @@
 	CURSOR_CHANGE,
 	CURSOR_ACTIVATED,
 	SELECTION_CHANGE,
-	DOUBLE_CLICK,
+	DBL_CLICK,
 	RIGHT_CLICK,
 	CLICK,
 	KEY_PRESS,
@@ -913,7 +913,7 @@
 {
 	ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
 
-	g_signal_emit (et, et_signals[DOUBLE_CLICK], 0, row, path, col, event);
+	g_signal_emit (et, et_signals[DBL_CLICK], 0, row, path, col, event);
 }
 
 static gboolean
@@ -3535,7 +3535,7 @@
 		g_cclosure_marshal_VOID__VOID,
 		G_TYPE_NONE, 0);
 
-	et_signals[DOUBLE_CLICK] = g_signal_new (
+	et_signals[DBL_CLICK] = g_signal_new (
 		"double_click",
 		G_OBJECT_CLASS_TYPE (object_class),
 		G_SIGNAL_RUN_LAST,
--- widgets/table/e-table.c	2013-01-19 17:35:14 +0000
+++ widgets/table/e-table.c	2013-12-28 06:56:41 +0000
@@ -69,7 +69,7 @@
 	CURSOR_CHANGE,
 	CURSOR_ACTIVATED,
 	SELECTION_CHANGE,
-	DOUBLE_CLICK,
+	DBL_CLICK,
 	RIGHT_CLICK,
 	CLICK,
 	KEY_PRESS,
@@ -865,7 +865,7 @@
                     GdkEvent *event,
                     ETable *et)
 {
-	g_signal_emit (et, et_signals[DOUBLE_CLICK], 0, row, col, event);
+	g_signal_emit (et, et_signals[DBL_CLICK], 0, row, col, event);
 }
 
 static gboolean
@@ -3336,7 +3336,7 @@
 		g_cclosure_marshal_VOID__VOID,
 		G_TYPE_NONE, 0);
 
-	et_signals[DOUBLE_CLICK] = g_signal_new (
+	et_signals[DBL_CLICK] = g_signal_new (
 		"double_click",
 		G_OBJECT_CLASS_TYPE (object_class),
 		G_SIGNAL_RUN_LAST,
--- widgets/table/e-table-item.c	2013-01-19 17:35:14 +0000
+++ widgets/table/e-table-item.c	2013-12-28 06:38:54 +0000
@@ -73,7 +73,7 @@
 enum {
 	CURSOR_CHANGE,
 	CURSOR_ACTIVATED,
-	DOUBLE_CLICK,
+	DBL_CLICK,
 	RIGHT_CLICK,
 	CLICK,
 	KEY_PRESS,
@@ -2600,7 +2600,7 @@
 
 			if (model_row != -1 && model_col != -1) {
 				g_signal_emit (
-					eti, eti_signals[DOUBLE_CLICK], 0,
+					eti, eti_signals[DBL_CLICK], 0,
 					model_row, model_col, e);
 			}
 		}
@@ -3172,7 +3172,7 @@
 		G_TYPE_NONE, 1,
 		G_TYPE_INT);
 
-	eti_signals[DOUBLE_CLICK] = g_signal_new (
+	eti_signals[DBL_CLICK] = g_signal_new (
 		"double_click",
 		G_OBJECT_CLASS_TYPE (object_class),
 		G_SIGNAL_RUN_LAST,
--- widgets/table/e-table-group.c	2013-01-19 17:35:14 +0000
+++ widgets/table/e-table-group.c	2013-12-28 06:37:58 +0000
@@ -43,7 +43,7 @@
 enum {
 	CURSOR_CHANGE,
 	CURSOR_ACTIVATED,
-	DOUBLE_CLICK,
+	DBL_CLICK,
 	RIGHT_CLICK,
 	CLICK,
 	KEY_PRESS,
@@ -489,7 +489,7 @@
 
 	g_signal_emit (
 		e_table_group,
-		etg_signals[DOUBLE_CLICK], 0,
+		etg_signals[DBL_CLICK], 0,
 		row, col, event);
 }
 
@@ -705,7 +705,7 @@
 		G_TYPE_NONE, 1,
 		G_TYPE_INT);
 
-	etg_signals[DOUBLE_CLICK] = g_signal_new (
+	etg_signals[DBL_CLICK] = g_signal_new (
 		"double_click",
 		G_OBJECT_CLASS_TYPE (object_class),
 		G_SIGNAL_RUN_LAST,
--- e-util/e-icon-factory..c	2013-12-27 20:37:10 +0000
+++ e-util/e-icon-factory.c	2013-12-27 21:03:21 +0000
@@ -30,9 +30,11 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#ifdef HAVE_GNOME_DESKTOP
 #define GNOME_DESKTOP_USE_UNSTABLE_API
 #include <libgnome-desktop/gnome-desktop-thumbnail.h>
 #undef GNOME_DESKTOP_USE_UNSTABLE_API
+#endif
 
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
@@ -148,9 +150,11 @@
 	if (height <= 0)
 		height = 1;
 
+#ifdef HAVE_GNOME_DESKTOP
 	/* because this can only scale down, not up */
 	if (gdk_pixbuf_get_width (pixbuf) > width && gdk_pixbuf_get_height (pixbuf) > height)
 		return gnome_desktop_thumbnail_scale_down_pixbuf (pixbuf, width, height);
+#endif
 
 	return gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
 }
@@ -167,6 +171,7 @@
 gchar *
 e_icon_factory_create_thumbnail (const gchar *filename)
 {
+#ifdef HAVE_GNOME_DESKTOP
 	static GnomeDesktopThumbnailFactory *thumbnail_factory = NULL;
 	struct stat file_stat;
 	gchar *thumbnail = NULL;
@@ -212,4 +217,7 @@
 	}
 
 	return thumbnail;
+#else
+	return NULL;
+#endif
 }
--- mail/Makefile.am	2013-01-19 17:35:13 +0000
+++ mail/Makefile.am	2014-01-13 00:11:08 +0000
@@ -4,6 +4,12 @@
 
 mailincludedir = $(privincludedir)/mail
 
+if OS_WIN32
+DNS_LIBS = -lws2_32 -ldnsapi
+else
+DNS_LIBS = -lresolv
+endif
+
 libevolution_mail_la_CPPFLAGS =				\
 	$(AM_CPPFLAGS)					\
 	-I$(top_srcdir)/widgets				\
@@ -217,7 +223,7 @@
 	$(E_WIDGETS_LIBS)				\
 	$(SMIME_LIBS)					\
 	$(LIBSOUP_LIBS)					\
-	-lresolv
+	$(DNS_LIBS)
 
 libevolution_mail_la_LDFLAGS = -avoid-version $(NO_UNDEFINED)
 
@@ -238,7 +244,7 @@
 test_mail_autoconfig_LDADD = \
 	$(EVOLUTION_DATA_SERVER_LIBS)			\
 	$(GNOME_PLATFORM_LIBS)				\
-	-lresolv
+	$(DNS_LIBS)
 
 # Misc data to install
 filterdir = $(privdatadir)
--- modules/plugin-lib/e-plugin-lib.c	2014-01-29 09:29:58 +0000
+++ modules/plugin-lib/e-plugin-lib.c	2014-01-29 09:30:28 +0000
@@ -26,7 +26,7 @@
 #include "e-plugin-lib.h"
 
 #ifdef G_OS_WIN32
-#include <libedataserver/e-data-server-util.h> /* for e_util_replace_prefix() */
+#include <libedataserver/libedataserver.h> /* for e_util_replace_prefix() */
 #endif
 
 #include <string.h>
