Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-12-22 00:44:41 (GMT)
committer Owen Taylor <otaylor@src.gnome.org>2004-12-22 00:44:41 (GMT)
commita4cf673a3347ec011ebc90b22b6541bae0b9f6b4 (patch)
treec083238873e7fd943411e0bb2e1a761adf716783 /shell
parentd6198ac2024d229d47b631648fe8352ffb4d3e80 (diff)
Switch from .a to libtool convenience libraries.
Tue Dec 21 19:28:55 2004 Owen Taylor <otaylor@redhat.com> * pdf/{goo,fofi,splash,xpdf}/Makefile.am: Switch from .a to libtool convenience libraries. * shell/ev-window.c (ev_window_open): Hard code loading a PDF document. * backend/ev-document.h: Add a boolean return to load(), fix GError * to GError **. * pdf/xpdf/pdf-document.[ch] Makefile.am: Add a stub object for a PDF backend EvDocument.
Diffstat (limited to 'shell')
-rw-r--r--shell/Makefile.am8
-rw-r--r--shell/ev-window.c29
2 files changed, 35 insertions, 2 deletions
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 7179a7d..891eadb 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -3,6 +3,8 @@ NULL=
INCLUDES= \
-DDATADIR=\"$(pkgdatadir)\" \
-I$(top_srcdir)/lib \
+ -I$(top_srcdir)/backend \
+ -I$(top_srcdir)/pdf/xpdf \
-DGNOMELOCALEDIR=\"$(datadir)/locale\" \
$(SHELL_CFLAGS) \
$(EVINCE_DISABLE_DEPRECATED) \
@@ -22,6 +24,8 @@ evince_SOURCES= \
main.c \
$(NULL)
-evince_LDADD= \
- $(SHELL_LIBS) \
+evince_LDADD= \
+ $(SHELL_LIBS) \
+ $(top_builddir)/backend/libevbackend.la \
+ $(top_builddir)/pdf/xpdf/libpdfdocument.la \
$(NULL)
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 14733fe..a6097ce 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -30,6 +30,8 @@
#include "ev-sidebar.h"
#include "eggfindbar.h"
+#include "pdf-document.h"
+
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <libgnomevfs/gnome-vfs-mime-utils.h>
@@ -57,6 +59,8 @@ struct _EvWindowPrivate {
GtkUIManager *ui_manager;
GtkWidget *statusbar;
guint help_message_cid;
+
+ EvDocument *document;
};
#if 0
@@ -147,6 +151,31 @@ ev_window_is_empty (const EvWindow *ev_window)
void
ev_window_open (EvWindow *ev_window, const char *uri)
{
+ EvDocument *document = g_object_new (PDF_TYPE_DOCUMENT, NULL);
+ GError *error = NULL;
+
+ if (ev_document_load (document, uri, &error)) {
+ if (ev_window->priv->document)
+ g_object_unref (ev_window->priv->document);
+ ev_window->priv->document = document;
+
+ } else {
+ GtkWidget *dialog;
+
+ g_object_unref (document);
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (ev_window),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("Unable to open document"));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ "%s", error->message);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ g_error_free (error);
+ }
+
#if 0
char *mime_type;
BonoboObject *bonobo_control;