├── .travis.yml ├── ABOUT-NLS ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README.md ├── THANKS ├── aclocal.m4 ├── config.guess ├── config.h.in ├── config.rpath ├── config.sub ├── configure ├── configure.ac ├── data ├── Makefile.am ├── Makefile.in ├── bsd.latexmkrc ├── dot.latexmkrc ├── epdfsync ├── epdfview-ui-print.xml ├── epdfview-ui.xml ├── epdfview.1 ├── epdfview.desktop ├── epdfview.svg ├── icon_epdfview-24.png ├── icon_epdfview-32.png ├── icon_epdfview-48.png ├── stock_find_next_24.png ├── stock_find_previous_24.png ├── stock_rotate-270.png ├── stock_rotate-90.png └── stock_zoom-page-width.png ├── depcomp ├── doc ├── Doxyfile.in ├── Makefile.am └── Makefile.in ├── install-sh ├── intl ├── ChangeLog ├── Makefile.in ├── VERSION ├── bindtextdom.c ├── config.charset ├── dcgettext.c ├── dcigettext.c ├── dcngettext.c ├── dgettext.c ├── dngettext.c ├── eval-plural.h ├── explodename.c ├── finddomain.c ├── gettext.c ├── gettextP.h ├── gmo.h ├── hash-string.h ├── intl-compat.c ├── l10nflist.c ├── langprefs.c ├── libgnuintl.h.in ├── loadinfo.h ├── loadmsgcat.c ├── localcharset.c ├── localcharset.h ├── locale.alias ├── localealias.c ├── localename.c ├── log.c ├── ngettext.c ├── os2compat.c ├── os2compat.h ├── osdep.c ├── plural-exp.c ├── plural-exp.h ├── plural.c ├── plural.y ├── printf-args.c ├── printf-args.h ├── printf-parse.c ├── printf-parse.h ├── printf.c ├── ref-add.sin ├── ref-del.sin ├── relocatable.c ├── relocatable.h ├── textdomain.c ├── vasnprintf.c ├── vasnprintf.h ├── vasnwprintf.h ├── wprintf-parse.h └── xsize.h ├── m4 ├── Makefile.am ├── Makefile.in ├── codeset.m4 ├── cppunit.m4 ├── cups.m4 ├── gettext.m4 ├── glibc2.m4 ├── glibc21.m4 ├── iconv.m4 ├── intdiv0.m4 ├── intmax.m4 ├── inttypes-pri.m4 ├── inttypes.m4 ├── inttypes_h.m4 ├── isc-posix.m4 ├── lcmessage.m4 ├── lib-ld.m4 ├── lib-link.m4 ├── lib-prefix.m4 ├── longdouble.m4 ├── longlong.m4 ├── nls.m4 ├── pkg.m4 ├── po.m4 ├── printf-posix.m4 ├── progtest.m4 ├── signed.m4 ├── size_max.m4 ├── stdint_h.m4 ├── uintmax_t.m4 ├── ulonglong.m4 ├── wchar_t.m4 ├── wint_t.m4 └── xsize.m4 ├── missing ├── mkinstalldirs ├── po ├── LINGUAS ├── Makefile.in.in ├── Makevars ├── POTFILES.in ├── Rules-quot ├── ar.gmo ├── ar.po ├── boldquot.sed ├── ca.gmo ├── ca.po ├── cs.gmo ├── cs.po ├── de.gmo ├── de.po ├── el.gmo ├── el.po ├── en@boldquot.header ├── en@quot.header ├── epdfview.pot ├── es.gmo ├── es.po ├── eu.gmo ├── eu.po ├── fr.gmo ├── fr.po ├── gl.gmo ├── gl.po ├── he.gmo ├── he.po ├── hu.gmo ├── hu.po ├── insert-header.sin ├── it.gmo ├── it.po ├── ja.gmo ├── ja.po ├── nl.gmo ├── nl.po ├── pl.gmo ├── pl.po ├── pt.gmo ├── pt.po ├── pt_BR.gmo ├── pt_BR.po ├── quot.sed ├── remove-potcdate.sin ├── ru.gmo ├── ru.po ├── stamp-po ├── sv.gmo ├── sv.po ├── vi.gmo ├── vi.po ├── zh_CN.gmo ├── zh_CN.po ├── zh_TW.gmo └── zh_TW.po ├── snap └── snapcraft.yaml ├── src ├── Config.cxx ├── Config.h ├── DocumentLinkGoto.cxx ├── DocumentLinkGoto.h ├── DocumentLinkUri.cxx ├── DocumentLinkUri.h ├── DocumentOutline.cxx ├── DocumentOutline.h ├── DocumentPage.cxx ├── DocumentPage.h ├── DocumentRectangle.cxx ├── DocumentRectangle.h ├── FindPter.cxx ├── FindPter.h ├── IDocument.cxx ├── IDocument.h ├── IDocumentLink.cxx ├── IDocumentLink.h ├── IDocumentObserver.h ├── IFindView.h ├── IJob.cxx ├── IJob.h ├── IMainView.h ├── IPageView.h ├── IPreferencesView.h ├── IPrintView.h ├── JobFind.cxx ├── JobFind.h ├── JobLoad.cxx ├── JobLoad.h ├── JobPrint.cxx ├── JobPrint.h ├── JobRender.cxx ├── JobRender.h ├── JobSave.cxx ├── JobSave.h ├── MainPter.cxx ├── MainPter.h ├── Makefile.am ├── Makefile.in ├── PDFDocument.cxx ├── PDFDocument.h ├── PagePter.cxx ├── PagePter.h ├── PreferencesPter.cxx ├── PreferencesPter.h ├── PrintPter.cxx ├── PrintPter.h ├── epdfview.h ├── gettext.h ├── gtk │ ├── FindView.cxx │ ├── FindView.h │ ├── MainView.cxx │ ├── MainView.h │ ├── Makefile.am │ ├── Makefile.in │ ├── PageView.cxx │ ├── PageView.h │ ├── PreferencesView.cxx │ ├── PreferencesView.h │ ├── PrintView.cxx │ ├── PrintView.h │ ├── StockIcons.cxx │ └── StockIcons.h └── main.cxx └── tests ├── ConfigTest.cxx ├── ConfigTest.h ├── DocumentOutlineTest.cxx ├── DocumentOutlineTest.h ├── DumbDocument.cxx ├── DumbDocument.h ├── DumbDocumentObserver.cxx ├── DumbDocumentObserver.h ├── DumbFindView.cxx ├── DumbFindView.h ├── DumbMainView.cxx ├── DumbMainView.h ├── DumbPageView.cxx ├── DumbPageView.h ├── DumbPreferencesView.cxx ├── DumbPreferencesView.h ├── DumbPrintView.cxx ├── DumbPrintView.h ├── FindPterTest.cxx ├── FindPterTest.h ├── MainPterTest.cxx ├── MainPterTest.h ├── Makefile.am ├── Makefile.in ├── PDFDocumentTest.cxx ├── PDFDocumentTest.h ├── PagePterTest.cxx ├── PagePterTest.h ├── PreferencesPterTest.cxx ├── PreferencesPterTest.h ├── PrintPterTest.cxx ├── PrintPterTest.h ├── Utils.cxx ├── Utils.h ├── main.cxx ├── test1.pdf ├── test2.pdf └── test_encrypted.pdf /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | before_install: 3 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq ; fi 4 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -qq libgtk2.0-dev libpoppler-glib-dev libcups2 ; fi 5 | compiler: 6 | - clang 7 | - gcc 8 | script: 9 | - ./configure --prefix="$HOME/build/jristz/" 10 | - make 11 | - make DESTDIR="$HOME/build/jristz/" install 12 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | ePDFView is copyright © 2006 Emma's Software. 2 | Jordi Fita 3 | 4 | ePDFView is copyright © 2014-2016 Pablo Lezaeta. 5 | Pablo Lezaeta 6 | Pedro A. Aranda Gutiérrez 7 | 8 | ePDFView is under the GPLv2+. 9 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | epdfview 0.2: 2 | 3 | * Forked https://github.com/jristz/epdfview - and remerged with changes 4 | * Included Ctrl-Button1Down handler 5 | * Included SIGHUP handler 6 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | 2 | ePDFView Installation Instructions 3 | ================================== 4 | 5 | 1) Get the tarball. 6 | 2) Copy it to your home directory. 7 | 3) Unpack it: 8 | 9 | tar xvzf epdfview-.tar.gz 10 | 11 | 4) Change to the new directory: 12 | 13 | cd epdfview- 14 | 15 | 5) Run the configure script. You can check its parameters using the 16 | help option: 17 | 18 | ./configure --help 19 | ./configure --prefix=/usr/local 20 | 21 | 6) Make the application: 22 | 23 | make 24 | 25 | 7) Make sure the application was built correctly (Optional. Needs 26 | CppUnit): 27 | 28 | make check 29 | 30 | 8) Install it: 31 | 32 | make install 33 | 34 | 9) Run the application: 35 | 36 | epdfview 37 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Process this file with automake to produce a Makefile.in file. 2 | SUBDIRS = data intl po m4 src doc 3 | if build_tests 4 | SUBDIRS += tests 5 | endif 6 | 7 | ACLOCAL_AMFLAGS = -I m4 8 | 9 | EXTRA_DIST = config.rpath mkinstalldirs 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TODO (So any pull request is apreciated): 2 | * Add continuous scrolling & maybe an option for toggle hide scrollbars. 3 | * Add shift+scroll for horizontal scrolling 4 | * Move to CMake to make it multiplatform easily 5 | (If Meson support Windows then it become also an option) 6 | * Change icons for some more originals to not use GNOME icons anymore 7 | * Port to GTK+ 3.0 to keep a lightweight alternative to evince alive 8 | (Any pull request to add functionality is also apreciated). 9 | 10 | 11 | ePDFView 12 | ======== 13 | 14 | 15 | ![Travis status](https://travis-ci.org/jristz/epdfview.svg) 16 | 17 | ePDFView is a simple and lightweight PDF viewer. 18 | For more general information about the original ePDFView please visit the project's website at 19 | http://www.emma-soft.com/projects/epdfview/ . 20 | For info about this fork check the source code or ask a question on the bugtracker. 21 | 22 | This software is licensed under the GNU General Public License (GPL). 23 | The icons used by this software are part of the Gnome Icon Theme, 24 | which is copyright The GNOME Project and released under the GNU General Public License (GPL). 25 | 26 | Enhancements by Pedro A. Aranda Gutiérrez 27 | ========================================= 28 | 29 | epdfsync 30 | ======== 31 | 32 | epdfsync is a companion script that will be called by epdfview upon a 33 | Ctrl-Button1Down. This script should call synctex, if you want to have a full 34 | edit cycle for LaTEX. 35 | Tested on: 36 | * Lubuntu 15.10 (LXDE) 37 | * Ubuntu 14.04.3 LTS (Unity) 38 | * FreeBSD 10.2 (Xfce) 39 | * ArchLinux on 2017/04/23 (Xfce) 40 | SIGHUP 41 | ====== 42 | 43 | Reload on SIGHUP to integrate with 'latexmk -pvc'. 44 | 45 | 46 | Requirements 47 | ============ 48 | 49 | GTK+ version 2.6.0 or higher ( http://www.gtk.org/ ), but lower than 2.95.0 50 | Poppler version 0.5.0 with glib bindings ( http://poppler.freedesktop.org/ ) 51 | CppUnit to run the test suite ( http://cppunit.sourceforge.net/ ) 52 | Doxygen to build the documentation ( http://www.stack.nl/~dimitri/doxygen/ ) 53 | -------------------------------------------------------------------------------- /data/Makefile.am: -------------------------------------------------------------------------------- 1 | # Process this file with automake to produce a Makefile.in file. 2 | EXTRA_DIST = \ 3 | icon_epdfview-24.png \ 4 | icon_epdfview-32.png \ 5 | icon_epdfview-48.png \ 6 | stock_find_next_24.png \ 7 | stock_find_previous_24.png \ 8 | stock_rotate-90.png \ 9 | stock_rotate-270.png \ 10 | stock_zoom-page-width.png \ 11 | epdfsync \ 12 | dot.latexmkrc \ 13 | bsd.latexmkrc \ 14 | epdfview.1 \ 15 | epdfview-ui.xml \ 16 | epdfview-ui-print.xml \ 17 | epdfview.svg \ 18 | epdfview.desktop 19 | 20 | pixmapdir = $(pkgdatadir)/pixmaps 21 | pixmap_DATA = \ 22 | icon_epdfview-24.png \ 23 | icon_epdfview-32.png \ 24 | icon_epdfview-48.png \ 25 | stock_find_next_24.png \ 26 | stock_find_previous_24.png \ 27 | stock_rotate-90.png \ 28 | stock_rotate-270.png \ 29 | stock_zoom-page-width.png 30 | 31 | uidir = $(pkgdatadir)/ui 32 | ui_DATA = \ 33 | epdfview-ui.xml \ 34 | epdfview-ui-print.xml 35 | 36 | extradir = $(pkgdatadir)/extra 37 | extra_DATA = \ 38 | epdfsync \ 39 | epdfview.svg \ 40 | dot.latexmkrc \ 41 | bsd.latexmkrc 42 | 43 | desktopdir = $(datadir)/applications 44 | desktop_DATA = \ 45 | epdfview.desktop 46 | 47 | man1_MANS = epdfview.1 48 | -------------------------------------------------------------------------------- /data/bsd.latexmkrc: -------------------------------------------------------------------------------- 1 | $postscript_mode = $dvi_mode = 0; 2 | $pdf_mode = 1; 3 | $pdf_previewer = 'start epdfview'; 4 | $new_viewer_always = 0; 5 | $pdf_update_method = 2; 6 | ## $pdf_update_signal = "HUP"; ## default 7 | $pdflatex = 'pdflatex -synctex=1 %O %S'; 8 | $bibtex_use = 2; 9 | ## $diagnostics = 1; 10 | $pscmd = 'ps -f -U $USER'; 11 | $pid_position = 0; 12 | -------------------------------------------------------------------------------- /data/dot.latexmkrc: -------------------------------------------------------------------------------- 1 | $postscript_mode = $dvi_mode = 0; 2 | $pdf_mode = 1; 3 | $pdf_previewer = 'start epdfview'; 4 | $new_viewer_always = 0; 5 | $pdf_update_method = 2; 6 | ## $pdf_update_signal = "HUP"; ## default 7 | $pdflatex = 'pdflatex -synctex=1 %O %S'; 8 | $bibtex_use = 2; 9 | ## $diagnostics = 1; 10 | -------------------------------------------------------------------------------- /data/epdfsync: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import sys 4 | import re 5 | import os 6 | from subprocess import Popen,PIPE 7 | 8 | try: 9 | if sys.argv[1] == '-l': 10 | LOG = open(os.path.join(os.getenv("HOME"),"epdfsync.log"), "a") 11 | arg = 2 12 | else: 13 | LOG = None 14 | arg = 1 15 | except: 16 | print ("%s: execute synctex and open up emacsclient" % os.path.basename(sys.argv[0])) 17 | print ("Arguments: [-l] page x y pdffile") 18 | print (" -l generates a log in ~/epdfsync.log") 19 | raise SystemExit 20 | 21 | 22 | print("Running " + " ".join(sys.argv), file=LOG) 23 | 24 | PAGE = int(sys.argv[arg]) 25 | X = int(sys.argv[arg+1]) 26 | Y = int(sys.argv[arg+2]) 27 | PDFFILE = sys.argv[arg+3] 28 | 29 | sarg = ":".join(sys.argv[arg:]) 30 | 31 | CMD = ["synctex", "edit", "-o", "%d:%d:%d:%s" % (PAGE,X,Y,PDFFILE)] 32 | print("Executing "+" ".join(CMD), file=LOG) 33 | synctex = Popen(CMD, stdout=PIPE, stderr=None) 34 | info, _ = synctex.communicate() 35 | print(info, file=LOG) 36 | try: 37 | inputRe=re.compile(r"Input:(.+)$",re.MULTILINE) 38 | fileName=inputRe.search(info).group(1) 39 | lineRe=re.compile(r"Line:(.+)$",re.MULTILINE) 40 | lineNumber=lineRe.search(info).group(1) 41 | 42 | print("emacsclient +%s %s" % (lineNumber, fileName), file=LOG) 43 | emacsclient = ["emacsclient", "-n", "-a", "emacs", "+"+lineNumber, fileName] 44 | Popen(emacsclient,stdout=None,stderr=None).communicate() 45 | except: 46 | print ("Something went wrong with synctex") 47 | if LOG is None: 48 | prin ("Enable loggong in .xpdfrc with '-l'") 49 | else: 50 | print(info, file=LOG) 51 | -------------------------------------------------------------------------------- /data/epdfview-ui-print.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /data/epdfview-ui.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /data/epdfview.1: -------------------------------------------------------------------------------- 1 | .TH "epdfview" "1" "2010\-07\-31" 2 | .SH "NAME" 3 | epdfview \- view PDF documents 4 | .SH "SYNOPSIS" 5 | .PP 6 | .B epdfview 7 | .RI "[ " OPTION... " ] [ " FILE " ]" 8 | .SH "DESCRIPTION" 9 | .PP 10 | This manual page documents briefly the \fBepdfview\fR command. 11 | .PP 12 | The aim of \fBepdfview\fR is to make a simple PDF document viewer, in the lines 13 | of \fBevince\fR(1) but without using the GNOME libraries. 14 | .SH "OPTIONS" 15 | .SS "Help Options" 16 | .TP 17 | .BR \-h , " \-\-help" 18 | Show help options 19 | .TP 20 | .BR \-\-help\-all 21 | Show all help options 22 | .TP 23 | .BR \-\-help\-gtk 24 | Show GTK+ Options 25 | .SS "GTK+ Options" 26 | .TP 27 | .BI \-\-class= CLASS 28 | Program class as used by the window manager 29 | .TP 30 | .BI \-\-name= NAME 31 | Program name as used by the window manager 32 | .TP 33 | .BI \-\-screen= SCREEN 34 | X screen to use 35 | .TP 36 | .BR \-\-sync 37 | Make X calls synchronous 38 | .TP 39 | .BI \-\-gtk\-module= MODULES 40 | Load additional GTK+ modules 41 | .TP 42 | .BR \-\-g\-fatal\-warnings 43 | Make all warnings fatal 44 | .SS "Application Options" 45 | .TP 46 | .BI \-\-display= DISPLAY 47 | X display to use 48 | .SH "SEE ALSO" 49 | .BR evince "(1), " xpdf (1) 50 | .SH "AUTHOR" 51 | \fBepdfview\fR is \(co 2006, 2007, 2009 Jordi Fita 52 | 53 | This manual page was written by Francois Wendling for the 54 | Debian GNU/Linux system (but may be used by others). 55 | -------------------------------------------------------------------------------- /data/epdfview.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Categories=Viewer;Office;GTK;Graphics;Viewer; 3 | Comment=Lightweight PDF document viewer 4 | Comment[ca]=Visor de documents PDF lleuger 5 | Comment[es]=Visor de documentos PDF ligero 6 | Exec=epdfview %f 7 | GenericName=PDF Viewer 8 | GenericName[ca]=Visor PDF 9 | GenericName[es]=Visor PDF 10 | Icon=/usr/share/epdfview/extra/epdfview.svg 11 | Name=ePDFViewer 12 | Name[ca]=ePDFViewer 13 | Name[es]=ePDFViewer 14 | MimeType=application/pdf; 15 | Terminal=false 16 | Type=Application 17 | -------------------------------------------------------------------------------- /data/icon_epdfview-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/data/icon_epdfview-24.png -------------------------------------------------------------------------------- /data/icon_epdfview-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/data/icon_epdfview-32.png -------------------------------------------------------------------------------- /data/icon_epdfview-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/data/icon_epdfview-48.png -------------------------------------------------------------------------------- /data/stock_find_next_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/data/stock_find_next_24.png -------------------------------------------------------------------------------- /data/stock_find_previous_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/data/stock_find_previous_24.png -------------------------------------------------------------------------------- /data/stock_rotate-270.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/data/stock_rotate-270.png -------------------------------------------------------------------------------- /data/stock_rotate-90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/data/stock_rotate-90.png -------------------------------------------------------------------------------- /data/stock_zoom-page-width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/data/stock_zoom-page-width.png -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | # Process this file with automake to produce a Makefile.in file. 2 | 3 | if build_reference 4 | reference: 5 | doxygen Doxyfile 6 | else 7 | reference: 8 | 9 | endif 10 | 11 | clean-local: 12 | rm -fr html 13 | 14 | all: reference 15 | -------------------------------------------------------------------------------- /intl/ChangeLog: -------------------------------------------------------------------------------- 1 | 2005-04-11 GNU 2 | 3 | * Version 0.14.4 released. 4 | 5 | -------------------------------------------------------------------------------- /intl/VERSION: -------------------------------------------------------------------------------- 1 | GNU gettext library from gettext-0.14.4 2 | -------------------------------------------------------------------------------- /intl/dcgettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dcgettext(3) function. 2 | Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | #ifdef _LIBC 25 | # include 26 | #else 27 | # include "libgnuintl.h" 28 | #endif 29 | 30 | /* @@ end of prolog @@ */ 31 | 32 | /* Names for the libintl functions are a problem. They must not clash 33 | with existing names and they should follow ANSI C. But this source 34 | code is also used in GNU C Library where the names have a __ 35 | prefix. So we have to make a difference here. */ 36 | #ifdef _LIBC 37 | # define DCGETTEXT __dcgettext 38 | # define DCIGETTEXT __dcigettext 39 | #else 40 | # define DCGETTEXT libintl_dcgettext 41 | # define DCIGETTEXT libintl_dcigettext 42 | #endif 43 | 44 | /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 45 | locale. */ 46 | char * 47 | DCGETTEXT (const char *domainname, const char *msgid, int category) 48 | { 49 | return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); 50 | } 51 | 52 | #ifdef _LIBC 53 | /* Alias for function name in GNU C Library. */ 54 | INTDEF(__dcgettext) 55 | weak_alias (__dcgettext, dcgettext); 56 | #endif 57 | -------------------------------------------------------------------------------- /intl/dcngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dcngettext(3) function. 2 | Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | #ifdef _LIBC 25 | # include 26 | #else 27 | # include "libgnuintl.h" 28 | #endif 29 | 30 | /* @@ end of prolog @@ */ 31 | 32 | /* Names for the libintl functions are a problem. They must not clash 33 | with existing names and they should follow ANSI C. But this source 34 | code is also used in GNU C Library where the names have a __ 35 | prefix. So we have to make a difference here. */ 36 | #ifdef _LIBC 37 | # define DCNGETTEXT __dcngettext 38 | # define DCIGETTEXT __dcigettext 39 | #else 40 | # define DCNGETTEXT libintl_dcngettext 41 | # define DCIGETTEXT libintl_dcigettext 42 | #endif 43 | 44 | /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 45 | locale. */ 46 | char * 47 | DCNGETTEXT (const char *domainname, 48 | const char *msgid1, const char *msgid2, unsigned long int n, 49 | int category) 50 | { 51 | return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); 52 | } 53 | 54 | #ifdef _LIBC 55 | /* Alias for function name in GNU C Library. */ 56 | weak_alias (__dcngettext, dcngettext); 57 | #endif 58 | -------------------------------------------------------------------------------- /intl/dgettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dgettext(3) function. 2 | Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | 25 | #include 26 | 27 | #ifdef _LIBC 28 | # include 29 | #else 30 | # include "libgnuintl.h" 31 | #endif 32 | 33 | /* @@ end of prolog @@ */ 34 | 35 | /* Names for the libintl functions are a problem. They must not clash 36 | with existing names and they should follow ANSI C. But this source 37 | code is also used in GNU C Library where the names have a __ 38 | prefix. So we have to make a difference here. */ 39 | #ifdef _LIBC 40 | # define DGETTEXT __dgettext 41 | # define DCGETTEXT INTUSE(__dcgettext) 42 | #else 43 | # define DGETTEXT libintl_dgettext 44 | # define DCGETTEXT libintl_dcgettext 45 | #endif 46 | 47 | /* Look up MSGID in the DOMAINNAME message catalog of the current 48 | LC_MESSAGES locale. */ 49 | char * 50 | DGETTEXT (const char *domainname, const char *msgid) 51 | { 52 | return DCGETTEXT (domainname, msgid, LC_MESSAGES); 53 | } 54 | 55 | #ifdef _LIBC 56 | /* Alias for function name in GNU C Library. */ 57 | weak_alias (__dgettext, dgettext); 58 | #endif 59 | -------------------------------------------------------------------------------- /intl/dngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dngettext(3) function. 2 | Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | 25 | #include 26 | 27 | #ifdef _LIBC 28 | # include 29 | #else 30 | # include "libgnuintl.h" 31 | #endif 32 | 33 | /* @@ end of prolog @@ */ 34 | 35 | /* Names for the libintl functions are a problem. They must not clash 36 | with existing names and they should follow ANSI C. But this source 37 | code is also used in GNU C Library where the names have a __ 38 | prefix. So we have to make a difference here. */ 39 | #ifdef _LIBC 40 | # define DNGETTEXT __dngettext 41 | # define DCNGETTEXT __dcngettext 42 | #else 43 | # define DNGETTEXT libintl_dngettext 44 | # define DCNGETTEXT libintl_dcngettext 45 | #endif 46 | 47 | /* Look up MSGID in the DOMAINNAME message catalog of the current 48 | LC_MESSAGES locale and skip message according to the plural form. */ 49 | char * 50 | DNGETTEXT (const char *domainname, 51 | const char *msgid1, const char *msgid2, unsigned long int n) 52 | { 53 | return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); 54 | } 55 | 56 | #ifdef _LIBC 57 | /* Alias for function name in GNU C Library. */ 58 | weak_alias (__dngettext, dngettext); 59 | #endif 60 | -------------------------------------------------------------------------------- /intl/eval-plural.h: -------------------------------------------------------------------------------- 1 | /* Plural expression evaluation. 2 | Copyright (C) 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifndef STATIC 20 | #define STATIC static 21 | #endif 22 | 23 | /* Evaluate the plural expression and return an index value. */ 24 | STATIC 25 | unsigned long int 26 | internal_function 27 | plural_eval (struct expression *pexp, unsigned long int n) 28 | { 29 | switch (pexp->nargs) 30 | { 31 | case 0: 32 | switch (pexp->operation) 33 | { 34 | case var: 35 | return n; 36 | case num: 37 | return pexp->val.num; 38 | default: 39 | break; 40 | } 41 | /* NOTREACHED */ 42 | break; 43 | case 1: 44 | { 45 | /* pexp->operation must be lnot. */ 46 | unsigned long int arg = plural_eval (pexp->val.args[0], n); 47 | return ! arg; 48 | } 49 | case 2: 50 | { 51 | unsigned long int leftarg = plural_eval (pexp->val.args[0], n); 52 | if (pexp->operation == lor) 53 | return leftarg || plural_eval (pexp->val.args[1], n); 54 | else if (pexp->operation == land) 55 | return leftarg && plural_eval (pexp->val.args[1], n); 56 | else 57 | { 58 | unsigned long int rightarg = plural_eval (pexp->val.args[1], n); 59 | 60 | switch (pexp->operation) 61 | { 62 | case mult: 63 | return leftarg * rightarg; 64 | case divide: 65 | #if !INTDIV0_RAISES_SIGFPE 66 | if (rightarg == 0) 67 | raise (SIGFPE); 68 | #endif 69 | return leftarg / rightarg; 70 | case module: 71 | #if !INTDIV0_RAISES_SIGFPE 72 | if (rightarg == 0) 73 | raise (SIGFPE); 74 | #endif 75 | return leftarg % rightarg; 76 | case plus: 77 | return leftarg + rightarg; 78 | case minus: 79 | return leftarg - rightarg; 80 | case less_than: 81 | return leftarg < rightarg; 82 | case greater_than: 83 | return leftarg > rightarg; 84 | case less_or_equal: 85 | return leftarg <= rightarg; 86 | case greater_or_equal: 87 | return leftarg >= rightarg; 88 | case equal: 89 | return leftarg == rightarg; 90 | case not_equal: 91 | return leftarg != rightarg; 92 | default: 93 | break; 94 | } 95 | } 96 | /* NOTREACHED */ 97 | break; 98 | } 99 | case 3: 100 | { 101 | /* pexp->operation must be qmop. */ 102 | unsigned long int boolarg = plural_eval (pexp->val.args[0], n); 103 | return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); 104 | } 105 | } 106 | /* NOTREACHED */ 107 | return 0; 108 | } 109 | -------------------------------------------------------------------------------- /intl/gettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of gettext(3) function. 2 | Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #ifdef _LIBC 24 | # define __need_NULL 25 | # include 26 | #else 27 | # include /* Just for NULL. */ 28 | #endif 29 | 30 | #include "gettextP.h" 31 | #ifdef _LIBC 32 | # include 33 | #else 34 | # include "libgnuintl.h" 35 | #endif 36 | 37 | /* @@ end of prolog @@ */ 38 | 39 | /* Names for the libintl functions are a problem. They must not clash 40 | with existing names and they should follow ANSI C. But this source 41 | code is also used in GNU C Library where the names have a __ 42 | prefix. So we have to make a difference here. */ 43 | #ifdef _LIBC 44 | # define GETTEXT __gettext 45 | # define DCGETTEXT INTUSE(__dcgettext) 46 | #else 47 | # define GETTEXT libintl_gettext 48 | # define DCGETTEXT libintl_dcgettext 49 | #endif 50 | 51 | /* Look up MSGID in the current default message catalog for the current 52 | LC_MESSAGES locale. If not found, returns MSGID itself (the default 53 | text). */ 54 | char * 55 | GETTEXT (const char *msgid) 56 | { 57 | return DCGETTEXT (NULL, msgid, LC_MESSAGES); 58 | } 59 | 60 | #ifdef _LIBC 61 | /* Alias for function name in GNU C Library. */ 62 | weak_alias (__gettext, gettext); 63 | #endif 64 | -------------------------------------------------------------------------------- /intl/hash-string.h: -------------------------------------------------------------------------------- 1 | /* Description of GNU message catalog format: string hashing function. 2 | Copyright (C) 1995, 1997-1998, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | /* @@ end of prolog @@ */ 20 | 21 | /* We assume to have `unsigned long int' value with at least 32 bits. */ 22 | #define HASHWORDBITS 32 23 | 24 | 25 | /* Defines the so called `hashpjw' function by P.J. Weinberger 26 | [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 27 | 1986, 1987 Bell Telephone Laboratories, Inc.] */ 28 | static inline unsigned long int 29 | hash_string (const char *str_param) 30 | { 31 | unsigned long int hval, g; 32 | const char *str = str_param; 33 | 34 | /* Compute the hash value for the given string. */ 35 | hval = 0; 36 | while (*str != '\0') 37 | { 38 | hval <<= 4; 39 | hval += (unsigned char) *str++; 40 | g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); 41 | if (g != 0) 42 | { 43 | hval ^= g >> (HASHWORDBITS - 8); 44 | hval ^= g; 45 | } 46 | } 47 | return hval; 48 | } 49 | -------------------------------------------------------------------------------- /intl/localcharset.h: -------------------------------------------------------------------------------- 1 | /* Determine a canonical name for the current locale's character encoding. 2 | Copyright (C) 2000-2003 Free Software Foundation, Inc. 3 | This file is part of the GNU CHARSET Library. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | USA. */ 19 | 20 | #ifndef _LOCALCHARSET_H 21 | #define _LOCALCHARSET_H 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | 29 | /* Determine the current locale's character encoding, and canonicalize it 30 | into one of the canonical names listed in config.charset. 31 | The result must not be freed; it is statically allocated. 32 | If the canonical name cannot be determined, the result is a non-canonical 33 | name. */ 34 | extern const char * locale_charset (void); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | 42 | #endif /* _LOCALCHARSET_H */ 43 | -------------------------------------------------------------------------------- /intl/locale.alias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/intl/locale.alias -------------------------------------------------------------------------------- /intl/log.c: -------------------------------------------------------------------------------- 1 | /* Log file output. 2 | Copyright (C) 2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | /* Written by Bruno Haible . */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | # include 23 | #endif 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | /* Print an ASCII string with quotes and escape sequences where needed. */ 30 | static void 31 | print_escaped (FILE *stream, const char *str) 32 | { 33 | putc ('"', stream); 34 | for (; *str != '\0'; str++) 35 | if (*str == '\n') 36 | { 37 | fputs ("\\n\"", stream); 38 | if (str[1] == '\0') 39 | return; 40 | fputs ("\n\"", stream); 41 | } 42 | else 43 | { 44 | if (*str == '"' || *str == '\\') 45 | putc ('\\', stream); 46 | putc (*str, stream); 47 | } 48 | putc ('"', stream); 49 | } 50 | 51 | /* Add to the log file an entry denoting a failed translation. */ 52 | void 53 | _nl_log_untranslated (const char *logfilename, const char *domainname, 54 | const char *msgid1, const char *msgid2, int plural) 55 | { 56 | static char *last_logfilename = NULL; 57 | static FILE *last_logfile = NULL; 58 | FILE *logfile; 59 | 60 | /* Can we reuse the last opened logfile? */ 61 | if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0) 62 | { 63 | /* Close the last used logfile. */ 64 | if (last_logfilename != NULL) 65 | { 66 | if (last_logfile != NULL) 67 | { 68 | fclose (last_logfile); 69 | last_logfile = NULL; 70 | } 71 | free (last_logfilename); 72 | last_logfilename = NULL; 73 | } 74 | /* Open the logfile. */ 75 | last_logfilename = (char *) malloc (strlen (logfilename) + 1); 76 | if (last_logfilename == NULL) 77 | return; 78 | strcpy (last_logfilename, logfilename); 79 | last_logfile = fopen (logfilename, "a"); 80 | if (last_logfile == NULL) 81 | return; 82 | } 83 | logfile = last_logfile; 84 | 85 | fprintf (logfile, "domain "); 86 | print_escaped (logfile, domainname); 87 | fprintf (logfile, "\nmsgid "); 88 | print_escaped (logfile, msgid1); 89 | if (plural) 90 | { 91 | fprintf (logfile, "\nmsgid_plural "); 92 | print_escaped (logfile, msgid2); 93 | fprintf (logfile, "\nmsgstr[0] \"\"\n"); 94 | } 95 | else 96 | fprintf (logfile, "\nmsgstr \"\"\n"); 97 | putc ('\n', logfile); 98 | } 99 | -------------------------------------------------------------------------------- /intl/ngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of ngettext(3) function. 2 | Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #ifdef _LIBC 24 | # define __need_NULL 25 | # include 26 | #else 27 | # include /* Just for NULL. */ 28 | #endif 29 | 30 | #include "gettextP.h" 31 | #ifdef _LIBC 32 | # include 33 | #else 34 | # include "libgnuintl.h" 35 | #endif 36 | 37 | #include 38 | 39 | /* @@ end of prolog @@ */ 40 | 41 | /* Names for the libintl functions are a problem. They must not clash 42 | with existing names and they should follow ANSI C. But this source 43 | code is also used in GNU C Library where the names have a __ 44 | prefix. So we have to make a difference here. */ 45 | #ifdef _LIBC 46 | # define NGETTEXT __ngettext 47 | # define DCNGETTEXT __dcngettext 48 | #else 49 | # define NGETTEXT libintl_ngettext 50 | # define DCNGETTEXT libintl_dcngettext 51 | #endif 52 | 53 | /* Look up MSGID in the current default message catalog for the current 54 | LC_MESSAGES locale. If not found, returns MSGID itself (the default 55 | text). */ 56 | char * 57 | NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n) 58 | { 59 | return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); 60 | } 61 | 62 | #ifdef _LIBC 63 | /* Alias for function name in GNU C Library. */ 64 | weak_alias (__ngettext, ngettext); 65 | #endif 66 | -------------------------------------------------------------------------------- /intl/os2compat.c: -------------------------------------------------------------------------------- 1 | /* OS/2 compatibility functions. 2 | Copyright (C) 2001-2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #define OS2_AWARE 20 | #ifdef HAVE_CONFIG_H 21 | #include 22 | #endif 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | /* A version of getenv() that works from DLLs */ 29 | extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); 30 | 31 | char * 32 | _nl_getenv (const char *name) 33 | { 34 | unsigned char *value; 35 | if (DosScanEnv (name, &value)) 36 | return NULL; 37 | else 38 | return value; 39 | } 40 | 41 | /* A fixed size buffer. */ 42 | char libintl_nl_default_dirname[MAXPATHLEN+1]; 43 | 44 | char *_nlos2_libdir = NULL; 45 | char *_nlos2_localealiaspath = NULL; 46 | char *_nlos2_localedir = NULL; 47 | 48 | static __attribute__((constructor)) void 49 | nlos2_initialize () 50 | { 51 | char *root = getenv ("UNIXROOT"); 52 | char *gnulocaledir = getenv ("GNULOCALEDIR"); 53 | 54 | _nlos2_libdir = gnulocaledir; 55 | if (!_nlos2_libdir) 56 | { 57 | if (root) 58 | { 59 | size_t sl = strlen (root); 60 | _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); 61 | memcpy (_nlos2_libdir, root, sl); 62 | memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); 63 | } 64 | else 65 | _nlos2_libdir = LIBDIR; 66 | } 67 | 68 | _nlos2_localealiaspath = gnulocaledir; 69 | if (!_nlos2_localealiaspath) 70 | { 71 | if (root) 72 | { 73 | size_t sl = strlen (root); 74 | _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); 75 | memcpy (_nlos2_localealiaspath, root, sl); 76 | memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); 77 | } 78 | else 79 | _nlos2_localealiaspath = LOCALE_ALIAS_PATH; 80 | } 81 | 82 | _nlos2_localedir = gnulocaledir; 83 | if (!_nlos2_localedir) 84 | { 85 | if (root) 86 | { 87 | size_t sl = strlen (root); 88 | _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); 89 | memcpy (_nlos2_localedir, root, sl); 90 | memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); 91 | } 92 | else 93 | _nlos2_localedir = LOCALEDIR; 94 | } 95 | 96 | if (strlen (_nlos2_localedir) <= MAXPATHLEN) 97 | strcpy (libintl_nl_default_dirname, _nlos2_localedir); 98 | } 99 | -------------------------------------------------------------------------------- /intl/os2compat.h: -------------------------------------------------------------------------------- 1 | /* OS/2 compatibility defines. 2 | This file is intended to be included from config.h 3 | Copyright (C) 2001-2002 Free Software Foundation, Inc. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | USA. */ 19 | 20 | /* When included from os2compat.h we need all the original definitions */ 21 | #ifndef OS2_AWARE 22 | 23 | #undef LIBDIR 24 | #define LIBDIR _nlos2_libdir 25 | extern char *_nlos2_libdir; 26 | 27 | #undef LOCALEDIR 28 | #define LOCALEDIR _nlos2_localedir 29 | extern char *_nlos2_localedir; 30 | 31 | #undef LOCALE_ALIAS_PATH 32 | #define LOCALE_ALIAS_PATH _nlos2_localealiaspath 33 | extern char *_nlos2_localealiaspath; 34 | 35 | #endif 36 | 37 | #undef HAVE_STRCASECMP 38 | #define HAVE_STRCASECMP 1 39 | #define strcasecmp stricmp 40 | #define strncasecmp strnicmp 41 | 42 | /* We have our own getenv() which works even if library is compiled as DLL */ 43 | #define getenv _nl_getenv 44 | 45 | /* Older versions of gettext used -1 as the value of LC_MESSAGES */ 46 | #define LC_MESSAGES_COMPAT (-1) 47 | -------------------------------------------------------------------------------- /intl/osdep.c: -------------------------------------------------------------------------------- 1 | /* OS dependent parts of libintl. 2 | Copyright (C) 2001-2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #if defined __EMX__ 20 | # include "os2compat.c" 21 | #else 22 | /* Avoid AIX compiler warning. */ 23 | typedef int dummy; 24 | #endif 25 | -------------------------------------------------------------------------------- /intl/printf-parse.h: -------------------------------------------------------------------------------- 1 | /* Parse printf format string. 2 | Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifndef _PRINTF_PARSE_H 20 | #define _PRINTF_PARSE_H 21 | 22 | #include "printf-args.h" 23 | 24 | 25 | /* Flags */ 26 | #define FLAG_GROUP 1 /* ' flag */ 27 | #define FLAG_LEFT 2 /* - flag */ 28 | #define FLAG_SHOWSIGN 4 /* + flag */ 29 | #define FLAG_SPACE 8 /* space flag */ 30 | #define FLAG_ALT 16 /* # flag */ 31 | #define FLAG_ZERO 32 32 | 33 | /* arg_index value indicating that no argument is consumed. */ 34 | #define ARG_NONE (~(size_t)0) 35 | 36 | /* A parsed directive. */ 37 | typedef struct 38 | { 39 | const char* dir_start; 40 | const char* dir_end; 41 | int flags; 42 | const char* width_start; 43 | const char* width_end; 44 | size_t width_arg_index; 45 | const char* precision_start; 46 | const char* precision_end; 47 | size_t precision_arg_index; 48 | char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ 49 | size_t arg_index; 50 | } 51 | char_directive; 52 | 53 | /* A parsed format string. */ 54 | typedef struct 55 | { 56 | size_t count; 57 | char_directive *dir; 58 | size_t max_width_length; 59 | size_t max_precision_length; 60 | } 61 | char_directives; 62 | 63 | 64 | /* Parses the format string. Fills in the number N of directives, and fills 65 | in directives[0], ..., directives[N-1], and sets directives[N].dir_start 66 | to the end of the format string. Also fills in the arg_type fields of the 67 | arguments and the needed count of arguments. */ 68 | #ifdef STATIC 69 | STATIC 70 | #else 71 | extern 72 | #endif 73 | int printf_parse (const char *format, char_directives *d, arguments *a); 74 | 75 | #endif /* _PRINTF_PARSE_H */ 76 | -------------------------------------------------------------------------------- /intl/ref-add.sin: -------------------------------------------------------------------------------- 1 | # Add this package to a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | ta 25 | :a 26 | s/ @PACKAGE@ / @PACKAGE@ / 27 | tb 28 | s/ $/ @PACKAGE@ / 29 | :b 30 | s/^/# Packages using this file:/ 31 | } 32 | -------------------------------------------------------------------------------- /intl/ref-del.sin: -------------------------------------------------------------------------------- 1 | # Remove this package from a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | s/ @PACKAGE@ / / 25 | s/^/# Packages using this file:/ 26 | } 27 | -------------------------------------------------------------------------------- /intl/relocatable.h: -------------------------------------------------------------------------------- 1 | /* Provide relocatable packages. 2 | Copyright (C) 2003 Free Software Foundation, Inc. 3 | Written by Bruno Haible , 2003. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | USA. */ 19 | 20 | #ifndef _RELOCATABLE_H 21 | #define _RELOCATABLE_H 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | 28 | /* This can be enabled through the configure --enable-relocatable option. */ 29 | #if ENABLE_RELOCATABLE 30 | 31 | /* When building a DLL, we must export some functions. Note that because 32 | this is a private .h file, we don't need to use __declspec(dllimport) 33 | in any case. */ 34 | #if defined _MSC_VER && BUILDING_DLL 35 | # define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) 36 | #else 37 | # define RELOCATABLE_DLL_EXPORTED 38 | #endif 39 | 40 | /* Sets the original and the current installation prefix of the package. 41 | Relocation simply replaces a pathname starting with the original prefix 42 | by the corresponding pathname with the current prefix instead. Both 43 | prefixes should be directory names without trailing slash (i.e. use "" 44 | instead of "/"). */ 45 | extern RELOCATABLE_DLL_EXPORTED void 46 | set_relocation_prefix (const char *orig_prefix, 47 | const char *curr_prefix); 48 | 49 | /* Returns the pathname, relocated according to the current installation 50 | directory. */ 51 | extern const char * relocate (const char *pathname); 52 | 53 | /* Memory management: relocate() leaks memory, because it has to construct 54 | a fresh pathname. If this is a problem because your program calls 55 | relocate() frequently, think about caching the result. */ 56 | 57 | /* Convenience function: 58 | Computes the current installation prefix, based on the original 59 | installation prefix, the original installation directory of a particular 60 | file, and the current pathname of this file. Returns NULL upon failure. */ 61 | extern const char * compute_curr_prefix (const char *orig_installprefix, 62 | const char *orig_installdir, 63 | const char *curr_pathname); 64 | 65 | #else 66 | 67 | /* By default, we use the hardwired pathnames. */ 68 | #define relocate(pathname) (pathname) 69 | 70 | #endif 71 | 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif /* _RELOCATABLE_H */ 78 | -------------------------------------------------------------------------------- /intl/vasnprintf.h: -------------------------------------------------------------------------------- 1 | /* vsprintf with automatic memory allocation. 2 | Copyright (C) 2002-2004 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifndef _VASNPRINTF_H 20 | #define _VASNPRINTF_H 21 | 22 | /* Get va_list. */ 23 | #include 24 | 25 | /* Get size_t. */ 26 | #include 27 | 28 | #ifndef __attribute__ 29 | /* This feature is available in gcc versions 2.5 and later. */ 30 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ 31 | # define __attribute__(Spec) /* empty */ 32 | # endif 33 | /* The __-protected variants of `format' and `printf' attributes 34 | are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ 35 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) 36 | # define __format__ format 37 | # define __printf__ printf 38 | # endif 39 | #endif 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /* Write formatted output to a string dynamically allocated with malloc(). 46 | You can pass a preallocated buffer for the result in RESULTBUF and its 47 | size in *LENGTHP; otherwise you pass RESULTBUF = NULL. 48 | If successful, return the address of the string (this may be = RESULTBUF 49 | if no dynamic memory allocation was necessary) and set *LENGTHP to the 50 | number of resulting bytes, excluding the trailing NUL. Upon error, set 51 | errno and return NULL. 52 | 53 | When dynamic memory allocation occurs, the preallocated buffer is left 54 | alone (with possibly modified contents). This makes it possible to use 55 | a statically allocated or stack-allocated buffer, like this: 56 | 57 | char buf[100]; 58 | size_t len = sizeof (buf); 59 | char *output = vasnprintf (buf, &len, format, args); 60 | if (output == NULL) 61 | ... error handling ...; 62 | else 63 | { 64 | ... use the output string ...; 65 | if (output != buf) 66 | free (output); 67 | } 68 | */ 69 | extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) 70 | __attribute__ ((__format__ (__printf__, 3, 4))); 71 | extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) 72 | __attribute__ ((__format__ (__printf__, 3, 0))); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* _VASNPRINTF_H */ 79 | -------------------------------------------------------------------------------- /intl/vasnwprintf.h: -------------------------------------------------------------------------------- 1 | /* vswprintf with automatic memory allocation. 2 | Copyright (C) 2002-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifndef _VASNWPRINTF_H 20 | #define _VASNWPRINTF_H 21 | 22 | /* Get va_list. */ 23 | #include 24 | 25 | /* Get wchar_t, size_t. */ 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /* Write formatted output to a string dynamically allocated with malloc(). 33 | You can pass a preallocated buffer for the result in RESULTBUF and its 34 | size in *LENGTHP; otherwise you pass RESULTBUF = NULL. 35 | If successful, return the address of the string (this may be = RESULTBUF 36 | if no dynamic memory allocation was necessary) and set *LENGTHP to the 37 | number of resulting bytes, excluding the trailing NUL. Upon error, set 38 | errno and return NULL. */ 39 | extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...); 40 | extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* _VASNWPRINTF_H */ 47 | -------------------------------------------------------------------------------- /intl/wprintf-parse.h: -------------------------------------------------------------------------------- 1 | /* Parse printf format string. 2 | Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifndef _WPRINTF_PARSE_H 20 | #define _WPRINTF_PARSE_H 21 | 22 | #include "printf-args.h" 23 | 24 | 25 | /* Flags */ 26 | #define FLAG_GROUP 1 /* ' flag */ 27 | #define FLAG_LEFT 2 /* - flag */ 28 | #define FLAG_SHOWSIGN 4 /* + flag */ 29 | #define FLAG_SPACE 8 /* space flag */ 30 | #define FLAG_ALT 16 /* # flag */ 31 | #define FLAG_ZERO 32 32 | 33 | /* arg_index value indicating that no argument is consumed. */ 34 | #define ARG_NONE (~(size_t)0) 35 | 36 | /* A parsed directive. */ 37 | typedef struct 38 | { 39 | const wchar_t* dir_start; 40 | const wchar_t* dir_end; 41 | int flags; 42 | const wchar_t* width_start; 43 | const wchar_t* width_end; 44 | size_t width_arg_index; 45 | const wchar_t* precision_start; 46 | const wchar_t* precision_end; 47 | size_t precision_arg_index; 48 | wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */ 49 | size_t arg_index; 50 | } 51 | wchar_t_directive; 52 | 53 | /* A parsed format string. */ 54 | typedef struct 55 | { 56 | size_t count; 57 | wchar_t_directive *dir; 58 | size_t max_width_length; 59 | size_t max_precision_length; 60 | } 61 | wchar_t_directives; 62 | 63 | 64 | /* Parses the format string. Fills in the number N of directives, and fills 65 | in directives[0], ..., directives[N-1], and sets directives[N].dir_start 66 | to the end of the format string. Also fills in the arg_type fields of the 67 | arguments and the needed count of arguments. */ 68 | #ifdef STATIC 69 | STATIC 70 | #else 71 | extern 72 | #endif 73 | int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a); 74 | 75 | #endif /* _WPRINTF_PARSE_H */ 76 | -------------------------------------------------------------------------------- /m4/Makefile.am: -------------------------------------------------------------------------------- 1 | # Process this file with automake to produce a Makefile.in file. 2 | EXTRA_DIST = codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 pkg.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4 cppunit.m4 cups.m4 3 | -------------------------------------------------------------------------------- /m4/codeset.m4: -------------------------------------------------------------------------------- 1 | # codeset.m4 serial AM1 (gettext-0.10.40) 2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([AM_LANGINFO_CODESET], 10 | [ 11 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 12 | [AC_TRY_LINK([#include ], 13 | [char* cs = nl_langinfo(CODESET);], 14 | am_cv_langinfo_codeset=yes, 15 | am_cv_langinfo_codeset=no) 16 | ]) 17 | if test $am_cv_langinfo_codeset = yes; then 18 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 19 | [Define if you have and nl_langinfo(CODESET).]) 20 | fi 21 | ]) 22 | -------------------------------------------------------------------------------- /m4/cppunit.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 3 | dnl 4 | AC_DEFUN([AM_PATH_CPPUNIT], 5 | [ 6 | 7 | AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)], 8 | cppunit_config_prefix="$withval", cppunit_config_prefix="") 9 | AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)], 10 | cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="") 11 | 12 | if test x$cppunit_config_exec_prefix != x ; then 13 | cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" 14 | if test x${CPPUNIT_CONFIG+set} != xset ; then 15 | CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config 16 | fi 17 | fi 18 | if test x$cppunit_config_prefix != x ; then 19 | cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" 20 | if test x${CPPUNIT_CONFIG+set} != xset ; then 21 | CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config 22 | fi 23 | fi 24 | 25 | AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no) 26 | cppunit_version_min=$1 27 | 28 | AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min) 29 | no_cppunit="" 30 | if test "$CPPUNIT_CONFIG" = "no" ; then 31 | no_cppunit=yes 32 | else 33 | CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` 34 | CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` 35 | cppunit_version=`$CPPUNIT_CONFIG --version` 36 | 37 | cppunit_major_version=`echo $cppunit_version | \ 38 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 39 | cppunit_minor_version=`echo $cppunit_version | \ 40 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 41 | cppunit_micro_version=`echo $cppunit_version | \ 42 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 43 | 44 | cppunit_major_min=`echo $cppunit_version_min | \ 45 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 46 | cppunit_minor_min=`echo $cppunit_version_min | \ 47 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 48 | cppunit_micro_min=`echo $cppunit_version_min | \ 49 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 50 | 51 | cppunit_version_proper=`expr \ 52 | $cppunit_major_version \> $cppunit_major_min \| \ 53 | $cppunit_major_version \= $cppunit_major_min \& \ 54 | $cppunit_minor_version \> $cppunit_minor_min \| \ 55 | $cppunit_major_version \= $cppunit_major_min \& \ 56 | $cppunit_minor_version \= $cppunit_minor_min \& \ 57 | $cppunit_micro_version \>= $cppunit_micro_min ` 58 | 59 | if test "$cppunit_version_proper" = "1" ; then 60 | AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version]) 61 | else 62 | AC_MSG_RESULT(no) 63 | no_cppunit=yes 64 | fi 65 | fi 66 | 67 | if test "x$no_cppunit" = x ; then 68 | ifelse([$2], , :, [$2]) 69 | else 70 | CPPUNIT_CFLAGS="" 71 | CPPUNIT_LIBS="" 72 | ifelse([$3], , :, [$3]) 73 | fi 74 | 75 | AC_SUBST(CPPUNIT_CFLAGS) 76 | AC_SUBST(CPPUNIT_LIBS) 77 | ]) 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /m4/cups.m4: -------------------------------------------------------------------------------- 1 | # 2 | # EPDFVIEW_PATH_CUPS(PREFIX, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 3 | # 4 | # Check to see whether the CUPS header and libraries exists. 5 | # 6 | AC_DEFUN([EPDFVIEW_PATH_CUPS], 7 | [AC_ARG_WITH([cups], 8 | AS_HELP_STRING([--with-cups], [use the CUPS for printing (default)]), 9 | [ac_cv_use_cups=$withval], [ac_cv_use_cups=yes]) 10 | AC_PATH_PROG([CUPS_CONFIG], [cups-config], no, [$PATH]) 11 | AC_MSG_CHECKING([for CUPS]) 12 | if test "x$ac_cv_use_cups" = "xno"; then 13 | AC_MSG_RESULT([disabled]) 14 | ac_cv_have_cups=no 15 | elif test "x$CUPS_CONFIG" = "xno"; then 16 | AC_MSG_RESULT([cups-config not found.]) 17 | ac_cv_have_cups=no 18 | else 19 | AC_MSG_RESULT([yes]) 20 | $1[]_CFLAGS=`$CUPS_CONFIG --cflags` 21 | $1[]_LIBS=`$CUPS_CONFIG --libs` 22 | ac_cv_have_cups=yes 23 | fi 24 | 25 | if test "x$ac_cv_have_cups" = "xyes"; then 26 | ifelse([$2], , :, [$2]) 27 | else 28 | ifelse([$3], , :, [$3]) 29 | fi 30 | ]) # EPDFVIEW_CUPS_PATH 31 | -------------------------------------------------------------------------------- /m4/glibc2.m4: -------------------------------------------------------------------------------- 1 | # glibc2.m4 serial 1 2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.0 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gt_GLIBC2], 11 | [ 12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, 13 | ac_cv_gnu_library_2, 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ >= 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | ac_cv_gnu_library_2=yes, 24 | ac_cv_gnu_library_2=no) 25 | ] 26 | ) 27 | AC_SUBST(GLIBC2) 28 | GLIBC2="$ac_cv_gnu_library_2" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /m4/glibc21.m4: -------------------------------------------------------------------------------- 1 | # glibc21.m4 serial 3 2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.1 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gl_GLIBC21], 11 | [ 12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 13 | ac_cv_gnu_library_2_1, 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | ac_cv_gnu_library_2_1=yes, 24 | ac_cv_gnu_library_2_1=no) 25 | ] 26 | ) 27 | AC_SUBST(GLIBC21) 28 | GLIBC21="$ac_cv_gnu_library_2_1" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /m4/intdiv0.m4: -------------------------------------------------------------------------------- 1 | # intdiv0.m4 serial 1 (gettext-0.11.3) 2 | dnl Copyright (C) 2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([gt_INTDIV0], 10 | [ 11 | AC_REQUIRE([AC_PROG_CC])dnl 12 | AC_REQUIRE([AC_CANONICAL_HOST])dnl 13 | 14 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], 15 | gt_cv_int_divbyzero_sigfpe, 16 | [ 17 | AC_TRY_RUN([ 18 | #include 19 | #include 20 | 21 | static void 22 | #ifdef __cplusplus 23 | sigfpe_handler (int sig) 24 | #else 25 | sigfpe_handler (sig) int sig; 26 | #endif 27 | { 28 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ 29 | exit (sig != SIGFPE); 30 | } 31 | 32 | int x = 1; 33 | int y = 0; 34 | int z; 35 | int nan; 36 | 37 | int main () 38 | { 39 | signal (SIGFPE, sigfpe_handler); 40 | /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ 41 | #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) 42 | signal (SIGTRAP, sigfpe_handler); 43 | #endif 44 | /* Linux/SPARC yields signal SIGILL. */ 45 | #if defined (__sparc__) && defined (__linux__) 46 | signal (SIGILL, sigfpe_handler); 47 | #endif 48 | 49 | z = x / y; 50 | nan = y / y; 51 | exit (1); 52 | } 53 | ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, 54 | [ 55 | # Guess based on the CPU. 56 | case "$host_cpu" in 57 | alpha* | i[34567]86 | m68k | s390*) 58 | gt_cv_int_divbyzero_sigfpe="guessing yes";; 59 | *) 60 | gt_cv_int_divbyzero_sigfpe="guessing no";; 61 | esac 62 | ]) 63 | ]) 64 | case "$gt_cv_int_divbyzero_sigfpe" in 65 | *yes) value=1;; 66 | *) value=0;; 67 | esac 68 | AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, 69 | [Define if integer division by zero raises signal SIGFPE.]) 70 | ]) 71 | -------------------------------------------------------------------------------- /m4/intmax.m4: -------------------------------------------------------------------------------- 1 | # intmax.m4 serial 2 (gettext-0.14.2) 2 | dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the system has the 'intmax_t' type, but don't attempt to 9 | dnl find a replacement if it is lacking. 10 | 11 | AC_DEFUN([gt_TYPE_INTMAX_T], 12 | [ 13 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 14 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 15 | AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, 16 | [AC_TRY_COMPILE([ 17 | #include 18 | #include 19 | #if HAVE_STDINT_H_WITH_UINTMAX 20 | #include 21 | #endif 22 | #if HAVE_INTTYPES_H_WITH_UINTMAX 23 | #include 24 | #endif 25 | ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) 26 | if test $gt_cv_c_intmax_t = yes; then 27 | AC_DEFINE(HAVE_INTMAX_T, 1, 28 | [Define if you have the 'intmax_t' type in or .]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /m4/inttypes-pri.m4: -------------------------------------------------------------------------------- 1 | # inttypes-pri.m4 serial 1 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | # Define PRI_MACROS_BROKEN if exists and defines the PRI* 10 | # macros to non-string values. This is the case on AIX 4.3.3. 11 | 12 | AC_DEFUN([gt_INTTYPES_PRI], 13 | [ 14 | AC_REQUIRE([gt_HEADER_INTTYPES_H]) 15 | if test $gt_cv_header_inttypes_h = yes; then 16 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], 17 | gt_cv_inttypes_pri_broken, 18 | [ 19 | AC_TRY_COMPILE([#include 20 | #ifdef PRId32 21 | char *p = PRId32; 22 | #endif 23 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) 24 | ]) 25 | fi 26 | if test "$gt_cv_inttypes_pri_broken" = yes; then 27 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, 28 | [Define if exists and defines unusable PRI* macros.]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /m4/inttypes.m4: -------------------------------------------------------------------------------- 1 | # inttypes.m4 serial 1 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H if exists and doesn't clash with 10 | # . 11 | 12 | AC_DEFUN([gt_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, 15 | [ 16 | AC_TRY_COMPILE( 17 | [#include 18 | #include ], 19 | [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) 20 | ]) 21 | if test $gt_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, 23 | [Define if exists and doesn't clash with .]) 24 | fi 25 | ]) 26 | -------------------------------------------------------------------------------- /m4/inttypes_h.m4: -------------------------------------------------------------------------------- 1 | # inttypes_h.m4 serial 6 2 | dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1;], 19 | gl_cv_header_inttypes_h=yes, 20 | gl_cv_header_inttypes_h=no)]) 21 | if test $gl_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /m4/isc-posix.m4: -------------------------------------------------------------------------------- 1 | # isc-posix.m4 serial 2 (gettext-0.11.2) 2 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. 8 | 9 | # This test replaces the one in autoconf. 10 | # Currently this macro should have the same name as the autoconf macro 11 | # because gettext's gettext.m4 (distributed in the automake package) 12 | # still uses it. Otherwise, the use in gettext.m4 makes autoheader 13 | # give these diagnostics: 14 | # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX 15 | # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX 16 | 17 | undefine([AC_ISC_POSIX]) 18 | 19 | AC_DEFUN([AC_ISC_POSIX], 20 | [ 21 | dnl This test replaces the obsolescent AC_ISC_POSIX kludge. 22 | AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) 23 | ] 24 | ) 25 | -------------------------------------------------------------------------------- /m4/lcmessage.m4: -------------------------------------------------------------------------------- 1 | # lcmessage.m4 serial 4 (gettext-0.14.2) 2 | dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1995. 18 | 19 | # Check whether LC_MESSAGES is available in . 20 | 21 | AC_DEFUN([gt_LC_MESSAGES], 22 | [ 23 | AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, 24 | [AC_TRY_LINK([#include ], [return LC_MESSAGES], 25 | gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) 26 | if test $gt_cv_val_LC_MESSAGES = yes; then 27 | AC_DEFINE(HAVE_LC_MESSAGES, 1, 28 | [Define if your file defines LC_MESSAGES.]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /m4/longdouble.m4: -------------------------------------------------------------------------------- 1 | # longdouble.m4 serial 1 (gettext-0.12) 2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the compiler supports the 'long double' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_LONGDOUBLE], 12 | [ 13 | AC_CACHE_CHECK([for long double], gt_cv_c_long_double, 14 | [if test "$GCC" = yes; then 15 | gt_cv_c_long_double=yes 16 | else 17 | AC_TRY_COMPILE([ 18 | /* The Stardent Vistra knows sizeof(long double), but does not support it. */ 19 | long double foo = 0.0; 20 | /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ 21 | int array [2*(sizeof(long double) >= sizeof(double)) - 1]; 22 | ], , 23 | gt_cv_c_long_double=yes, gt_cv_c_long_double=no) 24 | fi]) 25 | if test $gt_cv_c_long_double = yes; then 26 | AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /m4/longlong.m4: -------------------------------------------------------------------------------- 1 | # longlong.m4 serial 5 2 | dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_LONG_LONG if 'long long' works. 10 | 11 | AC_DEFUN([gl_AC_TYPE_LONG_LONG], 12 | [ 13 | AC_CACHE_CHECK([for long long], ac_cv_type_long_long, 14 | [AC_TRY_LINK([long long ll = 1LL; int i = 63;], 15 | [long long llmax = (long long) -1; 16 | return ll << i | ll >> i | llmax / ll | llmax % ll;], 17 | ac_cv_type_long_long=yes, 18 | ac_cv_type_long_long=no)]) 19 | if test $ac_cv_type_long_long = yes; then 20 | AC_DEFINE(HAVE_LONG_LONG, 1, 21 | [Define if you have the 'long long' type.]) 22 | fi 23 | ]) 24 | -------------------------------------------------------------------------------- /m4/nls.m4: -------------------------------------------------------------------------------- 1 | # nls.m4 serial 2 (gettext-0.14.3) 2 | dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1995-2000. 18 | dnl Bruno Haible , 2000-2003. 19 | 20 | AC_PREREQ(2.50) 21 | 22 | AC_DEFUN([AM_NLS], 23 | [ 24 | AC_MSG_CHECKING([whether NLS is requested]) 25 | dnl Default is enabled NLS 26 | AC_ARG_ENABLE(nls, 27 | [ --disable-nls do not use Native Language Support], 28 | USE_NLS=$enableval, USE_NLS=yes) 29 | AC_MSG_RESULT($USE_NLS) 30 | AC_SUBST(USE_NLS) 31 | ]) 32 | 33 | AC_DEFUN([AM_MKINSTALLDIRS], 34 | [ 35 | dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing. 36 | m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])]) 37 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly 38 | dnl find the mkinstalldirs script in another subdir but $(top_srcdir). 39 | dnl Try to locate it. 40 | MKINSTALLDIRS= 41 | if test -n "$ac_aux_dir"; then 42 | case "$ac_aux_dir" in 43 | /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; 44 | *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; 45 | esac 46 | fi 47 | if test -z "$MKINSTALLDIRS"; then 48 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" 49 | fi 50 | AC_SUBST(MKINSTALLDIRS) 51 | ]) 52 | -------------------------------------------------------------------------------- /m4/printf-posix.m4: -------------------------------------------------------------------------------- 1 | # printf-posix.m4 serial 2 (gettext-0.13.1) 2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the printf() function supports POSIX/XSI format strings with 9 | dnl positions. 10 | 11 | AC_DEFUN([gt_PRINTF_POSIX], 12 | [ 13 | AC_REQUIRE([AC_PROG_CC]) 14 | AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], 15 | gt_cv_func_printf_posix, 16 | [ 17 | AC_TRY_RUN([ 18 | #include 19 | #include 20 | /* The string "%2$d %1$d", with dollar characters protected from the shell's 21 | dollar expansion (possibly an autoconf bug). */ 22 | static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; 23 | static char buf[100]; 24 | int main () 25 | { 26 | sprintf (buf, format, 33, 55); 27 | return (strcmp (buf, "55 33") != 0); 28 | }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, 29 | [ 30 | AC_EGREP_CPP(notposix, [ 31 | #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ 32 | notposix 33 | #endif 34 | ], gt_cv_func_printf_posix="guessing no", 35 | gt_cv_func_printf_posix="guessing yes") 36 | ]) 37 | ]) 38 | case $gt_cv_func_printf_posix in 39 | *yes) 40 | AC_DEFINE(HAVE_POSIX_PRINTF, 1, 41 | [Define if your printf() function supports format strings with positions.]) 42 | ;; 43 | esac 44 | ]) 45 | -------------------------------------------------------------------------------- /m4/progtest.m4: -------------------------------------------------------------------------------- 1 | # progtest.m4 serial 4 (gettext-0.14.2) 2 | dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1996. 18 | 19 | AC_PREREQ(2.50) 20 | 21 | # Search path for a program which passes the given test. 22 | 23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, 24 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) 25 | AC_DEFUN([AM_PATH_PROG_WITH_TEST], 26 | [ 27 | # Prepare PATH_SEPARATOR. 28 | # The user is always right. 29 | if test "${PATH_SEPARATOR+set}" != set; then 30 | echo "#! /bin/sh" >conf$$.sh 31 | echo "exit 0" >>conf$$.sh 32 | chmod +x conf$$.sh 33 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then 34 | PATH_SEPARATOR=';' 35 | else 36 | PATH_SEPARATOR=: 37 | fi 38 | rm -f conf$$.sh 39 | fi 40 | 41 | # Find out how to test for executable files. Don't use a zero-byte file, 42 | # as systems may use methods other than mode bits to determine executability. 43 | cat >conf$$.file <<_ASEOF 44 | #! /bin/sh 45 | exit 0 46 | _ASEOF 47 | chmod +x conf$$.file 48 | if test -x conf$$.file >/dev/null 2>&1; then 49 | ac_executable_p="test -x" 50 | else 51 | ac_executable_p="test -f" 52 | fi 53 | rm -f conf$$.file 54 | 55 | # Extract the first word of "$2", so it can be a program name with args. 56 | set dummy $2; ac_word=[$]2 57 | AC_MSG_CHECKING([for $ac_word]) 58 | AC_CACHE_VAL(ac_cv_path_$1, 59 | [case "[$]$1" in 60 | [[\\/]]* | ?:[[\\/]]*) 61 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 62 | ;; 63 | *) 64 | ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR 65 | for ac_dir in ifelse([$5], , $PATH, [$5]); do 66 | IFS="$ac_save_IFS" 67 | test -z "$ac_dir" && ac_dir=. 68 | for ac_exec_ext in '' $ac_executable_extensions; do 69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then 70 | echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD 71 | if [$3]; then 72 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" 73 | break 2 74 | fi 75 | fi 76 | done 77 | done 78 | IFS="$ac_save_IFS" 79 | dnl If no 4th arg is given, leave the cache variable unset, 80 | dnl so AC_PATH_PROGS will keep looking. 81 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" 82 | ])dnl 83 | ;; 84 | esac])dnl 85 | $1="$ac_cv_path_$1" 86 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then 87 | AC_MSG_RESULT([$]$1) 88 | else 89 | AC_MSG_RESULT(no) 90 | fi 91 | AC_SUBST($1)dnl 92 | ]) 93 | -------------------------------------------------------------------------------- /m4/signed.m4: -------------------------------------------------------------------------------- 1 | # signed.m4 serial 1 (gettext-0.10.40) 2 | dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([bh_C_SIGNED], 10 | [ 11 | AC_CACHE_CHECK([for signed], bh_cv_c_signed, 12 | [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) 13 | if test $bh_cv_c_signed = no; then 14 | AC_DEFINE(signed, , 15 | [Define to empty if the C compiler doesn't support this keyword.]) 16 | fi 17 | ]) 18 | -------------------------------------------------------------------------------- /m4/size_max.m4: -------------------------------------------------------------------------------- 1 | # size_max.m4 serial 2 2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([gl_SIZE_MAX], 10 | [ 11 | AC_CHECK_HEADERS(stdint.h) 12 | dnl First test whether the system already has SIZE_MAX. 13 | AC_MSG_CHECKING([for SIZE_MAX]) 14 | result= 15 | AC_EGREP_CPP([Found it], [ 16 | #include 17 | #if HAVE_STDINT_H 18 | #include 19 | #endif 20 | #ifdef SIZE_MAX 21 | Found it 22 | #endif 23 | ], result=yes) 24 | if test -z "$result"; then 25 | dnl Define it ourselves. Here we assume that the type 'size_t' is not wider 26 | dnl than the type 'unsigned long'. 27 | dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', 28 | dnl which is guaranteed to work from LONG_MIN to LONG_MAX. 29 | _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, 30 | [#include ], result=?) 31 | _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, 32 | [#include ], result=?) 33 | _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, 34 | [#include ], result=?) 35 | if test "$fits_in_uint" = 1; then 36 | dnl Even though SIZE_MAX fits in an unsigned int, it must be of type 37 | dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. 38 | AC_TRY_COMPILE([#include 39 | extern size_t foo; 40 | extern unsigned long foo; 41 | ], [], fits_in_uint=0) 42 | fi 43 | if test -z "$result"; then 44 | if test "$fits_in_uint" = 1; then 45 | result="$res_hi$res_lo"U 46 | else 47 | result="$res_hi$res_lo"UL 48 | fi 49 | else 50 | dnl Shouldn't happen, but who knows... 51 | result='~(size_t)0' 52 | fi 53 | fi 54 | AC_MSG_RESULT([$result]) 55 | if test "$result" != yes; then 56 | AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], 57 | [Define as the maximum value of type 'size_t', if the system doesn't define it.]) 58 | fi 59 | ]) 60 | -------------------------------------------------------------------------------- /m4/stdint_h.m4: -------------------------------------------------------------------------------- 1 | # stdint_h.m4 serial 5 2 | dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_STDINT_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_STDINT_H], 13 | [ 14 | AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1;], 19 | gl_cv_header_stdint_h=yes, 20 | gl_cv_header_stdint_h=no)]) 21 | if test $gl_cv_header_stdint_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /m4/uintmax_t.m4: -------------------------------------------------------------------------------- 1 | # uintmax_t.m4 serial 9 2 | dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | AC_PREREQ(2.13) 10 | 11 | # Define uintmax_t to 'unsigned long' or 'unsigned long long' 12 | # if it is not already defined in or . 13 | 14 | AC_DEFUN([gl_AC_TYPE_UINTMAX_T], 15 | [ 16 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 17 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 18 | if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then 19 | AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) 20 | test $ac_cv_type_unsigned_long_long = yes \ 21 | && ac_type='unsigned long long' \ 22 | || ac_type='unsigned long' 23 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, 24 | [Define to unsigned long or unsigned long long 25 | if and don't define.]) 26 | else 27 | AC_DEFINE(HAVE_UINTMAX_T, 1, 28 | [Define if you have the 'uintmax_t' type in or .]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /m4/ulonglong.m4: -------------------------------------------------------------------------------- 1 | # ulonglong.m4 serial 4 2 | dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. 10 | 11 | AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], 12 | [ 13 | AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, 14 | [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], 15 | [unsigned long long ullmax = (unsigned long long) -1; 16 | return ull << i | ull >> i | ullmax / ull | ullmax % ull;], 17 | ac_cv_type_unsigned_long_long=yes, 18 | ac_cv_type_unsigned_long_long=no)]) 19 | if test $ac_cv_type_unsigned_long_long = yes; then 20 | AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, 21 | [Define if you have the 'unsigned long long' type.]) 22 | fi 23 | ]) 24 | -------------------------------------------------------------------------------- /m4/wchar_t.m4: -------------------------------------------------------------------------------- 1 | # wchar_t.m4 serial 1 (gettext-0.12) 2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wchar_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WCHAR_T], 12 | [ 13 | AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, 14 | [AC_TRY_COMPILE([#include 15 | wchar_t foo = (wchar_t)'\0';], , 16 | gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) 17 | if test $gt_cv_c_wchar_t = yes; then 18 | AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) 19 | fi 20 | ]) 21 | -------------------------------------------------------------------------------- /m4/wint_t.m4: -------------------------------------------------------------------------------- 1 | # wint_t.m4 serial 1 (gettext-0.12) 2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wint_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WINT_T], 12 | [ 13 | AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, 14 | [AC_TRY_COMPILE([#include 15 | wint_t foo = (wchar_t)'\0';], , 16 | gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) 17 | if test $gt_cv_c_wint_t = yes; then 18 | AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) 19 | fi 20 | ]) 21 | -------------------------------------------------------------------------------- /m4/xsize.m4: -------------------------------------------------------------------------------- 1 | # xsize.m4 serial 3 2 | dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | AC_DEFUN([gl_XSIZE], 8 | [ 9 | dnl Prerequisites of lib/xsize.h. 10 | AC_REQUIRE([gl_SIZE_MAX]) 11 | AC_REQUIRE([AC_C_INLINE]) 12 | AC_CHECK_HEADERS(stdint.h) 13 | ]) 14 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # Set of available languages. 2 | ar ca cs de el es eu fr gl hu he it ja nl pl pt_BR pt ru sv vi zh_CN zh_TW 3 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Emma'\''s Software 22 | 23 | # This is the email address or URL to which the translators shall report 24 | # bugs in the untranslated strings: 25 | # - Strings which are not entire sentences, see the maintainer guidelines 26 | # in the GNU gettext documentation, section 'Preparing Strings'. 27 | # - Strings which use unclear terms or require additional context to be 28 | # understood. 29 | # - Strings which make invalid assumptions about notation of date, time or 30 | # money. 31 | # - Pluralisation problems. 32 | # - Incorrect English spelling. 33 | # - Incorrect formatting. 34 | # It can be your email address, or a mailing list address where translators 35 | # can write to without being subscribed, or the URL of a web page through 36 | # which the translators can contact you. 37 | MSGID_BUGS_ADDRESS = jordi@emma-soft.com 38 | 39 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 40 | # message catalogs shall be used. It is usually empty. 41 | EXTRA_LOCALE_CATEGORIES = 42 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files which contain translatable strings. 2 | 3 | src/FindPter.cxx 4 | src/IDocument.cxx 5 | src/main.cxx 6 | src/MainPter.cxx 7 | src/PagePter.cxx 8 | src/PrintPter.cxx 9 | src/PDFDocument.cxx 10 | # GTK+ Shell 11 | src/gtk/FindView.cxx 12 | src/gtk/MainView.cxx 13 | src/gtk/PreferencesView.cxx 14 | src/gtk/PrintView.cxx 15 | src/gtk/StockIcons.cxx 16 | -------------------------------------------------------------------------------- /po/Rules-quot: -------------------------------------------------------------------------------- 1 | # Special Makefile rules for English message catalogs with quotation marks. 2 | 3 | DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot 4 | 5 | .SUFFIXES: .insert-header .po-update-en 6 | 7 | en@quot.po-create: 8 | $(MAKE) en@quot.po-update 9 | en@boldquot.po-create: 10 | $(MAKE) en@boldquot.po-update 11 | 12 | en@quot.po-update: en@quot.po-update-en 13 | en@boldquot.po-update: en@boldquot.po-update-en 14 | 15 | .insert-header.po-update-en: 16 | @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ 17 | if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ 18 | tmpdir=`pwd`; \ 19 | echo "$$lang:"; \ 20 | ll=`echo $$lang | sed -e 's/@.*//'`; \ 21 | LC_ALL=C; export LC_ALL; \ 22 | cd $(srcdir); \ 23 | if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ 24 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 25 | rm -f $$tmpdir/$$lang.new.po; \ 26 | else \ 27 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 28 | :; \ 29 | else \ 30 | echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 31 | exit 1; \ 32 | fi; \ 33 | fi; \ 34 | else \ 35 | echo "creation of $$lang.po failed!" 1>&2; \ 36 | rm -f $$tmpdir/$$lang.new.po; \ 37 | fi 38 | 39 | en@quot.insert-header: insert-header.sin 40 | sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header 41 | 42 | en@boldquot.insert-header: insert-header.sin 43 | sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header 44 | 45 | mostlyclean: mostlyclean-quot 46 | mostlyclean-quot: 47 | rm -f *.insert-header 48 | -------------------------------------------------------------------------------- /po/ar.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/ar.gmo -------------------------------------------------------------------------------- /po/boldquot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | s/“/“/g 8 | s/”/”/g 9 | s/‘/‘/g 10 | s/’/’/g 11 | -------------------------------------------------------------------------------- /po/ca.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/ca.gmo -------------------------------------------------------------------------------- /po/cs.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/cs.gmo -------------------------------------------------------------------------------- /po/de.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/de.gmo -------------------------------------------------------------------------------- /po/el.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/el.gmo -------------------------------------------------------------------------------- /po/en@boldquot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | # This catalog furthermore displays the text between the quotation marks in 24 | # bold face, assuming the VT100/XTerm escape sequences. 25 | # 26 | -------------------------------------------------------------------------------- /po/en@quot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | -------------------------------------------------------------------------------- /po/es.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/es.gmo -------------------------------------------------------------------------------- /po/eu.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/eu.gmo -------------------------------------------------------------------------------- /po/fr.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/fr.gmo -------------------------------------------------------------------------------- /po/gl.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/gl.gmo -------------------------------------------------------------------------------- /po/he.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/he.gmo -------------------------------------------------------------------------------- /po/hu.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/hu.gmo -------------------------------------------------------------------------------- /po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # At each occurrence of a line starting with "msgid ", we execute the following 4 | # commands. At the first occurrence, insert the file. At the following 5 | # occurrences, do nothing. The distinction between the first and the following 6 | # occurrences is achieved by looking at the hold space. 7 | /^msgid /{ 8 | x 9 | # Test if the hold space is empty. 10 | s/m/m/ 11 | ta 12 | # Yes it was empty. First occurrence. Read the file. 13 | r HEADER 14 | # Output the file's contents by reading the next line. But don't lose the 15 | # current line while doing this. 16 | g 17 | N 18 | bb 19 | :a 20 | # The hold space was nonempty. Following occurrences. Do nothing. 21 | x 22 | :b 23 | } 24 | -------------------------------------------------------------------------------- /po/it.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/it.gmo -------------------------------------------------------------------------------- /po/ja.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/ja.gmo -------------------------------------------------------------------------------- /po/nl.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/nl.gmo -------------------------------------------------------------------------------- /po/pl.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/pl.gmo -------------------------------------------------------------------------------- /po/pt.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/pt.gmo -------------------------------------------------------------------------------- /po/pt_BR.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/pt_BR.gmo -------------------------------------------------------------------------------- /po/quot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | -------------------------------------------------------------------------------- /po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that remove the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # The distinction between the first and the following occurrences of the 5 | # pattern is achieved by looking at the hold space. 6 | /^"POT-Creation-Date: .*"$/{ 7 | x 8 | # Test if the hold space is empty. 9 | s/P/P/ 10 | ta 11 | # Yes it was empty. First occurrence. Remove the line. 12 | g 13 | d 14 | bb 15 | :a 16 | # The hold space was nonempty. Following occurrences. Do nothing. 17 | x 18 | :b 19 | } 20 | -------------------------------------------------------------------------------- /po/ru.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/ru.gmo -------------------------------------------------------------------------------- /po/stamp-po: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /po/sv.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/sv.gmo -------------------------------------------------------------------------------- /po/vi.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/vi.gmo -------------------------------------------------------------------------------- /po/zh_CN.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/zh_CN.gmo -------------------------------------------------------------------------------- /po/zh_TW.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/po/zh_TW.gmo -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | 2 | name: epdfview-git # you probably want to 'snapcraft register ' 3 | version: '0.1.8.r43-1' # just for humans, typically '1.2+git' or '1.3.2' 4 | summary: Single-line elevator pitch for your amazing snap # 79 char long summary 5 | description: 6 | Lightweight PDF document viewer. 7 | 8 | grade: devel # must be 'stable' to release into candidate/stable channels 9 | confinement: devmode # use 'strict' once you have the right plugs and slots 10 | 11 | parts: 12 | my-part: 13 | # See 'snapcraft plugins' 14 | plugin: nil 15 | 16 | options: 17 | source: 18 | required: true 19 | 20 | -------------------------------------------------------------------------------- /src/DocumentLinkGoto.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "epdfview.h" 20 | 21 | using namespace ePDFView; 22 | 23 | /// 24 | /// @brief Construct a new DocumentLinkGoto object. 25 | /// 26 | /// @param x1 The X coordinate of the link's top-left corner. 27 | /// @param y1 The Y coordinate of the link's top-left corner. 28 | /// @param x2 The X coordinate of the link's bottom-right corner. 29 | /// @param y2 The Y coordinate of the link's bottom-right corner. 30 | /// @param destinationPage The page number the links points to. 31 | /// 32 | DocumentLinkGoto::DocumentLinkGoto (gdouble x1, gdouble y1, gdouble x2, 33 | gdouble y2, gint destinationPage): 34 | IDocumentLink (x1, y1, x2, y2) 35 | { 36 | m_DestinationPage = destinationPage; 37 | } 38 | 39 | /// 40 | /// @brief Destroys all dynamically allocated memory by DocumentLinkGoto. 41 | /// 42 | DocumentLinkGoto::~DocumentLinkGoto () 43 | { 44 | } 45 | 46 | /// 47 | /// @brief Activates the link. 48 | /// 49 | /// @param document The document where the link was activated from. 50 | /// 51 | void 52 | DocumentLinkGoto::activate (IDocument *document) 53 | { 54 | document->goToPage (m_DestinationPage); 55 | } 56 | -------------------------------------------------------------------------------- /src/DocumentLinkGoto.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DOCUMENT_LINK_GOTO_H__) 19 | #define __DOCUMENT_LINK_GOTO_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class DocumentLinkGoto: public IDocumentLink 24 | { 25 | public: 26 | DocumentLinkGoto (gdouble x1, gdouble y1, gdouble x2, gdouble y2, 27 | gint destinationPage); 28 | virtual ~DocumentLinkGoto (void); 29 | 30 | virtual void activate (IDocument *document); 31 | 32 | protected: 33 | /// The number of the link's destination page. 34 | gint m_DestinationPage; 35 | }; 36 | } 37 | 38 | #endif // !__DOCUMENT_LINK_GOTO_H__ 39 | -------------------------------------------------------------------------------- /src/DocumentLinkUri.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "epdfview.h" 20 | 21 | using namespace ePDFView; 22 | 23 | /// 24 | /// @brief Construct a new DocumentLinkUri object. 25 | /// 26 | /// @param x1 The X coordinate of the link's top-left corner. 27 | /// @param y1 The Y coordinate of the link's top-left corner. 28 | /// @param x2 The X coordinate of the link's bottom-right corner. 29 | /// @param y2 The Y coordinate of the link's bottom-right corner. 30 | /// @param uri The URI the links points to. 31 | /// 32 | DocumentLinkUri::DocumentLinkUri (gdouble x1, gdouble y1, 33 | gdouble x2, gdouble y2, const gchar *uri): 34 | IDocumentLink (x1, y1, x2, y2) 35 | { 36 | g_assert (NULL != uri && "The URI for the link is NULL."); 37 | 38 | m_Uri = g_strdup (uri); 39 | } 40 | 41 | /// 42 | /// @brief Destroys all dynamically allocated memory by DocumentLinkUri. 43 | /// 44 | DocumentLinkUri::~DocumentLinkUri () 45 | { 46 | g_free (m_Uri); 47 | } 48 | 49 | /// 50 | /// @brief Activates the link. 51 | /// 52 | /// @param document The document where the link was activated from. 53 | /// 54 | void 55 | DocumentLinkUri::activate (IDocument *document) 56 | { 57 | // Create the command line to execute the external browser. 58 | gchar *userCommandLine = 59 | Config::getConfig ().getExternalBrowserCommandLine (); 60 | gchar *commandLine = g_strdup_printf (userCommandLine, m_Uri); 61 | g_free (userCommandLine); 62 | // Call the browser. 63 | GError *error = NULL; 64 | if ( !g_spawn_command_line_async (commandLine, &error) ) 65 | { 66 | g_error_free (error); 67 | } 68 | g_free (commandLine); 69 | } 70 | -------------------------------------------------------------------------------- /src/DocumentLinkUri.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DOCUMENT_LINK_URI_H__) 19 | #define __DOCUMENT_LINK_URI_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class DocumentLinkUri: public IDocumentLink 24 | { 25 | public: 26 | DocumentLinkUri (gdouble x1, gdouble y1, gdouble x2, gdouble y2, 27 | const gchar *uri); 28 | virtual ~DocumentLinkUri (void); 29 | 30 | virtual void activate (IDocument *document); 31 | 32 | protected: 33 | /// The URI to go when the link is activated. 34 | gchar *m_Uri; 35 | }; 36 | } 37 | 38 | #endif // !__DOCUMENT_LINK_URI_H__ 39 | -------------------------------------------------------------------------------- /src/DocumentOutline.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DOCUMENT_OUTLINE_H__) 19 | #define __DOCUMENT_OUTLINE_H__ 20 | 21 | namespace ePDFView 22 | { 23 | /// 24 | /// @class DocumentOutline 25 | /// @brief Stores the document's outline title, page num. and its children. 26 | /// 27 | /// Some documents have an index with them. This index can be used to 28 | /// help the user navigate through the document, similar to a table of 29 | /// contents. 30 | /// 31 | /// Each node contains a title, a destination page an possibly children 32 | /// nodes. The only node that have an empty name and a 0 page number is the 33 | /// top level DocumentOutline, that is only used as a container for all 34 | /// other DocumentOutline objects. 35 | /// 36 | class DocumentOutline 37 | { 38 | public: 39 | DocumentOutline (void); 40 | ~DocumentOutline (void); 41 | 42 | void addChild (DocumentOutline *child); 43 | gint getDestinationPage (void); 44 | DocumentOutline *getFirstChild (void); 45 | DocumentOutline *getNextChild (void); 46 | gint getNumChildren (void); 47 | const gchar *getTitle (void); 48 | void setParent (DocumentOutline *parent); 49 | void setTitle (const gchar *title); 50 | void setDestination (gint destination); 51 | 52 | protected: 53 | /// The list of this outline's children. 54 | GList *m_Children; 55 | /// The page number this outline points to. 56 | gint m_Destination; 57 | /// @brief This is used to know which child to return when calling 58 | /// the DocumentOutline::getNextChild() function. 59 | GList *m_LastReturnedChild; 60 | /// The outline's parent outline. 61 | DocumentOutline *m_Parent; 62 | /// The outline's name or title. 63 | gchar *m_Title; 64 | }; 65 | } 66 | 67 | #endif // !__DOCUMENT_OUTLINE_H__ 68 | -------------------------------------------------------------------------------- /src/DocumentPage.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DOCUMENT_PAGE_H__) 19 | #define __DOCUMENT_PAGE_H__ 20 | 21 | typedef struct _GdkRegion GdkRegion; 22 | 23 | namespace ePDFView 24 | { 25 | /// 26 | /// @class DocumentPage 27 | /// @brief A single document's page. 28 | /// 29 | /// Contains the rendered image of a single document's page. 30 | /// 31 | class DocumentPage 32 | { 33 | public: 34 | DocumentPage (void); 35 | ~DocumentPage (void); 36 | 37 | void addLink (IDocumentLink *link); 38 | void clearSelection (void); 39 | guchar *getData (void); 40 | gint getHeight (void); 41 | IDocumentLink *getLinkAtPosition (gint x, gint y); 42 | gint getRowStride (void); 43 | gint getWidth (void); 44 | gboolean hasAlpha (void); 45 | gboolean newPage (gint width, gint height); 46 | void setSelection (DocumentRectangle &selection, gdouble scale); 47 | void setSelection (GdkRegion *region); 48 | 49 | protected: 50 | /// The page's image. 51 | guchar *m_Data; 52 | /// Tells if the page has a text selection. 53 | gboolean m_HasSelection; 54 | /// The page's height. 55 | gint m_Height; 56 | /// The selection top-left X coordinate. 57 | gint m_SelectionX1; 58 | /// The selection bottom-right X coordinate. 59 | gint m_SelectionX2; 60 | /// The selection top-left Y coordinate. 61 | gint m_SelectionY1; 62 | /// The selection bottom-right Y coordinate. 63 | gint m_SelectionY2; 64 | /// The page's width. 65 | gint m_Width; 66 | /// The list of links from the page. 67 | GList *m_LinkList; 68 | /// Selection region 69 | GdkRegion *m_Selection; 70 | 71 | void invertRegion (GdkRegion*); 72 | void invertArea (gint x1, gint y1, gint x2, gint y2); 73 | }; 74 | } 75 | 76 | #endif // !__DOCUMENT_PAGE_H__ 77 | -------------------------------------------------------------------------------- /src/DocumentRectangle.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include "epdfview.h" 19 | 20 | using namespace ePDFView; 21 | 22 | /// 23 | /// @brief Constructs a new rectangle. 24 | /// 25 | /// @param x1 The X coordinate of the rectangle's top-left corner. 26 | /// @param y1 The Y coordinate of the rectangle's top-left corner. 27 | /// @param x2 The X coordinate of the rectangle's bottom-right corner. 28 | /// @param y2 The Y coordinate of the rectangle's bottom-right corner. 29 | /// 30 | DocumentRectangle::DocumentRectangle (gdouble x1, gdouble y1, 31 | gdouble x2, gdouble y2) 32 | { 33 | m_X1 = x1; 34 | m_X2 = x2; 35 | m_Y1 = y1; 36 | m_Y2 = y2; 37 | } 38 | 39 | /// 40 | /// @brief Constructs a new rectangle as a copy of another rectangle. 41 | /// 42 | /// @param original The original rectangle to copy. 43 | /// 44 | DocumentRectangle::DocumentRectangle (DocumentRectangle &original) 45 | { 46 | m_X1 = original.getX1 (); 47 | m_X2 = original.getX2 (); 48 | m_Y1 = original.getY1 (); 49 | m_Y2 = original.getY2 (); 50 | } 51 | 52 | /// 53 | /// @brief Destroys all dynamically allocated memory for DocumentRectangle. 54 | /// 55 | DocumentRectangle::~DocumentRectangle () 56 | { 57 | } 58 | 59 | /// 60 | /// @brief Gets the top-left corner X coordinates. 61 | /// 62 | /// @return The X coordinates of the rectangle's top-left corner. 63 | /// 64 | gdouble 65 | DocumentRectangle::getX1 () 66 | { 67 | return m_X1; 68 | } 69 | 70 | /// 71 | /// @brief Gets the bottom-right corner X coordinates. 72 | /// 73 | /// @return The X coordinates of the rectangle's bottom-right corner. 74 | /// 75 | gdouble 76 | DocumentRectangle::getX2 () 77 | { 78 | return m_X2; 79 | } 80 | 81 | /// 82 | /// @brief Gets the top-left corner Y coordinates. 83 | /// 84 | /// @return The Y coordinates of the rectangle's top-left corner. 85 | /// 86 | gdouble 87 | DocumentRectangle::getY1 () 88 | { 89 | return m_Y1; 90 | } 91 | 92 | /// 93 | /// @brief Gets the right-bottom corner Y coordinates. 94 | /// 95 | /// @return The Y coordinates of the rectangle's bottom-right corner. 96 | /// 97 | gdouble 98 | DocumentRectangle::getY2 () 99 | { 100 | return m_Y2; 101 | } 102 | -------------------------------------------------------------------------------- /src/DocumentRectangle.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DOCUMENT_RECTANGLE_H__) 19 | #define __DOCUMENT_RECTANGLE_H__ 20 | 21 | namespace ePDFView 22 | { 23 | /// 24 | /// @class DocumentRectangle. 25 | /// @brief A rectangle on a page. 26 | /// 27 | /// This class is just to hold the coordinates of a rectangle on a document. 28 | /// It is used as a way to know where are the document's link or the 29 | /// text that has been searched. 30 | /// 31 | class DocumentRectangle 32 | { 33 | public: 34 | DocumentRectangle (gdouble x1, gdouble y1, gdouble x2, gdouble y2); 35 | DocumentRectangle (DocumentRectangle &original); 36 | ~DocumentRectangle (void); 37 | 38 | gdouble getX1 (void); 39 | gdouble getX2 (void); 40 | gdouble getY1 (void); 41 | gdouble getY2 (void); 42 | 43 | protected: 44 | /// The X coordinate of the link's top-left corner. 45 | gdouble m_X1; 46 | /// The X coordinate of the link's bottom-right corner. 47 | gdouble m_X2; 48 | /// The Y coordinate of the link's top-left corner. 49 | gdouble m_Y1; 50 | /// The Y coordinate of the link's bottom-right corner. 51 | gdouble m_Y2; 52 | 53 | }; 54 | } 55 | 56 | #endif // !__DOCUMENT_RECTANGLE_H__ 57 | -------------------------------------------------------------------------------- /src/FindPter.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__FIND_PTER_H__) 19 | #define __FIND_PTER_H__ 20 | 21 | namespace ePDFView 22 | { 23 | // Forward declarations. 24 | class JobFind; 25 | 26 | /// 27 | /// @class FindPter 28 | /// @brief Find bar presenter. 29 | /// 30 | /// This presenter is the controlling class of the find bar and 31 | /// the find next / previous functionality. 32 | /// 33 | class FindPter 34 | { 35 | public: 36 | FindPter (IDocument *document); 37 | ~FindPter (void); 38 | 39 | void closeActivated (void); 40 | void findNextActivated (void); 41 | void findPreviousActivated (void); 42 | IFindView &getView (void); 43 | void notifyFindFinished (gboolean endOfSearch); 44 | void notifyFindResults (gint pageNum, GList *results, 45 | FindDirection direction); 46 | void setView (IFindView *view); 47 | void textToFindChanged (void); 48 | 49 | protected: 50 | /// The current selected match from m_FindResults. 51 | GList *m_CurrentMatch; 52 | /// The document to search to. 53 | IDocument *m_Document; 54 | /// The current page that we found something. 55 | gint m_FindPage; 56 | /// The results on m_FindPage. 57 | GList *m_FindResults; 58 | /// The current find job. 59 | JobFind *m_Job; 60 | /// The view that the presenter is controlling. 61 | IFindView *m_View; 62 | 63 | void cancelJob (void); 64 | void freeFindResults (void); 65 | }; 66 | } 67 | 68 | #endif // !__FIND_PTER_H__ 69 | -------------------------------------------------------------------------------- /src/IDocumentLink.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "epdfview.h" 20 | 21 | using namespace ePDFView; 22 | 23 | /// 24 | /// @brief Construct a new IDocumentLink object. 25 | /// 26 | /// @param x1 The X coordinate of the link's top-left corner. 27 | /// @param y1 The Y coordinate of the link's top-left corner. 28 | /// @param x2 The X coordinate of the link's bottom-right corner. 29 | /// @param y2 The Y coordinate of the link's bottom-right corner. 30 | /// 31 | IDocumentLink::IDocumentLink (gdouble x1, gdouble y1, gdouble x2, gdouble y2) 32 | { 33 | m_Rect = new DocumentRectangle (x1, y1, x2, y2); 34 | } 35 | 36 | /// 37 | /// @brief Destroys all dynamically allocated memory by IDocumentLink. 38 | /// 39 | IDocumentLink::~IDocumentLink () 40 | { 41 | delete m_Rect; 42 | } 43 | 44 | /// @brief Checks if a position is over the link. 45 | /// 46 | /// This function just check that the given position (x, y) is either 47 | /// inside the link's rectangle (i.e., is over the link) or not. 48 | /// 49 | /// @param x The X coordinate of the position to check. 50 | /// @param y The Y coordinate of the position to check. 51 | /// 52 | /// @return TRUE if the position is over the link. FALSE otherwise. 53 | /// 54 | gboolean 55 | IDocumentLink::positionIsOver (gint x, gint y) 56 | { 57 | return ( (gint)m_Rect->getX1 () <= x && (gint)m_Rect->getY1 () <= y && 58 | (gint)m_Rect->getX2 () >= x && (gint)m_Rect->getY2 () >= y ); 59 | } 60 | -------------------------------------------------------------------------------- /src/IDocumentLink.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__IDOCUMENT_LINK_H__) 19 | #define __IDOCUMENT_LINK_H__ 20 | 21 | namespace ePDFView 22 | { 23 | // Forward declarations. 24 | class IDocument; 25 | 26 | /// 27 | /// @class IDocumentLink 28 | /// @brief A single link on a page. 29 | /// 30 | /// This class is used by ePDFView::DocumentPage to maintain a list 31 | /// of all links that a single page have. 32 | /// 33 | class IDocumentLink 34 | { 35 | public: 36 | IDocumentLink (gdouble x1, gdouble y1, gdouble x2, gdouble y2); 37 | virtual ~IDocumentLink (void); 38 | 39 | virtual void activate (IDocument *document) = 0; 40 | gboolean positionIsOver (gint x, gint y); 41 | 42 | protected: 43 | /// The link rectangle. 44 | DocumentRectangle *m_Rect; 45 | }; 46 | } 47 | 48 | #endif // !__IDOCUMENT_LINK_H__ 49 | -------------------------------------------------------------------------------- /src/IJob.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include "epdfview.h" 19 | #include 20 | #include 21 | 22 | using namespace ePDFView; 23 | 24 | /// The queue of jobs to run in background. 25 | GAsyncQueue *IJob::m_JobsQueue = NULL; 26 | 27 | /// 28 | /// @brief Clears the list of jobs. 29 | /// 30 | /// This is mainly used for the test suites when they are going 31 | /// to delete the document class and don't want to generate segmentation 32 | /// faults. It just pops all queued jobs without run them. 33 | /// 34 | void 35 | IJob::clearQueue (void) 36 | { 37 | IJob *job = NULL; 38 | do 39 | { 40 | job = (IJob *)g_async_queue_try_pop (m_JobsQueue); 41 | } 42 | while ( NULL != job ); 43 | } 44 | 45 | /// 46 | /// @brief The job dispatcher. 47 | /// 48 | /// This function is the one that will run in a thread. What it does is 49 | /// just pop queued jobs from the queue and then runs them. 50 | /// 51 | /// @param data The asynchronous queue where the jobs will be enqueued. 52 | /// 53 | gpointer 54 | IJob::dispatcher (gpointer data) 55 | { 56 | while (true) 57 | { 58 | IJob *job = (IJob *)g_async_queue_pop (m_JobsQueue); 59 | if ( job->run () ) 60 | { 61 | delete job; 62 | } 63 | } 64 | #ifdef _WIN32 65 | _sleep(0); 66 | #else 67 | sleep(0); 68 | #endif 69 | } 70 | 71 | /// 72 | /// @brief Initialises the job dispatcher. 73 | /// 74 | /// This function must be the first called before any other jobs-related 75 | /// function, as it does initialised the thread subsystem, created the 76 | /// threaded dispatcher() function and initialised the job queue. 77 | /// 78 | void 79 | IJob::init () 80 | { 81 | if ( !g_thread_supported () ) 82 | { 83 | g_thread_init (NULL); 84 | } 85 | m_JobsQueue = g_async_queue_new (); 86 | GError *error = NULL; 87 | if ( NULL == g_thread_create (IJob::dispatcher, NULL, FALSE, &error) ) 88 | { 89 | g_error ("Couldn't create the dispatcher thread: %s\n", error->message); 90 | } 91 | } 92 | 93 | /// 94 | /// @brief Adds a new job to the queue. 95 | /// 96 | /// It adds a new job to the queued jobs that will be dispatched by 97 | /// the dispatch() function. 98 | /// 99 | /// @param job The job to add to the queue. 100 | /// 101 | void 102 | IJob::enqueue (IJob *job) 103 | { 104 | g_assert ( NULL != job && "Tried to queue a NULL job."); 105 | 106 | g_async_queue_push (m_JobsQueue, (gpointer)job); 107 | } 108 | -------------------------------------------------------------------------------- /src/IJob.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__IJOB_H__) 19 | #define __IJOB_H__ 20 | 21 | #if defined DEBUG 22 | #define JOB_NOTIFIER(callback, data) callback (data) 23 | #define JOB_DELETE TRUE 24 | #define JOB_NOTIFIER_END() 25 | #else // !DEBUG 26 | #define JOB_NOTIFIER(callback, data) g_idle_add (callback, data) 27 | #define JOB_DELETE FALSE 28 | #define JOB_NOTIFIER_END() delete job 29 | #endif // !DEBUG 30 | 31 | namespace ePDFView 32 | { 33 | /// @class IJob 34 | /// @brief Interface for jobs. 35 | /// 36 | /// A Job is simply a process that will be processed in background 37 | /// by the dispatch() function. 38 | /// 39 | class IJob 40 | { 41 | public: 42 | /// @brief Destroys all dynamically allocated memory for IJob. 43 | virtual ~IJob (void) { } 44 | 45 | static void clearQueue (void); 46 | static gpointer dispatcher (gpointer data); 47 | static void init (void); 48 | static void enqueue (IJob *job); 49 | 50 | /// 51 | /// @brief Runs the job. 52 | /// 53 | /// This is called by the dispatcher() function when 54 | /// the job must start its work. It's the job's entry point. 55 | /// 56 | /// @return TRUE if the job must be deleted after the 57 | /// call to run(). FALSE if the job will be 58 | /// deleted by himself. 59 | /// 60 | virtual gboolean run (void) = 0; 61 | 62 | protected: 63 | static GAsyncQueue *m_JobsQueue; 64 | 65 | /// @brief Creates a new IJob object. 66 | IJob () { } 67 | }; 68 | } 69 | 70 | #endif // __IJOB_H__ 71 | -------------------------------------------------------------------------------- /src/IPreferencesView.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__IPREFERENCES_VIEW_H__) 19 | #define __IPREFERENCES_VIEW_H__ 20 | 21 | namespace ePDFView 22 | { 23 | // Forward declarations. 24 | class PreferencesPter; 25 | 26 | /// 27 | /// @class IPreferencesView 28 | /// @brief Interface for the preferences view. 29 | /// 30 | class IPreferencesView 31 | { 32 | public: 33 | /// 34 | /// @brief Destroys all allocated memory for IPreferencesView. 35 | /// 36 | virtual ~IPreferencesView (void) 37 | { 38 | } 39 | 40 | /// 41 | /// @brief Gets the view's presenter. 42 | /// 43 | /// @return The presenter that is controlling the view. 44 | /// 45 | PreferencesPter *getPresenter (void) 46 | { 47 | return m_Pter; 48 | } 49 | 50 | /// 51 | /// @brief Sets the view's presenter. 52 | /// 53 | /// After setting the presenter, the view can show the 54 | /// preferences dialog. 55 | /// 56 | /// @param pter The presenter that will control the view. 57 | /// 58 | virtual void setPresenter (PreferencesPter *pter) 59 | { 60 | m_Pter = pter; 61 | } 62 | 63 | virtual const gchar *getBrowserCommandLine (void) = 0; 64 | virtual const gchar *getBacksearchCommandLine (void) = 0; 65 | 66 | protected: 67 | /// The presenter that controls the view. 68 | PreferencesPter *m_Pter; 69 | 70 | /// 71 | /// @brief Constructs a new IPresenterView object. 72 | /// 73 | IPreferencesView (void) 74 | { 75 | m_Pter = NULL; 76 | } 77 | }; 78 | } 79 | 80 | #endif // !__IPREFERENCES_VIEW_H__ 81 | -------------------------------------------------------------------------------- /src/JobLoad.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__JOB_LOAD_H__) 19 | #define __JOB_LOAD_H__ 20 | 21 | namespace ePDFView 22 | { 23 | // Forward declarations. 24 | class IDocument; 25 | 26 | /// 27 | /// @class JobLoad 28 | /// @brief A background job that loads a file. 29 | /// 30 | /// This class is used to load and reload the PDF files. 31 | /// 32 | class JobLoad: public IJob 33 | { 34 | public: 35 | JobLoad (void); 36 | ~JobLoad (void); 37 | 38 | IDocument &getDocument (void); 39 | GError *getError (void); 40 | const gchar *getFileName (void); 41 | const gchar *getPassword (void); 42 | gboolean isReloading (void); 43 | gboolean run (void); 44 | void setDocument (IDocument *document); 45 | void setError (GError *error); 46 | void setFileName (const gchar *fileName); 47 | void setPassword (const gchar *password); 48 | void setReload (gboolean reload); 49 | 50 | protected: 51 | /// The document to notify when loaded or on error. 52 | IDocument *m_Document; 53 | /// The error produced when loading. 54 | GError *m_Error; 55 | /// The file name to load or reload. 56 | gchar *m_FileName; 57 | /// The password to use when loading the file. 58 | gchar *m_Password; 59 | /// Tells if we are reloading or loading from new. 60 | gboolean m_Reload; 61 | }; 62 | } 63 | 64 | #endif // __JOB_LOAD_H__ 65 | -------------------------------------------------------------------------------- /src/JobRender.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__JOB_RENDER_H__) 19 | #define __JOB_RENDER_H__ 20 | 21 | namespace ePDFView 22 | { 23 | /// 24 | /// @class JobRender 25 | /// @brief A background job that renders a page. 26 | /// 27 | /// This class is used to render a single page. Render means not only 28 | /// get the image but also the links on that page. 29 | /// 30 | class JobRender: public IJob 31 | { 32 | public: 33 | JobRender (); 34 | ~JobRender (); 35 | 36 | gboolean run (void); 37 | 38 | guint32 getAge (void); 39 | IDocument *getDocument (void); 40 | DocumentPage *getPageImage (void); 41 | gint getPageNumber (void); 42 | void setAge (guint32 age); 43 | void setDocument (IDocument *document); 44 | void setPageNumber (gint pageNumber); 45 | 46 | static gboolean m_CanProcessJobs; 47 | static void setMinAge (guint32 age); 48 | 49 | protected: 50 | /// The job's age. 51 | guint32 m_Age; 52 | /// The class to use to render the page. 53 | IDocument *m_Document; 54 | static guint32 m_MinAge; 55 | /// The page's rendered image. 56 | DocumentPage *m_PageImage; 57 | /// The page's number to render. 58 | gint m_PageNumber; 59 | 60 | }; 61 | } 62 | 63 | #endif // !__JOB_RENDER_H__ 64 | -------------------------------------------------------------------------------- /src/JobSave.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__JOB_SAVE_H__) 19 | #define __JOB_SAVE_H__ 20 | 21 | namespace ePDFView 22 | { 23 | // Forward declarations. 24 | class IDocument; 25 | 26 | /// 27 | /// @class JobSave 28 | /// @brief A background job that saves a document's copy to a file. 29 | /// 30 | /// This class is used to save copies of PDF files. 31 | /// 32 | class JobSave: public IJob 33 | { 34 | public: 35 | JobSave (void); 36 | ~JobSave (void); 37 | 38 | IDocument &getDocument (void); 39 | GError *getError (void); 40 | const gchar *getFileName (void); 41 | gboolean run (void); 42 | void setDocument (IDocument *document); 43 | void setError (GError *error); 44 | void setFileName (const gchar *fileName); 45 | 46 | protected: 47 | /// The document to notify when loaded or on error. 48 | IDocument *m_Document; 49 | /// The error produced when loading. 50 | GError *m_Error; 51 | /// The file name to load or reload. 52 | gchar *m_FileName; 53 | }; 54 | } 55 | 56 | #endif // __JOB_SAVE_H__ 57 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # Process this file with automake to produce a Makefile.in file. 2 | SUBDIRS = gtk 3 | 4 | noinst_LIBRARIES = libepdfview.a 5 | 6 | libepdfview_a_SOURCES = \ 7 | Config.cxx \ 8 | Config.h \ 9 | DocumentLinkGoto.cxx \ 10 | DocumentLinkGoto.h \ 11 | DocumentLinkUri.cxx \ 12 | DocumentLinkUri.h \ 13 | DocumentOutline.cxx \ 14 | DocumentOutline.h \ 15 | DocumentPage.h \ 16 | DocumentPage.cxx \ 17 | DocumentRectangle.cxx \ 18 | DocumentRectangle.h \ 19 | epdfview.h \ 20 | FindPter.cxx \ 21 | FindPter.h \ 22 | gettext.h \ 23 | IDocument.cxx \ 24 | IDocument.h \ 25 | IDocumentLink.cxx \ 26 | IDocumentLink.h \ 27 | IDocumentObserver.h \ 28 | IFindView.h \ 29 | IJob.cxx \ 30 | IJob.h \ 31 | IMainView.h \ 32 | IPageView.h \ 33 | IPreferencesView.h \ 34 | JobFind.cxx \ 35 | JobFind.h \ 36 | JobLoad.cxx \ 37 | JobLoad.h \ 38 | JobRender.cxx \ 39 | JobRender.h \ 40 | JobSave.cxx \ 41 | JobSave.h \ 42 | MainPter.cxx \ 43 | MainPter.h \ 44 | PagePter.cxx \ 45 | PagePter.h \ 46 | PDFDocument.cxx \ 47 | PDFDocument.h \ 48 | PreferencesPter.cxx \ 49 | PreferencesPter.h 50 | 51 | libepdfview_a_CXXFLAGS = \ 52 | $(GLIB_CFLAGS) \ 53 | $(POPPLER_CFLAGS) 54 | 55 | bin_PROGRAMS = epdfview 56 | 57 | epdfview_SOURCES = \ 58 | main.cxx 59 | 60 | libshell_cxxflags = -I$(top_srcdir)/src/gtk $(GTK2_CFLAGS) 61 | libshell_ldadd = $(top_builddir)/src/gtk/libshell-gtk.a $(GTK2_LIBS) 62 | 63 | epdfview_CXXFLAGS = \ 64 | -DLOCALEDIR='"$(datadir)/locale"' \ 65 | $(GLIB_CFLAGS) \ 66 | $(POPPLER_CFLAGS) \ 67 | $(libshell_cxxflags) 68 | 69 | epdfview_LDADD = \ 70 | libepdfview.a \ 71 | $(GLIB_LIBS) \ 72 | $(POPPLER_LIBS) \ 73 | $(libshell_ldadd) 74 | 75 | epdfview_LDFLAGS = 76 | 77 | if cups_printing 78 | libepdfview_a_SOURCES += \ 79 | IPrintView.h \ 80 | JobPrint.cxx \ 81 | JobPrint.h \ 82 | PrintPter.cxx \ 83 | PrintPter.h 84 | 85 | libepdfview_a_CXXFLAGS += \ 86 | $(CUPS_CFLAGS) 87 | 88 | epdfview_LDADD += \ 89 | $(CUPS_LIBS) 90 | endif 91 | 92 | if OS_WIN32 93 | epdfview_LDFLAGS += -mwindows 94 | endif 95 | 96 | -------------------------------------------------------------------------------- /src/PDFDocument.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PDF_DOCUMENT_H__) 19 | #define __PDF_DOCUMENT_H__ 20 | 21 | 22 | /// Forward declarations. 23 | typedef struct _PopplerDocument PopplerDocument; 24 | typedef struct _PopplerIndexIter PopplerIndexIter; 25 | typedef struct _PopplerLinkMapping PopplerLinkMapping; 26 | typedef struct _PopplerPage PopplerPage; 27 | typedef struct _PopplerPSFile PopplerPSFile; 28 | 29 | namespace ePDFView 30 | { 31 | /// 32 | /// @class PDFDocument 33 | /// @brief A PDF document. 34 | /// 35 | /// Derived class from IDocument that loads and renders PDF documents. 36 | /// 37 | class PDFDocument: public IDocument 38 | { 39 | public: 40 | PDFDocument (void); 41 | ~PDFDocument (void); 42 | 43 | IDocument *copy (void) const; 44 | GList *findTextInPage (gint pageNum, const gchar *textToFind); 45 | gboolean isLoaded (void); 46 | gboolean loadFile (const gchar *filename, const gchar *password, 47 | GError **error); 48 | void getPageSizeForPage (gint pageNum, gdouble *width, 49 | gdouble *height); 50 | void outputPostscriptBegin (const gchar *fileName, guint numOfPages, 51 | gfloat pageWidth, gfloat pageHeight); 52 | void outputPostscriptEnd (void); 53 | void outputPostscriptPage (guint pageNum); 54 | 55 | DocumentPage *renderPage (gint pageNum); 56 | gboolean saveFile (const gchar *fileName, GError **error); 57 | GdkRegion* getTextRegion (DocumentRectangle* rect); 58 | void setTextSelection (DocumentRectangle *rect); 59 | 60 | protected: 61 | /// The PDF document. 62 | PopplerDocument *m_Document; 63 | /// The output to PostScript. 64 | PopplerPSFile *m_PostScript; 65 | 66 | IDocumentLink *createDocumentLink (const PopplerLinkMapping *link, 67 | const gdouble pageHeight, 68 | const gdouble scale); 69 | void loadMetadata (void); 70 | void setOutline (DocumentOutline *outline, 71 | PopplerIndexIter *childrenList); 72 | void setLinks (DocumentPage *renderedPage, 73 | PopplerPage *popplerPage); 74 | }; 75 | } 76 | 77 | #endif // !__DOCUMENT_H__ 78 | -------------------------------------------------------------------------------- /src/PagePter.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PAGE_PTER_H__) 19 | #define __PAGE_PTER_H__ 20 | 21 | // Forward declarations. 22 | typedef struct _DragInfo DragInfo; 23 | 24 | namespace ePDFView 25 | { 26 | enum PagePterMode{ 27 | PagePterModeScroll, 28 | PagePterModeSelectText, 29 | }; 30 | 31 | /// 32 | /// @class PagePter. 33 | /// @brief The page presenter. 34 | /// 35 | /// This class is the presenter that drives the page view that 36 | /// shows the current document's page image. 37 | /// 38 | class PagePter: public IDocumentObserver 39 | { 40 | public: 41 | PagePter (IDocument *document); 42 | ~PagePter (); 43 | 44 | void getSize (gint *width, gint *height); 45 | IPageView &getView (void); 46 | void onCtrlButton (gint mouseButton, gint mouseState,gint x, gint y); 47 | void mouseButtonPressed (gint mouseButton, gint mouseState,gint x, gint y); 48 | void mouseButtonReleased (gint mouseButton); 49 | void mouseMoved (gint x, gint y); 50 | void notifyFindChanged (DocumentRectangle *matchRect); 51 | void notifyLoad (void); 52 | void notifyPageChanged (gint pageNum); 53 | void notifyPageRotated (gint rotation); 54 | void notifyPageZoomed (gdouble zoom); 55 | void notifyReload (void); 56 | void tryReShowPage (void); 57 | static gboolean pageNotAvailable (gpointer user); 58 | void scrollToNextPage (void); 59 | void scrollToPreviousPage (void); 60 | void setNextPageScroll (PageScroll next); 61 | void setView (IMainView &view); 62 | void viewResized (gint width, gint height); 63 | void setMode(PagePterMode mode); 64 | void setInvertColorToggle(char on);//krogan 65 | 66 | protected: 67 | /// The document whose page is shown. 68 | IDocument *m_Document; 69 | /// Information about dragging the page. 70 | DragInfo *m_DragInfo; 71 | /// How to scroll the next page to show. 72 | PageScroll m_NextPageScroll; 73 | /// The page view. 74 | IPageView *m_PageView; 75 | /// Last text selection 76 | GdkRegion *m_LastSelection; 77 | /// What page presenter must do when user move mouse with button pressed. 78 | PagePterMode m_ScrollMode; 79 | 80 | void refreshPage (PageScroll pageScroll, gboolean wasZoomed); 81 | }; 82 | } 83 | 84 | #endif // !__PAGE_PTER_H__ 85 | -------------------------------------------------------------------------------- /src/PreferencesPter.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "epdfview.h" 20 | 21 | using namespace ePDFView; 22 | 23 | PreferencesPter::PreferencesPter () 24 | { 25 | m_View = NULL; 26 | } 27 | 28 | PreferencesPter::~PreferencesPter () 29 | { 30 | delete m_View; 31 | } 32 | 33 | IPreferencesView & 34 | PreferencesPter::getView () 35 | { 36 | g_assert ( NULL != m_View && "The preferences' view is NULL."); 37 | 38 | return *m_View; 39 | } 40 | 41 | void 42 | PreferencesPter::setView (IPreferencesView *view) 43 | { 44 | m_View = view; 45 | getView ().setPresenter (this); 46 | } 47 | 48 | void 49 | PreferencesPter::browserCommandLineChanged () 50 | { 51 | const gchar *commandLine = getView ().getBrowserCommandLine (); 52 | Config::getConfig ().setExternalBrowserCommandLine (commandLine); 53 | } 54 | 55 | void 56 | PreferencesPter::backsearchCommandLineChanged () 57 | { 58 | const gchar *commandLine = getView ().getBacksearchCommandLine (); 59 | Config::getConfig ().setExternalBacksearchCommandLine (commandLine); 60 | } 61 | 62 | void 63 | PreferencesPter::closeActivated () 64 | { 65 | delete this; 66 | } 67 | -------------------------------------------------------------------------------- /src/PreferencesPter.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PREFERENCES_PTER_H__) 19 | #define __PREFERENCES_PTER_H__ 20 | 21 | namespace ePDFView 22 | { 23 | /// 24 | /// @class PreferencesPter 25 | /// @brief Preferences Presenter. 26 | /// 27 | class PreferencesPter 28 | { 29 | public: 30 | PreferencesPter (void); 31 | ~PreferencesPter (void); 32 | 33 | IPreferencesView &getView (void); 34 | void setView (IPreferencesView *view); 35 | 36 | void browserCommandLineChanged (void); 37 | void backsearchCommandLineChanged (void); 38 | void closeActivated (void); 39 | 40 | protected: 41 | IPreferencesView *m_View; 42 | }; 43 | } 44 | 45 | #endif // !__PREFERENCES_PTER_H__ 46 | -------------------------------------------------------------------------------- /src/PrintPter.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PRINT_PTER_H__) 19 | #define __PRINT_PTER_H__ 20 | 21 | // Forward declarations. 22 | typedef struct _printerAttributes printerAttributes; 23 | 24 | namespace ePDFView 25 | { 26 | /// 27 | /// @class PrintPter 28 | /// @brief Print Presenter. 29 | /// 30 | class PrintPter 31 | { 32 | public: 33 | PrintPter (IDocument *document); 34 | ~PrintPter (void); 35 | 36 | IPrintView &getView (void); 37 | void setView (IPrintView *view); 38 | 39 | void cancelActivated (void); 40 | void numberOfCopiesChanged (void); 41 | void pageRangeOptionChanged (void); 42 | void printActivated (void); 43 | void printerSelectionChanged (void); 44 | 45 | protected: 46 | IDocument *m_Document; 47 | IPrintView *m_View; 48 | 49 | void getPageSizeForPrinter (const gchar *printerName, 50 | const gchar *sizeName, 51 | float *pageWidth, float *pageHeight); 52 | printerAttributes *getPrinterAttributes (const gchar *printerName); 53 | void listPrinters (void); 54 | }; 55 | } 56 | 57 | #endif // !__PRINT_PTER_H__ 58 | -------------------------------------------------------------------------------- /src/epdfview.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__E_PDF_VIEW_H__) 19 | #define __E_PDF_VIEW_H__ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #if defined (HAVE_CUPS) 44 | #endif // HAVE_CUPS 45 | 46 | #include 47 | #include 48 | #include 49 | #if defined (HAVE_CUPS) 50 | #include 51 | #endif // HAVE_CUPS 52 | #include 53 | #include 54 | #include 55 | #include 56 | #if defined (HAVE_CUPS) 57 | #include 58 | #endif // HAVE_CUPS 59 | #include 60 | 61 | #endif //!__E_PDF_VIEW_H__ 62 | -------------------------------------------------------------------------------- /src/gtk/FindView.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__FIND_VIEW_H__) 19 | #define __FIND_VIEW_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class FindView: public IFindView 24 | { 25 | public: 26 | FindView (void); 27 | ~FindView (void); 28 | 29 | const gchar *getTextToFind (void); 30 | GtkWidget *getTopWidget (void); 31 | void hide (void); 32 | void sensitiveFindNext (gboolean sensitive); 33 | void sensitiveFindPrevious (gboolean sensitive); 34 | void setInformationText (const gchar *text); 35 | void setPresenter (FindPter *pter); 36 | 37 | protected: 38 | GtkToolItem *m_Close; 39 | GtkWidget *m_FindBar; 40 | GtkToolItem *m_FindNext; 41 | GtkToolItem *m_FindPrevious; 42 | GtkWidget *m_InformationText; 43 | GtkWidget *m_TextToFind; 44 | GtkAccelKey m_SlashAccelKey; 45 | }; 46 | } 47 | 48 | #endif // !__FIND_VIEW_H__ 49 | -------------------------------------------------------------------------------- /src/gtk/Makefile.am: -------------------------------------------------------------------------------- 1 | # Process this file with automake to produce a Makefile.in file. 2 | noinst_LIBRARIES = libshell-gtk.a 3 | libshell_gtk_a_SOURCES = \ 4 | FindView.cxx \ 5 | FindView.h \ 6 | MainView.cxx \ 7 | MainView.h \ 8 | PageView.cxx \ 9 | PageView.h \ 10 | PreferencesView.cxx \ 11 | PreferencesView.h \ 12 | StockIcons.cxx \ 13 | StockIcons.h 14 | 15 | libshell_gtk_a_CXXFLAGS = \ 16 | -DDATADIR='"$(pkgdatadir)"' \ 17 | -I$(top_srcdir)/src \ 18 | $(GTK2_CFLAGS) 19 | 20 | if cups_printing 21 | libshell_gtk_a_SOURCES += \ 22 | PrintView.cxx \ 23 | PrintView.h 24 | endif 25 | -------------------------------------------------------------------------------- /src/gtk/PageView.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PAGE_VIEW_H__) 19 | #define __PAGE_VIEW_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class PageView: public IPageView 24 | { 25 | public: 26 | PageView (void); 27 | ~PageView (void); 28 | 29 | gdouble getHorizontalScroll (void); 30 | GtkWidget *getTopWidget (void); 31 | void getPagePosition (gint widgetX, gint widgetY, 32 | gint *pageX, gint *pageY); 33 | void getSize (gint *width, gint *height); 34 | gdouble getVerticalScroll (void); 35 | void makeRectangleVisible (DocumentRectangle &rect, gdouble scale); 36 | void resizePage (gint width, gint height); 37 | void scrollPage (gdouble scrollX, gdouble scrollY, 38 | gint dx, gint dy); 39 | void setCursor (PageCursor cursorType); 40 | void setPresenter (PagePter *pter); 41 | 42 | void showPage (DocumentPage *page, PageScroll scroll); 43 | void tryReShowPage (void); 44 | 45 | void showText (const gchar *text); 46 | 47 | void setInvertColorToggle(char on); // krogan edit 48 | 49 | protected: 50 | DocumentPage *lastPageShown; 51 | PageScroll lastScroll; 52 | char hasShownAPage; 53 | 54 | PageCursor m_CurrentCursor; 55 | GtkWidget *m_EventBox; 56 | GtkWidget *m_PageImage; 57 | GtkWidget *m_PageScroll; 58 | 59 | GdkPixbuf *getPixbufFromPage (DocumentPage *page); 60 | 61 | char invertColorToggle; // krogan edit 62 | }; 63 | } 64 | 65 | #endif // !__PAGE_VIEW_H__ 66 | -------------------------------------------------------------------------------- /src/gtk/PreferencesView.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PREFERENCES_VIEW_H__) 19 | #define __PREFERENCES_VIEW_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class PreferencesView: public IPreferencesView 24 | { 25 | public: 26 | PreferencesView (GtkWindow *parent); 27 | virtual ~PreferencesView (void); 28 | 29 | virtual void setPresenter (PreferencesPter *pter); 30 | virtual const gchar *getBrowserCommandLine (void); 31 | virtual const gchar *getBacksearchCommandLine (void); 32 | 33 | protected: 34 | GtkWidget *m_PreferencesDialog; 35 | GtkWidget *m_BrowserCommandLine; 36 | GtkWidget *m_BacksearchCommandLine; 37 | 38 | GtkWidget *createExternalCommandsTab (void); 39 | }; 40 | } 41 | 42 | #endif // !__PREFERENCES_VIEW_H__ 43 | -------------------------------------------------------------------------------- /src/gtk/StockIcons.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include "StockIcons.h" 24 | 25 | static const struct 26 | { 27 | const char *iconName; 28 | const char *iconFile; 29 | } g_StockIcons[] = 30 | { 31 | { EPDFVIEW_STOCK_FIND_NEXT, "stock_find_next_24.png" }, 32 | { EPDFVIEW_STOCK_FIND_PREVIOUS, "stock_find_previous_24.png" }, 33 | { EPDFVIEW_STOCK_ROTATE_LEFT, "stock_rotate-270.png" }, 34 | { EPDFVIEW_STOCK_ROTATE_RIGHT, "stock_rotate-90.png" }, 35 | { EPDFVIEW_STOCK_ZOOM_WIDTH, "stock_zoom-page-width.png" } 36 | }; 37 | 38 | static GtkStockItem g_StockItems[] = 39 | { 40 | { EPDFVIEW_STOCK_FIND_NEXT, N_("Find _Next"), (GdkModifierType)0, 0, PACKAGE }, 41 | { EPDFVIEW_STOCK_FIND_PREVIOUS, N_("Find _Previous"), (GdkModifierType)0, 0, PACKAGE }, 42 | { EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), (GdkModifierType)0, 0, PACKAGE }, 43 | { EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), (GdkModifierType)0, 0, PACKAGE }, 44 | { EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), (GdkModifierType)0, 0, PACKAGE } 45 | }; 46 | 47 | void 48 | epdfview_stock_icons_init (void) 49 | { 50 | GtkIconFactory *factory = gtk_icon_factory_new (); 51 | gtk_icon_factory_add_default (factory); 52 | 53 | // Add the custom stock icons. 54 | int numIcons = G_N_ELEMENTS (g_StockIcons); 55 | for ( int iconIndex = 0 ; iconIndex < numIcons ; iconIndex++ ) 56 | { 57 | gchar *fileName = g_strdup_printf ("%s/pixmaps/%s", DATADIR, 58 | g_StockIcons[iconIndex].iconFile); 59 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (fileName, NULL); 60 | g_free (fileName); 61 | if ( NULL != pixbuf ) 62 | { 63 | GtkIconSet *iconSet = gtk_icon_set_new_from_pixbuf (pixbuf); 64 | gtk_icon_factory_add (factory, g_StockIcons[iconIndex].iconName, 65 | iconSet); 66 | gtk_icon_set_unref (iconSet); 67 | } 68 | } 69 | g_object_unref (G_OBJECT (factory)); 70 | 71 | gtk_stock_add_static (g_StockItems, G_N_ELEMENTS (g_StockItems)); 72 | } 73 | -------------------------------------------------------------------------------- /src/gtk/StockIcons.h: -------------------------------------------------------------------------------- 1 | // ePDFView - A lightweight PDF Viewer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__STOCK_ICONS_H__) 19 | #define __STOCK_ICONS_H__ 20 | 21 | #include 22 | 23 | G_BEGIN_DECLS 24 | 25 | // ePDFView stock icons. 26 | #define EPDFVIEW_STOCK_FIND_NEXT "epdfview_find-next" 27 | #define EPDFVIEW_STOCK_FIND_PREVIOUS "epdfview_find-previous" 28 | #define EPDFVIEW_STOCK_ROTATE_LEFT "epdfview_rotate-left" 29 | #define EPDFVIEW_STOCK_ROTATE_RIGHT "epdfview_rotate-right" 30 | #define EPDFVIEW_STOCK_ZOOM_WIDTH "epdfview_zoom-width" 31 | 32 | void epdfview_stock_icons_init (void); 33 | 34 | G_END_DECLS 35 | 36 | #endif // !__STOCK_ICONS_H__ 37 | -------------------------------------------------------------------------------- /tests/ConfigTest.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Configuration Test Fixture. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__CONFIG_TEST_H__) 19 | #define __CONFIG_TEST_H__ 20 | 21 | #include 22 | 23 | namespace ePDFView 24 | { 25 | class ConfigTest: public CppUnit::TestFixture 26 | { 27 | CPPUNIT_TEST_SUITE (ConfigTest); 28 | CPPUNIT_TEST (defaultValues); 29 | CPPUNIT_TEST (windowValues); 30 | CPPUNIT_TEST (showToolbar); 31 | CPPUNIT_TEST (showStatusbar); 32 | CPPUNIT_TEST (openCurrentFolder); 33 | CPPUNIT_TEST (saveCurrentFolder); 34 | CPPUNIT_TEST (zoomValues); 35 | CPPUNIT_TEST (externalBrowser); 36 | CPPUNIT_TEST_SUITE_END (); 37 | 38 | public: 39 | void setUp (void); 40 | void tearDown (void); 41 | 42 | void defaultValues (void); 43 | void windowValues (void); 44 | void showToolbar (void); 45 | void showStatusbar (void); 46 | void openCurrentFolder (void); 47 | void saveCurrentFolder (void); 48 | void zoomValues (void); 49 | void externalBrowser (void); 50 | }; 51 | } 52 | 53 | #endif // __CONFIG_TEST_H__ 54 | -------------------------------------------------------------------------------- /tests/DocumentOutlineTest.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Document Outline Test Fixture. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DOCUMENT_OUTLINE_TEST_H__) 19 | #define __DOCUMENT_OUTLINE_TEST_H__ 20 | 21 | #include 22 | 23 | namespace ePDFView 24 | { 25 | class DocumentOutlineTest: public CppUnit::TestFixture 26 | { 27 | CPPUNIT_TEST_SUITE (DocumentOutlineTest); 28 | CPPUNIT_TEST (initialStatus); 29 | CPPUNIT_TEST (noOutline); 30 | CPPUNIT_TEST (hasOutline); 31 | CPPUNIT_TEST_SUITE_END (); 32 | 33 | public: 34 | void setUp (void); 35 | void tearDown (void); 36 | 37 | void initialStatus (void); 38 | void noOutline (void); 39 | void hasOutline (void); 40 | 41 | protected: 42 | PDFDocument *m_Document; 43 | }; 44 | } 45 | 46 | #endif // !__DOCUMENT_OUTLINE_TEST_H__ 47 | -------------------------------------------------------------------------------- /tests/DumbDocument.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Dumb Test Document. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined(__DUMB_DOCUMENT_H__) 19 | #define __DUMB_DOCUMENT_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class DumbDocument: public IDocument 24 | { 25 | public: 26 | DumbDocument (); 27 | ~DumbDocument (); 28 | 29 | // Interface methods. 30 | IDocument *copy (void) const; 31 | GList *findTextInPage (gint pageNum, const gchar *text); 32 | gboolean isLoaded (void); 33 | gboolean loadFile (const gchar *filename, const gchar *password, 34 | GError **error); 35 | void getPageSizeForPage (gint pageNum, gdouble *width, 36 | gdouble *height); 37 | void outputPostscriptBegin (const gchar *fileName, guint numberOfPages, gfloat pageWidth, gfloat pageHeight); 38 | void outputPostscriptEnd (void); 39 | void outputPostscriptPage (guint pageNumber); 40 | DocumentPage *renderPage (gint pageNum); 41 | gboolean saveFile (const gchar *fileName, GError **error); 42 | 43 | // Test functions. 44 | const gchar *getSavedFileName (void); 45 | void setOpenError (DocumentError error); 46 | void setOutline (DocumentOutline *outline); 47 | void setTestPassword (const gchar *password); 48 | 49 | private: 50 | gboolean m_Loaded; 51 | DocumentError m_OpenError; 52 | gchar *m_TestPassword; 53 | gchar *m_SavedFileName; 54 | }; 55 | } 56 | 57 | #endif // !__DUMB_DOCUMENT_H__ 58 | -------------------------------------------------------------------------------- /tests/DumbDocumentObserver.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Dumb Test Document Observer. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DUMB_DOCUMENT_OBSERVER_H__) 19 | #define __DUMB_DOCUMENT_OBSERVER_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class DumbDocumentObserver: public IDocumentObserver 24 | { 25 | public: 26 | DumbDocumentObserver (void); 27 | ~DumbDocumentObserver (void); 28 | 29 | void notifyFindChanged (DocumentRectangle *matchRect); 30 | void notifyFindFinished (void); 31 | void notifyFindStarted (void); 32 | void notifyLoad (void); 33 | void notifyLoadError (const GError *error); 34 | void notifyLoadPassword (const gchar *fileName, gboolean reload, 35 | const GError *error); 36 | void notifyPageChanged (gint pageNum); 37 | void notifyPageRotated (gint rotation); 38 | void notifyPageZoomed (gdouble zoom); 39 | void notifyReload (void); 40 | 41 | // Functions for test only purposes. 42 | gint getCurrentPage (void); 43 | DocumentRectangle *getFindMatchRect (void); 44 | const GError *getLoadError (void); 45 | gdouble getZoom (void); 46 | gboolean isStillSearching (void); 47 | gboolean loadFinished (void); 48 | gboolean notifiedError (void); 49 | gboolean notifiedLoaded (void); 50 | gboolean notifiedPassword (void); 51 | gboolean notifiedRotation (void); 52 | gboolean notifiedZoom (void); 53 | void setLoadError (const GError *error); 54 | 55 | protected: 56 | gint m_CurrentPage; 57 | GError *m_Error; 58 | DocumentRectangle *m_FindMatchRect; 59 | gboolean m_NotifiedError; 60 | gboolean m_NotifiedLoad; 61 | gboolean m_NotifiedPassword; 62 | gboolean m_NotifiedPageRotated; 63 | gboolean m_NotifiedPageZoomed; 64 | gboolean m_NotifiedReload; 65 | volatile gboolean m_Searching; 66 | gdouble m_Zoom; 67 | }; 68 | } 69 | 70 | #endif // !__DUMB_DOCUMENT_OBSERVER_H__ 71 | -------------------------------------------------------------------------------- /tests/DumbFindView.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - Dumb Test Find View. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "DumbFindView.h" 20 | 21 | using namespace ePDFView; 22 | 23 | DumbFindView::DumbFindView (): 24 | IFindView () 25 | { 26 | m_FindNextSensitive = TRUE; 27 | m_FindNextSensitive = TRUE; 28 | m_InformationText = g_strdup (""); 29 | m_TextToFind = g_strdup (""); 30 | } 31 | 32 | DumbFindView::~DumbFindView () 33 | { 34 | g_free (m_InformationText); 35 | g_free (m_TextToFind); 36 | } 37 | 38 | const gchar * 39 | DumbFindView::getTextToFind () 40 | { 41 | return m_TextToFind; 42 | } 43 | 44 | void 45 | DumbFindView::hide () 46 | { 47 | } 48 | 49 | void 50 | DumbFindView::sensitiveFindNext (gboolean sensitive) 51 | { 52 | m_FindNextSensitive = sensitive; 53 | } 54 | 55 | void 56 | DumbFindView::sensitiveFindPrevious (gboolean sensitive) 57 | { 58 | m_FindPreviousSensitive = sensitive; 59 | } 60 | 61 | void 62 | DumbFindView::setInformationText (const gchar *text) 63 | { 64 | g_free (m_InformationText); 65 | m_InformationText = g_strdup (text); 66 | } 67 | 68 | //////////////////////////////////////////////////////////////// 69 | // Test Only Functions. 70 | //////////////////////////////////////////////////////////////// 71 | 72 | const gchar * 73 | DumbFindView::getInformationText () 74 | { 75 | return m_InformationText; 76 | } 77 | 78 | gboolean 79 | DumbFindView::isFindNextSensitive () 80 | { 81 | return m_FindNextSensitive; 82 | } 83 | 84 | gboolean 85 | DumbFindView::isFindPreviousSensitive () 86 | { 87 | return m_FindPreviousSensitive; 88 | } 89 | 90 | void 91 | DumbFindView::setTextToFind (const gchar *text) 92 | { 93 | g_free (m_TextToFind); 94 | m_TextToFind = g_strdup (text); 95 | getPresenter ()->textToFindChanged (); 96 | } 97 | -------------------------------------------------------------------------------- /tests/DumbFindView.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Dumb Test Find View. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DUMB_FIND_VIEW_H__) 19 | #define __DUMB_FIND_VIEW_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class DumbFindView: public IFindView 24 | { 25 | public: 26 | DumbFindView (void); 27 | ~DumbFindView (void); 28 | 29 | const gchar *getTextToFind (void); 30 | void hide (void); 31 | void sensitiveFindNext (gboolean sensitive); 32 | void sensitiveFindPrevious (gboolean sensitive); 33 | void setInformationText (const gchar *text); 34 | 35 | // Methods for test only purposes. 36 | const gchar *getInformationText (void); 37 | gboolean isFindNextSensitive (void); 38 | gboolean isFindPreviousSensitive (void); 39 | void setTextToFind (const gchar *text); 40 | 41 | protected: 42 | gboolean m_FindNextSensitive; 43 | gboolean m_FindPreviousSensitive; 44 | gchar *m_InformationText; 45 | gchar *m_TextToFind; 46 | }; 47 | } 48 | 49 | #endif // !__DUMB_FIND_VIEW_H__ 50 | -------------------------------------------------------------------------------- /tests/DumbPageView.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - Dumb Test Page View. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "DumbPageView.h" 20 | 21 | using namespace ePDFView; 22 | 23 | DumbPageView::DumbPageView (): 24 | IPageView () 25 | { 26 | m_HorizontalScroll = 0.0; 27 | m_VerticalScroll = 0.0; 28 | } 29 | 30 | DumbPageView::~DumbPageView () 31 | { 32 | } 33 | 34 | gdouble 35 | DumbPageView::getHorizontalScroll () 36 | { 37 | return m_HorizontalScroll; 38 | } 39 | 40 | void 41 | DumbPageView::getSize (gint *width, gint *height) 42 | { 43 | *width = 75; 44 | *height = 50; 45 | } 46 | 47 | gdouble 48 | DumbPageView::getVerticalScroll () 49 | { 50 | return m_VerticalScroll; 51 | } 52 | 53 | void 54 | DumbPageView::makeRectangleVisible (DocumentRectangle &rect, gdouble scale) 55 | { 56 | } 57 | 58 | void 59 | DumbPageView::resizePage (gint width, gint height) 60 | { 61 | } 62 | 63 | void 64 | DumbPageView::scrollPage (gdouble scrollX, gdouble scrollY, gint dx, gint dy) 65 | { 66 | m_HorizontalScroll = (gdouble)dx; 67 | m_VerticalScroll = (gdouble)dy; 68 | } 69 | 70 | void 71 | DumbPageView::setCursor (PageCursor cursorType) 72 | { 73 | } 74 | 75 | void 76 | DumbPageView::showPage (DocumentPage *page, PageScroll scroll) 77 | { 78 | } 79 | 80 | void 81 | DumbPageView::showText (const gchar *text) 82 | { 83 | } 84 | -------------------------------------------------------------------------------- /tests/DumbPageView.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Dumb Test Page View. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DUMB_PAGE_VIEW_H__) 19 | #define __DUMB_PAGE_VIEW_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class DumbPageView: public IPageView 24 | { 25 | public: 26 | DumbPageView (void); 27 | ~DumbPageView (void); 28 | 29 | gdouble getHorizontalScroll (void); 30 | void getSize (gint *width, gint *height); 31 | gdouble getVerticalScroll (void); 32 | void makeRectangleVisible (DocumentRectangle &rect, gdouble scale); 33 | void resizePage (gint width, gint height); 34 | void scrollPage (gdouble scrollX, gdouble scrollY, 35 | gint dx, gint dy); 36 | void setCursor (PageCursor cursorType); 37 | void showPage (DocumentPage *page, PageScroll scroll); 38 | void showText (const gchar *text); 39 | 40 | 41 | private: 42 | gdouble m_HorizontalScroll; 43 | gdouble m_VerticalScroll; 44 | }; 45 | } 46 | 47 | #endif // !__DUMB_PAGE_VIEW_H__ 48 | -------------------------------------------------------------------------------- /tests/DumbPreferencesView.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - Dumb Test Preferences View. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "DumbPreferencesView.h" 20 | 21 | using namespace ePDFView; 22 | 23 | DumbPreferencesView::DumbPreferencesView (): 24 | IPreferencesView () 25 | { 26 | m_BrowserCommandLine = g_strdup (""); 27 | } 28 | 29 | DumbPreferencesView::~DumbPreferencesView () 30 | { 31 | g_free (m_BrowserCommandLine); 32 | } 33 | 34 | const gchar * 35 | DumbPreferencesView::getBrowserCommandLine () 36 | { 37 | return m_BrowserCommandLine; 38 | } 39 | 40 | //////////////////////////////////////////////////////////////// 41 | // Test Only Functions. 42 | //////////////////////////////////////////////////////////////// 43 | 44 | void 45 | DumbPreferencesView::setBrowserCommandLine (const gchar *commandLine) 46 | { 47 | g_free (m_BrowserCommandLine); 48 | m_BrowserCommandLine = g_strdup (commandLine); 49 | } 50 | -------------------------------------------------------------------------------- /tests/DumbPreferencesView.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Dumb Test Preferences View. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__DUMB_PREFERENCES_VIEW_H__) 19 | #define __DUMB_PREFERENCES_VIEW_H__ 20 | 21 | namespace ePDFView 22 | { 23 | class DumbPreferencesView: public IPreferencesView 24 | { 25 | public: 26 | DumbPreferencesView (void); 27 | virtual ~DumbPreferencesView (void); 28 | 29 | virtual const gchar *getBrowserCommandLine (void); 30 | 31 | // Test only functions. 32 | void setBrowserCommandLine (const char *commandLine); 33 | 34 | protected: 35 | gchar *m_BrowserCommandLine; 36 | }; 37 | } 38 | 39 | #endif // !__DUMB_PREFERENCES_VIEW_H__ 40 | -------------------------------------------------------------------------------- /tests/FindPterTest.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Find Presenter Test Fixture. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__FIND_PTER_TEST_H__) 19 | #define __FIND_PTER_TEST_H__ 20 | 21 | #include 22 | 23 | namespace ePDFView 24 | { 25 | class FindPterTest: public CppUnit::TestFixture 26 | { 27 | CPPUNIT_TEST_SUITE (FindPterTest); 28 | CPPUNIT_TEST (viewSensitivity); 29 | CPPUNIT_TEST (textDoesNotExist); 30 | CPPUNIT_TEST (findNext); 31 | CPPUNIT_TEST (findPrevious); 32 | CPPUNIT_TEST_SUITE_END (); 33 | 34 | public: 35 | void setUp (void); 36 | void tearDown (void); 37 | 38 | void viewSensitivity (void); 39 | void textDoesNotExist (void); 40 | void findNext (void); 41 | void findPrevious (void); 42 | 43 | private: 44 | PDFDocument *m_Document; 45 | FindPter *m_FindPter; 46 | DumbDocumentObserver *m_Observer; 47 | DumbFindView *m_View; 48 | }; 49 | } 50 | 51 | #endif // !__FIND_PTER_TEST_H__ 52 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | # Process this file with automake to produce a Makefile.in file. 2 | TESTS=test_epdfview 3 | noinst_PROGRAMS=test_epdfview 4 | EXTRA_DIST = \ 5 | test1.pdf \ 6 | test2.pdf \ 7 | test_encrypted.pdf 8 | 9 | test_epdfview_SOURCES = \ 10 | ConfigTest.cxx \ 11 | ConfigTest.h \ 12 | DocumentOutlineTest.cxx \ 13 | DocumentOutlineTest.h \ 14 | DumbDocument.cxx \ 15 | DumbDocument.h \ 16 | DumbDocumentObserver.cxx \ 17 | DumbDocumentObserver.h \ 18 | DumbFindView.cxx \ 19 | DumbFindView.h \ 20 | DumbMainView.cxx \ 21 | DumbMainView.h \ 22 | DumbPageView.cxx \ 23 | DumbPageView.h \ 24 | DumbPreferencesView.cxx \ 25 | DumbPreferencesView.h \ 26 | FindPterTest.cxx \ 27 | FindPterTest.h \ 28 | main.cxx \ 29 | MainPterTest.cxx \ 30 | MainPterTest.h \ 31 | PagePterTest.cxx \ 32 | PagePterTest.h \ 33 | PDFDocumentTest.cxx \ 34 | PDFDocumentTest.h \ 35 | PreferencesPterTest.cxx \ 36 | PreferencesPterTest.h \ 37 | Utils.cxx \ 38 | Utils.h 39 | 40 | 41 | test_epdfview_CXXFLAGS = \ 42 | -DTEST_DIR='"$(top_srcdir)/tests/"' \ 43 | -I$(top_srcdir)/src \ 44 | $(GLIB_CFLAGS) \ 45 | $(CPPUNIT_CFLAGS) 46 | 47 | test_epdfview_LDADD = \ 48 | $(GLIB_LIBS) \ 49 | $(POPPLER_LIBS) \ 50 | $(CPPUNIT_LIBS) \ 51 | $(top_builddir)/src/libepdfview.a 52 | 53 | if cups_printing 54 | test_epdfview_SOURCES += \ 55 | DumbPrintView.cxx \ 56 | DumbPrintView.h \ 57 | PrintPterTest.cxx \ 58 | PrintPterTest.h 59 | 60 | test_epdfview_CXXFLAGS += \ 61 | $(CUPS_CFLAGS) 62 | 63 | test_epdfview_LDADD += \ 64 | $(CUPS_LIBS) 65 | endif 66 | -------------------------------------------------------------------------------- /tests/PDFDocumentTest.h: -------------------------------------------------------------------------------- 1 | // ePDFView - PDF Document Test Fixture. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PDF_DOCUMENT_TEST_H__) 19 | #define __PDF_DOCUMENT_TEST_H__ 20 | 21 | #include 22 | 23 | namespace ePDFView 24 | { 25 | class PDFDocumentTest: public CppUnit::TestFixture 26 | { 27 | CPPUNIT_TEST_SUITE (PDFDocumentTest); 28 | CPPUNIT_TEST (emptyDocument); 29 | CPPUNIT_TEST (fileNotFound); 30 | CPPUNIT_TEST (invalidFile); 31 | CPPUNIT_TEST (encryptedFile); 32 | CPPUNIT_TEST (validFile); 33 | CPPUNIT_TEST (relativePath); 34 | CPPUNIT_TEST (pageChange); 35 | CPPUNIT_TEST (pageRotate); 36 | CPPUNIT_TEST (pageZoom); 37 | CPPUNIT_TEST (pageRender); 38 | CPPUNIT_TEST (pageLinks); 39 | CPPUNIT_TEST (pageFindText); 40 | CPPUNIT_TEST_SUITE_END (); 41 | 42 | public: 43 | void setUp (void); 44 | void tearDown (void); 45 | 46 | void emptyDocument (void); 47 | void fileNotFound (void); 48 | void invalidFile (void); 49 | void encryptedFile (void); 50 | void validFile (void); 51 | void relativePath (void); 52 | void pageChange (void); 53 | void pageRotate (void); 54 | void pageZoom (void); 55 | void pageRender (void); 56 | void pageLinks (void); 57 | void pageFindText (void); 58 | 59 | private: 60 | PDFDocument *m_Document; 61 | DumbDocumentObserver *m_Observer; 62 | }; 63 | } 64 | 65 | #endif // !__PDF_DOCUMENT_TEST_H__ 66 | -------------------------------------------------------------------------------- /tests/PagePterTest.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Page Presenter Test Fixture. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PAGE_PTER_TEST_H__) 19 | #define __PAGE_PTER_TEST_H__ 20 | 21 | #include 22 | 23 | namespace ePDFView 24 | { 25 | class PagePterTest: public CppUnit::TestFixture 26 | { 27 | CPPUNIT_TEST_SUITE (PagePterTest); 28 | CPPUNIT_TEST (pageZoomWidth); 29 | CPPUNIT_TEST (pageZoomFit); 30 | CPPUNIT_TEST (pageDrag); 31 | CPPUNIT_TEST_SUITE_END (); 32 | 33 | public: 34 | void setUp (void); 35 | void tearDown (void); 36 | 37 | void pageZoomWidth (void); 38 | void pageZoomFit (void); 39 | void pageDrag (void); 40 | 41 | protected: 42 | DumbDocument *m_Document; 43 | MainPter *m_MainPter; 44 | DumbMainView *m_MainView; 45 | PagePter *m_PagePter; 46 | DumbPageView *m_PageView; 47 | }; 48 | } 49 | 50 | #endif // !__PAGE_PTER_TEST_H__ 51 | -------------------------------------------------------------------------------- /tests/PreferencesPterTest.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - Preferences Presenter Test Fixture. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "DumbPreferencesView.h" 20 | #include "PreferencesPterTest.h" 21 | 22 | using namespace ePDFView; 23 | 24 | // Register the test suite into the `registry'. 25 | CPPUNIT_TEST_SUITE_REGISTRATION (PreferencesPterTest); 26 | 27 | /// 28 | /// @brief Sets up the environment for each test. 29 | /// 30 | void 31 | PreferencesPterTest::setUp () 32 | { 33 | Config::loadFile (FALSE); 34 | m_PreferencesPter = new PreferencesPter (); 35 | m_View = new DumbPreferencesView (); 36 | m_PreferencesPter->setView (m_View); 37 | } 38 | 39 | /// 40 | /// @brief Cleans up after each test. 41 | /// 42 | void 43 | PreferencesPterTest::tearDown () 44 | { 45 | Config::destroy (); 46 | // Telling the presenter to close will delete the view and the presenter. 47 | m_PreferencesPter->closeActivated (); 48 | m_PreferencesPter = NULL; 49 | m_View = NULL; 50 | } 51 | 52 | /// 53 | /// @brief Test setting the external browser command line. 54 | /// 55 | void 56 | PreferencesPterTest::externalCommandBrowser () 57 | { 58 | Config &config = Config::getConfig (); 59 | 60 | gchar *commandLine = config.getExternalBrowserCommandLine (); 61 | CPPUNIT_ASSERT ( 0 == g_ascii_strcasecmp ("firefox %s", commandLine)); 62 | g_free (commandLine); 63 | 64 | m_View->setBrowserCommandLine ("Eterm links %s"); 65 | m_PreferencesPter->browserCommandLineChanged (); 66 | 67 | commandLine = config.getExternalBrowserCommandLine (); 68 | CPPUNIT_ASSERT ( 0 == g_ascii_strcasecmp ("Eterm links %s", commandLine)); 69 | g_free (commandLine); 70 | } 71 | -------------------------------------------------------------------------------- /tests/PreferencesPterTest.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Preferences Presenter Test Fixture. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PREFERENCES_PTER_TEST_H__) 19 | #define __PREFERENCES_PTER_TEST_H__ 20 | 21 | #include 22 | 23 | namespace ePDFView 24 | { 25 | class PreferencesPterTest: public CppUnit::TestFixture 26 | { 27 | CPPUNIT_TEST_SUITE (PreferencesPterTest); 28 | CPPUNIT_TEST (externalCommandBrowser); 29 | CPPUNIT_TEST_SUITE_END (); 30 | 31 | public: 32 | void setUp (void); 33 | void tearDown (void); 34 | 35 | void externalCommandBrowser (void); 36 | 37 | protected: 38 | PreferencesPter *m_PreferencesPter; 39 | DumbPreferencesView *m_View; 40 | }; 41 | } 42 | 43 | #endif // !__PREFERENCES_PTER_TEST_H__ 44 | -------------------------------------------------------------------------------- /tests/PrintPterTest.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Preferences Presenter Test Fixture. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__PRINT_PTER_TEST_H__) 19 | #define __PRINT_PTER_TEST_H__ 20 | 21 | #include 22 | 23 | namespace ePDFView 24 | { 25 | class PrintPterTest: public CppUnit::TestFixture 26 | { 27 | CPPUNIT_TEST_SUITE (PrintPterTest); 28 | CPPUNIT_TEST (initialSensitivity); 29 | CPPUNIT_TEST (collateSensitivity); 30 | CPPUNIT_TEST (pageRangeSensitivity); 31 | CPPUNIT_TEST_SUITE_END (); 32 | 33 | public: 34 | void setUp (void); 35 | void tearDown (void); 36 | 37 | void initialSensitivity (void); 38 | void collateSensitivity (void); 39 | void pageRangeSensitivity (void); 40 | 41 | protected: 42 | DumbDocument *m_Document; 43 | PrintPter *m_PrintPter; 44 | DumbPrintView *m_View; 45 | }; 46 | } 47 | 48 | #endif // !__PRINT_PTER_TEST_H__ 49 | -------------------------------------------------------------------------------- /tests/Utils.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - Test Util Functions. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include "Utils.h" 20 | 21 | /// 22 | /// @brief Returns the path to the test data file. 23 | /// 24 | /// It assumes that TEST_DIR is defined to the relative 25 | /// tests directory and that the checks are executed from the 26 | /// test build dir. 27 | /// 28 | gchar * 29 | getTestFile (const gchar *fileName) 30 | { 31 | gchar *currentDir = g_get_current_dir (); 32 | gchar *filePath = g_build_filename (currentDir, TEST_DIR, fileName, NULL); 33 | g_free (currentDir); 34 | 35 | return filePath; 36 | } 37 | -------------------------------------------------------------------------------- /tests/Utils.h: -------------------------------------------------------------------------------- 1 | // ePDFView - Test Util Functions. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #if !defined (__UTILS_TEST_H__) 19 | #define __UTILS_TEST_H__ 20 | 21 | gchar *getTestFile (const gchar *fileName); 22 | 23 | #endif // !__UTILS_TEST_H__ 24 | -------------------------------------------------------------------------------- /tests/main.cxx: -------------------------------------------------------------------------------- 1 | // ePDFView - Test Suite. 2 | // Copyright (C) 2006, 2007, 2009 Emma's Software. 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | using namespace CPPUNIT_NS; 26 | 27 | int 28 | main (int argc, char **argv) 29 | { 30 | // We must initialize glib't types. 31 | g_type_init (); 32 | 33 | // Initialize the job's queue. 34 | ePDFView::IJob::init (); 35 | 36 | // Get the top level suite from the registry. 37 | Test *suite = TestFactoryRegistry::getRegistry ().makeTest (); 38 | 39 | // Add the test suite to the list of tests to run. 40 | TextUi::TestRunner runner; 41 | runner.addTest (suite); 42 | 43 | // Change the default outputter to a compiler error format outputter. 44 | runner.setOutputter (new CompilerOutputter (&runner.result (), std::cerr)); 45 | 46 | // Run the tests. 47 | bool wasSuccessful = runner.run (); 48 | 49 | return wasSuccessful ? EXIT_SUCCESS : EXIT_FAILURE; 50 | } 51 | -------------------------------------------------------------------------------- /tests/test1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/tests/test1.pdf -------------------------------------------------------------------------------- /tests/test2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/tests/test2.pdf -------------------------------------------------------------------------------- /tests/test_encrypted.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JotaRandom/epdfview/f1b4b26bb719c7755d4a17a196054f173cbad099/tests/test_encrypted.pdf --------------------------------------------------------------------------------