summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am5
-rw-r--r--configure.ac136
-rw-r--r--cut-n-paste/smclient/Makefile.am24
-rw-r--r--cut-n-paste/smclient/eggsmclient-osx.c235
-rw-r--r--cut-n-paste/smclient/eggsmclient-private.h14
-rw-r--r--cut-n-paste/smclient/eggsmclient-win32.c353
-rw-r--r--cut-n-paste/smclient/eggsmclient.c18
-rw-r--r--libdocument/ev-backends-manager.c10
-rw-r--r--libdocument/ev-file-helpers.c8
-rw-r--r--libdocument/ev-init.c61
-rw-r--r--libview/ev-stock-icons.c7
-rw-r--r--previewer/Makefile.am4
-rw-r--r--previewer/ev-previewer-window.c13
-rw-r--r--previewer/ev-previewer.c33
-rw-r--r--shell/Makefile.am11
-rw-r--r--shell/ev-application.c49
-rw-r--r--shell/main.c47
-rw-r--r--thumbnailer/Makefile.am4
-rw-r--r--thumbnailer/atril-thumbnailer.c15
19 files changed, 18 insertions, 1029 deletions
diff --git a/Makefile.am b/Makefile.am
index 60da867d..014c6714 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-# Set the minimum required Windows version to Windows 2000 (0x0500).
-if PLATFORM_WIN32
- AM_CPPFLAGS = -D_WIN32_WINNT=0x0500
-endif
-
SUBDIRS = \
cut-n-paste \
data \
diff --git a/configure.ac b/configure.ac
index 244fddb8..9785e2da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,40 +86,6 @@ AC_SUBST([EV_INTLTOOL_ATRIL_BACKEND_RULE])
GLIB_GSETTINGS
-# Check which platform to use
-
-AC_MSG_CHECKING([for which platform to build])
-AC_ARG_WITH([platform],
- [AS_HELP_STRING([--with-platform=mate|win32|hildon],
- [Setting platform (default: mate)])],
- [case "$withval" in
- mate|win32|hildon) ;;
- *) AC_MSG_ERROR([invalid argument "$withval" for --with-platform]) ;;
- esac],
- [case "$host" in
- *-*-mingw*|*-*-cygwin*) with_platform="win32" ;;
- *) with_platform=mate ;;
- esac])
-
-AC_MSG_RESULT([$with_platform])
-
-if test "$with_platform" = "win32"; then
- AC_CHECK_TOOL([WINDRES],[windres])
- AC_MSG_CHECKING([for native Win32])
- case "$host" in
- *-*-mingw*)
- os_win32=yes
- ;;
- *)
- os_win32=no
- ;;
- esac
- AC_MSG_RESULT([$os_win32])
-fi
-
-AM_CONDITIONAL([PLATFORM_HILDON], [test "$with_platform" = "hildon"])
-AM_CONDITIONAL([PLATFORM_WIN32], [test "$with_platform" = "win32"])
-
AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2.0|3.0], [which gtk+ version to compile against (default: 2.0)])],
@@ -175,31 +141,7 @@ PKG_CHECK_MODULES(BACKEND, cairo >= $CAIRO_REQUIRED gtk+-$GTK_API_VERSION >= $GT
PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
-SHELL_PLATFORM_PKGS=
-case "$with_platform" in
- hildon) AC_DEFINE([PLATFORM_HILDON],[1],[Define if building for the hildon platform])
- SHELL_PLATFORM_PKGS="hildon-1 hildon-fm-2 libosso"
- ;;
- mate)
- # Atril has a rather soft run-time dependency on hicolor-icon-theme.
- # If the hicolor theme is not available, Atril fails to display some
- # icons. Because we cannot check for it at run-time, we instead
- # would like to require the icon theme at compile-time. But, because
- # the hicolor-icon-theme does not have a pkgconfig file, on mate we
- # require the mate icon theme instead.
- SHELL_PLATFORM_PKGS="mate-icon-theme >= $MATE_ICON_THEME_REQUIRED"
- # The totem-screensaver and egg_smclient code use x11 directly.
- SHELL_PLATFORM_PKGS="$SHELL_PLATFORM_PKGS x11"
- ;;
- *)
- # On all other platforms we issue a warning about the runtime
- # dependency.
- AC_MSG_WARN([Atril has a soft run-time dependency on hicolor-icon-theme. You are advised to have this theme installed when running Atril.]);
- SHELL_PLATFORM_PKGS=""
- ;;
-esac
-
-PKG_CHECK_MODULES([SHELL_CORE],[libxml-2.0 >= $LIBXML_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gthread-2.0 $SHELL_PLATFORM_PKGS])
+PKG_CHECK_MODULES([SHELL_CORE],[libxml-2.0 >= $LIBXML_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gthread-2.0 mate-icon-theme >= $MATE_ICON_THEME_REQUIRED x11])
dnl
dnl zlib support
@@ -215,45 +157,13 @@ AS_IF([test "x$found_zlib" = "xno"], [
AC_SUBST(ZLIB_LIBS)
])
-# *********
-# SM client
-# *********
-
-GDK_TARGET="$($PKG_CONFIG --variable target gdk-$GTK_API_VERSION)"
-
-AC_MSG_CHECKING([which smclient backend to use])
-AC_ARG_WITH([smclient],
- [AS_HELP_STRING([--with-smclient-backend=no|xsmp|win32|quartz],
- [Setting smclient backend (default:auto)])],
- [],
- [case "$GDK_TARGET" in
- x11) case "$with_platform" in
- mate) with_smclient=xsmp ;;
- *) with_smclient=no ;;
- esac ;;
- win32|quartz) with_smclient=$GDK_TARGET ;;
- *) with_smclient=no ;;
- esac])
-
-AC_MSG_RESULT([$with_smclient])
-
-if test "$with_smclient" != "no"; then
- AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])
-
- case "$with_smclient" in
- xsmp) SMCLIENT_PKGS="sm >= 1.0.0" ;;
- *) SMCLIENT_PKGS="" ;;
- esac
-
- PKG_CHECK_MODULES([SMCLIENT],[gtk+-$GTK_API_VERSION gthread-2.0 $SMCLIENT_PKGS])
- AC_SUBST([SMCLIENT_CFLAGS])
- AC_SUBST([SMCLIENT_LIBS])
-fi
+dnl
+dnl SM client
+dnl
-AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
-AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
-AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
-AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])
+PKG_CHECK_MODULES([SMCLIENT],[gtk+-$GTK_API_VERSION gthread-2.0 sm >= 1.0.0])
+AC_SUBST([SMCLIENT_CFLAGS])
+AC_SUBST([SMCLIENT_LIBS])
# ***
@@ -274,10 +184,7 @@ AC_MSG_CHECKING([whether gtk+-unix-print support is requested])
AC_ARG_WITH([gtk-unix-print],
[AS_HELP_STRING([--without-gtk-unix-print],
[Disable the use of gtk-unix-print])],
- [],[case "$os_win32" in
- yes) with_gtk_unix_print=no ;;
- *) with_gtk_unix_print=yes ;;
- esac])
+ [],[with_gtk_unix_print=yes])
AC_MSG_RESULT([$with_gtk_unix_print])
@@ -294,10 +201,7 @@ AC_ARG_WITH(keyring,
[AS_HELP_STRING([--without-keyring],
[Disable the use of libsecret and keyring])],
[],
- [case "$with_platform" in
- mate) with_keyring=yes ;;
- hildon|win32) with_keyring=no ;;
- esac])
+ [with_keyring=yes])
AM_CONDITIONAL([WITH_KEYRING],[test "$with_keyring" = "yes"])
@@ -313,10 +217,7 @@ fi
AC_ARG_ENABLE([dbus],
[AS_HELP_STRING([--disable-dbus], [Disable support for dbus])],
[],
- [case "$with_platform" in
- mate) enable_dbus=yes ;;
- hildon) enable_dbus=no ;;
- esac])
+ [enable_dbus=yes])
if test "$enable_dbus" = "yes"; then
AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
@@ -379,10 +280,7 @@ AC_ARG_ENABLE([caja],
[AS_HELP_STRING([--disable-caja],
[Disable build of caja extensions])],
[],
- [case "$with_platform" in
- mate) enable_caja=yes ;;
- *) enable_caja=no ;;
- esac])
+ [enable_caja=yes])
if test "$enable_caja" = "yes" ; then
PKG_CHECK_MODULES([CAJA],[gtk+-x11-$GTK_API_VERSION $MM gthread-2.0 libcaja-extension],
@@ -403,10 +301,7 @@ AC_ARG_ENABLE([thumbnailer],
[AS_HELP_STRING([--disable-thumbnailer],
[Disable MATE thumbnailer])],
[],
- [case "$with_platform" in
- hildon) enable_thumbnailer=no ;;
- *) enable_thumbnailer=yes ;;
- esac])
+ [enable_thumbnailer=yes])
AM_CONDITIONAL([ENABLE_THUMBNAILER],[test "$enable_thumbnailer" = "yes"])
@@ -418,10 +313,7 @@ AC_ARG_ENABLE([previewer],
[AS_HELP_STRING([--disable-previewer],
[Disable the MATE Document Previewer])],
[],
- [case "$with_platform" in
- hildon) enable_previewer=no ;;
- *) enable_previewer=yes ;;
- esac])
+ [enable_previewer=yes])
if test x$enable_previewer = "xyes" ; then
PKG_CHECK_MODULES([PREVIEWER],[gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED])
@@ -949,13 +841,11 @@ AC_OUTPUT
echo "
Configure summary:
- Platform............: $with_platform
GTK+ version........: $with_gtk
GTK+ Unix Print.....: $with_gtk_unix_print
MATE desktop Support: $with_matedesktop
Keyring Support.....: $with_keyring
DBUS Support........: $enable_dbus
- SM client support...: $with_smclient
Caja Plugin.........: $enable_caja
Thumbnailer.........: $enable_thumbnailer
Previewer...........: $enable_previewer
diff --git a/cut-n-paste/smclient/Makefile.am b/cut-n-paste/smclient/Makefile.am
index f99d40b1..6affe94d 100644
--- a/cut-n-paste/smclient/Makefile.am
+++ b/cut-n-paste/smclient/Makefile.am
@@ -1,16 +1,17 @@
noinst_LTLIBRARIES = libsmclient.la
-NULL =
-
-if WITH_SMCLIENT
libsmclient_la_SOURCES = \
eggsmclient.c \
eggsmclient.h \
eggsmclient-private.h \
+ eggdesktopfile.c \
+ eggdesktopfile.h \
+ eggsmclient-xsmp.c \
$(NULL)
libsmclient_la_CPPFLAGS = \
-DG_LOG_DOMAIN=\""EggSMClient"\" \
+ -DEGG_SM_CLIENT_BACKEND_XSMP \
$(DISABLE_DEPRECATED) \
$(AM_CPPFLAGS)
@@ -23,21 +24,4 @@ libsmclient_la_LIBADD = \
$(SMCLIENT_LIBS) \
-lICE
-if WITH_SMCLIENT_XSMP
-libsmclient_la_SOURCES += \
- eggdesktopfile.c \
- eggdesktopfile.h \
- eggsmclient-xsmp.c \
- $(NULL)
-libsmclient_la_CPPFLAGS += -DEGG_SM_CLIENT_BACKEND_XSMP
-endif
-if WITH_SMCLIENT_WIN32
-libsmclient_la_SOURCES += eggsmclient-win32.c
-endif
-if WITH_SMCLIENT_QUARTZ
-libsmclient_la_SOURCES += eggsmclient-osx.c
-endif
-
-endif # WITH_SMCLIENT
-
-include $(top_srcdir)/git.mk
diff --git a/cut-n-paste/smclient/eggsmclient-osx.c b/cut-n-paste/smclient/eggsmclient-osx.c
deleted file mode 100644
index 5428c09f..00000000
--- a/cut-n-paste/smclient/eggsmclient-osx.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (C) 2007 Novell, Inc.
- * Copyright (C) 2008 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/* EggSMClientOSX
- *
- * For details on the OS X logout process, see:
- * http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/BootProcess.html#//apple_ref/doc/uid/20002130-114618
- *
- * EggSMClientOSX registers for the kAEQuitApplication AppleEvent; the
- * handler we register (quit_requested()) will be invoked from inside
- * the quartz event-handling code (specifically, from inside
- * [NSApplication nextEventMatchingMask]) when an AppleEvent arrives.
- * We use AESuspendTheCurrentEvent() and AEResumeTheCurrentEvent() to
- * allow asynchronous / non-main-loop-reentering processing of the
- * quit request. (These are part of the Carbon framework; it doesn't
- * seem to be possible to handle AppleEvents asynchronously from
- * Cocoa.)
- */
-
-#include "config.h"
-
-#include "eggsmclient-private.h"
-#include <gdk/gdkquartz.h>
-#include <Carbon/Carbon.h>
-#include <CoreServices/CoreServices.h>
-
-#define EGG_TYPE_SM_CLIENT_OSX (egg_sm_client_osx_get_type ())
-#define EGG_SM_CLIENT_OSX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSX))
-#define EGG_SM_CLIENT_OSX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSXClass))
-#define EGG_IS_SM_CLIENT_OSX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_OSX))
-#define EGG_IS_SM_CLIENT_OSX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_OSX))
-#define EGG_SM_CLIENT_OSX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_OSX, EggSMClientOSXClass))
-
-typedef struct _EggSMClientOSX EggSMClientOSX;
-typedef struct _EggSMClientOSXClass EggSMClientOSXClass;
-
-struct _EggSMClientOSX {
- EggSMClient parent;
-
- AppleEvent quit_event, quit_reply;
- gboolean quit_requested, quitting;
-};
-
-struct _EggSMClientOSXClass
-{
- EggSMClientClass parent_class;
-
-};
-
-static void sm_client_osx_startup (EggSMClient *client,
- const char *client_id);
-static void sm_client_osx_will_quit (EggSMClient *client,
- gboolean will_quit);
-static gboolean sm_client_osx_end_session (EggSMClient *client,
- EggSMClientEndStyle style,
- gboolean request_confirmation);
-
-static pascal OSErr quit_requested (const AppleEvent *, AppleEvent *, long);
-
-G_DEFINE_TYPE (EggSMClientOSX, egg_sm_client_osx, EGG_TYPE_SM_CLIENT)
-
-static void
-egg_sm_client_osx_init (EggSMClientOSX *osx)
-{
- ;
-}
-
-static void
-egg_sm_client_osx_class_init (EggSMClientOSXClass *klass)
-{
- EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass);
-
- sm_client_class->startup = sm_client_osx_startup;
- sm_client_class->will_quit = sm_client_osx_will_quit;
- sm_client_class->end_session = sm_client_osx_end_session;
-}
-
-EggSMClient *
-egg_sm_client_osx_new (void)
-{
- return g_object_new (EGG_TYPE_SM_CLIENT_OSX, NULL);
-}
-
-static void
-sm_client_osx_startup (EggSMClient *client,
- const char *client_id)
-{
- AEInstallEventHandler (kCoreEventClass, kAEQuitApplication,
- NewAEEventHandlerUPP (quit_requested),
- (long)GPOINTER_TO_SIZE (client), false);
-}
-
-static gboolean
-idle_quit_requested (gpointer client)
-{
- egg_sm_client_quit_requested (client);
- return FALSE;
-}
-
-static pascal OSErr
-quit_requested (const AppleEvent *aevt, AppleEvent *reply, long refcon)
-{
- EggSMClient *client = GSIZE_TO_POINTER ((gsize)refcon);
- EggSMClientOSX *osx = GSIZE_TO_POINTER ((gsize)refcon);
-
- g_return_val_if_fail (!osx->quit_requested, userCanceledErr);
-
- /* FIXME AEInteractWithUser? */
-
- osx->quit_requested = TRUE;
- AEDuplicateDesc (aevt, &osx->quit_event);
- AEDuplicateDesc (reply, &osx->quit_reply);
- AESuspendTheCurrentEvent (aevt);
-
- /* Don't emit the "quit_requested" signal immediately, since we're
- * called from a weird point in the guts of gdkeventloop-quartz.c
- */
- g_idle_add (idle_quit_requested, client);
- return noErr;
-}
-
-static pascal OSErr
-quit_requested_resumed (const AppleEvent *aevt, AppleEvent *reply, long refcon)
-{
- EggSMClientOSX *osx = GSIZE_TO_POINTER ((gsize)refcon);
-
- osx->quit_requested = FALSE;
- return osx->quitting ? noErr : userCanceledErr;
-}
-
-static gboolean
-idle_will_quit (gpointer client)
-{
- EggSMClientOSX *osx = (EggSMClientOSX *)client;
-
- /* Resume the event with a new handler that will return a value to
- * the system.
- */
- AEResumeTheCurrentEvent (&osx->quit_event, &osx->quit_reply,
- NewAEEventHandlerUPP (quit_requested_resumed),
- (long)GPOINTER_TO_SIZE (client));
- AEDisposeDesc (&osx->quit_event);
- AEDisposeDesc (&osx->quit_reply);
-
- if (osx->quitting)
- egg_sm_client_quit (client);
- return FALSE;
-}
-
-static void
-sm_client_osx_will_quit (EggSMClient *client,
- gboolean will_quit)
-{
- EggSMClientOSX *osx = (EggSMClientOSX *)client;
-
- g_return_if_fail (osx->quit_requested);
-
- osx->quitting = will_quit;
-
- /* Finish in an idle handler since the caller might have called
- * egg_sm_client_will_quit() from inside the "quit_requested" signal
- * handler, but may not expect the "quit" signal to arrive during
- * the _will_quit() call.
- */
- g_idle_add (idle_will_quit, client);
-}
-
-static gboolean
-sm_client_osx_end_session (EggSMClient *client,
- EggSMClientEndStyle style,
- gboolean request_confirmation)
-{
- static const ProcessSerialNumber loginwindow_psn = { 0, kSystemProcess };
- AppleEvent event = { typeNull, NULL }, reply = { typeNull, NULL };
- AEAddressDesc target;
- AEEventID id;
- OSErr err;
-
- switch (style)
- {
- case EGG_SM_CLIENT_END_SESSION_DEFAULT:
- case EGG_SM_CLIENT_LOGOUT:
- id = request_confirmation ? kAELogOut : kAEReallyLogOut;
- break;
- case EGG_SM_CLIENT_REBOOT:
- id = request_confirmation ? kAEShowRestartDialog : kAERestart;
- break;
- case EGG_SM_CLIENT_SHUTDOWN:
- id = request_confirmation ? kAEShowShutdownDialog : kAEShutDown;
- break;
- }
-
- err = AECreateDesc (typeProcessSerialNumber, &loginwindow_psn,
- sizeof (loginwindow_psn), &target);
- if (err != noErr)
- {
- g_warning ("Could not create descriptor for loginwindow: %d", err);
- return FALSE;
- }
-
- err = AECreateAppleEvent (kCoreEventClass, id, &target,
- kAutoGenerateReturnID, kAnyTransactionID,
- &event);
- AEDisposeDesc (&target);
- if (err != noErr)
- {
- g_warning ("Could not create logout AppleEvent: %d", err);
- return FALSE;
- }
-
- err = AESend (&event, &reply, kAENoReply, kAENormalPriority,
- kAEDefaultTimeout, NULL, NULL);
- AEDisposeDesc (&event);
- if (err == noErr)
- AEDisposeDesc (&reply);
-
- return err == noErr;
-}
diff --git a/cut-n-paste/smclient/eggsmclient-private.h b/cut-n-paste/smclient/eggsmclient-private.h
index 4f8572fe..71ce652f 100644
--- a/cut-n-paste/smclient/eggsmclient-private.h
+++ b/cut-n-paste/smclient/eggsmclient-private.h
@@ -29,22 +29,8 @@ void egg_sm_client_quit_requested (EggSMClient *client);
void egg_sm_client_quit_cancelled (EggSMClient *client);
void egg_sm_client_quit (EggSMClient *client);
-#if defined (GDK_WINDOWING_X11)
-# ifdef EGG_SM_CLIENT_BACKEND_XSMP
GType egg_sm_client_xsmp_get_type (void);
EggSMClient *egg_sm_client_xsmp_new (void);
-# endif
-# ifdef EGG_SM_CLIENT_BACKEND_DBUS
-GType egg_sm_client_dbus_get_type (void);
-EggSMClient *egg_sm_client_dbus_new (void);
-# endif
-#elif defined (GDK_WINDOWING_WIN32)
-GType egg_sm_client_win32_get_type (void);
-EggSMClient *egg_sm_client_win32_new (void);
-#elif defined (GDK_WINDOWING_QUARTZ)
-GType egg_sm_client_osx_get_type (void);
-EggSMClient *egg_sm_client_osx_new (void);
-#endif
G_END_DECLS
diff --git a/cut-n-paste/smclient/eggsmclient-win32.c b/cut-n-paste/smclient/eggsmclient-win32.c
deleted file mode 100644
index 3fec775c..00000000
--- a/cut-n-paste/smclient/eggsmclient-win32.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (C) 2007 Novell, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/* EggSMClientWin32
- *
- * For details on the Windows XP logout process, see:
- * http://msdn.microsoft.com/en-us/library/aa376876.aspx.
- *
- * Vista adds some new APIs which EggSMClient does not make use of; see
- * http://msdn.microsoft.com/en-us/library/ms700677(VS.85).aspx
- *
- * When shutting down, Windows sends every top-level window a
- * WM_QUERYENDSESSION event, which the application must respond to
- * synchronously, saying whether or not it will quit. To avoid main
- * loop re-entrancy problems (and to avoid having to muck about too
- * much with the guts of the gdk-win32 main loop), we watch for this
- * event in a separate thread, which then signals the main thread and
- * waits for the main thread to handle the event. Since we don't want
- * to require g_thread_init() to be called, we do this all using
- * Windows-specific thread methods.
- *
- * After the application handles the WM_QUERYENDSESSION event,
- * Windows then sends it a WM_ENDSESSION event with a TRUE or FALSE
- * parameter indicating whether the session is or is not actually
- * going to end now. We handle this from the other thread as well.
- *
- * As mentioned above, Vista introduces several additional new APIs
- * that don't fit into the (current) EggSMClient API. Windows also has
- * an entirely separate shutdown-notification scheme for non-GUI apps,
- * which we also don't handle here.
- */
-
-#include "config.h"
-
-#include "eggsmclient-private.h"
-#include <gdk/gdk.h>
-
-#define WIN32_LEAN_AND_MEAN
-#define UNICODE
-#include <windows.h>
-#include <process.h>
-
-#define EGG_TYPE_SM_CLIENT_WIN32 (egg_sm_client_win32_get_type ())
-#define EGG_SM_CLIENT_WIN32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32))
-#define EGG_SM_CLIENT_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class))
-#define EGG_IS_SM_CLIENT_WIN32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT_WIN32))
-#define EGG_IS_SM_CLIENT_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT_WIN32))
-#define EGG_SM_CLIENT_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT_WIN32, EggSMClientWin32Class))
-
-typedef struct _EggSMClientWin32 EggSMClientWin32;
-typedef struct _EggSMClientWin32Class EggSMClientWin32Class;
-
-struct _EggSMClientWin32 {
- EggSMClient parent;
-
- HANDLE message_event, response_event;
-
- volatile GSourceFunc event;
- volatile gboolean will_quit;
-};
-
-struct _EggSMClientWin32Class
-{
- EggSMClientClass parent_class;
-
-};
-
-static void sm_client_win32_startup (EggSMClient *client,
- const char *client_id);
-static void sm_client_win32_will_quit (EggSMClient *client,
- gboolean will_quit);
-static gboolean sm_client_win32_end_session (EggSMClient *client,
- EggSMClientEndStyle style,
- gboolean request_confirmation);
-
-static GSource *g_win32_handle_source_add (HANDLE handle, GSourceFunc callback,
- gpointer user_data);
-static gboolean got_message (gpointer user_data);
-static void sm_client_thread (gpointer data);
-
-G_DEFINE_TYPE (EggSMClientWin32, egg_sm_client_win32, EGG_TYPE_SM_CLIENT)
-
-static void
-egg_sm_client_win32_init (EggSMClientWin32 *win32)
-{
- ;
-}
-
-static void
-egg_sm_client_win32_class_init (EggSMClientWin32Class *klass)
-{
- EggSMClientClass *sm_client_class = EGG_SM_CLIENT_CLASS (klass);
-
- sm_client_class->startup = sm_client_win32_startup;
- sm_client_class->will_quit = sm_client_win32_will_quit;
- sm_client_class->end_session = sm_client_win32_end_session;
-}
-
-EggSMClient *
-egg_sm_client_win32_new (void)
-{
- return g_object_new (EGG_TYPE_SM_CLIENT_WIN32, NULL);
-}
-
-static void
-sm_client_win32_startup (EggSMClient *client,
- const char *client_id)
-{
- EggSMClientWin32 *win32 = (EggSMClientWin32 *)client;
-
- win32->message_event = CreateEvent (NULL, FALSE, FALSE, NULL);
- win32->response_event = CreateEvent (NULL, FALSE, FALSE, NULL);
- g_win32_handle_source_add (win32->message_event, got_message, win32);
- _beginthread (sm_client_thread, 0, client);
-}
-
-static void
-sm_client_win32_will_quit (EggSMClient *client,
- gboolean will_quit)
-{
- EggSMClientWin32 *win32 = (EggSMClientWin32 *)client;
-
- win32->will_quit = will_quit;
- SetEvent (win32->response_event);
-}
-
-static gboolean
-sm_client_win32_end_session (EggSMClient *client,
- EggSMClientEndStyle style,
- gboolean request_confirmation)
-{
- UINT uFlags = EWX_LOGOFF;
-
- switch (style)
- {
- case EGG_SM_CLIENT_END_SESSION_DEFAULT:
- case EGG_SM_CLIENT_LOGOUT:
- uFlags = EWX_LOGOFF;
- break;
- case EGG_SM_CLIENT_REBOOT:
- uFlags = EWX_REBOOT;
- break;
- case EGG_SM_CLIENT_SHUTDOWN:
- uFlags = EWX_POWEROFF;
- break;
- }
-
- /* There's no way to make ExitWindowsEx() show a logout dialog, so
- * we ignore @request_confirmation.
- */
-
-#ifdef SHTDN_REASON_FLAG_PLANNED
- ExitWindowsEx (uFlags, SHTDN_REASON_FLAG_PLANNED);
-#else
- ExitWindowsEx (uFlags, 0);
-#endif
-
- return TRUE;
-}
-
-
-/* callbacks from logout-listener thread */
-
-static gboolean
-emit_quit_requested (gpointer smclient)
-{
- gdk_threads_enter ();
- egg_sm_client_quit_requested (smclient);
- gdk_threads_leave ();
-
- return FALSE;
-}
-
-static gboolean
-emit_quit (gpointer smclient)
-{
- EggSMClientWin32 *win32 = smclient;
-
- gdk_threads_enter ();
- egg_sm_client_quit (smclient);
- gdk_threads_leave ();
-
- SetEvent (win32->response_event);
- return FALSE;
-}
-
-static gboolean
-emit_quit_cancelled (gpointer smclient)
-{
- EggSMClientWin32 *win32 = smclient;
-
- gdk_threads_enter ();
- egg_sm_client_quit_cancelled (smclient);
- gdk_threads_leave ();
-
- SetEvent (win32->response_event);
- return FALSE;
-}
-
-static gboolean
-got_message (gpointer smclient)
-{
- EggSMClientWin32 *win32 = smclient;
-
- win32->event (win32);
- return TRUE;
-}
-
-/* Windows HANDLE GSource */
-
-typedef struct {
- GSource source;
- GPollFD pollfd;
-} GWin32HandleSource;
-
-static gboolean
-g_win32_handle_source_prepare (GSource *source, gint *timeout)
-{
- *timeout = -1;
- return FALSE;
-}
-
-static gboolean
-g_win32_handle_source_check (GSource *source)
-{
- GWin32HandleSource *hsource = (GWin32HandleSource *)source;
-
- return hsource->pollfd.revents;
-}
-
-static gboolean
-g_win32_handle_source_dispatch (GSource *source, GSourceFunc callback, gpointer user_data)
-{
- return (*callback) (user_data);
-}
-
-static void
-g_win32_handle_source_finalize (GSource *source)
-{
- ;
-}
-
-GSourceFuncs g_win32_handle_source_funcs = {
- g_win32_handle_source_prepare,
- g_win32_handle_source_check,
- g_win32_handle_source_dispatch,
- g_win32_handle_source_finalize
-};
-
-static GSource *
-g_win32_handle_source_add (HANDLE handle, GSourceFunc callback, gpointer user_data)
-{
- GWin32HandleSource *hsource;
- GSource *source;
-
- source = g_source_new (&g_win32_handle_source_funcs, sizeof (GWin32HandleSource));
- hsource = (GWin32HandleSource *)source;
- hsource->pollfd.fd = (int)handle;
- hsource->pollfd.events = G_IO_IN;
- hsource->pollfd.revents = 0;
- g_source_add_poll (source, &hsource->pollfd);
-
- g_source_set_callback (source, callback, user_data, NULL);
- g_source_attach (source, NULL);
- return source;
-}
-
-/* logout-listener thread */
-
-LRESULT CALLBACK
-sm_client_win32_window_procedure (HWND hwnd,
- UINT message,
- WPARAM wParam,
- LPARAM lParam)
-{
- EggSMClientWin32 *win32 =
- (EggSMClientWin32 *)GetWindowLongPtr (hwnd, GWLP_USERDATA);
-
- switch (message)
- {
- case WM_QUERYENDSESSION:
- win32->event = emit_quit_requested;
- SetEvent (win32->message_event);
-
- WaitForSingleObject (win32->response_event, INFINITE);
- return win32->will_quit;
-
- case WM_ENDSESSION:
- if (wParam)
- {
- /* The session is ending */
- win32->event = emit_quit;
- }
- else
- {
- /* Nope, the session *isn't* ending */
- win32->event = emit_quit_cancelled;
- }
-
- SetEvent (win32->message_event);
- WaitForSingleObject (win32->response_event, INFINITE);
-
- return 0;
-
- default:
- return DefWindowProc (hwnd, message, wParam, lParam);
- }
-}
-
-static void
-sm_client_thread (gpointer smclient)
-{
- HINSTANCE instance;
- WNDCLASSEXW wcl;
- ATOM klass;
- HWND window;
- MSG msg;
-
- instance = GetModuleHandle (NULL);
-
- memset (&wcl, 0, sizeof (WNDCLASSEX));
- wcl.cbSize = sizeof (WNDCLASSEX);
- wcl.lpfnWndProc = sm_client_win32_window_procedure;
- wcl.hInstance = instance;
- wcl.lpszClassName = L"EggSmClientWindow";
- klass = RegisterClassEx (&wcl);
-
- window = CreateWindowEx (0, MAKEINTRESOURCE (klass),
- L"EggSmClientWindow", 0,
- 10, 10, 50, 50, GetDesktopWindow (),
- NULL, instance, NULL);
- SetWindowLongPtr (window, GWLP_USERDATA, (LONG_PTR)smclient);
-
- /* main loop */
- while (GetMessage (&msg, NULL, 0, 0))
- DispatchMessage (&msg);
-}
diff --git a/cut-n-paste/smclient/eggsmclient.c b/cut-n-paste/smclient/eggsmclient.c
index 071618e7..69429cd1 100644
--- a/cut-n-paste/smclient/eggsmclient.c
+++ b/cut-n-paste/smclient/eggsmclient.c
@@ -25,9 +25,7 @@
#include "eggsmclient.h"
#include "eggsmclient-private.h"
-#ifdef EGG_SM_CLIENT_BACKEND_XSMP
EggSMClient *egg_sm_client_xsmp_new (void);
-#endif
static void egg_sm_client_debug_handler (const char *log_domain,
GLogLevelFlags log_level,
@@ -324,23 +322,7 @@ egg_sm_client_get (void)
if (global_client_mode != EGG_SM_CLIENT_MODE_DISABLED &&
!sm_client_disable)
{
-#if defined (GDK_WINDOWING_WIN32)
- global_client = egg_sm_client_win32_new ();
-#elif defined (GDK_WINDOWING_QUARTZ)
- global_client = egg_sm_client_osx_new ();
-#else
- /* If both D-Bus and XSMP are compiled in, try XSMP first
- * (since it supports state saving) and fall back to D-Bus
- * if XSMP isn't available.
- */
-# ifdef EGG_SM_CLIENT_BACKEND_XSMP
global_client = egg_sm_client_xsmp_new ();
-# endif
-# ifdef EGG_SM_CLIENT_BACKEND_DBUS
- if (!global_client)
- global_client = egg_sm_client_dbus_new ();
-# endif
-#endif
}
/* Fallback: create a dummy client, so that callers don't have
diff --git a/libdocument/ev-backends-manager.c b/libdocument/ev-backends-manager.c
index 6313b5ee..d071b67a 100644
--- a/libdocument/ev-backends-manager.c
+++ b/libdocument/ev-backends-manager.c
@@ -47,17 +47,7 @@ static const gchar *
backends_dir (void)
{
if (!backendsdir) {
-#ifdef G_OS_WIN32
- gchar *dir;
-
- dir = g_win32_get_package_installation_directory_of_module (NULL);
- backendsdir = g_build_filename (dir, "lib", "atril",
- EV_BACKENDSBINARYVERSION,
- "backends", NULL);
- g_free (dir);
-#else
backendsdir = g_strdup (EV_BACKENDSDIR);
-#endif
}
return backendsdir;
diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c
index ce998b2a..1206db63 100644
--- a/libdocument/ev-file-helpers.c
+++ b/libdocument/ev-file-helpers.c
@@ -455,7 +455,6 @@ get_mime_type_from_uri (const gchar *uri, GError **error)
static gchar *
get_mime_type_from_data (const gchar *uri, GError **error)
{
-#ifndef G_OS_WIN32
GFile *file;
GFileInputStream *input_stream;
gssize size_read;
@@ -495,13 +494,6 @@ get_mime_type_from_data (const gchar *uri, GError **error)
mime_type = g_content_type_get_mime_type (content_type);
g_free (content_type);
return mime_type;
-#else
- /*
- * On Windows, the implementation of g_content_type_guess() is too limited at the moment, so we do not
- * use it and fall back to get_mime_type_from_uri()
- */
- return get_mime_type_from_uri (uri, error);
-#endif /* G_OS_WIN32 */
}
/**
diff --git a/libdocument/ev-init.c b/libdocument/ev-init.c
index bb92ad13..15cb555e 100644
--- a/libdocument/ev-init.c
+++ b/libdocument/ev-init.c
@@ -21,9 +21,6 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
-#ifdef G_OS_WIN32
-#include <windows.h>
-#endif
#include "ev-init.h"
#include "ev-backends-manager.h"
@@ -32,63 +29,10 @@
static int ev_init_count;
-#ifdef G_OS_WIN32
-
-static HMODULE evdocument_dll = NULL;
-static gchar *locale_dir = NULL;
-
-#ifdef DLL_EXPORT
-BOOL WINAPI
-DllMain (HINSTANCE hinstDLL,
- DWORD fdwReason,
- LPVOID lpvReserved)
-{
- if (fdwReason == DLL_PROCESS_ATTACH)
- evdocument_dll = hinstDLL;
-
- return TRUE;
-}
-#endif
-
-static const gchar *
-_ev_win32_get_locale_dir (HMODULE module)
-{
- if (locale_dir)
- return locale_dir;
-
- gchar *install_dir = NULL, *utf8_locale_dir;
- gchar *retval = NULL;
-
- if (evdocument_dll != NULL)
- install_dir =
- g_win32_get_package_installation_directory_of_module (module);
-
- if (install_dir) {
- utf8_locale_dir = g_build_filename (install_dir,
- "share", "locale", NULL);
-
- locale_dir = g_win32_locale_filename_from_utf8 (utf8_locale_dir);
-
- g_free (install_dir);
- g_free (utf8_locale_dir);
- }
-
- if (!locale_dir)
- locale_dir = g_strdup ("");
-
- return locale_dir;
-}
-
-#endif
-
const gchar *
ev_get_locale_dir (void)
{
-#ifdef G_OS_WIN32
- return _ev_win32_get_locale_dir (evdocument_dll);
-#else
return MATELOCALEDIR;
-#endif
}
/**
@@ -134,11 +78,6 @@ ev_shutdown (void)
if (--ev_init_count > 0)
return;
-#ifdef G_OS_WIN32
- if (locale_dir != NULL)
- g_free(locale_dir);
-#endif
-
_ev_backends_manager_shutdown ();
_ev_file_helpers_shutdown ();
_ev_debug_shutdown ();
diff --git a/libview/ev-stock-icons.c b/libview/ev-stock-icons.c
index 7d86fd98..b694c651 100644
--- a/libview/ev-stock-icons.c
+++ b/libview/ev-stock-icons.c
@@ -93,15 +93,8 @@ ev_stock_icons_init (void)
GtkIconFactory *factory;
GtkIconSource *source;
gint i;
-#ifdef G_OS_WIN32
- gchar *dir;
- dir = g_win32_get_package_installation_directory_of_module (NULL);
- ev_icons_path = g_build_filename (dir, "share", "atril", "icons", NULL);
- g_free (dir);
-#else
ev_icons_path = g_build_filename (ATRILDATADIR, "icons", NULL);
-#endif
factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (factory);
diff --git a/previewer/Makefile.am b/previewer/Makefile.am
index 5ac0d110..462665ac 100644
--- a/previewer/Makefile.am
+++ b/previewer/Makefile.am
@@ -26,10 +26,6 @@ atril_previewer_CFLAGS = \
atril_previewer_LDFLAGS = $(AM_LDFLAGS)
-if PLATFORM_WIN32
-atril_previewer_LDFLAGS += -mwindows
-endif
-
atril_previewer_LDADD = \
$(top_builddir)/libdocument/libatrildocument.la \
$(top_builddir)/libview/libatrilview.la \
diff --git a/previewer/ev-previewer-window.c b/previewer/ev-previewer-window.c
index 444d8e79..8c7249d5 100644
--- a/previewer/ev-previewer-window.c
+++ b/previewer/ev-previewer-window.c
@@ -479,18 +479,7 @@ ev_previewer_window_dispose (GObject *object)
static gchar*
data_dir (void)
{
- gchar *datadir;
-#ifdef G_OS_WIN32
- gchar *dir;
-
- dir = g_win32_get_package_installation_directory_of_module (NULL);
- datadir = g_build_filename (dir, "share", "atril", NULL);
- g_free (dir);
-#else
- datadir = g_strdup (ATRILDATADIR);
-#endif
-
- return datadir;
+ return g_strdup (ATRILDATADIR);
}
static void
diff --git a/previewer/ev-previewer.c b/previewer/ev-previewer.c
index b19fc08f..53cb2e22 100644
--- a/previewer/ev-previewer.c
+++ b/previewer/ev-previewer.c
@@ -27,15 +27,6 @@
#include "ev-previewer-window.h"
-#ifdef G_OS_WIN32
-#include <io.h>
-#include <conio.h>
-#if !(_WIN32_WINNT >= 0x0500)
-#error "_WIN32_WINNT must be defined >= 0x0500"
-#endif
-#include <windows.h>
-#endif
-
static gboolean unlink_temp_file = FALSE;
static const gchar *print_settings;
static const gchar **filenames;
@@ -106,30 +97,6 @@ main (gint argc, gchar **argv)
EvDocumentModel *model;
GError *error = NULL;
-#ifdef G_OS_WIN32
- if (fileno (stdout) != -1 &&
- _get_osfhandle (fileno (stdout)) != -1)
- {
- /* stdout is fine, presumably redirected to a file or pipe */
- }
- else
- {
- typedef BOOL (* WINAPI AttachConsole_t) (DWORD);
-
- AttachConsole_t p_AttachConsole =
- (AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), "AttachConsole");
-
- if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS))
- {
- freopen ("CONOUT$", "w", stdout);
- dup2 (fileno (stdout), 1);
- freopen ("CONOUT$", "w", stderr);
- dup2 (fileno (stderr), 2);
-
- }
- }
-#endif
-
#ifdef ENABLE_NLS
/* Initialize the i18n stuff */
bindtextdomain (GETTEXT_PACKAGE, ev_get_locale_dir());
diff --git a/shell/Makefile.am b/shell/Makefile.am
index bc29d864..82648842 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -102,10 +102,6 @@ endif
atril_LDFLAGS = $(AM_LDFLAGS)
-if PLATFORM_WIN32
-atril_LDFLAGS += -mwindows
-endif
-
atril_LDADD= \
$(top_builddir)/cut-n-paste/zoom-control/libephyzoom.la \
$(top_builddir)/cut-n-paste/toolbar-editor/libtoolbareditor.la \
@@ -119,13 +115,6 @@ atril_LDADD= \
$(SHELL_LIBS) \
$(MATE_DESKTOP_LIBS)
-if PLATFORM_WIN32
-atril_LDADD += atril-icon.o
-
-atril-icon.o: $(srcdir)/atril-icon.rc $(top_srcdir)/data/atril.ico
- $(WINDRES) $(srcdir)/atril-icon.rc -I $(top_srcdir)/data atril-icon.o
-endif
-
BUILT_SOURCES = ev-marshal.h ev-marshal.c
atril_convert_metadata_SOURCES= \
diff --git a/shell/ev-application.c b/shell/ev-application.c
index e2b1ea62..f274af8b 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -30,16 +30,11 @@
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
-#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
-#endif
-#include <unistd.h>
#include "totem-scrsaver.h"
-#ifdef WITH_SMCLIENT
#include "eggsmclient.h"
-#endif
#include "ev-application.h"
#include "ev-file-helpers.h"
@@ -66,9 +61,7 @@ struct _EvApplication {
TotemScrsaver *scr_saver;
-#ifdef WITH_SMCLIENT
EggSMClient *smclient;
-#endif
gchar *filechooser_open_uri;
gchar *filechooser_save_uri;
@@ -133,13 +126,11 @@ ev_application_load_session (EvApplication *application)
GKeyFile *state_file;
gchar *uri;
-#ifdef WITH_SMCLIENT
if (egg_sm_client_is_resumed (application->smclient)) {
state_file = egg_sm_client_get_state_file (application->smclient);
if (!state_file)
return FALSE;
} else
-#endif /* WITH_SMCLIENT */
return FALSE;
uri = g_key_file_get_string (state_file, "Atril", "uri", NULL);
@@ -156,8 +147,6 @@ ev_application_load_session (EvApplication *application)
return TRUE;
}
-#ifdef WITH_SMCLIENT
-
static void
smclient_save_state_cb (EggSMClient *client,
GKeyFile *state_file,
@@ -175,12 +164,10 @@ smclient_quit_cb (EggSMClient *client,
{
ev_application_shutdown (application);
}
-#endif /* WITH_SMCLIENT */
static void
ev_application_init_session (EvApplication *application)
{
-#ifdef WITH_SMCLIENT
application->smclient = egg_sm_client_get ();
g_signal_connect (application->smclient, "save_state",
G_CALLBACK (smclient_save_state_cb),
@@ -188,7 +175,6 @@ ev_application_init_session (EvApplication *application)
g_signal_connect (application->smclient, "quit",
G_CALLBACK (smclient_quit_cb),
application);
-#endif
}
/**
@@ -238,19 +224,7 @@ ev_spawn (const char *uri,
GError *error = NULL;
cmd = g_string_new (NULL);
-
-#ifdef G_OS_WIN32
-{
- gchar *dir;
-
- dir = g_win32_get_package_installation_directory_of_module (NULL);
- path = g_build_filename (dir, "bin", "atril", NULL);
- g_free (dir);
-}
-#else
path = g_build_filename (BINDIR, "atril", NULL);
-#endif
-
g_string_append_printf (cmd, " %s", path);
g_free (path);
@@ -614,9 +588,7 @@ ev_application_open_uri_in_window (EvApplication *application,
const gchar *search_string,
guint timestamp)
{
-#ifdef GDK_WINDOWING_X11
GdkWindow *gdk_window;
-#endif
if (screen) {
ev_stock_icons_set_screen (screen);
@@ -630,7 +602,6 @@ ev_application_open_uri_in_window (EvApplication *application,
if (!gtk_widget_get_realized (GTK_WIDGET (ev_window)))
gtk_widget_realize (GTK_WIDGET (ev_window));
-#ifdef GDK_WINDOWING_X11
gdk_window = gtk_widget_get_window (GTK_WIDGET (ev_window));
if (timestamp <= 0)
@@ -638,9 +609,6 @@ ev_application_open_uri_in_window (EvApplication *application,
gdk_x11_window_set_user_time (gdk_window, timestamp);
gtk_window_present (GTK_WINDOW (ev_window));
-#else
- gtk_window_present_with_time (GTK_WINDOW (ev_window), timestamp);
-#endif /* GDK_WINDOWING_X11 */
}
static void
@@ -715,9 +683,7 @@ ev_application_open_window (EvApplication *application,
guint32 timestamp)
{
GtkWidget *new_window = ev_window_new ();
-#ifdef GDK_WINDOWING_X11
GdkWindow *gdk_window;
-#endif
if (screen) {
ev_stock_icons_set_screen (screen);
@@ -727,7 +693,6 @@ ev_application_open_window (EvApplication *application,
if (!gtk_widget_get_realized (new_window))
gtk_widget_realize (new_window);
-#ifdef GDK_WINDOWING_X11
gdk_window = gtk_widget_get_window (GTK_WIDGET (new_window));
if (timestamp <= 0)
@@ -735,9 +700,6 @@ ev_application_open_window (EvApplication *application,
gdk_x11_window_set_user_time (gdk_window, timestamp);
gtk_window_present (GTK_WINDOW (new_window));
-#else
- gtk_window_present_with_time (GTK_WINDOW (new_window), timestamp);
-#endif /* GDK_WINDOWING_X11 */
}
#ifdef ENABLE_DBUS
@@ -895,7 +857,6 @@ static void ev_application_accel_map_save(EvApplication* application)
if (g_rename(tmp_filename, accel_map_file) == -1)
{
- /* FIXME: win32? */
g_unlink(tmp_filename);
}
@@ -992,17 +953,7 @@ static void ev_application_init(EvApplication* ev_application)
ev_application->dot_dir = g_build_filename(g_get_user_config_dir(), "atril", NULL);
}
-#ifdef G_OS_WIN32
-{
- gchar *dir;
-
- dir = g_win32_get_package_installation_directory_of_module (NULL);
- ev_application->data_dir = g_build_filename (dir, "share", "atril", NULL);
- g_free (dir);
-}
-#else
ev_application->data_dir = g_strdup (ATRILDATADIR);
-#endif
ev_application_init_session (ev_application);
diff --git a/shell/main.c b/shell/main.c
index 367e0977..3d0def7d 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -33,21 +33,9 @@
#include "ev-stock-icons.h"
#include "ev-metadata.h"
-#ifdef WITH_SMCLIENT
#include "eggsmclient.h"
-#ifdef GDK_WINDOWING_X11
#include "eggdesktopfile.h"
-#endif
-#endif /* WITH_SMCLIENT */
-#ifdef G_OS_WIN32
-#include <io.h>
-#include <conio.h>
-#if !(_WIN32_WINNT >= 0x0500)
-#error "_WIN32_WINNT must be defined >= 0x0500"
-#endif
-#include <windows.h>
-#endif
static gchar *ev_page_label;
static gchar *ev_find_string;
@@ -235,31 +223,6 @@ main (int argc, char *argv[])
GOptionContext *context;
GError *error = NULL;
-#ifdef G_OS_WIN32
-
- if (fileno (stdout) != -1 &&
- _get_osfhandle (fileno (stdout)) != -1)
- {
- /* stdout is fine, presumably redirected to a file or pipe */
- }
- else
- {
- typedef BOOL (* WINAPI AttachConsole_t) (DWORD);
-
- AttachConsole_t p_AttachConsole =
- (AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), "AttachConsole");
-
- if (p_AttachConsole != NULL && p_AttachConsole (ATTACH_PARENT_PROCESS))
- {
- freopen ("CONOUT$", "w", stdout);
- dup2 (fileno (stdout), 1);
- freopen ("CONOUT$", "w", stderr);
- dup2 (fileno (stderr), 2);
-
- }
- }
-#endif
-
#ifdef ENABLE_NLS
/* Initialize the i18n stuff */
bindtextdomain (GETTEXT_PACKAGE, ev_get_locale_dir());
@@ -270,11 +233,7 @@ main (int argc, char *argv[])
context = g_option_context_new (N_("MATE Document Viewer"));
g_option_context_set_translation_domain(context, GETTEXT_PACKAGE);
g_option_context_add_main_entries (context, goption_options, GETTEXT_PACKAGE);
-
-#ifdef WITH_SMCLIENT
g_option_context_add_group (context, egg_sm_client_get_option_group ());
-#endif
-
g_option_context_add_group (context, gtk_get_option_group (TRUE));
if (!g_option_context_parse (context, &argc, &argv, &error)) {
@@ -299,13 +258,7 @@ main (int argc, char *argv[])
ev_stock_icons_init ();
-#if defined(WITH_SMCLIENT) && defined(GDK_WINDOWING_X11)
egg_set_desktop_file (MATEDATADIR "/applications/atril.desktop");
-#else
- /* Manually set name and icon */
- g_set_application_name (_("Document Viewer"));
- gtk_window_set_default_icon_name ("atril");
-#endif /* WITH_SMCLIENT && GDK_WINDOWING_X11 */
ev_application_load_session (EV_APP);
load_files (file_arguments);
diff --git a/thumbnailer/Makefile.am b/thumbnailer/Makefile.am
index a64cbe6a..27ab0200 100644
--- a/thumbnailer/Makefile.am
+++ b/thumbnailer/Makefile.am
@@ -21,10 +21,6 @@ atril_thumbnailer_CFLAGS = \
atril_thumbnailer_LDFLAGS = $(AM_LDFLAGS)
-if PLATFORM_WIN32
-atril_thumbnailer_LDFLAGS += -mwindows
-endif
-
atril_thumbnailer_LDADD = \
$(top_builddir)/libdocument/libatrildocument.la \
$(FRONTEND_LIBS)
diff --git a/thumbnailer/atril-thumbnailer.c b/thumbnailer/atril-thumbnailer.c
index c3288595..bc62502d 100644
--- a/thumbnailer/atril-thumbnailer.c
+++ b/thumbnailer/atril-thumbnailer.c
@@ -25,15 +25,6 @@
#include <stdlib.h>
#include <string.h>
-#ifdef G_OS_WIN32
-#include <io.h>
-#include <conio.h>
-#if !(_WIN32_WINNT >= 0x0500)
-#error "_WIN32_WINNT must be defined >= 0x0500"
-#endif
-#include <windows.h>
-#endif
-
#define THUMBNAIL_SIZE 128
#define DEFAULT_SLEEP_TIME (15 * G_USEC_PER_SEC) /* 15 seconds */
@@ -188,13 +179,7 @@ atril_thumbnail_pngenc_get (EvDocument *document, const char *thumbnail, int siz
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", "atril", overlaid_icon_name, NULL);
- g_free (dir);
-#else
gchar *overlaid_icon_path = g_strdup_printf ("%s/%s", ATRILDATADIR, overlaid_icon_name);
-#endif
overlaid_pixbuf = gdk_pixbuf_new_from_file (overlaid_icon_path, NULL);
g_free (overlaid_icon_path);
if (overlaid_pixbuf != NULL) {