summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-08-24 22:25:31 +0300
committerinfirit <[email protected]>2015-08-31 14:51:17 +0200
commite5e2b894e070fd0509c0016e7285d78c6ff543c3 (patch)
tree6b52f77438b32132f46da5521b3ccc693ba10123 /shell
parent0f060b5170016a28cf742edbc623dea906fa7f15 (diff)
downloadatril-e5e2b894e070fd0509c0016e7285d78c6ff543c3.tar.bz2
atril-e5e2b894e070fd0509c0016e7285d78c6ff543c3.tar.xz
drop support for win32/osx/hildon, make smclient mandatory
Diffstat (limited to 'shell')
-rw-r--r--shell/Makefile.am11
-rw-r--r--shell/ev-application.c49
-rw-r--r--shell/main.c47
3 files changed, 0 insertions, 107 deletions
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);