-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
PTHREAD_LIB = @PTHREAD_LIB@
RANLIB = @RANLIB@
STRIP = @STRIP@
+USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@
XPM_LIBS = @XPM_LIBS@
YACC = @YACC@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
DEP_FILES = .deps/Array.P .deps/Catalog.P .deps/Dict.P .deps/Error.P \
.deps/GOutputDev.P .deps/Gfx.P .deps/GfxFont.P .deps/GfxState.P \
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
- echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \
done
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$/$$file $(distdir)/$$file; \
+ cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
all-am: Makefile $(PROGRAMS) $(DATA)
all-redirect: all-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(gladedir)
#define DEV_DEBUG 0
-double zoom = 86.0;
-gint page = 2;
-
#define DOC_ROOT_TAG "xpdf_doc_root"
struct DOC_ROOT {
GString *title;
GtkScrolledWindow *scroll;
GtkWidget *mainframe;
GladeXML *gui;
+
+ double zoom;
+ gint page;
};
GList *documents = NULL;
int w, h;
GdkPixmap *pixmap = NULL;
- w = (int)((pdf->getPageWidth (page) * zoom) / 72.0);
- h = (int)((pdf->getPageHeight (page) * zoom) / 72.0);
+ w = (int)((pdf->getPageWidth (doc->page) * doc->zoom) / 72.0);
+ h = (int)((pdf->getPageHeight (doc->page) * doc->zoom) / 72.0);
pixmap = gdk_pixmap_new (window, w, h, -1);
}
static void
-show_page (DOC_ROOT *doc, gint page)
+render_page (DOC_ROOT *doc)
{
- doc->pdf->displayPage(doc->out, page, zoom, 0, gTrue);
+ doc->pdf->displayPage(doc->out, doc->page, doc->zoom, 0, gTrue);
}
/*static void displayPage(int page1, int zoom1, int rotate1) {
return NULL;
}
+ doc->zoom = 86.0;
+ doc->page = 1;
+
connect_signals (doc);
gtk_object_set_data (GTK_OBJECT (doc->mainframe), DOC_ROOT_TAG, doc);
doc->scroll = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
gtk_scrolled_window_set_policy (doc->scroll, GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- show_page (doc, page);
+ render_page (doc);
gtk_scrolled_window_add_with_viewport (doc->scroll, GTK_WIDGET (doc->pixmap));
gtk_box_pack_start (GTK_BOX (pane), GTK_WIDGET (doc->scroll), TRUE, TRUE, 0);
}
static void
- simple_connect (DOC_ROOT *doc, const char *name, GtkSignalFunc func)
+ do_forward_button (GtkWidget *w, DOC_ROOT *doc)
+ {
+ if (doc->page < doc->pdf->getNumPages()) {
+ doc->page++;
+ render_page (doc);
+ gtk_widget_queue_draw (GTK_WIDGET (doc->scroll));
+ }
+ }
+
+ static void
+ do_back_button (GtkWidget *w, DOC_ROOT *doc)
+ {
+ if (doc->page > 1) {
+ doc->page--;
+ render_page (doc);
+ gtk_widget_queue_draw (GTK_WIDGET (doc->pixmap));
+ }
+ }
+
+ static void
+ do_first_button (GtkWidget *w, DOC_ROOT *doc)
+ {
+ if (doc->page != 1) {
+ doc->page = 1;
+ render_page (doc);
+ gtk_widget_queue_draw (GTK_WIDGET (doc->pixmap));
+ }
+ }
+
+ static void
+ do_last_button (GtkWidget *w, DOC_ROOT *doc)
+ {
+ if (doc->page != doc->pdf->getNumPages()) {
+ doc->page = doc->pdf->getNumPages();
+ render_page (doc);
+ gtk_widget_queue_draw (GTK_WIDGET (doc->pixmap));
+ }
+ }
+
+ static void
+ do_larger_button (GtkWidget *w, DOC_ROOT *doc)
+ {
+ if (doc->zoom < 200) {
+ doc->zoom *= 1.2;
+ render_page (doc);
+ gtk_widget_queue_draw (GTK_WIDGET (doc->pixmap));
+ }
+ }
+
+ static void
+ do_smaller_button (GtkWidget *w, DOC_ROOT *doc)
+ {
+ if (doc->zoom < 200) {
+ doc->zoom /= 1.2;
+ render_page (doc);
+ gtk_widget_queue_draw (GTK_WIDGET (doc->pixmap));
+ }
+ }
+
+ static void
+ simple_menu_connect (DOC_ROOT *doc, const char *name, GtkSignalFunc func)
{
GtkWidget *w;
w = glade_xml_get_widget (doc->gui, name);
+ g_return_if_fail (w);
gtk_signal_connect (GTK_OBJECT (w), "activate", func, doc);
}
+ static void
+ simple_button_connect (DOC_ROOT *doc, const char *name, GtkSignalFunc func)
+ {
+ GtkWidget *w;
+ w = glade_xml_get_widget (doc->gui, name);
+ g_return_if_fail (w);
+ gtk_signal_connect (GTK_OBJECT (w), "clicked", func, doc);
+ }
+
static void
connect_signals (DOC_ROOT *doc)
{
- simple_connect (doc, "about_menu", GTK_SIGNAL_FUNC (do_about_box));
- simple_connect (doc, "close_menu", GTK_SIGNAL_FUNC (do_close));
- simple_connect (doc, "exit_menu", GTK_SIGNAL_FUNC (do_exit));
+ GtkWidget *w;
+
+ simple_menu_connect (doc, "about_menu", GTK_SIGNAL_FUNC (do_about_box));
+ simple_menu_connect (doc, "close_menu", GTK_SIGNAL_FUNC (do_close));
+ simple_menu_connect (doc, "exit_menu", GTK_SIGNAL_FUNC (do_exit));
+
+ simple_button_connect (doc, "forward", GTK_SIGNAL_FUNC (do_forward_button));
+ simple_button_connect (doc, "back", GTK_SIGNAL_FUNC (do_back_button));
+ simple_button_connect (doc, "first", GTK_SIGNAL_FUNC (do_first_button));
+ simple_button_connect (doc, "last", GTK_SIGNAL_FUNC (do_last_button));
+/* simple_button_connect (doc, "larger", GTK_SIGNAL_FUNC (do_larger_button)); need to resize the gtkpixmap...
+ simple_button_connect (doc, "smaller", GTK_SIGNAL_FUNC (do_smaller_button)); but bed first. */
+
+ gtk_signal_connect (GTK_OBJECT (doc->mainframe), "destroy",
+ GTK_SIGNAL_FUNC (do_close), doc);
}
}