├── debian ├── docs ├── source │ └── format ├── paperman.manpages ├── dirs ├── paperman.install ├── README.Debian ├── menu ├── watch ├── rules.in ├── rules.bionic ├── control.bookworm ├── control.in ├── control.focal ├── control.bionic ├── control.buster └── changelog.in ├── doc ├── 5.png ├── 6.png ├── 7.png ├── 8.png ├── 9.png ├── 1.jpeg ├── 2.jpeg ├── 3.jpeg ├── 4.jpeg └── all.png ├── test ├── .gitignore ├── files │ ├── testfile.max │ └── testpdf.pdf ├── test.h ├── test.pro ├── test.cpp ├── test_utils.h ├── test_dirmodel.h ├── suite.h └── test_ops.h ├── images ├── redo ├── undo ├── editcut ├── filenew ├── print ├── editcopy ├── editpaste ├── fileopen ├── filesave ├── maxview.png ├── searchfind ├── add.xpm ├── sub.xpm ├── fileopen.xpm ├── delete_bookmarks.xpm ├── left.xpm ├── right.xpm ├── pagekeep.xpm ├── pageremove.xpm ├── setup.xpm ├── pageblank.xpm ├── zoom.xpm ├── multiselection.xpm ├── zoom_off.xpm ├── zoom_redo.xpm ├── zoom_undo.xpm ├── autoselection_setup.xpm ├── resolution_option.xpm ├── brx_option.xpm ├── bry_option.xpm ├── tlx_option.xpm ├── tly_option.xpm ├── brightness_option.xpm ├── contrast_option.xpm ├── no_entry.xpm ├── gamma_option.xpm ├── gamma_red_option.xpm ├── gamma_blue_option.xpm └── gamma_green_option.xpm ├── scripts ├── make_tar └── setup-pbuilder ├── foldersel.h ├── deliver └── delivermv.pro ├── measure.cpp ├── .gitignore ├── qlistwidgetitemiterator.h ├── measure.h ├── qlistwidgetitemiterator.cpp ├── configure ├── ChangeLog ├── maxview.h ├── ocrtess.h ├── qi ├── splashwidget.h ├── qsplinearray.h ├── motranslator.h ├── qimageioext.h ├── qbuttonoption.h ├── textiosupporter.h ├── qreadonlyoption.h ├── resource.h ├── scanareatemplate.cpp ├── qoptionscrollview.h ├── unknownprogressdialog.h ├── scanareatemplate.h ├── fileiosupporter.h ├── qfiledialogext.h ├── qdoublespinbox.h ├── qstringoption.h ├── qswitchoffmessage.h ├── qdraglabel.h ├── previewupdatewidget.h ├── directorylistview.h ├── qreadonlyoption.cpp ├── ruler.h ├── qbooloption.h ├── dragiconview.h ├── qbuttonoption.cpp ├── qunknownprogresswidget.h ├── saneconfig.h ├── qdraglistbox.h ├── iconviewitemext.h ├── sanefixedspinbox.h ├── qhtmlview.h ├── qdraglabel.cpp ├── unknownprogressdialog.cpp ├── checklistitemext.h ├── sanewidgetholder.h ├── qdoublespinbox.cpp ├── sanewidgetholder.cpp ├── qqualitydialog.h ├── splashwidget.cpp ├── imagedetection.h ├── scanarea.h ├── qpreviewfiledialog.h ├── saneintoption.h ├── qwordcombooption.h ├── sliderspin.h ├── qstringoption.cpp ├── sanefixedoption.h ├── qocrprogress.h ├── qfiledialogext.cpp ├── qdevicesettings.h └── qcurvewidget.h ├── pagetools.h ├── ocromni.h ├── maxview.qrc ├── qsanestatusmessage.h ├── mem.h ├── resource.h ├── options.h ├── saneconfig.h ├── quiteinsanenamespace.h ├── INSTALL ├── pdfwrite.h ├── senddialog.h ├── ocr.h ├── presetadd.ui ├── ocr.cpp ├── op.cpp ├── pagetools.cpp ├── config.h ├── ocrbar.ui ├── mem.cpp ├── dirview.h └── zipentry_p.h /debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/paperman.manpages: -------------------------------------------------------------------------------- 1 | paperman.1 2 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/man/man1 3 | -------------------------------------------------------------------------------- /debian/paperman.install: -------------------------------------------------------------------------------- 1 | usr/bin/paperman 2 | -------------------------------------------------------------------------------- /doc/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/5.png -------------------------------------------------------------------------------- /doc/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/6.png -------------------------------------------------------------------------------- /doc/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/7.png -------------------------------------------------------------------------------- /doc/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/8.png -------------------------------------------------------------------------------- /doc/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/9.png -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | test 2 | moc_*.h 3 | .qmake.stash 4 | Makefile 5 | -------------------------------------------------------------------------------- /doc/1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/1.jpeg -------------------------------------------------------------------------------- /doc/2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/2.jpeg -------------------------------------------------------------------------------- /doc/3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/3.jpeg -------------------------------------------------------------------------------- /doc/4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/4.jpeg -------------------------------------------------------------------------------- /doc/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/doc/all.png -------------------------------------------------------------------------------- /images/redo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/redo -------------------------------------------------------------------------------- /images/undo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/undo -------------------------------------------------------------------------------- /images/editcut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/editcut -------------------------------------------------------------------------------- /images/filenew: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/filenew -------------------------------------------------------------------------------- /images/print: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/print -------------------------------------------------------------------------------- /images/editcopy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/editcopy -------------------------------------------------------------------------------- /images/editpaste: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/editpaste -------------------------------------------------------------------------------- /images/fileopen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/fileopen -------------------------------------------------------------------------------- /images/filesave: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/filesave -------------------------------------------------------------------------------- /images/maxview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/maxview.png -------------------------------------------------------------------------------- /images/searchfind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/images/searchfind -------------------------------------------------------------------------------- /test/files/testfile.max: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/test/files/testfile.max -------------------------------------------------------------------------------- /test/files/testpdf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjg20/paperman/HEAD/test/files/testpdf.pdf -------------------------------------------------------------------------------- /test/test.h: -------------------------------------------------------------------------------- 1 | class QApplication; 2 | 3 | int test_run(int argc, char **argv, QApplication *app); 4 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | Paperman for Debian 2 | ------------------- 3 | 4 | This is a debian package for Paperman. 5 | 6 | -- Simon Glass Sun, 29 Sep 2024 17:53:24 MDT 7 | -------------------------------------------------------------------------------- /debian/menu: -------------------------------------------------------------------------------- 1 | ?package(paperman):needs="X11" section="Applications/File Management"\ 2 | title="paperman" command="/usr/bin/paperman" 3 | ?package(paperman):needs="text" section="Applications/File Management"\ 4 | title="paperman-cli" command="/usr/bin/paperman" 5 | -------------------------------------------------------------------------------- /test/test.pro: -------------------------------------------------------------------------------- 1 | QT += widgets testlib 2 | 3 | SOURCES = testpaperman.cpp ../utils.cpp ../zip.cpp ../epeglite.cpp \ 4 | ../err.cpp ../mem.cpp 5 | 6 | # install 7 | target.path = $$[QT_INSTALL_EXAMPLES]/qtestlib/tutorial1 8 | INSTALLS += target 9 | 10 | LIBS += -ltiff -lsane -ljpeg -lz 11 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | # Example watch control file for uscan 2 | # Rename this file to "watch" and then you can run the "uscan" command 3 | # to check for upstream updates and more. 4 | # See uscan(1) for format 5 | 6 | # Compulsory line, this is a version 4 file 7 | version=4 8 | https://github.com//sjg20/paperman/tags .*/v?(\d.*)@ARCHIVE_EXT@ 9 | -------------------------------------------------------------------------------- /scripts/make_tar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dest=../paperman_1.3.orig.tar.bz2 4 | 5 | exclude=".git" 6 | # .moc .ui .obj Makefile debian/changelog doc/ tests 7 | 8 | for item in ${exclude}; do 9 | excludes+="--exclude ${item} " 10 | done 11 | 12 | # Make a tar file excluding the compiled files 13 | tar cfj $dest ${excludes} . 14 | -------------------------------------------------------------------------------- /foldersel.h: -------------------------------------------------------------------------------- 1 | #ifndef FOLDERSEL_H 2 | #define FOLDERSEL_H 3 | 4 | #include 5 | 6 | class Foldersel : public QLineEdit 7 | { 8 | Q_OBJECT 9 | 10 | protected: 11 | virtual void focusOutEvent(QFocusEvent *e) override; 12 | 13 | public: 14 | Foldersel(QWidget* parent); 15 | ~Foldersel(); 16 | }; 17 | 18 | #endif // FOLDERSEL_H 19 | -------------------------------------------------------------------------------- /debian/rules.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([0-9]:)*([^-]+).*,\2,p') 4 | 5 | %: 6 | dh $@ 7 | 8 | override_dh_auto_build: 9 | pod2man --section=1 --release="$(DEB_UPSTREAM_VERSION)" --center "" debian/paperman.pod > paperman.1 10 | dh_auto_build 11 | 12 | CFLAGS=-O3 13 | CXXFLAGS=-O3 14 | -------------------------------------------------------------------------------- /debian/rules.bionic: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([0-9]:)*([^-]+).*,\2,p') 4 | 5 | %: 6 | dh $@ 7 | 8 | override_dh_auto_build: 9 | pod2man --section=1 --release="$(DEB_UPSTREAM_VERSION)" --center "" debian/paperman.pod > paperman.1 10 | dh_auto_build 11 | 12 | CFLAGS=-O3 13 | CXXFLAGS=-O3 14 | -------------------------------------------------------------------------------- /deliver/delivermv.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | LANGUAGE = C++ 3 | CONFIG += qt warn_on debug console 4 | QT += network 5 | 6 | QMAKE_CXXFLAGS += -DDELIVER 7 | #LIBS += -ljpeg 8 | 9 | SOURCES += delivermv.cpp transfer.cpp delivery.cpp err.cpp utils.cpp mem.cpp zip.cpp \ 10 | /usr/share/qtcreator/gdbmacros/gdbmacros.cpp 11 | 12 | HEADERS += transfer.h delivery.h err.h utils.h mem.h zip.h 13 | 14 | 15 | -------------------------------------------------------------------------------- /measure.cpp: -------------------------------------------------------------------------------- 1 | /* Measurer for text bounding box */ 2 | 3 | #include 4 | #include 5 | 6 | #include "measure.h" 7 | 8 | Measure::Measure(QStyle *style, QFont font) 9 | : _style(style) 10 | { 11 | _font = font; 12 | } 13 | 14 | Measure::~Measure() 15 | { 16 | } 17 | 18 | int Measure::getWidth(const QString& text) 19 | { 20 | QFontMetrics fm(_font); 21 | return fm.size(0, text).width(); 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | 9 | # Compiled Static libraries 10 | *.lai 11 | *.la 12 | *.a 13 | 14 | *.moc 15 | *.obj 16 | /Makefile 17 | /paperman 18 | /qrc_maxview.cpp 19 | /qmake_image_collection.cpp 20 | /maxview.pro.user 21 | /qmeta-build-desktop 22 | /paper 23 | /.paperdesk 24 | /paperman.pro.user 25 | 26 | # Symlink to paperman executable built by QT creator 27 | pm 28 | 29 | .ui/ 30 | .qmake.stash 31 | -------------------------------------------------------------------------------- /images/add.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * add_xpm[] = { 3 | "16 16 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " .... ", 8 | " .... ", 9 | " .... ", 10 | " .... ", 11 | " .... ", 12 | " .............. ", 13 | " .............. ", 14 | " .............. ", 15 | " .............. ", 16 | " .... ", 17 | " .... ", 18 | " .... ", 19 | " .... ", 20 | " .... ", 21 | " "}; 22 | -------------------------------------------------------------------------------- /images/sub.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * sub_xpm[] = { 3 | "16 16 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " ", 12 | " .............. ", 13 | " .............. ", 14 | " .............. ", 15 | " .............. ", 16 | " ", 17 | " ", 18 | " ", 19 | " ", 20 | " ", 21 | " "}; 22 | -------------------------------------------------------------------------------- /qlistwidgetitemiterator.h: -------------------------------------------------------------------------------- 1 | #ifndef QLISTWIDGETITEMITERATOR_H 2 | #define QLISTWIDGETITEMITERATOR_H 3 | 4 | class QListWidget; 5 | class QListWidgetItem; 6 | 7 | class QListWidgetItemIterator { 8 | public: 9 | QListWidgetItemIterator(QListWidget *w); 10 | QListWidgetItemIterator &operator++(void); 11 | QListWidgetItem *current(void); 12 | private: 13 | void next(void); 14 | 15 | int mUpto; 16 | QListWidget *mWidget; 17 | QListWidgetItem *mCur; 18 | }; 19 | 20 | #endif // QLISTWIDGETITEMITERATOR_H 21 | -------------------------------------------------------------------------------- /images/fileopen.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char* const fileopen[] = { 3 | " 16 13 5 1", 4 | ". c #040404", 5 | "# c #808304", 6 | "a c None", 7 | "b c #f3f704", 8 | "c c #f3f7f3", 9 | "aaaaaaaaa...aaaa", 10 | "aaaaaaaa.aaa.a.a", 11 | "aaaaaaaaaaaaa..a", 12 | "a...aaaaaaaa...a", 13 | ".bcb.......aaaaa", 14 | ".cbcbcbcbc.aaaaa", 15 | ".bcbcbcbcb.aaaaa", 16 | ".cbcb...........", 17 | ".bcb.#########.a", 18 | ".cb.#########.aa", 19 | ".b.#########.aaa", 20 | "..#########.aaaa", 21 | "...........aaaaa" 22 | }; 23 | -------------------------------------------------------------------------------- /measure.h: -------------------------------------------------------------------------------- 1 | #ifndef MEASURE_H 2 | #define MEASURE_H 3 | 4 | #include 5 | #include 6 | 7 | class QStyle; 8 | 9 | /** measure text according to a predefined font */ 10 | class Measure { 11 | public: 12 | /* Set up measurement with a given style and font */ 13 | Measure(QStyle *style, QFont font); 14 | ~Measure(); 15 | 16 | //! Get the width of a given string 17 | int getWidth(const QString& text); 18 | 19 | private: 20 | QStyle *_style; 21 | QFont _font; 22 | }; 23 | 24 | #endif // MEASURE_H 25 | -------------------------------------------------------------------------------- /images/delete_bookmarks.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * delete_bookmarks_xpm[] = { 3 | "16 16 3 1", 4 | " c None", 5 | ". c #FF0000", 6 | "+ c #8C0B0B", 7 | " ", 8 | " ", 9 | " ", 10 | " ", 11 | " .+ .+ ", 12 | " .+ .+ ", 13 | " .+ .+ ", 14 | " .+.+ ", 15 | " .+ ", 16 | " .+.+ ", 17 | " .+ .+ ", 18 | " .+ .+ ", 19 | " .+ .+ ", 20 | " ", 21 | " ", 22 | " "}; 23 | -------------------------------------------------------------------------------- /images/left.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * left_xpm[] = { 3 | "14 14 9 1", 4 | " c None", 5 | ". c #020202", 6 | "+ c #B2C6AE", 7 | "@ c #E7EDE6", 8 | "# c #121A12", 9 | "$ c #263222", 10 | "% c #497241", 11 | "& c #78A16E", 12 | "* c #86AD7D", 13 | " ..", 14 | " ..+.", 15 | " ..@@+.", 16 | " ..@@@@+.", 17 | " ..@@@@@@+.", 18 | " .#@@@@@@@@+.", 19 | "..+@@@@@@@@@+$", 20 | "..%%&&&*****&.", 21 | " ..%%&*&***&.", 22 | " ..%%&*&*&.", 23 | " ..%%&&&.", 24 | " ..%&%.", 25 | " ..%.", 26 | " .."}; 27 | -------------------------------------------------------------------------------- /images/right.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * right_xpm[] = { 3 | "14 14 9 1", 4 | " c None", 5 | ". c #020202", 6 | "+ c #B2C6AE", 7 | "@ c #E7EDE6", 8 | "# c #121A12", 9 | "$ c #263222", 10 | "% c #78A16E", 11 | "& c #86AD7D", 12 | "* c #497241", 13 | ".. ", 14 | ".+.. ", 15 | ".+@@.. ", 16 | ".+@@@@.. ", 17 | ".+@@@@@@.. ", 18 | ".+@@@@@@@@#. ", 19 | "$+@@@@@@@@@+..", 20 | ".%&&&&&%%%**..", 21 | ".%&&&%&%**.. ", 22 | ".%&%&%**.. ", 23 | ".%%%**.. ", 24 | ".*%*.. ", 25 | ".*.. ", 26 | ".. "}; 27 | -------------------------------------------------------------------------------- /images/pagekeep.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *pagekeep[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 18 2 1", 5 | " c #07FF01", 6 | ". c None", 7 | /* pixels */ 8 | "................", 9 | "................", 10 | "............ .", 11 | "........... .", 12 | "........... .", 13 | "........... ..", 14 | ".......... ..", 15 | ".......... ...", 16 | "......... ...", 17 | "......... ....", 18 | ". ... ....", 19 | ". .. ....", 20 | ".. .....", 21 | "... .....", 22 | ".... ......", 23 | "..... ......", 24 | "...... .......", 25 | "....... ......." 26 | }; 27 | -------------------------------------------------------------------------------- /images/pageremove.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *pageremove[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 18 2 1", 5 | " c #FF3801", 6 | ". c None", 7 | /* pixels */ 8 | " ............ .", 9 | " ........... .", 10 | ". ......... .", 11 | ".. ....... ..", 12 | "... ..... ...", 13 | "... .... ....", 14 | ".... .. .....", 15 | "..... ......", 16 | "...... .......", 17 | "...... ......", 18 | "..... ......", 19 | ".... .. .....", 20 | "... .... ....", 21 | "... ...... ...", 22 | ".. ....... ..", 23 | ". ......... .", 24 | " ........... ", 25 | " ............. ." 26 | }; 27 | -------------------------------------------------------------------------------- /images/setup.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char* const setup[] = { 3 | "16 16 10 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #000000", 7 | "@ c #DCDCDC", 8 | "# c #585858", 9 | "$ c #A0A0A0", 10 | "% c #FFFFFF", 11 | "& c #C3C3C3", 12 | "* c #303030", 13 | "= c #808080", 14 | " ++++++ ", 15 | " +=#@@$++ ", 16 | " +&##@&$+ ", 17 | "+++ ++&#@$+ ", 18 | "+%$++ +#@@$+ ", 19 | "+%@@@+##@@@$+ ", 20 | "+#%%@@@@@@@@$++ ", 21 | "*%##%%@@@@@@@$$+", 22 | "+&@%####$%%@@@@$", 23 | " ++&@&&$###%%@@@", 24 | " +++$&&&$##%%@", 25 | " ++++@@$##%", 26 | " ++@@$#", 27 | " ++@@", 28 | " ++", 29 | " "}; 30 | -------------------------------------------------------------------------------- /images/pageblank.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *pageblank[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "16 18 5 1", 5 | " c #FEFF00", 6 | ". c #FFFE01", 7 | "X c #FEFF01", 8 | "o c #FFFE02", 9 | "O c None", 10 | /* pixels */ 11 | "OOOOOOOOOoOOOOOO", 12 | "OOOOOOOOooOOOOOO", 13 | "OOOOOOOOoooOOOOO", 14 | "OOOOOOOOoXoOOOOO", 15 | "OOOOOOoo. oooooo", 16 | "OOOoooo. XXooO", 17 | "OOOOooX ooOO", 18 | "OOOOOooX XoOOO", 19 | "OOOOOOo. oOOO", 20 | "OOOOOOoXXooXoOOO", 21 | "OOOOOOooooooooOO", 22 | "OOOOOOooOOOOooOO", 23 | "OOOOOOoOOOOOOOOO", 24 | "OOOOOOOOOOOOOOOO", 25 | "OOOOOOOOOOOOOOOO", 26 | "OOOOOOOOOOOOOOOO", 27 | "OOOOOOOOOOOOOOOO", 28 | "OOOOOOOOOOOOOOOO" 29 | }; 30 | -------------------------------------------------------------------------------- /qlistwidgetitemiterator.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "qlistwidgetitemiterator.h" 3 | 4 | #include 5 | 6 | QListWidgetItemIterator::QListWidgetItemIterator(QListWidget *w) 7 | { 8 | mWidget = w; 9 | mUpto = -1; 10 | next(); 11 | } 12 | 13 | QListWidgetItemIterator &QListWidgetItemIterator::operator++(void) 14 | { 15 | next(); 16 | return *this; 17 | } 18 | 19 | QListWidgetItem *QListWidgetItemIterator::current(void) 20 | { 21 | return mCur; 22 | } 23 | 24 | void QListWidgetItemIterator::next(void) 25 | { 26 | mUpto++; 27 | if (mUpto >= 0 && mUpto < mWidget->count()) 28 | mCur = mWidget->item(mUpto); 29 | else 30 | mCur = 0; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # this is a simply configure script, it just runs qmake 4 | 5 | QMAKE=`which qmake` 6 | 7 | # we need qmake to create our Makefile 8 | # this is a perfectly reasonable requirement 9 | if [ "$QMAKE" = "" ]; then 10 | echo "Cannot find qmake. Try installing qmake-qt4 with:" 11 | echo 12 | echo " sudo apt-get install qmake-qt4" 13 | exit 14 | fi 15 | 16 | CMAKE=`which cmake` 17 | 18 | # we need cmake for building podofo 19 | # I wish we didn't 20 | if [ "$CMAKE" = "" ]; then 21 | echo "Cannot find cmake. Try installing cmake with:" 22 | echo 23 | echo " sudo apt-get install cmake" 24 | exit 25 | fi 26 | 27 | # if this fails we hope the user can figure it out 28 | qmake paperman.pro 29 | 30 | -------------------------------------------------------------------------------- /test/test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "test.h" 4 | 5 | #include "test_dirmodel.h" 6 | #include "test_ops.h" 7 | #include "test_utils.h" 8 | 9 | //QTEST_MAIN(TestPaperman) 10 | 11 | static TestUtils TEST_UTILS("utils"); 12 | static TestOps TEST_OPS("ops"); 13 | static TestDirmodel TEST_DIRMODEL("dirmodel"); 14 | 15 | int test_run(int argc, char **in_argv, QApplication *) 16 | { 17 | int status = 0; 18 | auto runTest = [&status, argc, in_argv](QObject* obj) { 19 | status |= QTest::qExec(obj, argc, in_argv); 20 | }; 21 | 22 | // run suite 23 | auto &suite = Suite::suite(); 24 | for (auto it = suite.begin(); it != suite.end(); ++it) { 25 | const Test *test = *it; 26 | qDebug() << "suite" << test->_name; 27 | runTest(*it); 28 | } 29 | 30 | return status; 31 | } 32 | -------------------------------------------------------------------------------- /test/test_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_UTILS_H 2 | #define TEST_UTILS_H 3 | 4 | #include 5 | 6 | #include "suite.h" 7 | 8 | class QTemporaryDir; 9 | 10 | class TreeItem; 11 | 12 | class TestUtils: public Suite 13 | { 14 | Q_OBJECT 15 | public: 16 | using Suite::Suite; 17 | 18 | private slots: 19 | void testDetectYear(); 20 | void testDetectMonth(); 21 | void testDetectMatches(); 22 | void testScanDir(); 23 | void testAdopt(); 24 | void testFindItem(); 25 | private: 26 | // Create files in a temporary directory structure used for testing 27 | void createDirStructure(QTemporaryDir& tmp); 28 | 29 | // Create an empty file in a directory 30 | void touch(const QString& dirpath, QString fname); 31 | 32 | // Compare two trees recursively 33 | void compare_trees(TreeItem *node1, TreeItem *node2); 34 | }; 35 | 36 | #endif // TEST_UTILS_H 37 | -------------------------------------------------------------------------------- /images/zoom.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * zoom_xpm[] = { 3 | "22 22 7 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #CBE2FF", 7 | "@ c #DDECFF", 8 | "# c #E8F1FF", 9 | "$ c #FFFFFF", 10 | "% c #AFAFAF", 11 | " ", 12 | " ....... ", 13 | " ..++++@.. ", 14 | " ..++@@@@#.. ", 15 | " .++@@####@. ", 16 | " .+@@#$$##@. ", 17 | " .+@#$$$#@+. ", 18 | " .+@#$$##@+. ", 19 | " .@@#####@+. ", 20 | " ..@##@@@+.. ", 21 | " ..@@+++.... ", 22 | " ........... ", 23 | " ..... ", 24 | " .. ...... ", 25 | " .. ...%.. ", 26 | " .. .%%%.. ", 27 | " ........ ..%%%.. ", 28 | " ........ ..%%%.. ", 29 | " .. ..%%.. ", 30 | " .. .... ", 31 | " .. .. ", 32 | " "}; 33 | -------------------------------------------------------------------------------- /images/multiselection.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * multiselection_xpm[] = { 3 | "22 22 7 1", 4 | " c None", 5 | ". c #FF0000", 6 | "+ c #FFFFFF", 7 | "@ c #000000", 8 | "# c #37FF00", 9 | "$ c #FFEE00", 10 | "% c #0033FF", 11 | " ", 12 | " ", 13 | " ..++..++.. ", 14 | " + + ", 15 | " . @@##@@##@@##@ ", 16 | " . # . @ ", 17 | " + # . # ", 18 | " + @ + # ", 19 | " . @ + @ ", 20 | " . # . @ ", 21 | " + #@@##@@##@@## ", 22 | " + + ", 23 | " . . $$%%$$%% ", 24 | " . . $ $ ", 25 | " + + $ $ ", 26 | " + + % % ", 27 | " ..++..++.. % % ", 28 | " $ $ ", 29 | " $ $ ", 30 | " % % ", 31 | " %$$%%$$% ", 32 | " "}; 33 | -------------------------------------------------------------------------------- /images/zoom_off.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * zoom_off_xpm[] = { 3 | "22 22 8 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #CBE2FF", 7 | "@ c #DDECFF", 8 | "# c #FF0000", 9 | "$ c #E8F1FF", 10 | "% c #FFFFFF", 11 | "& c #AFAFAF", 12 | " ", 13 | " ....... ", 14 | " ..++++@.. ", 15 | " ..#+@@@@$.. # ", 16 | " .###@$$$$@. ### ", 17 | " .+###%%$$@. ### ", 18 | " .+@###%$@+. ### ", 19 | " .+@$###$@+. ### ", 20 | " .@@$$###@+.### ", 21 | " ..@$$@###.### ", 22 | " ..@@++##### ", 23 | " ......###.. ", 24 | " #####.. ", 25 | " ### ###... ", 26 | " ### ###&.. ", 27 | " ### ###&.. ", 28 | " ### .###&.. ", 29 | " ### .###&.. ", 30 | " ### .###.. ", 31 | " # .#.. ", 32 | " .. ", 33 | " "}; 34 | -------------------------------------------------------------------------------- /images/zoom_redo.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * zoom_redo_xpm[] = { 3 | "22 22 8 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #DDECFF", 7 | "@ c #CBE2FF", 8 | "# c #E8F1FF", 9 | "$ c #FFFFFF", 10 | "% c #002AFF", 11 | "& c #AFAFAF", 12 | " ", 13 | " ....... ", 14 | " ..+@@@@.. ", 15 | " ..#++++@@.. ", 16 | " .+####++@@. ", 17 | " .+##$$#++@. ", 18 | " .@+#$$$#+@. ", 19 | " .@+##$$#+@. ", 20 | " .@+#####++. ", 21 | " ..@+++##+.. ", 22 | " ....@@@++.. ", 23 | " ........... ", 24 | " ..... ", 25 | " ...... %%% %", 26 | " ..&... %%%%%%% %%", 27 | " ..&&&. %%%%%%%%% %%", 28 | " ..&&&.. %% %%% %%", 29 | " ..&&&.. %% %%%%%", 30 | " ..&&.. %% %%%%", 31 | " .... %% %%%%%%%", 32 | " .. %%%%%%%%", 33 | " "}; 34 | -------------------------------------------------------------------------------- /images/zoom_undo.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * zoom_undo_xpm[] = { 3 | "22 22 8 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #CBE2FF", 7 | "@ c #DDECFF", 8 | "# c #E8F1FF", 9 | "$ c #FFFFFF", 10 | "% c #002AFF", 11 | "& c #AFAFAF", 12 | " ", 13 | " ....... ", 14 | " ..++++@.. ", 15 | " ..++@@@@#.. ", 16 | " .++@@####@. ", 17 | " .+@@#$$##@. ", 18 | " .+@#$$$#@+. ", 19 | " .+@#$$##@+. ", 20 | " .@@#####@+. ", 21 | " ..@##@@@+.. ", 22 | " ..@@+++.... ", 23 | " ........... ", 24 | " ..... ", 25 | "% %%% ...... ", 26 | "%% %%%%%%% ...&.. ", 27 | "%% %%%%%%%%% .&&&.. ", 28 | "%% %%% %% ..&&&.. ", 29 | "%%%%% %% ..&&&.. ", 30 | "%%%% %% ..&&.. ", 31 | "%%%%%%% %% .... ", 32 | "%%%%%%%% .. ", 33 | " "}; 34 | -------------------------------------------------------------------------------- /images/autoselection_setup.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * autoselection_setup_xpm[] = { 3 | "22 22 9 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #000000", 7 | "@ c #A0A0A0", 8 | "# c #DCDCDC", 9 | "$ c #585858", 10 | "% c #808080", 11 | "& c #C3C3C3", 12 | "* c #303030", 13 | " ..++..++..++..", 14 | " + +", 15 | " + +", 16 | " . .", 17 | " . .", 18 | " + +", 19 | " + +", 20 | " ++++++ .", 21 | " ++@##$%+ .", 22 | " +@&#$$&+ +", 23 | " +@#$&++ +++ +", 24 | " +@##$+ ++@.+ .", 25 | " +@###$$+###.+ .", 26 | " ++@########..$++..++", 27 | " +@@#######..$$.* ", 28 | " @####..@$$$$.#&+ ", 29 | " ###..$$$@&&#&++ ", 30 | " #..$$@&&&@+++ ", 31 | " .$$@##++++ ", 32 | " $@##++ ", 33 | " ##++ ", 34 | " ++ "}; 35 | -------------------------------------------------------------------------------- /debian/control.bookworm: -------------------------------------------------------------------------------- 1 | Source: paperman 2 | Section: graphics 3 | Priority: optional 4 | Maintainer: Simon Glass 5 | Build-Depends: debhelper-compat (= 10), autotools-dev, qt5-qmake, cmake, libtiff5-dev, qtbase5-dev-tools, libsane-dev, libpoppler-qt5-dev, libpodofo-dev, imagemagick, tesseract-ocr, tesseract-ocr-eng 6 | Standards-Version: 4.6.2 7 | Homepage: https://github.com/sjg20/paperman 8 | 9 | Package: paperman 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Recommends: tesseract-ocr 13 | Description: Electronic filing cabinet: scan, print, stack, arrange 14 | Paperman allows you to: 15 | - Quickly scan and file paper into your computer 16 | - Read and write PaperPort .max files 17 | - Stack, arrange and name your scanned paper 18 | - Easily print and view your scanned paper or convert to / from PDF 19 | - Paperman uses SANE and supports JPEG compression on modern, high-speed 20 | scanners 21 | -------------------------------------------------------------------------------- /debian/control.in: -------------------------------------------------------------------------------- 1 | Source: paperman 2 | Section: graphics 3 | Priority: optional 4 | Maintainer: Simon Glass 5 | Build-Depends: debhelper-compat (= 13), autotools-dev, qt5-qmake, cmake, libtiff5-dev, qtbase5-dev-tools, libsane-dev, libpoppler-qt5-dev, cmake, libpodofo-dev, imagemagick, tesseract-ocr, tesseract-ocr-eng 6 | Standards-Version: 4.6.2 7 | Homepage: https://github.com/sjg20/paperman 8 | 9 | Package: paperman 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Recommends: tesseract-ocr 13 | Description: Electronic filing cabinet: scan, print, stack, arrange 14 | Paperman allows you to: 15 | - Quickly scan and file paper into your computer 16 | - Read and write PaperPort .max files 17 | - Stack, arrange and name your scanned paper 18 | - Easily print and view your scanned paper or convert to / from PDF 19 | - Paperman uses SANE and supports JPEG compression on modern, high-speed 20 | scanners 21 | -------------------------------------------------------------------------------- /debian/control.focal: -------------------------------------------------------------------------------- 1 | Source: paperman 2 | Section: graphics 3 | Priority: optional 4 | Maintainer: Simon Glass 5 | Build-Depends: debhelper-compat (= 12), autotools-dev, qt5-qmake, cmake, libtiff5-dev, qtbase5-dev-tools, libsane-dev, libpoppler-qt5-dev, cmake, libpodofo-dev, imagemagick, tesseract-ocr, tesseract-ocr-eng 6 | Standards-Version: 4.6.2 7 | Homepage: https://github.com/sjg20/paperman 8 | 9 | Package: paperman 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Recommends: tesseract-ocr 13 | Description: Electronic filing cabinet: scan, print, stack, arrange 14 | Paperman allows you to: 15 | - Quickly scan and file paper into your computer 16 | - Read and write PaperPort .max files 17 | - Stack, arrange and name your scanned paper 18 | - Easily print and view your scanned paper or convert to / from PDF 19 | - Paperman uses SANE and supports JPEG compression on modern, high-speed 20 | scanners 21 | -------------------------------------------------------------------------------- /debian/control.bionic: -------------------------------------------------------------------------------- 1 | Source: paperman 2 | Section: graphics 3 | Priority: optional 4 | Maintainer: Simon Glass 5 | Build-Depends: debhelper-compat (= 10), autotools-dev, qt5-default, qt5-qmake, cmake, libtiff5-dev, qtbase5-dev-tools, libsane-dev, libpoppler-qt5-dev, libpodofo-dev, imagemagick, tesseract-ocr, tesseract-ocr-eng 6 | Standards-Version: 4.6.2 7 | Homepage: https://github.com/sjg20/paperman 8 | 9 | Package: paperman 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Recommends: tesseract-ocr 13 | Description: Electronic filing cabinet: scan, print, stack, arrange 14 | Paperman allows you to: 15 | - Quickly scan and file paper into your computer 16 | - Read and write PaperPort .max files 17 | - Stack, arrange and name your scanned paper 18 | - Easily print and view your scanned paper or convert to / from PDF 19 | - Paperman uses SANE and supports JPEG compression on modern, high-speed 20 | scanners 21 | -------------------------------------------------------------------------------- /debian/control.buster: -------------------------------------------------------------------------------- 1 | Source: paperman 2 | Section: graphics 3 | Priority: optional 4 | Maintainer: Simon Glass 5 | Build-Depends: debhelper-compat (= 11), autotools-dev, qt5-qmake, qt5-default, cmake, libtiff5-dev, qtbase5-dev-tools, libsane-dev, libpoppler-qt5-dev, libpodofo-dev, imagemagick, tesseract-ocr, tesseract-ocr-eng 6 | Standards-Version: 4.6.2 7 | Homepage: https://github.com/sjg20/paperman 8 | 9 | Package: paperman 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Recommends: tesseract-ocr 13 | Description: Electronic filing cabinet: scan, print, stack, arrange 14 | Paperman allows you to: 15 | - Quickly scan and file paper into your computer 16 | - Read and write PaperPort .max files 17 | - Stack, arrange and name your scanned paper 18 | - Easily print and view your scanned paper or convert to / from PDF 19 | - Paperman uses SANE and supports JPEG compression on modern, high-speed 20 | scanners 21 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2010-11-04 Simon Glass 2 | 3 | * scripts/do-build, scripts/setup-pbuilder: Added build scripts 4 | 5 | 2010-11-03 Simon Glass 6 | 7 | * maxview.pro: Removed gdbmacros from normal build 8 | 9 | 2010-11-02 Simon Glass 10 | 11 | * debian/README.Debian, debian/changelog, debian/compat, debian/control, 12 | debian/copyright, debian/dirs, debian/docs, debian/maxview.doc-base.EX, 13 | debian/maxview.pod, debian/menu, debian/rules, debian/watch, maxview.pro: 14 | Added debian files 15 | 16 | 2010-11-01 Simon Glass 17 | 18 | * README: Small change to README (version bump) 19 | 20 | * desk.cpp, desktopmodel.cpp, desktopview.cpp, desktopwidget.cpp, file.cpp, 21 | filemax.cpp, filemax.h, maxview.cpp, mem.cpp, mem.h, pagewidget.cpp, 22 | utils.cpp, utils.h: Fixed nasty JPEG decompression memory overwrite bug 23 | Removed some stdout debugging Fixed Pagewidget layout warning message (needs 24 | more testing) 25 | -------------------------------------------------------------------------------- /maxview.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | #ifndef __maxview_h 26 | #define __maxview_h 27 | 28 | 29 | bool err_complain (err_info *err); 30 | 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /images/resolution_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * resolution_option_xpm[] = { 3 | "31 31 2 1", 4 | " c None", 5 | ". c #000000", 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 | -------------------------------------------------------------------------------- /images/brx_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * brx_option_xpm[] = { 3 | "31 31 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 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 | -------------------------------------------------------------------------------- /images/bry_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * bry_option_xpm[] = { 3 | "31 31 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 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 | -------------------------------------------------------------------------------- /images/tlx_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * tlx_option_xpm[] = { 3 | "31 31 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 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 | -------------------------------------------------------------------------------- /images/tly_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * tly_option_xpm[] = { 3 | "31 31 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 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 | -------------------------------------------------------------------------------- /images/brightness_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * brightness_option_xpm[] = { 3 | "31 31 3 1", 4 | " c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 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 | -------------------------------------------------------------------------------- /images/contrast_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * contrast_option_xpm[] = { 3 | "31 31 3 1", 4 | "0 c None", 5 | ". c #000000", 6 | "+ c #FFFFFF", 7 | "0000000000000000000000000000000", 8 | "0000000000000000000000000000000", 9 | "0000000000000000000000000000000", 10 | "0000000000000000000000000000000", 11 | "0000000000000000000000000000000", 12 | "0000000000000000000000000000000", 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 | -------------------------------------------------------------------------------- /ocrtess.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | #include "ocr.h" 26 | 27 | 28 | class Ocrtess : public Ocr 29 | { 30 | public: 31 | Ocrtess (void); 32 | ~Ocrtess (); 33 | 34 | /** convert an image to text */ 35 | err_info *imageToText (QImage &image, QString &text); 36 | 37 | err_info *init (void); 38 | }; 39 | 40 | -------------------------------------------------------------------------------- /test/test_dirmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_DIRMODEL_H 2 | #define TEST_DIRMODEL_H 3 | 4 | class QAbstractItemModel; 5 | class QAbstractProxyModel; 6 | 7 | #include 8 | 9 | #include "suite.h" 10 | 11 | class Dirmodel; 12 | 13 | class TestDirmodel: public Suite 14 | { 15 | Q_OBJECT 16 | public: 17 | using Suite::Suite; 18 | 19 | private slots: 20 | void testBase(); 21 | void testProxy(); 22 | void testModel(); 23 | void testAddDir(); 24 | void testAddFiles(); 25 | 26 | //! Check that the cache has files in it 27 | void testCacheFiles(); 28 | 29 | private: 30 | /** 31 | * @brief Set up a new Dirmodel with test data 32 | * @param add_files true to add some files, false for just directories 33 | * @return Dirmodel, ready for tests 34 | */ 35 | Dirmodel *setupModel(bool add_file = false); 36 | 37 | /** 38 | * @brief Run checks on a Dirmodel 39 | * @param model Model to check 40 | * @param dirmodel Dirmodel object, if available, else nullptr 41 | * @param proxy Dirproxy object, if available, else nullptr 42 | */ 43 | void checkModel(const QAbstractItemModel *model, const Dirmodel *dirmodel, 44 | const QAbstractProxyModel *proxy); 45 | 46 | // Read the .papertree file from a path and return it as a string 47 | QString getPaperTree(QString &path); 48 | }; 49 | 50 | #endif // TEST_DIRMODEL_H 51 | -------------------------------------------------------------------------------- /images/no_entry.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * no_entry_xpm[] = { 3 | "32 32 4 1", 4 | " s None c None", 5 | ". c #000000000000", 6 | "X c red", 7 | "o c yellow", 8 | " ", 9 | " ......... ", 10 | " ...XXXXXXXXX... ", 11 | " .XXXXXXXXXXXXXXX. ", 12 | " ..XXXXXXXXXXXXXXXXX.. ", 13 | " .XXXXXXXXXXXXXXXXXXXXX. ", 14 | " .XXXXXXXXXXXXXXXXXXXXXXX. ", 15 | " .XXXXXXXXXXXXXXXXXXXXXXX. ", 16 | " .XXXXXXXXXXXXXXXXXXXXXXXXX. ", 17 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ", 18 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ", 19 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ", 20 | ".XXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ", 21 | ".XXX.......................XXX. ", 22 | ".XXX.ooooooooooooooooooooo.XXX. ", 23 | ".XXX.ooooooooooooooooooooo.XXX. ", 24 | ".XXX.ooooooooooooooooooooo.XXX. ", 25 | ".XXX.ooooooooooooooooooooo.XXX. ", 26 | ".XXX.ooooooooooooooooooooo.XXX. ", 27 | ".XXX.ooooooooooooooooooooo.XXX. ", 28 | ".XXX.......................XXX. ", 29 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ", 30 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ", 31 | " .XXXXXXXXXXXXXXXXXXXXXXXXXXX. ", 32 | " .XXXXXXXXXXXXXXXXXXXXXXXXX. ", 33 | " .XXXXXXXXXXXXXXXXXXXXXXX. ", 34 | " .XXXXXXXXXXXXXXXXXXXXXXX. ", 35 | " .XXXXXXXXXXXXXXXXXXXXX. ", 36 | " ..XXXXXXXXXXXXXXXXX.. ", 37 | " .XXXXXXXXXXXXXXX. ", 38 | " ...XXXXXXXXX... ", 39 | " ......... "}; 40 | -------------------------------------------------------------------------------- /qi/splashwidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | splashwidget.h - description 3 | ------------------- 4 | begin : Sat Nov 23 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SPLASHWIDGET_H 19 | #define SPLASHWIDGET_H 20 | 21 | #include 22 | 23 | /** 24 | *@author Michael Herder 25 | */ 26 | 27 | class SplashWidget : public QWidget 28 | { 29 | Q_OBJECT 30 | public: 31 | SplashWidget(QWidget *parent=0, const char *name=0); 32 | ~SplashWidget(); 33 | /** No descriptions */ 34 | void show(); 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /pagetools.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | #include "ui_pagetools.h" 26 | 27 | class QFrame; 28 | 29 | 30 | class Pagetools : public QFrame, public Ui::Pagetools 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | Pagetools(QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); 36 | ~Pagetools(); 37 | 38 | protected slots: 39 | virtual void languageChange(); 40 | 41 | private: 42 | void init(); 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /ocromni.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | #include "ocr.h" 26 | 27 | 28 | class Ocromni : public Ocr 29 | { 30 | public: 31 | Ocromni (void); 32 | ~Ocromni (); 33 | 34 | /** convert an image to text */ 35 | err_info *imageToText (QImage &image, QString &text); 36 | 37 | err_info *init (void); 38 | 39 | private : 40 | err_info *omni_init (void); 41 | 42 | err_info *checkerr (char *operation, int rc); 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /qi/qsplinearray.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qsplinearray.h - description 3 | ------------------- 4 | begin : Tue Oct 31 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QSPLINEARRAY_H 18 | #define QSPLINEARRAY_H 19 | #define MAX_POINTS 200 20 | 21 | #include 22 | 23 | /** 24 | *@author M. Herder 25 | */ 26 | 27 | class QSplineArray : public QPolygon 28 | { 29 | public: 30 | QSplineArray(); 31 | ~QSplineArray(); 32 | /** */ 33 | QPolygon spline(); 34 | /** */ 35 | QPolygon line(); 36 | private: // Private attributes 37 | /** */ 38 | bool mSorted; 39 | private: // Private methods 40 | void sortCoords(); 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /qi/motranslator.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | motranslator.h - description 3 | ------------------- 4 | begin : Fri Apr 25 2003 5 | copyright : (C) 2003 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef MOTRANSLATOR_H 19 | #define MOTRANSLATOR_H 20 | 21 | #include 22 | #include 23 | 24 | /** 25 | *@author Michael Herder 26 | */ 27 | 28 | class MoTranslator : public QTranslator 29 | { 30 | public: 31 | MoTranslator(QObject* parent,const char* name=0); 32 | ~MoTranslator(); 33 | /** No descriptions */ 34 | bool loadMoFile(QString filename,const char* context); 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /maxview.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/locate.xpm 4 | images/unknown.xpm 5 | images/no_access.xpm 6 | images/info.xpm 7 | images/left.xpm 8 | images/right.xpm 9 | images/pages.xpm 10 | images/document-revert.xpm 11 | images/document-save.xpm 12 | images/scanmode.xpm 13 | images/hand.xpm 14 | images/pointer.xpm 15 | images/pageblank.xpm 16 | images/pagekeep.xpm 17 | images/pageremove.xpm 18 | images/maxview.png 19 | images/zoom-best-fit.xpm 20 | images/zoom-in.xpm 21 | images/zoom-out.xpm 22 | images/zoom-original.xpm 23 | images/hflip.xpm 24 | images/next.xpm 25 | images/options.xpm 26 | images/pnext.xpm 27 | images/pprev.xpm 28 | images/prev.xpm 29 | images/print.xpm 30 | images/rleft.xpm 31 | images/rright.xpm 32 | images/scan-go.xpm 33 | images/scan.xpm 34 | images/swap.xpm 35 | images/vflip.xpm 36 | 37 | 38 | -------------------------------------------------------------------------------- /qi/qimageioext.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qimageioext.h - description 3 | ------------------- 4 | begin : Mon Mar 26 2001 5 | copyright : (C) 2001 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef QIMAGEIOEXT_H 19 | #define QIMAGEIOEXT_H 20 | /** 21 | *@author M. Herder 22 | */ 23 | 24 | #include "resource.h" 25 | #include 26 | #include 27 | 28 | class QImageWriter; 29 | class QImageReader; 30 | 31 | #ifdef HAVE_LIBTIFF 32 | void initTiffIO(); 33 | #endif 34 | void initPnmIO(); 35 | bool qis_write_pbm_image( QImageWriter *iio, QImage &image ); 36 | QImage *qis_read_pbm_image(QImageReader* iio); 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /qsanestatusmessage.h: -------------------------------------------------------------------------------- 1 | #include 2 | /*************************************************************************** 3 | qsanestatusmessage.h - description 4 | ------------------- 5 | begin : Thu Jun 7 2001 6 | copyright : (C) 2001 by Michael Herder 7 | email : crapsite@gmx.net 8 | ***************************************************************************/ 9 | 10 | /*************************************************************************** 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License version 2 as * 14 | * published by the Free Software Foundation. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef QSANESTATUSMESSAGE_H 19 | #define QSANESTATUSMESSAGE_H 20 | 21 | extern "C" 22 | { 23 | #include 24 | } 25 | #include 26 | 27 | /** 28 | *@author Michael Herder 29 | */ 30 | 31 | 32 | class QSaneStatusMessage : public QMessageBox 33 | { 34 | Q_OBJECT 35 | public: 36 | QSaneStatusMessage(SANE_Status status, QWidget* parent); 37 | ~QSaneStatusMessage(); 38 | private: 39 | SANE_Status mSaneStatus; 40 | QLabel* mMessageLabel; 41 | void setMessage(); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /scripts/setup-pbuilder: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ARCHS="i386 amd64" 4 | ARCHS="amd64" 5 | #UDISTS="hardy jaunty karmic lucid maverick" 6 | UDISTS="bionic focal jammy noble oracular" 7 | DISTS="buster bullseye bookworm trixie" 8 | 9 | # ln: failed to create hard link 10 | # https://bugs.launchpad.net/ubuntu/+source/pbuilder/+bug/1408594 11 | 12 | # should remove /var/cache/pbuilder first 13 | LOGDIR=/var/cache/pbuilder/log 14 | sudo mkdir -p /var/cache/pbuilder 15 | 16 | # http://deb.debian.org/debian 17 | 18 | setup () { 19 | NAME=$dist-$arch.cow 20 | echo 21 | echo $NAME 22 | echo 23 | COMMON="ARCH=$arch DIST=$dist " 24 | COMMON+="cowbuilder --create --distribution $dist " 25 | COMMON+="--basepath /var/cache/pbuilder/base-$NAME --architecture $arch " 26 | COMMON+="--debootstrapopts --exclude=udev,pcmciautils,initramfs-tools " 27 | COMMON+="--debootstrapopts --arch --debootstrapopts $arch " 28 | } 29 | 30 | sudo mkdir -p $LOGDIR 31 | sudo mkdir -p /var/cache/pbuilder/aptcache/ 32 | 33 | sudo chmod a+rw $LOGDIR 34 | for arch in $ARCHS 35 | do 36 | for dist in $DISTS 37 | do 38 | setup 39 | sudo $COMMON --mirror http://deb.debian.org/debian >$LOGDIR/$NAME 40 | done 41 | 42 | for dist in $UDISTS 43 | do 44 | setup 45 | sudo MIRRORSITE=http://us.archive.ubuntu.com:80/ubuntu $COMMON --debootstrapopts --include=gpgv \ 46 | --debootstrapopts \ 47 | "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg" \ 48 | --components "main universe" \ 49 | >$LOGDIR/$NAME 50 | done 51 | done 52 | -------------------------------------------------------------------------------- /qi/qbuttonoption.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qbuttonoption.h - description 3 | ------------------- 4 | begin : Thu Sep 7 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QBUTTONOPTION_H 18 | #define QBUTTONOPTION_H 19 | 20 | #include "qsaneoption.h" 21 | #include 22 | /** 23 | *@author M. Herder 24 | */ 25 | class QPushButton; 26 | class QLabel; 27 | class QString; 28 | 29 | class QButtonOption : public QSaneOption 30 | { 31 | Q_OBJECT 32 | public: 33 | QButtonOption(QString title,QWidget *parent, const char *name=0); 34 | ~QButtonOption(); 35 | private: 36 | /** */ 37 | QPushButton* mpOptionButton; 38 | /** */ 39 | void initWidget(); 40 | /** */ 41 | QLabel* mpTitleLabel; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /qi/textiosupporter.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | textiosupporter.h - description 3 | ------------------- 4 | begin : Fri Mar 1 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef TEXTIOSUPPORTER_H 19 | #define TEXTIOSUPPORTER_H 20 | 21 | #include 22 | 23 | /** 24 | *@author Michael Herder 25 | */ 26 | 27 | class TextIOSupporter 28 | { 29 | public: 30 | TextIOSupporter(); 31 | ~TextIOSupporter(); 32 | /** No descriptions */ 33 | QString validateExtension(QString file_path,QString format=QString::null); 34 | /** No descriptions */ 35 | QString lastErrorString(); 36 | private: 37 | QString mErrorString; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /test/suite.h: -------------------------------------------------------------------------------- 1 | #ifndef SUITE_H 2 | #define SUITE_H 3 | 4 | #include 5 | #include 6 | 7 | class QTemporaryDir; 8 | 9 | // Info from here: 10 | // https://alexhuszagh.github.io/2016/using-qttest-effectively 11 | 12 | class Test : public QObject { 13 | Q_OBJECT 14 | public: 15 | Test(QString name); 16 | ~Test(); 17 | 18 | /** 19 | * @brief Set up a test repo for use and return path 20 | * @param add_files true to add some files, false for just directories 21 | * @return Temporary-directory path 22 | */ 23 | QString setupRepo(bool add_files = false); 24 | 25 | // Get the path to a trash file given its filename 26 | QString trashFile(QString fname); 27 | 28 | // Get the path to the cache file for a top-level paper directory 29 | QString cacheFile(const QString &path); 30 | 31 | static const QString testSrc; 32 | 33 | protected: 34 | /** 35 | * @brief Create a new, empty file 36 | * @param filePath Path to create in (directory must exist) 37 | * @return true if OK, false on error 38 | */ 39 | bool touch(QString filePath); 40 | 41 | private: 42 | /** 43 | * @brief Remove all files and directories within a directory path 44 | * @param dirPath Path to empty (this dir is not removed) 45 | */ 46 | void emptyDirectory(const QString &dirPath); 47 | 48 | public: 49 | QTemporaryDir *_tempDir; 50 | QString _name; 51 | }; 52 | 53 | class Suite: public Test 54 | { 55 | public: 56 | Suite(QString name); 57 | 58 | static std::vector & suite(); 59 | }; 60 | #endif // TESTSUITE_H 61 | -------------------------------------------------------------------------------- /qi/qreadonlyoption.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qreadonlyoption.h - description 3 | ------------------- 4 | begin : Sat Feb 17 2001 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QREADONLYOPTION_H 18 | #define QREADONLYOPTION_H 19 | 20 | #include "qsaneoption.h" 21 | #include 22 | /** 23 | *@author M. Herder 24 | */ 25 | class QLabel; 26 | class QString; 27 | 28 | class QReadOnlyOption : public QSaneOption 29 | { 30 | Q_OBJECT 31 | public: 32 | QReadOnlyOption(QString title,QWidget *parent, const char *name=0); 33 | ~QReadOnlyOption(); 34 | /** */ 35 | void setText(QString text); 36 | private: 37 | /** */ 38 | QLabel* mpValueLabel; 39 | /** */ 40 | void initWidget(); 41 | /** */ 42 | QLabel* mpTitleLabel; 43 | /** */ 44 | QString mTitleText; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /qi/resource.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | resource.h - description 3 | ------------------- 4 | begin : Don Jul 13 20:27:22 CEST 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | #ifndef RESOURCE_H 18 | #define RESOURCE_H 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include "config.h" 22 | #endif 23 | 24 | #include 25 | 26 | #if QT_VERSION >= 300 27 | #define USE_QT3 28 | #endif 29 | 30 | #ifdef KDEAPP 31 | #ifndef QIS_NO_STYLES 32 | #define QIS_NO_STYLES 1 33 | #endif 34 | #endif 35 | 36 | /////////////////////////////////////////////////////////////////// 37 | // General application values 38 | #define IDS_APP_ABOUT "QuiteInsane\nVersion " VERSION \ 39 | "\n(w) 2000 by M. Herder" 40 | #define IDS_STATUS_DEFAULT "Ready." 41 | 42 | #endif // RESOURCE_H 43 | -------------------------------------------------------------------------------- /qi/scanareatemplate.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | scanareatemplate.cpp - description 3 | ------------------- 4 | begin : Sat Nov 30 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #include "scanareatemplate.h" 19 | 20 | ScanAreaTemplate::ScanAreaTemplate(QString name) 21 | { 22 | mName = name; 23 | mRects.resize(0); 24 | } 25 | ScanAreaTemplate::~ScanAreaTemplate() 26 | { 27 | } 28 | /** No descriptions */ 29 | void ScanAreaTemplate::addRects(QVector rects) 30 | { 31 | mRects = rects; 32 | } 33 | /** No descriptions */ 34 | void ScanAreaTemplate::setName(QString name) 35 | { 36 | mName = name; 37 | } 38 | /** No descriptions */ 39 | QString ScanAreaTemplate::name() 40 | { 41 | return mName; 42 | } 43 | /** No descriptions */ 44 | QVector ScanAreaTemplate::rects() 45 | { 46 | return mRects; 47 | } 48 | -------------------------------------------------------------------------------- /qi/qoptionscrollview.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qoptionscrollview.h - description 3 | ------------------- 4 | begin : Thu Jul 20 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QOPTIONSCROLLVIEW_H 18 | #define QOPTIONSCROLLVIEW_H 19 | 20 | #include 21 | #include 22 | 23 | /** 24 | *@author M. Herder 25 | */ 26 | class QBoxLayout; 27 | 28 | 29 | class QOptionScrollView : public QScrollArea 30 | { 31 | public: 32 | QOptionScrollView(QWidget * parent=0, const char * name=0, Qt::WindowFlags f=Qt::WindowFlags() ); 33 | ~QOptionScrollView(); 34 | void addWidget(QWidget* qw,int stretch=0); 35 | protected: 36 | /** */ 37 | virtual void resizeEvent(QResizeEvent* qre); 38 | //s virtual void viewportResizeEvent(QResizeEvent* qre); 39 | private: // Private attributes 40 | /** */ 41 | QWidget* mpMainWidget; 42 | /** */ 43 | QBoxLayout* mpMainLayout; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /qi/unknownprogressdialog.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | unknownprogressdialog.h - description 3 | ------------------- 4 | begin : Sat Mar 16 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef UNKNOWNPROGRESSDIALOG_H 19 | #define UNKNOWNPROGRESSDIALOG_H 20 | 21 | #include 22 | #include 23 | 24 | /** 25 | *@author Michael Herder 26 | */ 27 | 28 | class QLabel; 29 | class QUnknownProgressWidget; 30 | 31 | class UnknownProgressDialog : public QDialog 32 | { 33 | public: 34 | UnknownProgressDialog(QString label=QString::null,QWidget* parent=0,const char* name=0); 35 | ~UnknownProgressDialog(); 36 | private: 37 | QString mLabelText; 38 | QLabel* mpLabel; 39 | QUnknownProgressWidget* mpUnknownProgress; 40 | private: // Private methods 41 | /** No descriptions */ 42 | void initDialog(); 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | struct err_info; 26 | 27 | 28 | /** allocate and zero memory: *ptr = malloc (size) */ 29 | struct err_info *mem_allocz (void **ptr, int size, const char *func_name); 30 | struct err_info *mem_realloc (void **ptr, int newsize, const char *func_name); 31 | struct err_info *mem_alloc (void **ptr, int size, const char *func_name); 32 | void mem_free (void **ptr); 33 | 34 | /** allocate memory for string: *ptr = strdup (str) */ 35 | struct err_info *mem_str (void **ptr, const char *str, const char *func_name); 36 | 37 | /** reallocate memory for string: free (*ptr); *ptr = strdup (str) */ 38 | err_info *mem_restr (void **ptr, const char *str, const char *func_name); 39 | 40 | void mem_check (void); 41 | -------------------------------------------------------------------------------- /qi/scanareatemplate.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | scanareatemplate.h - description 3 | ------------------- 4 | begin : Sat Nov 30 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SCANAREATEMPLATE_H 19 | #define SCANAREATEMPLATE_H 20 | 21 | #include 22 | #include "scanarea.h" 23 | 24 | #include 25 | 26 | /** 27 | *@author Michael Herder 28 | */ 29 | 30 | class ScanAreaTemplate 31 | { 32 | public: 33 | ScanAreaTemplate(QString name = QString()); 34 | ~ScanAreaTemplate(); 35 | /** No descriptions */ 36 | QVector rects(); //s 37 | /** No descriptions */ 38 | QString name(); 39 | /** No descriptions */ 40 | void setName(QString name); 41 | /** No descriptions */ 42 | void addRects(QVector rects); //s 43 | private: 44 | QVector mRects; 45 | QString mName; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /debian/changelog.in: -------------------------------------------------------------------------------- 1 | paperman (1.3-1VENDOR_VERSION) UNRELEASED; urgency=medium 2 | 3 | * Fix problems with dir cache being out of date 4 | * Add more tests for Dirmodel 5 | * Drop the 'recently used' folder 6 | * Set permissions on created files and directories 7 | 8 | -- Simon Glass Wed, 22 Jan 2025 07:17:22 -0700 9 | 10 | 11 | paperman (1.2.1-1VENDOR_VERSION) UNRELEASED; urgency=medium 12 | 13 | * Expand tests to include common stacking/unstacking operations 14 | * Fix various bugs in recent new features, particularly files not being opened 15 | before use 16 | 17 | -- Simon Glass Sat, 07 Sep 2024 20:10:58 -0600 18 | 19 | 20 | paperman (1.2-1VENDOR_VERSION) UNRELEASED; urgency=medium 21 | 22 | * Import files from outside directories 23 | * Avoid keeping all touched-files open 24 | * Bring back command-line operation 25 | * Presets (Ctrl-1 to Ctrl-6) for basic scanning operation 26 | * Faster folder-selection within the scanning window 27 | * Set the group for files 28 | 29 | -- Simon Glass Sat, 07 Sep 2024 20:10:58 -0600 30 | 31 | 32 | paperman (1.1-1VENDOR_VERSION) UNRELEASED; urgency=medium 33 | 34 | * Package renamed for potential, actual release 35 | * Some feature improvements to the scanning window 36 | 37 | -- Simon Glass Sat, 07 Sep 2024 20:10:58 -0600 38 | 39 | 40 | maxview (0.7-2) karmic; urgency=low 41 | 42 | * Update with various bug fixes and slightly wider distribution selection 43 | 44 | -- Simon Glass Sat, 06 Nov 2010 11:46:00 -0700 45 | 46 | 47 | maxview (0.7-1) karmic; urgency=low 48 | 49 | * Initial release (first packaged) 50 | 51 | -- Simon Glass Wed, 02 Sep 2009 21:23:29 +0100 52 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | resource.h - description 3 | ------------------- 4 | begin : Don Jul 13 20:27:22 CEST 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | #ifndef RESOURCE_H 18 | #define RESOURCE_H 19 | 20 | //s #ifdef HAVE_CONFIG_H 21 | //s #include "config.h" 22 | //s #endif 23 | #include "quiteinsanenamespace.h" 24 | 25 | #include 26 | 27 | #if QT_VERSION >= 300 28 | #define USE_QT3 29 | #endif 30 | 31 | #ifdef KDEAPP 32 | #ifndef QIS_NO_STYLES 33 | #define QIS_NO_STYLES 1 34 | #endif 35 | #endif 36 | 37 | /////////////////////////////////////////////////////////////////// 38 | // General application values 39 | 40 | #define VERSION "0.3" 41 | 42 | #define IDS_APP_ABOUT "Maxview\nVersion " VERSION \ 43 | "\n(w) 2005 by Simon Glass" 44 | #define IDS_STATUS_DEFAULT "Ready." 45 | 46 | #endif // RESOURCE_H 47 | -------------------------------------------------------------------------------- /qi/fileiosupporter.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | fileiosupporter.h - description 3 | ------------------- 4 | begin : Thu Nov 21 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef FILEIOSUPPORTER_H 19 | #define FILEIOSUPPORTER_H 20 | 21 | #include 22 | #include 23 | 24 | /** 25 | *@author Michael Herder 26 | */ 27 | 28 | class FileIOSupporter 29 | { 30 | public: 31 | FileIOSupporter(); 32 | ~FileIOSupporter(); 33 | /** No descriptions */ 34 | QString getIncreasingFilename(QString filepath,int step=1,int width=0,bool fill_gap=false); 35 | /** No descriptions */ 36 | QStringList getAbsPathList(QString dir_path,QString filetemplate,int width,QString ext); 37 | /** No descriptions */ 38 | bool isValidFilename(QString filepath); 39 | /** No descriptions */ 40 | QString lastErrorString(); 41 | private: 42 | QString mErrorString; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /qi/qfiledialogext.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qfiledialogext.h - description 3 | ------------------- 4 | begin : Sun Sep 16 2001 5 | copyright : (C) 2001 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef QFILEDIALOGEXT_H 19 | #define QFILEDIALOGEXT_H 20 | 21 | #include 22 | #include 23 | 24 | /**This class is needed to work around some 25 | bugs/limitations in QFileDialog. 26 | *@author Michael Herder 27 | */ 28 | 29 | class QFileDialogExt : public QFileDialog 30 | { 31 | public: 32 | QFileDialogExt(QWidget* parent=0,const char* name = 0,bool modal = true); 33 | QFileDialogExt(const QString& dirName,const QString& filter=QString::null, 34 | QWidget* parent=0,const char* name=0,bool modal=true); 35 | ~QFileDialogExt(); 36 | int intViewMode(); 37 | private: 38 | int mViewMode; 39 | protected slots: 40 | virtual void reject(); 41 | virtual void accept(); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /qi/qdoublespinbox.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qdoublespinbox.h - description 3 | ------------------- 4 | begin : Tue Dec 12 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef QDOUBLESPINBOX_H 19 | #define QDOUBLESPINBOX_H 20 | 21 | #include 22 | #include 23 | /** 24 | *@author M. Herder 25 | */ 26 | 27 | class QDouble100SpinBox : public QSpinBox 28 | { 29 | Q_OBJECT 30 | public: 31 | QDouble100SpinBox(QWidget * parent = 0, const char * name = 0); 32 | /** */ 33 | void selectAll(); 34 | protected: // Protected methods 35 | /** */ 36 | virtual int mapTextToValue(bool* ok); 37 | protected: // Protected methods 38 | /** */ 39 | QValidator::State validate(QString &input, int &pos) const; 40 | virtual QString mapValueToText(int value); 41 | ~QDouble100SpinBox(); 42 | public: 43 | void setValidator(QValidator *validator); 44 | private: 45 | QValidator *mValidator; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /qi/qstringoption.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qstringoption.h - description 3 | ------------------- 4 | begin : Fri Sep 15 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QSTRINGOPTION_H 18 | #define QSTRINGOPTION_H 19 | 20 | #include "qsaneoption.h" 21 | /** 22 | *@author M. Herder 23 | */ 24 | class QString; 25 | class QLineEdit; 26 | class QPushButton; 27 | 28 | class QStringOption : public QSaneOption 29 | { 30 | Q_OBJECT 31 | public: 32 | QStringOption(QString title,QWidget *parent, const char *name=0); 33 | ~QStringOption(); 34 | /** */ 35 | QString text(); 36 | /** */ 37 | void setText(const char* text); 38 | /** No descriptions */ 39 | void setMaxLength(int length); 40 | private: // Private methods 41 | /** */ 42 | void initWidget(); 43 | private: // Private attributes 44 | /** */ 45 | QLineEdit* mpOptionLineEdit; 46 | /** */ 47 | QString mCurrentText; 48 | private slots: // Private slots 49 | /** */ 50 | void slotTextChanged(const QString& qs); 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /qi/qswitchoffmessage.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qswitchoffmessage.h - description 3 | ------------------- 4 | begin : Mon Mar 12 2001 5 | copyright : (C) 2001 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef QSWITCHOFFMESSAGE_H 19 | #define QSWITCHOFFMESSAGE_H 20 | 21 | #include 22 | 23 | /** 24 | *@author Michael Herder 25 | */ 26 | class QCheckBox; 27 | 28 | class QSwitchOffMessage : public QDialog 29 | { 30 | Q_OBJECT 31 | public: 32 | enum Type 33 | { 34 | Type_AdfWarning, 35 | Type_MultiWarning, 36 | Type_PrinterSetupWarning 37 | }; 38 | QSwitchOffMessage(Type t,QWidget* parent=0,const char* name=0); 39 | ~QSwitchOffMessage(); 40 | /** */ 41 | bool dontShow(); 42 | private: 43 | Type mType; 44 | QCheckBox* mpDontShowCheckBox; 45 | private: //methods 46 | void initDlg(); 47 | private slots: // Private slots 48 | /** */ 49 | void slotButton2(); 50 | /** */ 51 | void slotDontShow(bool); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /test/test_ops.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_OPS_H 2 | #define TEST_OPS_H 3 | 4 | #include 5 | 6 | #include "suite.h" 7 | 8 | class QTemporaryDir; 9 | 10 | class Desktopmodel; 11 | class Mainwindow; 12 | class TreeItem; 13 | 14 | class TestOps: public Suite 15 | { 16 | Q_OBJECT 17 | public: 18 | using Suite::Suite; 19 | 20 | private slots: 21 | void testStartup(); 22 | void testAddRepos(); 23 | 24 | // Test duplicating a stack 25 | void testDuplicate(); 26 | 27 | // Test duplicating a stack and then undoing it 28 | void testDuplicateUndo(); 29 | 30 | // Test duplicating a stack, combining the two and then undoing it 31 | void testDuplicateStackUndo(); 32 | void testUnstackPage(); 33 | 34 | //! Duplicate a PDF as a Max file and then that as a PDF 35 | void testDuplicateMax(); 36 | 37 | //! Test duplication of odd and even pages 38 | void testDuplicateEvenOdd(); 39 | 40 | //! Test deleting of one or more stacks 41 | void testDeleteStacks(); 42 | 43 | //! Test unstacking stacks 44 | void testUnstackStacks(); 45 | 46 | //! Test renaming stacks 47 | void testRenameStack(); 48 | 49 | //! Test renaming a page 50 | void testRenamePage(); 51 | 52 | //! Test creating a dir 53 | void testCreateDir(); 54 | 55 | private: 56 | //! Setup the test repo and return its model and root index 57 | void getTestRepo(Mainwindow *me, Desktopmodel*& model, 58 | QModelIndex& repo_ind); 59 | 60 | void duplicate(Mainwindow *me, QModelIndex &repo_ind); 61 | 62 | /** 63 | * @brief Get ready to duplicate a stack 64 | * @param me Mainwindow 65 | * @param repo_ind Returns index of the repo being used 66 | * @param max_ind Returns index of the max file 67 | */ 68 | void prepareDuplicate(Mainwindow *me, QModelIndex &repo_ind, 69 | QModelIndex &max_ind); 70 | 71 | }; 72 | 73 | #endif // TEST_OPS_H 74 | -------------------------------------------------------------------------------- /options.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | #ifndef __options_h 26 | #define __options_h 27 | 28 | #include 29 | 30 | 31 | #include "ui_options.h" 32 | 33 | class Mainwidget; 34 | class Ui_printopt; 35 | 36 | class Options : public QDialog, public Ui::Options 37 | { 38 | Q_OBJECT 39 | 40 | public: 41 | Options(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = Qt::WindowFlags()); 42 | ~Options(); 43 | 44 | virtual void setMainwidget( Mainwidget * main ); 45 | 46 | public slots: 47 | virtual void ok_clicked(); 48 | virtual void cancel_clicked(); 49 | 50 | protected: 51 | Mainwidget *_main; 52 | 53 | protected slots: 54 | virtual void languageChange(); 55 | 56 | private: 57 | virtual void init(); 58 | 59 | private slots: 60 | virtual void updateThreshold( int ); 61 | 62 | }; 63 | 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /saneconfig.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | saneconfig.h - description 3 | ------------------- 4 | begin : Sat Apr 26 2003 5 | copyright : (C) 2003 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SANECONFIG_H 19 | #define SANECONFIG_H 20 | 21 | #include "resource.h" 22 | #include 23 | #include 24 | 25 | /** 26 | *@author Michael Herder 27 | */ 28 | 29 | class QProcess; 30 | 31 | class SaneConfig : public QObject 32 | { 33 | Q_OBJECT 34 | public: 35 | SaneConfig(QObject* parent,const char* name=0); 36 | /** No descriptions */ 37 | QString& prefix(); 38 | ~SaneConfig(); 39 | private: 40 | bool mRun; 41 | QString mPrefix; 42 | #ifndef USE_QT3 43 | QProcessBackport* mpProcess; 44 | #else 45 | QProcess* mpProcess; 46 | #endif 47 | private slots: // Private slots 48 | /** No descriptions */ 49 | void slotReadStdout(); 50 | /** No descriptions */ 51 | void slotExited(); 52 | /** No descriptions */ 53 | void slotForceStop(); 54 | private: // Private methods 55 | /** No descriptions */ 56 | void run(); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /qi/qdraglabel.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qdraglabel.h - description 3 | ------------------- 4 | begin : Thu Feb 22 2001 5 | copyright : (C) 2001 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef QDRAGLABEL_H 19 | #define QDRAGLABEL_H 20 | 21 | #include 22 | #include 23 | 24 | 25 | /**@author Michael Herder */ 26 | 27 | /**This label allows dragging a list of files to other 28 | applications. */ 29 | 30 | class QMouseMoveEvent; 31 | 32 | class QDragLabel : public QLabel 33 | { 34 | Q_OBJECT 35 | public: 36 | QDragLabel(QWidget* parent,const char* name=0,WFlags f=0); 37 | ~QDragLabel(); 38 | /**Clear the list of filenames and add fn as the only entry.*/ 39 | void setFilename(QString fn); 40 | /**Add fn to the list of filenames.*/ 41 | void addFilename(QString fn); 42 | /** Clear the list of filenames */ 43 | void clearFilenameList(); 44 | private: // Private attributes 45 | /** */ 46 | QStringList mFileNames; 47 | protected: // Protected methods 48 | /** */ 49 | void mouseMoveEvent(QMouseEvent* me); 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /quiteinsanenamespace.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | quiteinsanenamespace.h - description 3 | ------------------- 4 | begin : Fri Sep 8 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QUITEINSANENAMESPACE_H 18 | #define QUITEINSANENAMESPACE_H 19 | 20 | 21 | /** 22 | *@author M. Herder 23 | */ 24 | 25 | class QIN 26 | { 27 | public: 28 | enum ScanMode 29 | { 30 | Temporary = 0, 31 | SingleFile = 1, 32 | OCR = 2, 33 | CopyPrint = 3, 34 | MultiScan = 4, 35 | Direct = 5 36 | }; 37 | enum MetricSystem 38 | { 39 | Millimetre = 0, 40 | Centimetre = 1, 41 | Inch = 2, 42 | NoMetricSystem = 3 43 | }; 44 | enum Orientation 45 | { 46 | Vertical = 0, 47 | Horizontal = 1 48 | }; 49 | enum Layout 50 | { 51 | ScrollLayout = 0, 52 | TabLayout = 1, 53 | MultiWindowLayout = 2, 54 | ListLayout = 3 55 | }; 56 | enum Status 57 | { 58 | OpenFailed = 0, 59 | ReadyToShow = 1, 60 | NoScanner = 2, 61 | UserCancel = 3, 62 | InitFailed = 4 63 | }; 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /qi/previewupdatewidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | previewupdatewidget.h - description 3 | ------------------- 4 | begin : Mon May 13 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef PREVIEWUPDATEWIDGET_H 19 | #define PREVIEWUPDATEWIDGET_H 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | /** 27 | *@author Michael Herder 28 | */ 29 | 30 | class PreviewUpdateWidget : public QWidget 31 | { 32 | Q_OBJECT 33 | public: 34 | PreviewUpdateWidget(QWidget* parent=0,const char* name=0); 35 | ~PreviewUpdateWidget(); 36 | /** No descriptions */ 37 | void setData(QByteArray& data); 38 | /** No descriptions */ 39 | void clearWidget(); 40 | /** No descriptions */ 41 | void initPixmap(int rw, int rh); 42 | protected: // Protected methods 43 | /** No descriptions */ 44 | void paintEvent(QPaintEvent* e); 45 | private: 46 | /** */ 47 | int mBegin; 48 | /** */ 49 | int mRealWidth; 50 | /** */ 51 | int mRealHeight; 52 | /** */ 53 | QPixmap mPixmap; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /qi/directorylistview.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | directorylistview.h - description 3 | ------------------- 4 | begin : Wed Feb 6 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef DIRECTORYLISTVIEW_H 19 | #define DIRECTORYLISTVIEW_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | /** 26 | *@author Michael Herder 27 | */ 28 | 29 | class DirectoryListView : public QListView 30 | { 31 | Q_OBJECT 32 | public: 33 | DirectoryListView(QWidget* parent=0,const char* name=0); 34 | ~DirectoryListView(); 35 | /** No descriptions */ 36 | QString directory(); 37 | /** No descriptions */ 38 | void setDirectory(QString path); 39 | private: // Private methods 40 | /** No descriptions */ 41 | void createContents(); 42 | private: 43 | QString mCurrentDirPath; 44 | QDir mCurrentDir; 45 | private slots: // Private slots 46 | /** No descriptions */ 47 | void slotItemClicked(QListViewItem* li); 48 | signals: 49 | /** No descriptions */ 50 | void signalDirectoryChanged(QString path); 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /qi/qreadonlyoption.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qreadonlyoption.cpp - description 3 | ------------------- 4 | begin : Sat Feb 17 2001 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #include "qreadonlyoption.h" 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | QReadOnlyOption::QReadOnlyOption(QString title,QWidget *parent, const char *name ) 24 | :QSaneOption(title,parent,name) 25 | { 26 | mTitleText = title; 27 | initWidget(); 28 | } 29 | QReadOnlyOption::~QReadOnlyOption() 30 | { 31 | } 32 | /** */ 33 | void QReadOnlyOption::initWidget() 34 | { 35 | QGridLayout* qgl = new QGridLayout(this); 36 | qgl->setMargin(4); 37 | qgl->setSpacing(4); 38 | mpTitleLabel = new QLabel(mTitleText,this); 39 | mpValueLabel = new QLabel(this); 40 | //create pixmap 41 | assignPixmap(); 42 | qgl->addWidget(pixmapWidget(),0,0); 43 | qgl->addWidget(mpTitleLabel,0,1); 44 | qgl->addWidget(mpValueLabel,0,2); 45 | qgl->setColumnStretch(1,1); 46 | qgl->activate(); 47 | } 48 | /** */ 49 | void QReadOnlyOption::setText(QString text) 50 | { 51 | mpValueLabel->setText(text); 52 | } 53 | -------------------------------------------------------------------------------- /qi/ruler.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | ruler.h - description 3 | ------------------- 4 | begin : Mon Jul 17 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | //class name changed from QRuler to Ruler on Mon Jan 28 2002 18 | 19 | #ifndef RULER_H 20 | #define RULER_H 21 | 22 | #include 23 | 24 | #include "quiteinsanenamespace.h" 25 | /** 26 | *@author M. Herder 27 | */ 28 | //forward declarations 29 | class QPainter; 30 | 31 | class Ruler : public QFrame 32 | { 33 | public: 34 | Ruler( QWidget * parent=0, const char * name=0,Qt::Orientation o=Qt::Vertical, Qt::WindowFlags f=Qt::WindowFlags()); 35 | ~Ruler(); 36 | void setRulerValues(double rmv,double sm,int ssn); 37 | /** No descriptions */ 38 | void setMaxRange(double max); 39 | /** No descriptions */ 40 | void setMinRange(double min); 41 | /** No descriptions */ 42 | void setRange(double min,double max); 43 | private: // Private attributes 44 | /** */ 45 | double mMaxRange; 46 | /** */ 47 | double mMinRange; 48 | /** */ 49 | Qt::Orientation mOrientation; 50 | protected: // Protected methods 51 | /** */ 52 | virtual void drawContents(QPainter* painter); 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /qi/qbooloption.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qbooloption.h - description 3 | ------------------- 4 | begin : Thu Sep 14 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QBOOLOPTION_H 18 | #define QBOOLOPTION_H 19 | 20 | #include "qsaneoption.h" 21 | extern "C" 22 | { 23 | #include 24 | } 25 | 26 | /** 27 | *@author M. Herder 28 | */ 29 | class QString; 30 | class QCheckBox; 31 | 32 | class QBoolOption : public QSaneOption 33 | { 34 | Q_OBJECT 35 | public: 36 | QBoolOption(QString title,QWidget *parent, const char *name=0); 37 | ~QBoolOption(); 38 | /** */ 39 | SANE_Bool state(); 40 | /** */ 41 | void setState(SANE_Bool sb); 42 | /** */ 43 | void enableAutomatic(bool b); 44 | /** */ 45 | bool automatic(); 46 | private: 47 | /** */ 48 | void initWidget(); 49 | /** */ 50 | QCheckBox* mpOptionCheckBox; 51 | /** */ 52 | QCheckBox* mpAutoCheckBox; 53 | /** */ 54 | bool mAutomatic; 55 | private slots: // Private slots 56 | /**Turn automatic mode on or off. */ 57 | void slotAutoMode(bool automode); 58 | signals: // Signals 59 | /** */ 60 | void signalAutomatic(int opt,bool automode); 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /qi/dragiconview.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | dragiconview.h - description 3 | ------------------- 4 | begin : Tue Feb 26 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef DRAGICONVIEW_H 19 | #define DRAGICONVIEW_H 20 | 21 | #include 22 | 23 | /** 24 | *@author Michael Herder 25 | */ 26 | class QListViewItem; 27 | class QKeyEvent; 28 | 29 | class DragIconView : public QIconView 30 | { 31 | Q_OBJECT 32 | public: 33 | DragIconView(QWidget* parent=0,const char* name =0,WFlags f=0); 34 | ~DragIconView(); 35 | private: 36 | /** */ 37 | bool mShiftOrCtrlPressed; 38 | /** */ 39 | bool mLmbPressed; 40 | protected: // Protected methods 41 | /** */ 42 | void contentsMouseMoveEvent(QMouseEvent* me); 43 | /** */ 44 | void keyReleaseEvent(QKeyEvent* e); 45 | /** */ 46 | void keyPressEvent(QKeyEvent* e); 47 | /** No descriptions */ 48 | void contentsMousePressEvent(QMouseEvent* e); 49 | /** No descriptions */ 50 | void contentsMouseReleaseEvent(QMouseEvent* e); 51 | signals: // Signals 52 | /** */ 53 | void signalDragStarted(DragIconView* iconview); 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /qi/qbuttonoption.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qbuttonoption.cpp - description 3 | ------------------- 4 | begin : Thu Sep 7 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #include "qbuttonoption.h" 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | QButtonOption::QButtonOption(QString title,QWidget *parent, const char *name ) 27 | :QSaneOption(title,parent,name) 28 | { 29 | initWidget(); 30 | } 31 | QButtonOption::~QButtonOption() 32 | { 33 | } 34 | /** */ 35 | void QButtonOption::initWidget() 36 | { 37 | QGridLayout* qgl = new QGridLayout(this); 38 | mpTitleLabel = new QLabel(optionTitle(),this); 39 | mpOptionButton = new QPushButton(tr("Set Option"),this); 40 | connect(mpOptionButton,SIGNAL(clicked()), 41 | this,SLOT(slotEmitOptionChanged())); 42 | //create pixmap 43 | assignPixmap(); 44 | if(pixmapWidget()) 45 | qgl->addWidget(pixmapWidget(),0,0); 46 | qgl->addWidget(mpTitleLabel,0,1); 47 | qgl->addWidget(mpOptionButton,0,2); 48 | qgl->setSpacing(5); 49 | qgl->setColumnStretch(1,1); 50 | qgl->activate(); 51 | } 52 | -------------------------------------------------------------------------------- /qi/qunknownprogresswidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qunknownprogresswidget.h - description 3 | ------------------- 4 | begin : Sat Dec 30 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef QUNKNOWNPROGRESSWIDGET_H 19 | #define QUNKNOWNPROGRESSWIDGET_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | /** 26 | *@author M. Herder 27 | */ 28 | class QLabel; 29 | class QTimer; 30 | 31 | class QUnknownProgressWidget : public QFrame 32 | { 33 | Q_OBJECT 34 | public: 35 | QUnknownProgressWidget(QWidget* parent=0,const char* name=0,WFlags f=0); 36 | ~QUnknownProgressWidget(); 37 | /** */ 38 | void start(int ms = 20); 39 | /** */ 40 | void stop(); 41 | private: 42 | int mPos; 43 | QTimer* mpTimer; 44 | QLabel* mpProgressWidget; 45 | QPixmap mPixmap; 46 | QImage mImage; 47 | /** */ 48 | int mStep; 49 | private: //methods 50 | /** */ 51 | void initWidget(); 52 | private slots: 53 | /** */ 54 | void slotMoveIndicator(); 55 | protected: // Protected methods 56 | /** No descriptions */ 57 | virtual void resizeEvent(QResizeEvent* e); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /qi/saneconfig.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | saneconfig.h - description 3 | ------------------- 4 | begin : Sat Apr 26 2003 5 | copyright : (C) 2003 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SANECONFIG_H 19 | #define SANECONFIG_H 20 | 21 | #include "resource.h" 22 | #include 23 | #include 24 | 25 | /** 26 | *@author Michael Herder 27 | */ 28 | 29 | #ifndef USE_QT3 30 | class QProcessBackport; 31 | #else 32 | class QProcess; 33 | #endif 34 | 35 | class SaneConfig : public QObject 36 | { 37 | Q_OBJECT 38 | public: 39 | SaneConfig(QObject* parent,const char* name=0); 40 | /** No descriptions */ 41 | QString& prefix(); 42 | ~SaneConfig(); 43 | private: 44 | bool mRun; 45 | QString mPrefix; 46 | #ifndef USE_QT3 47 | QProcessBackport* mpProcess; 48 | #else 49 | QProcess* mpProcess; 50 | #endif 51 | private slots: // Private slots 52 | /** No descriptions */ 53 | void slotReadStdout(); 54 | /** No descriptions */ 55 | void slotExited(); 56 | /** No descriptions */ 57 | void slotForceStop(); 58 | private: // Private methods 59 | /** No descriptions */ 60 | void run(); 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation 2 | ------------ 3 | 4 | Unpack the code into a fresh directory 5 | 6 | You will need these packages: 7 | 8 | - libqt5-dev (or libqt4-dev on older distros) 9 | 10 | At least QT4.4 is needed. This is available in various distributions since 11 | late 2008. 12 | 13 | - libpoppler-qt5-dev (or libpoppler-qt4-dev on older distros) 14 | 15 | Used for PDF preview 16 | 17 | - libpodofo-dev 18 | 19 | podofo used to be embedded within the code, but is now available in a 20 | library. This is used for PDF operations. 21 | 22 | - libsane-dev 23 | 24 | This is the sane scanner library. 25 | 26 | - libtiff5-dev 27 | 28 | This is the tiff library 29 | 30 | - cmake 31 | 32 | This is needed to build podofo 33 | 34 | - imagemagick 35 | - tesseract-ocr 36 | - tesseract-ocr-eng 37 | 38 | These are needed for OCR (Optical Character Recognition). 39 | 40 | In summary, to prepare on Debian / Ubuntu with QT5: 41 | 42 | sudo apt-get install qtcreator g++ qtbase5-dev qtchooser qt5-qmake \ 43 | qtbase5-dev-tools libsane-dev libtiff5-dev cmake libpodofo-dev \ 44 | imagemagick tesseract-ocr tesseract-ocr-eng libpoppler-qt5-dev 45 | 46 | but of you only have QT4, then use: 47 | 48 | sudo apt-get install qtcreator g++ qt4-qmake libqt4-dev libpoppler-qt4-dev \ 49 | libsane-dev libtiff5-dev cmake libpodofo-dev imagemagick \ 50 | tesseract-ocr tesseract-ocr-eng 51 | 52 | For Red Hat / Centos you will try some other approach similar to the above. 53 | 54 | To build: 55 | 56 | cd paperman (if needed) 57 | qmake 58 | make 59 | 60 | But if you have QT3 installed: 61 | 62 | $ qmake -v 63 | Qmake version: 1.07a (Qt 3.3.8b) 64 | Qmake is free software from Trolltech ASA. 65 | 66 | 67 | then you will need to force QT4: 68 | 69 | qmake-qt4 70 | make 71 | 72 | That should create something called 'paperman' 73 | 74 | ./paperman 75 | 76 | After you run it, right-click in the left window to add a paper repository with 77 | the 'Add repository' option. This should be the directory containing your 78 | paper files. 79 | -------------------------------------------------------------------------------- /pdfwrite.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | /* 24 | Project: Maxview 25 | Author: Simon Glass 26 | Copyright: 2001-2009 Bluewater Systems Ltd, www.bluewatersys.com 27 | File: pdfwrite.h 28 | Started: 2/7/09 29 | 30 | This file implmenents a simple PDF writer, sufficient for out purposes. 31 | It uses the PoDoFo library. Unfortunately libpdf's open source version 32 | doesn't handle modification of existing PDFs, which is needed 33 | */ 34 | 35 | 36 | #include 37 | 38 | #include "err.h" 39 | 40 | namespace PoDoFo 41 | { 42 | class PdfMemDocument; 43 | }; 44 | 45 | class Filepage; 46 | 47 | 48 | class Pdfwrite 49 | { 50 | public : 51 | Pdfwrite (const QString &fname); 52 | ~Pdfwrite (); 53 | 54 | err_info *create (void); 55 | 56 | err_info *addPage (const Filepage *mp); 57 | 58 | err_info *open (void); 59 | 60 | err_info *close (void); 61 | 62 | private: 63 | PoDoFo::PdfMemDocument *_doc; //!< document handle 64 | QString _fname; //!< filename 65 | }; 66 | 67 | -------------------------------------------------------------------------------- /qi/qdraglistbox.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qdraglistbox.h - description 3 | ------------------- 4 | begin : Wed Jan 31 2001 5 | copyright : (C) 2001 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef QDRAGLISTBOX_H 19 | #define QDRAGLISTBOX_H 20 | 21 | #include 22 | 23 | /** 24 | *@author Michael Herder 25 | */ 26 | class QListViewItem; 27 | class QKeyEvent; 28 | 29 | class QDragListBox : public QListView 30 | { 31 | Q_OBJECT 32 | public: 33 | QDragListBox(QWidget* parent=0,const char* name=0,Qt::WindowFlags f=Qt::WindowFlags()); 34 | ~QDragListBox(); 35 | /** */ 36 | void insertItem(QString item); 37 | private: 38 | /** */ 39 | bool mShiftOrCtrlPressed; 40 | /** */ 41 | bool mLmbPressed; 42 | protected: // Protected methods 43 | /** */ 44 | void contentsMouseMoveEvent(QMouseEvent* me); 45 | /** */ 46 | void keyReleaseEvent(QKeyEvent* e); 47 | /** */ 48 | void keyPressEvent(QKeyEvent* e); 49 | /** No descriptions */ 50 | void contentsMousePressEvent(QMouseEvent* e); 51 | /** No descriptions */ 52 | void contentsMouseReleaseEvent(QMouseEvent* e); 53 | signals: // Signals 54 | /** */ 55 | void signalDragStarted(QListViewItem* lbi); 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /qi/iconviewitemext.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | iconviewitemext.h - description 3 | ------------------- 4 | begin : Wed Feb 6 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef ICONVIEWITEMEXT_H 19 | #define ICONVIEWITEMEXT_H 20 | 21 | #include 22 | 23 | /** 24 | *@author Michael Herder 25 | */ 26 | 27 | class IconViewItemExt : public QIconViewItem 28 | { 29 | public: 30 | /** */ 31 | IconViewItemExt(QIconView* parent); 32 | /** */ 33 | IconViewItemExt(QIconView* parent,QIconViewItem *after); 34 | /** */ 35 | IconViewItemExt(QIconView* parent,const QString &text); 36 | /** */ 37 | IconViewItemExt(QIconView* parent,QIconViewItem *after,const QString &text); 38 | /** */ 39 | IconViewItemExt(QIconView* parent,const QString &text,const QPixmap &icon); 40 | /** */ 41 | IconViewItemExt(QIconView* parent,QIconViewItem *after,const QString &text,const QPixmap &icon); 42 | /** */ 43 | ~IconViewItemExt(); 44 | /** */ 45 | QString hiddenText(); 46 | /** */ 47 | void setHiddenText(QString text); 48 | protected: 49 | void paintItem(QPainter* p,const QColorGroup& cg); 50 | private: 51 | /** */ 52 | QString mHiddenText; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /senddialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | // 24 | // C++ Interface: senddialog 25 | // 26 | // Description: 27 | // 28 | // 29 | // Author: Simon Glass , (C) 2009 30 | // 31 | // Copyright: See COPYING file that comes with this distribution 32 | // 33 | // 34 | 35 | 36 | #include 37 | 38 | 39 | #include "ui_send.h" 40 | 41 | 42 | class Desktopdelegate; 43 | class Desktopmodel; 44 | class Desktopproxy; 45 | class Transfer; 46 | struct err_info; 47 | 48 | 49 | class Senddialog : public QDialog, Ui::send 50 | { 51 | Q_OBJECT 52 | 53 | public: 54 | Senddialog (QWidget *parent = 0); 55 | 56 | err_info *setup (Desktopmodel *contents, QModelIndex parent, QModelIndexList &slist); 57 | 58 | err_info *doSend (void); 59 | 60 | private slots: 61 | void itemSelectionChanged (void); 62 | 63 | private: 64 | Desktopmodel *_model; //!< the model for our list of items to send 65 | Desktopmodelconv *_modelconv; 66 | Desktopmodelconv *_modelconv_assert; 67 | Desktopdelegate *_delegate; 68 | Desktopproxy *_proxy; 69 | Transfer *_transfer; 70 | }; 71 | -------------------------------------------------------------------------------- /qi/sanefixedspinbox.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | sanefixedspinbox.h - description 3 | ------------------- 4 | begin : Mon Apr 8 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SANEFIXEDSPINBOX_H 19 | #define SANEFIXEDSPINBOX_H 20 | 21 | #include "quiteinsanenamespace.h" 22 | 23 | extern "C" 24 | { 25 | #include 26 | } 27 | #include 28 | #include 29 | /** 30 | *@author M. Herder 31 | */ 32 | class QDoubleValidator; 33 | 34 | class SaneFixedSpinBox : public QSpinBox 35 | { 36 | Q_OBJECT 37 | public: 38 | SaneFixedSpinBox(QWidget* parent=0,const char* name=0); 39 | SaneFixedSpinBox(int min=0,int max=0,int step=0,QWidget* parent=0,const char* name=0); 40 | ~SaneFixedSpinBox(); 41 | /** */ 42 | void selectAll(); 43 | /** No descriptions */ 44 | void setSaneUnit(SANE_Unit unit); 45 | /** No descriptions */ 46 | void setUnit(SANE_Unit unit); 47 | private: 48 | /** */ 49 | QDoubleValidator* mpValidator; 50 | /** */ 51 | SANE_Unit mSaneUnit; 52 | /** */ 53 | QIN::MetricSystem mMetricSystem; 54 | protected: // Protected methods 55 | /** */ 56 | virtual int mapTextToValue(bool* ok); 57 | /** */ 58 | virtual QString mapValueToText(int value); 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /qi/qhtmlview.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qhtmlview.h - description 3 | ------------------- 4 | begin : Fri Nov 10 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QHTMLVIEW_H 18 | #define QHTMLVIEW_H 19 | 20 | #include 21 | #include 22 | /** 23 | *@author M. Herder 24 | */ 25 | class QTextBrowser; 26 | 27 | class QHTMLView : public QMainWindow 28 | { 29 | Q_OBJECT 30 | public: 31 | QHTMLView(QWidget * parent = 0, const char * name = 0, WFlags f = WType_TopLevel); 32 | ~QHTMLView(); 33 | private: // Private methods 34 | /** */ 35 | void init(); 36 | private: // Private attributes 37 | /** */ 38 | QTextBrowser* mpTextBrowser; 39 | /** */ 40 | QPixmap mPixBackward; 41 | /** */ 42 | QPixmap mPixForward; 43 | /** */ 44 | QPixmap mPixHome; 45 | /** */ 46 | int mIdBackward; 47 | /** */ 48 | int mIdForward; 49 | private slots: 50 | void setBackwardAvailable( bool b); 51 | void setForwardAvailable( bool b); 52 | void slotTextChanged(); 53 | void about(); 54 | void openFile(); 55 | public slots: // Public slots 56 | /** */ 57 | void show(); 58 | /** */ 59 | void home(); 60 | protected: // Protected methods 61 | /** */ 62 | virtual void resizeEvent(QResizeEvent* e); 63 | /** */ 64 | virtual void moveEvent(QMoveEvent* e); 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /qi/qdraglabel.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qdraglabel.cpp - description 3 | ------------------- 4 | begin : Thu Feb 22 2001 5 | copyright : (C) 2001 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #include "qdraglabel.h" 19 | #include "qxmlconfig.h" 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | QDragLabel::QDragLabel(QWidget* parent,const char* name,WFlags f) 28 | :QLabel(parent,name,f) 29 | { 30 | mFileNames.clear(); 31 | } 32 | QDragLabel::~QDragLabel() 33 | { 34 | } 35 | /** */ 36 | void QDragLabel::mouseMoveEvent(QMouseEvent* me) 37 | { 38 | QUriDrag* d; 39 | 40 | if(me->state() == Qt::LeftButton) 41 | { 42 | d = new QUriDrag(this); 43 | d->setFilenames(mFileNames); 44 | d->dragCopy(); 45 | } 46 | } 47 | /**Clear the list of filenames and add fn as the only entry.*/ 48 | void QDragLabel::setFilename(QString fn) 49 | { 50 | mFileNames.clear(); 51 | mFileNames.append(fn);//QUriDrag::localFileToUri(fn)); 52 | } 53 | /**Add fn to the list of filenames.*/ 54 | void QDragLabel::addFilename(QString fn) 55 | { 56 | mFileNames.append(fn); 57 | } 58 | /** Clear the list of filenames */ 59 | void QDragLabel::clearFilenameList() 60 | { 61 | mFileNames.clear(); 62 | } 63 | -------------------------------------------------------------------------------- /qi/unknownprogressdialog.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | unknownprogressdialog.cpp - description 3 | ------------------- 4 | begin : Sat Mar 16 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #include "unknownprogressdialog.h" 19 | #include "qunknownprogresswidget.h" 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | UnknownProgressDialog::UnknownProgressDialog(QString label,QWidget* parent,const char* name) 26 | :QDialog(parent,name,true) 27 | { 28 | mLabelText = label; 29 | initDialog(); 30 | } 31 | UnknownProgressDialog::~UnknownProgressDialog() 32 | { 33 | } 34 | /** No descriptions */ 35 | void UnknownProgressDialog::initDialog() 36 | { 37 | QGridLayout* mainlayout = new QGridLayout(this,3,3); 38 | mainlayout->setRowStretch(1,1); 39 | mainlayout->setColStretch(0,1); 40 | mainlayout->setColStretch(2,1); 41 | mpLabel = new QLabel(mLabelText,this); 42 | mpUnknownProgress = new QUnknownProgressWidget(this); 43 | mpUnknownProgress->setFixedHeight(20); 44 | QPushButton* stop_button = new QPushButton(tr("&Cancel"),this); 45 | mainlayout->addMultiCellWidget(mpLabel,0,0,0,2); 46 | mainlayout->addMultiCellWidget(mpUnknownProgress,1,1,0,2); 47 | mainlayout->addWidget(stop_button,2,1); 48 | } 49 | -------------------------------------------------------------------------------- /qi/checklistitemext.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | checklistitemext.h - description 3 | ------------------- 4 | begin : Thu Jan 24 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef CHECKLISTITEMEXT_H 19 | #define CHECKLISTITEMEXT_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | /** 26 | *@author Michael Herder 27 | */ 28 | 29 | class CheckListItemExt : public QListWidgetItem 30 | { 31 | public: 32 | CheckListItemExt(QListWidget* parent,const QString& text); 33 | CheckListItemExt(QListWidget* parent,const QString& text,const QPixmap& p); 34 | CheckListItemExt(QListWidgetItem* parent,const QString& text); 35 | CheckListItemExt(QListWidgetItem* parent,const QString& text,const QPixmap & p); 36 | ~CheckListItemExt(); 37 | /** No descriptions */ 38 | QRgb bgColor(); 39 | /** No descriptions */ 40 | void setBgColor(QRgb bg_color); 41 | /** No descriptions */ 42 | QRgb fgColor(); 43 | /** No descriptions */ 44 | void setFgColor(QRgb fg_color); 45 | /** No descriptions */ 46 | void updatePixmap(); 47 | /** No descriptions */ 48 | int number(); 49 | /** No descriptions */ 50 | void setNumber(int i); 51 | private: 52 | int mNumber; 53 | QRgb mBgColor; 54 | QRgb mFgColor; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /qi/sanewidgetholder.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | sanewidgetholder.h - description 3 | ------------------- 4 | begin : Wed Feb 26 2003 5 | copyright : (C) 2003 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SANEWIDGETHOLDER_H 19 | #define SANEWIDGETHOLDER_H 20 | 21 | #include 22 | 23 | /** 24 | *@author Michael Herder 25 | */ 26 | 27 | class QGridLayout; 28 | class QSaneOption; 29 | 30 | class SaneWidgetHolder : public QWidget 31 | { 32 | public: 33 | SaneWidgetHolder(QWidget* parent=0,const char* name=0,Qt::WindowFlags f=Qt::WindowFlags()); 34 | ~SaneWidgetHolder(); 35 | /** No descriptions */ 36 | void addWidget(QSaneOption* widget); 37 | /** No descriptions */ 38 | void replaceWidget(QSaneOption* widget); 39 | /** No descriptions */ 40 | QSaneOption* saneOption(); 41 | 42 | /** check if a change is pending. These are saved up until sane is no longer busy 43 | 44 | \returns true if a change is pending */ 45 | bool getPending (void); 46 | 47 | /** set whether a change is pending 48 | 49 | \param pending true if pending */ 50 | void setPending (bool pending); 51 | 52 | private: 53 | QSaneOption* mpSaneOption; 54 | QGridLayout* mpGridLayout; 55 | bool mPending; //!< pending change has been made while sane is busy 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /ocr.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | /* 24 | Project: Maxview 25 | Author: Simon Glass 26 | Copyright: 2001-2009 Bluewater Systems Ltd, www.bluewatersys.com 27 | File: ocr.h 28 | Started: 26/6/09 29 | 30 | This file contains the OCR (Optical Character Recognition) interface 31 | */ 32 | 33 | 34 | #ifndef __ocr_h 35 | #define __ocr_h 36 | 37 | 38 | class QImage; 39 | class QString; 40 | 41 | 42 | class Ocr 43 | { 44 | public: 45 | Ocr (void); 46 | virtual ~Ocr (); 47 | 48 | //! engine in use 49 | enum e_engine 50 | { 51 | OCRE_none, 52 | OCRE_tesseract, 53 | OCRE_omnipage 54 | }; 55 | 56 | /** convert an image to text */ 57 | virtual err_info *imageToText (QImage &image, QString &text) = 0; 58 | 59 | virtual err_info *init (void) = 0; 60 | 61 | /** sets up the best available Ocr engine and returns it 62 | 63 | \param err error returned, NULL if ok 64 | \returns ocr engine, or 0 if none could be found */ 65 | static Ocr *getOcr (err_info *&err); 66 | 67 | protected: 68 | e_engine _engine; //!< ocr engine we are using 69 | }; 70 | 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /qi/qdoublespinbox.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qdoublespinbox.cpp - description 3 | ------------------- 4 | begin : Tue Dec 12 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #include "qdoublespinbox.h" 19 | #include 20 | #include 21 | 22 | QDouble100SpinBox::QDouble100SpinBox(QWidget * parent,const char * name) 23 | :QSpinBox(parent) 24 | { 25 | setObjectName(name); 26 | QDoubleValidator* dv = new QDoubleValidator(this); 27 | dv->setDecimals(2); 28 | //s setValidator(dv); 29 | } 30 | QDouble100SpinBox::~QDouble100SpinBox() 31 | { 32 | } 33 | /** */ 34 | QString QDouble100SpinBox::mapValueToText(int value) 35 | { 36 | QString qs; 37 | qs.setNum(double(value)/100.0,'f',2); 38 | return qs; 39 | } 40 | /** */ 41 | int QDouble100SpinBox::mapTextToValue(bool* ok) 42 | { 43 | ok = ok; //s unused 44 | return int(text().toDouble()*100.0); 45 | } 46 | /** */ 47 | void QDouble100SpinBox::selectAll() 48 | { 49 | selectAll(); 50 | } 51 | 52 | QValidator::State QDouble100SpinBox::validate(QString &input, int &pos) const 53 | { 54 | if (!mValidator) 55 | return QValidator::Acceptable; 56 | return mValidator->validate(input, pos); 57 | } 58 | 59 | void QDouble100SpinBox::setValidator(QValidator *validator) 60 | { 61 | mValidator = validator; 62 | } 63 | 64 | -------------------------------------------------------------------------------- /presetadd.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Presetadd 4 | 5 | 6 | 7 | 0 8 | 0 9 | 344 10 | 130 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Preset name: 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | The preset will be available on Ctrl-1 35 | 36 | 37 | 38 | 39 | 40 | 41 | Qt::Horizontal 42 | 43 | 44 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | buttonBox 54 | accepted() 55 | Presetadd 56 | accept() 57 | 58 | 59 | 248 60 | 254 61 | 62 | 63 | 157 64 | 274 65 | 66 | 67 | 68 | 69 | buttonBox 70 | rejected() 71 | Presetadd 72 | reject() 73 | 74 | 75 | 316 76 | 260 77 | 78 | 79 | 286 80 | 274 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /ocr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include "err.h" 36 | 37 | #include "config.h" 38 | 39 | #include "ocr.h" 40 | #include "ocromni.h" 41 | #include "ocrtess.h" 42 | 43 | 44 | static Ocr *static_ocr = 0; 45 | 46 | 47 | Ocr::Ocr (void) 48 | { 49 | _engine = OCRE_none; 50 | } 51 | 52 | 53 | Ocr::~Ocr () 54 | { 55 | } 56 | 57 | 58 | Ocr *Ocr::getOcr (err_info *&err) 59 | { 60 | Ocr *ocr; 61 | 62 | err = NULL; 63 | #ifdef CONFIG_use_omnipage 64 | if (!static_ocr) 65 | { 66 | // should support dynamic loading for this 67 | ocr = new Ocromni (); 68 | err = ocr->init (); 69 | if (err) 70 | { 71 | qDebug () << "Omnipage enginer error" << err->errstr; 72 | delete ocr; 73 | } 74 | else 75 | static_ocr = ocr; 76 | } 77 | #endif 78 | if (!static_ocr) 79 | { 80 | ocr = new Ocrtess (); 81 | err = ocr->init (); 82 | if (err) 83 | delete ocr; 84 | else 85 | static_ocr = ocr; 86 | } 87 | return static_ocr; 88 | } 89 | 90 | 91 | -------------------------------------------------------------------------------- /qi/sanewidgetholder.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | sanewidgetholder.cpp - description 3 | ------------------- 4 | begin : Wed Feb 26 2003 5 | copyright : (C) 2003 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #include "sanewidgetholder.h" 19 | #include "qsaneoption.h" 20 | 21 | #include 22 | #include 23 | 24 | SaneWidgetHolder::SaneWidgetHolder(QWidget* parent,const char* name,Qt::WindowFlags f) 25 | :QWidget(parent,f) 26 | { 27 | setObjectName(name); 28 | mpSaneOption = 0L; 29 | mPending = false; 30 | mpGridLayout = new QGridLayout(this); 31 | } 32 | SaneWidgetHolder::~SaneWidgetHolder() 33 | { 34 | } 35 | /** No descriptions */ 36 | void SaneWidgetHolder::addWidget(QSaneOption* widget) 37 | { 38 | if(!widget) 39 | return; 40 | if(mpSaneOption) 41 | return; 42 | mpGridLayout->addWidget(widget,0,0); 43 | mpSaneOption = widget; 44 | } 45 | /** No descriptions */ 46 | void SaneWidgetHolder::replaceWidget(QSaneOption* widget) 47 | { 48 | if(!widget) 49 | return; 50 | if(mpSaneOption != 0) 51 | delete mpSaneOption; 52 | mpGridLayout->addWidget(widget,0,0); 53 | mpSaneOption = widget; 54 | } 55 | /** No descriptions */ 56 | QSaneOption* SaneWidgetHolder::saneOption() 57 | { 58 | return mpSaneOption; 59 | } 60 | 61 | bool SaneWidgetHolder::getPending (void) 62 | { 63 | return mPending; 64 | } 65 | 66 | 67 | void SaneWidgetHolder::setPending (bool pending) 68 | { 69 | mPending = pending; 70 | } 71 | -------------------------------------------------------------------------------- /qi/qqualitydialog.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qqualitydialog.h - description 3 | ------------------- 4 | begin : Fri Sep 1 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QQUALITYDIALOG_H 18 | #define QQUALITYDIALOG_H 19 | 20 | #include 21 | #include 22 | 23 | /** 24 | *@author M. Herder 25 | */ 26 | class QComboBox; 27 | class QSlider; 28 | class QLabel; 29 | class QString; 30 | class QHBoxLayout; 31 | 32 | class QQualityDialog : public QDialog 33 | { 34 | Q_OBJECT 35 | public: 36 | enum ImageType 37 | { 38 | ImageType_PNG = 0, 39 | ImageType_JPEG = 1, 40 | ImageType_TIFF8BIT = 2, 41 | ImageType_TIFFLINEART = 3 42 | }; 43 | QQualityDialog(ImageType t,QWidget *parent=0, const char *name=0,bool modal=true); 44 | ~QQualityDialog(); 45 | private: // Private attributes 46 | /** */ 47 | QLabel* mpQualityLabel; 48 | /** */ 49 | QComboBox* mpTiff8BitCombo; 50 | /** */ 51 | QComboBox* mpTiffLineartCombo; 52 | /** */ 53 | int mQuality; 54 | /** */ 55 | QSlider* mpQualitySlider; 56 | /** */ 57 | ImageType mImageType; 58 | /** */ 59 | QString mCompressionType; 60 | /** */ 61 | QHBoxLayout* mpQualityHBox; 62 | private: //methods 63 | /** */ 64 | void initDialog(); 65 | public: 66 | /** */ 67 | int quality(); 68 | /** */ 69 | QString compressionType(); 70 | private slots: // Private slots 71 | /** */ 72 | void slotQualityChanged(int value); 73 | /** */ 74 | void slotEnableQuality(int index); 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /qi/splashwidget.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | splashwidget.cpp - description 3 | ------------------- 4 | begin : Sat Nov 23 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #include "splashwidget.h" 19 | #include "quiteinsane_logo.xpm" 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | SplashWidget::SplashWidget(QWidget *parent, const char *name ) 27 | : QWidget(parent,name,WType_TopLevel|WStyle_Tool|WStyle_Customize| 28 | WStyle_NoBorder) 29 | { 30 | QGridLayout* grid = new QGridLayout(this,1,2); 31 | grid->setMargin(10); 32 | grid->setSpacing(8); 33 | QLabel* label1 = new QLabel(this); 34 | QPixmap qp((const char **)quiteinsane_logo_xpm); 35 | label1->setPixmap(qp); 36 | QLabel* label2 = new QLabel(tr("

QuiteInsane


" 37 | "
Searching available devices

" 38 | "
...please wait...
"),this); 39 | grid->addWidget(label1,0,0); 40 | grid->addWidget(label2,0,1); 41 | } 42 | SplashWidget::~SplashWidget() 43 | { 44 | } 45 | /** No descriptions */ 46 | void SplashWidget::show() 47 | { 48 | int x,y; 49 | x = (qApp->desktop()->width() - sizeHint().width())/2; 50 | y = (qApp->desktop()->height() - sizeHint().height())/2; 51 | move(x,y); 52 | QWidget::show(); 53 | } 54 | -------------------------------------------------------------------------------- /qi/imagedetection.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | imagedetection.h - description 3 | ------------------- 4 | begin : Tue Jun 18 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef IMAGEDETECTION_H 19 | #define IMAGEDETECTION_H 20 | 21 | //s #include 22 | #include 23 | #include 24 | 25 | /** 26 | *@author Michael Herder 27 | */ 28 | 29 | class ImageDetection 30 | { 31 | public: 32 | ImageDetection(QImage* image=0,bool multiple_images=false,QRgb rgb=0, 33 | double factor=1.2,double min_size=0.02); 34 | ~ImageDetection(); 35 | /** */ 36 | void setImage(QImage* image); 37 | /** No descriptions */ 38 | QVector autoSelect(); 39 | /** No descriptions */ 40 | void setGrayLimit(int min_or_max,bool black_bg); 41 | private: 42 | /** No descriptions */ 43 | QImage* mpImage; 44 | /** Find the first line, beginning at the bottom of the image, which 45 | is not filled with color rgb. 46 | */ 47 | int lastValidLine(); 48 | /** No descriptions */ 49 | QVector findVerticalLines(double std_dev); 50 | /** No descriptions */ 51 | QVector findHorizontalLines(int top,int bottom,double std_dev); 52 | /** No descriptions */ 53 | bool mMultipleImages; 54 | /** No descriptions */ 55 | QRgb mRgb; 56 | /** No descriptions */ 57 | double mMinSize; 58 | /** No descriptions */ 59 | double mFactor; 60 | bool mBlackBg; 61 | int mAvgMinMax; 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /qi/scanarea.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | scanarea.h - description 3 | ------------------- 4 | begin : Mon Jul 3 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef SCANAREA_H 18 | #define SCANAREA_H 19 | 20 | 21 | /** 22 | *@author M. Herder 23 | */ 24 | #include 25 | 26 | class ScanArea 27 | { 28 | public: 29 | ScanArea(QString name="",double tlx=0.0,double tly=0.0,double brx=1.0,double bry=1.0, double width = -1.0, double height = -1.0); 30 | ~ScanArea(); 31 | private: // Private attributes 32 | /** */ 33 | int mNumber; 34 | /** */ 35 | double mTlx; 36 | /** */ 37 | double mTly; 38 | /** */ 39 | double mBrx; 40 | /** */ 41 | double mBry; 42 | 43 | /** page size */ 44 | double mWidth, mHeight; 45 | /** */ 46 | QString mName; 47 | public: 48 | void setRange(double tlx=0.0,double tly=0.0,double brx=1.0,double bry=1.0, double width = -1.0, double height = -1.0); 49 | /** */ 50 | double tlx(); 51 | /** */ 52 | double tly(); 53 | /** */ 54 | double brx(); 55 | /** */ 56 | double bry(); 57 | /** */ 58 | 59 | double width (); 60 | double height (); 61 | 62 | void setTlx(double dvalue); 63 | /** */ 64 | void setTly(double dvalue); 65 | /** */ 66 | void setBrx(double dvalue); 67 | /** */ 68 | void setBry(double dvalue); 69 | /** */ 70 | void setName(QString qs); 71 | /** */ 72 | QString getName(); 73 | /** */ 74 | bool isValid(); 75 | /** No descriptions */ 76 | int number(); 77 | /** No descriptions */ 78 | void setNumber(int num); 79 | }; 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /op.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | #include 25 | 26 | #include "err.h" 27 | #include "qapplication.h" 28 | 29 | #include "op.h" 30 | 31 | //! the widget which needs to know about operation progress 32 | static QWidget *receiver; 33 | 34 | Operation::Operation (QString name, int count, QWidget *parent) 35 | { 36 | UNUSED (parent); 37 | _maximum = count; 38 | if (receiver) { 39 | connect(this, SIGNAL(operationProgress(Operation::state_t, int, QString)), 40 | receiver, SLOT(updateProgress(Operation::state_t, int, QString))); 41 | } 42 | emit operationProgress(init, 0, name); 43 | _upto = 0; 44 | } 45 | 46 | 47 | Operation::~Operation () 48 | { 49 | emit operationProgress(uninit, 0, QString()); 50 | } 51 | 52 | 53 | void Operation::setCount (int count) 54 | { 55 | _maximum = count < 1 ? 1 : count; 56 | } 57 | 58 | 59 | bool Operation::setProgress (int upto) 60 | { 61 | _upto = upto; 62 | int pc = int ((float)upto / _maximum * 100); 63 | 64 | emit operationProgress(running, pc, QString()); 65 | qApp->processEvents (); 66 | 67 | return false; 68 | } 69 | 70 | 71 | bool Operation::incProgress (int by) 72 | { 73 | setProgress (_upto + by); 74 | 75 | return true; 76 | } 77 | 78 | 79 | void Operation::setReceiver(QWidget *widget) 80 | { 81 | receiver = widget; 82 | } 83 | -------------------------------------------------------------------------------- /qi/qpreviewfiledialog.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qpreviewfiledialog.h - description 3 | ------------------- 4 | begin : Tue Nov 14 2000 5 | copyright : (C) 2000 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QPREVIEWFILEDIALOG_H 18 | #define QPREVIEWFILEDIALOG_H 19 | 20 | #include 21 | #include 22 | 23 | class QCheckBox; 24 | class QComboBox; 25 | class QLabel; 26 | class QWidget; 27 | /** 28 | *@author Michael Herder 29 | */ 30 | 31 | class QPreviewFileDialog : public QFileDialog 32 | { 33 | Q_OBJECT 34 | public: 35 | QPreviewFileDialog(bool has_preview=false,bool cancel_warning=false,QWidget* parent=0, 36 | const char* name = 0,bool modal = true); 37 | ~QPreviewFileDialog(); 38 | /** */ 39 | void loadImage(QString path); 40 | /** */ 41 | bool setImage(QImage* image); 42 | private: // Private methods 43 | /** */ 44 | QString mFilePath; 45 | /** */ 46 | QImage* mpImage; 47 | /** */ 48 | QCheckBox* mpPreviewCheckBox; 49 | /** */ 50 | bool mPreviewMode; 51 | /** */ 52 | bool mWarnOnCancel; 53 | /** */ 54 | QLabel* mpPixWidget; 55 | /** */ 56 | bool mMustDeleteImage; 57 | /** */ 58 | QString mImageFormat; 59 | private: //methods 60 | /** */ 61 | void format(); 62 | private slots: // Private slots 63 | /** */ 64 | void slotShowPreview(bool b); 65 | /** */ 66 | void initDlg(); 67 | protected: // Protected methods 68 | /** */ 69 | virtual void showEvent(QShowEvent* e); 70 | protected slots: 71 | virtual void reject(); 72 | virtual void accept(); 73 | /** No descriptions */ 74 | void resizeEvent(QResizeEvent* e); 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /qi/saneintoption.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | saneintoption.h - description 3 | ------------------- 4 | begin : Mon Apr 8 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SANEINTOPTION_H 19 | #define SANEINTOPTION_H 20 | 21 | #include "qsaneoption.h" 22 | #include "quiteinsanenamespace.h" 23 | #include 24 | 25 | extern "C" 26 | { 27 | #include 28 | } 29 | /** 30 | *@author M. Herder 31 | */ 32 | //forward declarations 33 | class QSpinBox; 34 | class QLabel; 35 | class QString; 36 | 37 | class SaneIntOption : public QSaneOption 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | /** 43 | *@author Michael Herder 44 | */ 45 | SaneIntOption(QString title,QWidget * parent, 46 | SANE_Value_Type type=SANE_TYPE_INT,const char * name=0); 47 | ~SaneIntOption(); 48 | /** */ 49 | void setUnit(SANE_Unit unit); 50 | /** */ 51 | void setValue(int val); 52 | /** */ 53 | int value(); 54 | /** */ 55 | SANE_Value_Type getSaneType(); 56 | private: // Private attributes 57 | /** */ 58 | SANE_Unit mSaneUnit; 59 | /** */ 60 | QSpinBox* mpValueSpinBox; 61 | /** */ 62 | QLabel* mpTitleLabel; 63 | /** */ 64 | SANE_Value_Type mSaneValueType; 65 | /** */ 66 | QIN::MetricSystem mMetricSystem; 67 | private: // Private methods 68 | /** */ 69 | void initWidget(); 70 | /** */ 71 | void redrawValueLabel(); 72 | private slots: // Private slots 73 | /** */ 74 | void slotValueChanged(int val); 75 | signals: // Signals 76 | /** */ 77 | void valueChanged(int); 78 | }; 79 | 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /pagetools.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | #include 26 | 27 | #include "pagetools.h" 28 | 29 | 30 | /* 31 | * Constructs a Pagetool as a child of 'parent', with the 32 | * name 'name' and widget flags set to 'f'. 33 | * 34 | */ 35 | Pagetools::Pagetools(QWidget* parent, Qt::WindowFlags fl) 36 | : QFrame(parent,fl) 37 | { 38 | setupUi(this); 39 | 40 | init(); 41 | } 42 | 43 | /* 44 | * Destroys the object and frees any allocated resources 45 | */ 46 | Pagetools::~Pagetools() 47 | { 48 | // no need to delete child widgets, Qt does it all for us 49 | } 50 | 51 | 52 | /* 53 | * Sets the strings of the subwidgets using the current 54 | * language. 55 | */ 56 | void Pagetools::languageChange() 57 | { 58 | retranslateUi(this); 59 | } 60 | 61 | /**************************************************************************** 62 | ** ui.h extension file, included from the uic-generated form implementation. 63 | ** 64 | ** If you want to add, delete, or rename functions or slots, use 65 | ** Qt Designer to update this file, preserving your code. 66 | ** 67 | ** You should not define a constructor or destructor in this file. 68 | ** Instead, write your code in functions called init() and destroy(). 69 | ** These will automatically be called by the form's constructor and 70 | ** destructor. 71 | *****************************************************************************/ 72 | 73 | void Pagetools::init() 74 | { 75 | } 76 | 77 | -------------------------------------------------------------------------------- /qi/qwordcombooption.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qwordcombooption.h - description 3 | ------------------- 4 | begin : Tue Nov 19 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QWORDCOMBOOPTION_H 18 | #define QWORDCOMBOOPTION_H 19 | 20 | #include "qsaneoption.h" 21 | #include 22 | //s #include 23 | extern "C" 24 | { 25 | #include 26 | } 27 | /** 28 | *@author M. Herder 29 | */ 30 | //forward declarations 31 | class QCheckBox; 32 | class QComboBox; 33 | class QLabel; 34 | class QString; 35 | 36 | class QWordComboOption : public QSaneOption 37 | { 38 | Q_OBJECT 39 | public: 40 | QWordComboOption(QString title,QWidget * parent, 41 | SANE_Value_Type type,const char * name=0); 42 | ~QWordComboOption(); 43 | /** */ 44 | void appendArray(QVector qa); 45 | /** */ 46 | SANE_Word getCurrentValue(); 47 | SANE_Value_Type getSaneType(); 48 | /** */ 49 | void setValue(SANE_Word val); 50 | /** */ 51 | void enableAutomatic(bool b); 52 | /** */ 53 | bool automatic(); 54 | private: // Private attributes 55 | /** */ 56 | QVector mValueArray; 57 | /** */ 58 | QComboBox* mpSelectionCombo; 59 | /** */ 60 | QCheckBox* mpAutoCheckBox; 61 | /** */ 62 | QLabel * mpTitleLabel; 63 | /** */ 64 | SANE_Value_Type mSaneValueType; 65 | /** */ 66 | bool mAutomatic; 67 | private: //methods 68 | /** */ 69 | void initWidget(); 70 | private slots: // Private slots 71 | /**Turn automatic mode on or off. */ 72 | void slotAutoMode(bool automode); 73 | void slotValueChanged(int); 74 | signals: // Signals 75 | /** */ 76 | void signalAutomatic(int opt,bool automode); 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /images/gamma_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * gamma_option_xpm[] = { 3 | "31 31 64 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #FDFDFD", 7 | "@ c #FCFCFC", 8 | "# c #FAFAFA", 9 | "$ c #F9F9F9", 10 | "% c #F7F7F7", 11 | "& c #F6F6F6", 12 | "* c #F5F5F5", 13 | "= c #F3F3F3", 14 | "- c #F2F2F2", 15 | "; c #F0F0F0", 16 | "> c #EFEFEF", 17 | ", c #EEEEEE", 18 | "' c #ECECEC", 19 | ") c #EBEBEB", 20 | "! c #E9E9E9", 21 | "~ c #E8E8E8", 22 | "{ c #E6E6E6", 23 | "] c #E5E5E5", 24 | "^ c #E4E4E4", 25 | "/ c #E2E2E2", 26 | "( c #E1E1E1", 27 | "_ c #DFDFDF", 28 | ": c #DEDEDE", 29 | "< c #DDDDDD", 30 | "[ c #DBDBDB", 31 | "} c #DADADA", 32 | "| c #D8D8D8", 33 | "1 c #D7D7D7", 34 | "2 c #D5D5D5", 35 | "3 c #D4D4D4", 36 | "4 c #D3D3D3", 37 | "5 c #000000", 38 | "6 c #242424", 39 | "7 c #D1D1D1", 40 | "8 c #D0D0D0", 41 | "9 c #CECECE", 42 | "0 c #CDCDCD", 43 | "a c #CBCBCB", 44 | "b c #CACACA", 45 | "c c #C9C9C9", 46 | "d c #C7C7C7", 47 | "e c #C6C6C6", 48 | "f c #C4C4C4", 49 | "g c #C3C3C3", 50 | "h c #C2C2C2", 51 | "i c #C0C0C0", 52 | "j c #BFBFBF", 53 | "k c #BDBDBD", 54 | "l c #BCBCBC", 55 | "m c #BABABA", 56 | "n c #B9B9B9", 57 | "o c #B8B8B8", 58 | "p c #B6B6B6", 59 | "q c #B5B5B5", 60 | "r c #B3B3B3", 61 | "s c #B2B2B2", 62 | "t c #B1B1B1", 63 | "u c #AFAFAF", 64 | "v c #AEAEAE", 65 | "w c #ACACAC", 66 | "x c #ABABAB", 67 | "y c #A9A9A9", 68 | ".+@#$%&*=-;>,')!~{]^/(_:<[}|123", 69 | "+@#$%&*=-;>,')!~{]^/(_:<[}|1234", 70 | "@#$%&55555555555555555556|12347", 71 | "#$%&*=5555555555555555555123478", 72 | "$%&*=-;555555555555555555234789", 73 | "%&*=-;>,5555{]^/(_:<[}555347890", 74 | "&*=-;>,'5555]^/(_:<[}|15547890a", 75 | "*=-;>,')5555^/(_:<[}|12357890ab", 76 | "=-;>,')!5555/(_:<[}|12347890abc", 77 | "-;>,')!~5555(_:<[}|12347890abcd", 78 | ";>,')!~{5555_:<[}|12347890abcde", 79 | ">,')!~{]5555:<[}|12347890abcdef", 80 | ",')!~{]^5555<[}|12347890abcdefg", 81 | "')!~{]^/5555[}|12347890abcdefgh", 82 | ")!~{]^/(5555}|12347890abcdefghi", 83 | "!~{]^/(_5555|12347890abcdefghij", 84 | "~{]^/(_:555512347890abcdefghijk", 85 | "{]^/(_:<55552347890abcdefghijkl", 86 | "]^/(_:<[5555347890abcdefghijklm", 87 | "^/(_:<[}555547890abcdefghijklmn", 88 | "/(_:<[}|55557890abcdefghijklmno", 89 | "(_:<[}|15555890abcdefghijklmnop", 90 | "_:<[}|12555590abcdefghijklmnopq", 91 | ":<[}|12355550abcdefghijklmnopqr", 92 | "<[}|12345555abcdefghijklmnopqrs", 93 | "[}|123475555bcdefghijklmnopqrst", 94 | "}|1234785555cdefghijklmnopqrstu", 95 | "|123478555555efghijklmnopqrstuv", 96 | "123478555555555hijklmnopqrstuvw", 97 | "2347890abcdefghijklmnopqrstuvwx", 98 | "347890abcdefghijklmnopqrstuvwxy"}; 99 | -------------------------------------------------------------------------------- /images/gamma_red_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * gamma_red_option_xpm[] = { 3 | "31 31 64 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #FFFAFA", 7 | "@ c #FFF6F6", 8 | "# c #FFF2F2", 9 | "$ c #FFEEEE", 10 | "% c #FFEAEA", 11 | "& c #FFE6E6", 12 | "* c #FFE2E2", 13 | "= c #FFDEDE", 14 | "- c #FFD9D9", 15 | "; c #FFD5D5", 16 | "> c #FFD1D1", 17 | ", c #FFCDCD", 18 | "' c #FFC9C9", 19 | ") c #FFC5C5", 20 | "! c #FFC1C1", 21 | "~ c #FFBDBD", 22 | "{ c #FFB9B9", 23 | "] c #FFB4B4", 24 | "^ c #FFB0B0", 25 | "/ c #FFACAC", 26 | "( c #FFA8A8", 27 | "_ c #FFA4A4", 28 | ": c #FFA0A0", 29 | "< c #FF9C9C", 30 | "[ c #FF9898", 31 | "} c #FF9494", 32 | "| c #FF8F8F", 33 | "1 c #FF8B8B", 34 | "2 c #FF8787", 35 | "3 c #FF8383", 36 | "4 c #FF7F7F", 37 | "5 c #000000", 38 | "6 c #2B1818", 39 | "7 c #FF7B7B", 40 | "8 c #FF7777", 41 | "9 c #FF7373", 42 | "0 c #FF6F6F", 43 | "a c #FF6A6A", 44 | "b c #FF6666", 45 | "c c #FF6262", 46 | "d c #FF5E5E", 47 | "e c #FF5A5A", 48 | "f c #FF5656", 49 | "g c #FF5252", 50 | "h c #FF4E4E", 51 | "i c #FF4A4A", 52 | "j c #FF4545", 53 | "k c #FF4141", 54 | "l c #FF3D3D", 55 | "m c #FF3939", 56 | "n c #FF3535", 57 | "o c #FF3131", 58 | "p c #FF2D2D", 59 | "q c #FF2929", 60 | "r c #FF2525", 61 | "s c #FF2020", 62 | "t c #FF1C1C", 63 | "u c #FF1818", 64 | "v c #FF1414", 65 | "w c #FF1010", 66 | "x c #FF0C0C", 67 | "y c #FF0808", 68 | ".+@#$%&*=-;>,')!~{]^/(_:<[}|123", 69 | "+@#$%&*=-;>,')!~{]^/(_:<[}|1234", 70 | "@#$%&55555555555555555556|12347", 71 | "#$%&*=5555555555555555555123478", 72 | "$%&*=-;555555555555555555234789", 73 | "%&*=-;>,5555{]^/(_:<[}555347890", 74 | "&*=-;>,'5555]^/(_:<[}|15547890a", 75 | "*=-;>,')5555^/(_:<[}|12357890ab", 76 | "=-;>,')!5555/(_:<[}|12347890abc", 77 | "-;>,')!~5555(_:<[}|12347890abcd", 78 | ";>,')!~{5555_:<[}|12347890abcde", 79 | ">,')!~{]5555:<[}|12347890abcdef", 80 | ",')!~{]^5555<[}|12347890abcdefg", 81 | "')!~{]^/5555[}|12347890abcdefgh", 82 | ")!~{]^/(5555}|12347890abcdefghi", 83 | "!~{]^/(_5555|12347890abcdefghij", 84 | "~{]^/(_:555512347890abcdefghijk", 85 | "{]^/(_:<55552347890abcdefghijkl", 86 | "]^/(_:<[5555347890abcdefghijklm", 87 | "^/(_:<[}555547890abcdefghijklmn", 88 | "/(_:<[}|55557890abcdefghijklmno", 89 | "(_:<[}|15555890abcdefghijklmnop", 90 | "_:<[}|12555590abcdefghijklmnopq", 91 | ":<[}|12355550abcdefghijklmnopqr", 92 | "<[}|12345555abcdefghijklmnopqrs", 93 | "[}|123475555bcdefghijklmnopqrst", 94 | "}|1234785555cdefghijklmnopqrstu", 95 | "|123478555555efghijklmnopqrstuv", 96 | "123478555555555hijklmnopqrstuvw", 97 | "2347890abcdefghijklmnopqrstuvwx", 98 | "347890abcdefghijklmnopqrstuvwxy"}; 99 | -------------------------------------------------------------------------------- /images/gamma_blue_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * gamma_blue_option_xpm[] = { 3 | "31 31 64 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #FAFBFF", 7 | "@ c #F6F7FF", 8 | "# c #F2F4FF", 9 | "$ c #EEF0FF", 10 | "% c #E9ECFF", 11 | "& c #E5E9FF", 12 | "* c #E1E5FF", 13 | "= c #DDE2FF", 14 | "- c #D8DEFF", 15 | "; c #D4DAFF", 16 | "> c #D0D7FF", 17 | ", c #CCD3FF", 18 | "' c #C7CFFF", 19 | ") c #C3CCFF", 20 | "! c #BFC8FF", 21 | "~ c #BBC5FF", 22 | "{ c #B6C1FF", 23 | "] c #B2BDFF", 24 | "^ c #AEBAFF", 25 | "/ c #AAB6FF", 26 | "( c #A5B3FF", 27 | "_ c #A1AFFF", 28 | ": c #9DABFF", 29 | "< c #98A8FF", 30 | "[ c #94A4FF", 31 | "} c #90A0FF", 32 | "| c #8C9DFF", 33 | "1 c #8799FF", 34 | "2 c #8396FF", 35 | "3 c #7F92FF", 36 | "4 c #7B8EFF", 37 | "5 c #000000", 38 | "6 c #181A2B", 39 | "7 c #778BFF", 40 | "8 c #7287FF", 41 | "9 c #6E84FF", 42 | "0 c #6A80FF", 43 | "a c #667CFF", 44 | "b c #6179FF", 45 | "c c #5D75FF", 46 | "d c #5971FF", 47 | "e c #556EFF", 48 | "f c #506AFF", 49 | "g c #4C67FF", 50 | "h c #4863FF", 51 | "i c #435FFF", 52 | "j c #3F5CFF", 53 | "k c #3B58FF", 54 | "l c #3755FF", 55 | "m c #3351FF", 56 | "n c #2E4DFF", 57 | "o c #2A4AFF", 58 | "p c #2646FF", 59 | "q c #2142FF", 60 | "r c #1D3FFF", 61 | "s c #193BFF", 62 | "t c #1538FF", 63 | "u c #1034FF", 64 | "v c #0C30FF", 65 | "w c #082DFF", 66 | "x c #0429FF", 67 | "y c #0025FF", 68 | ".+@#$%&*=-;>,')!~{]^/(_:<[}|123", 69 | "+@#$%&*=-;>,')!~{]^/(_:<[}|1234", 70 | "@#$%&55555555555555555556|12347", 71 | "#$%&*=5555555555555555555123478", 72 | "$%&*=-;555555555555555555234789", 73 | "%&*=-;>,5555{]^/(_:<[}555347890", 74 | "&*=-;>,'5555]^/(_:<[}|15547890a", 75 | "*=-;>,')5555^/(_:<[}|12357890ab", 76 | "=-;>,')!5555/(_:<[}|12347890abc", 77 | "-;>,')!~5555(_:<[}|12347890abcd", 78 | ";>,')!~{5555_:<[}|12347890abcde", 79 | ">,')!~{]5555:<[}|12347890abcdef", 80 | ",')!~{]^5555<[}|12347890abcdefg", 81 | "')!~{]^/5555[}|12347890abcdefgh", 82 | ")!~{]^/(5555}|12347890abcdefghi", 83 | "!~{]^/(_5555|12347890abcdefghij", 84 | "~{]^/(_:555512347890abcdefghijk", 85 | "{]^/(_:<55552347890abcdefghijkl", 86 | "]^/(_:<[5555347890abcdefghijklm", 87 | "^/(_:<[}555547890abcdefghijklmn", 88 | "/(_:<[}|55557890abcdefghijklmno", 89 | "(_:<[}|15555890abcdefghijklmnop", 90 | "_:<[}|12555590abcdefghijklmnopq", 91 | ":<[}|12355550abcdefghijklmnopqr", 92 | "<[}|12345555abcdefghijklmnopqrs", 93 | "[}|123475555bcdefghijklmnopqrst", 94 | "}|1234785555cdefghijklmnopqrstu", 95 | "|123478555555efghijklmnopqrstuv", 96 | "123478555555555hijklmnopqrstuvw", 97 | "2347890abcdefghijklmnopqrstuvwx", 98 | "347890abcdefghijklmnopqrstuvwxy"}; 99 | -------------------------------------------------------------------------------- /images/gamma_green_option.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static const char * gamma_green_option_xpm[] = { 3 | "31 31 64 1", 4 | " c None", 5 | ". c #FFFFFF", 6 | "+ c #FBFFFA", 7 | "@ c #F8FFF6", 8 | "# c #F5FFF2", 9 | "$ c #F2FFEE", 10 | "% c #EFFFE9", 11 | "& c #ECFFE5", 12 | "* c #E9FFE1", 13 | "= c #E5FFDD", 14 | "- c #E2FFD8", 15 | "; c #DFFFD4", 16 | "> c #DCFFD0", 17 | ", c #D9FFCC", 18 | "' c #D6FFC7", 19 | ") c #D3FFC3", 20 | "! c #CFFFBF", 21 | "~ c #CCFFBB", 22 | "{ c #C9FFB6", 23 | "] c #C6FFB2", 24 | "^ c #C3FFAE", 25 | "/ c #C0FFAA", 26 | "( c #BDFFA5", 27 | "_ c #BAFFA1", 28 | ": c #B6FF9D", 29 | "< c #B3FF98", 30 | "[ c #B0FF94", 31 | "} c #ADFF90", 32 | "| c #AAFF8C", 33 | "1 c #A7FF87", 34 | "2 c #A4FF83", 35 | "3 c #A0FF7F", 36 | "4 c #9DFF7B", 37 | "5 c #000000", 38 | "6 c #1D2B18", 39 | "7 c #9AFF77", 40 | "8 c #97FF72", 41 | "9 c #94FF6E", 42 | "0 c #91FF6A", 43 | "a c #8EFF66", 44 | "b c #8BFF61", 45 | "c c #87FF5D", 46 | "d c #84FF59", 47 | "e c #81FF55", 48 | "f c #7EFF50", 49 | "g c #7BFF4C", 50 | "h c #78FF48", 51 | "i c #75FF43", 52 | "j c #72FF3F", 53 | "k c #6EFF3B", 54 | "l c #6BFF37", 55 | "m c #68FF33", 56 | "n c #65FF2E", 57 | "o c #62FF2A", 58 | "p c #5FFF26", 59 | "q c #5CFF21", 60 | "r c #58FF1D", 61 | "s c #55FF19", 62 | "t c #52FF15", 63 | "u c #4FFF10", 64 | "v c #4CFF0C", 65 | "w c #49FF08", 66 | "x c #46FF04", 67 | "y c #43FF00", 68 | ".+@#$%&*=-;>,')!~{]^/(_:<[}|123", 69 | "+@#$%&*=-;>,')!~{]^/(_:<[}|1234", 70 | "@#$%&55555555555555555556|12347", 71 | "#$%&*=5555555555555555555123478", 72 | "$%&*=-;555555555555555555234789", 73 | "%&*=-;>,5555{]^/(_:<[}555347890", 74 | "&*=-;>,'5555]^/(_:<[}|15547890a", 75 | "*=-;>,')5555^/(_:<[}|12357890ab", 76 | "=-;>,')!5555/(_:<[}|12347890abc", 77 | "-;>,')!~5555(_:<[}|12347890abcd", 78 | ";>,')!~{5555_:<[}|12347890abcde", 79 | ">,')!~{]5555:<[}|12347890abcdef", 80 | ",')!~{]^5555<[}|12347890abcdefg", 81 | "')!~{]^/5555[}|12347890abcdefgh", 82 | ")!~{]^/(5555}|12347890abcdefghi", 83 | "!~{]^/(_5555|12347890abcdefghij", 84 | "~{]^/(_:555512347890abcdefghijk", 85 | "{]^/(_:<55552347890abcdefghijkl", 86 | "]^/(_:<[5555347890abcdefghijklm", 87 | "^/(_:<[}555547890abcdefghijklmn", 88 | "/(_:<[}|55557890abcdefghijklmno", 89 | "(_:<[}|15555890abcdefghijklmnop", 90 | "_:<[}|12555590abcdefghijklmnopq", 91 | ":<[}|12355550abcdefghijklmnopqr", 92 | "<[}|12345555abcdefghijklmnopqrs", 93 | "[}|123475555bcdefghijklmnopqrst", 94 | "}|1234785555cdefghijklmnopqrstu", 95 | "|123478555555efghijklmnopqrstuv", 96 | "123478555555555hijklmnopqrstuvw", 97 | "2347890abcdefghijklmnopqrstuvwx", 98 | "347890abcdefghijklmnopqrstuvwxy"}; 99 | -------------------------------------------------------------------------------- /qi/sliderspin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | sliderspin.h - description 3 | ------------------- 4 | begin : Fri Mar 8 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SLIDERSPIN_H 19 | #define SLIDERSPIN_H 20 | 21 | #include 22 | 23 | /**A combination of a QLabel, a QSlider and 24 | a QSpinBox, arranged in a QVBox. 25 | *@author Michael Herder 26 | */ 27 | 28 | class QLabel; 29 | class QSlider; 30 | class QSpinBox; 31 | 32 | class SliderSpin : public QWidget 33 | { 34 | Q_OBJECT 35 | public: 36 | SliderSpin(QWidget* parent=0,const char* name=0,Qt::WindowFlags f=Qt::WindowFlags(),bool allowLines=true); 37 | SliderSpin(int minval,int maxval,int val, QString title,QWidget* parent=0, 38 | const char* name=0,Qt::WindowFlags f=Qt::WindowFlags(),bool allowLines=true); 39 | ~SliderSpin(); 40 | /** No descriptions */ 41 | void setRange(int min,int max); 42 | /** No descriptions */ 43 | void setTitle(QString title); 44 | /** No descriptions */ 45 | int value(); 46 | /** No descriptions */ 47 | void setValue(int value); 48 | void setEnabled ( bool enable); 49 | private: // Private methods 50 | /** No descriptions */ 51 | void initWidget(); 52 | private: 53 | /** */ 54 | QLabel* mpTitleLabel; 55 | /** */ 56 | QSlider* mpSlider; 57 | /** */ 58 | QSpinBox* mpSpinBox; 59 | private slots: // Private slots 60 | /** No descriptions */ 61 | void slotValueChanged(int value); 62 | /** No descriptions */ 63 | void slotSliderMoved(int value); 64 | /** No descriptions */ 65 | void slotSpinValueChanged(int value); 66 | signals: 67 | void signalValueChanged(int value); 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | /** maxview config file 24 | 25 | sets up some build-specific things 26 | 27 | */ 28 | 29 | 30 | /* define this to support JPEG compression in the scanner - only later version of SANE do */ 31 | #define CONFIG_sane_jpeg 1 32 | 33 | // hack for now, as current versions of SANE out there don't have SANE_FRAME_JPEG 34 | // and since it is an enum I'm not sure how to detected it at build time when they do! 35 | 36 | #define HACK_SANE_FRAME_JPEG ((SANE_Frame)11) 37 | 38 | // this must be a multiple of 8 at the moment due to assumptions in scale_2bpp 39 | // previews are scaled 1:24 40 | #define CONFIG_preview_scale 24 41 | 42 | 43 | // a larger preview that we probably should try to use... 44 | #define CONFIG_large_preview_scale 16 45 | 46 | 47 | /** this is the fraction of full colour that the blue RGB value should be 48 | to show a blank page - don't add brackets or you will break the code */ 49 | #define CONFIG_preview_col_mult 7 / 8 50 | 51 | 52 | 53 | /** define this to use Nuance's Omnipage OCR. This will require a license 54 | purchase, currently around US400 per user. Please contact the author for 55 | details */ 56 | //#define CONFIG_use_omnipage 57 | 58 | 59 | /** define this to use the poppler library, which allows display of PDF files */ 60 | #define CONFIG_use_poppler 61 | 62 | 63 | 64 | 65 | // version numbers 66 | #define CONFIG_version_str "1.3" 67 | #define CONFIG_version 130 68 | 69 | 70 | //! port number to use for deliverymv server 71 | #define CONFIG_port 1968 72 | 73 | 74 | -------------------------------------------------------------------------------- /ocrbar.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ocrbar 4 | 5 | 6 | 7 | 0 8 | 0 9 | 303 10 | 57 11 | 12 | 13 | 14 | Frame 15 | 16 | 17 | QFrame::NoFrame 18 | 19 | 20 | QFrame::Raised 21 | 22 | 23 | 24 | 0 25 | 26 | 27 | 28 | 29 | 30 | 31 | Click to turn the image into editable text 32 | 33 | 34 | OCR 35 | 36 | 37 | 38 | 39 | 40 | 41 | Click to swap between vertical and horizontal views 42 | 43 | 44 | Flip View 45 | 46 | 47 | 48 | 49 | 50 | 51 | Click to clear the text 52 | 53 | 54 | Clear 55 | 56 | 57 | 58 | 59 | 60 | 61 | Click to copy text to the clipboard 62 | 63 | 64 | Copy 65 | 66 | 67 | 68 | 69 | 70 | 71 | Qt::Horizontal 72 | 73 | 74 | 75 | 40 76 | 20 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /qi/qstringoption.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qstringoption.cpp - description 3 | ------------------- 4 | begin : Fri Sep 15 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #include "qstringoption.h" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | QStringOption::QStringOption(QString title,QWidget *parent, const char *name ) 29 | :QSaneOption(title,parent,name) 30 | { 31 | initWidget(); 32 | } 33 | 34 | QStringOption::~QStringOption() 35 | { 36 | } 37 | /** */ 38 | void QStringOption::initWidget() 39 | { 40 | QGridLayout* qgl = new QGridLayout(this); 41 | QLabel* label = new QLabel(optionTitle(),this); 42 | mpOptionLineEdit = new QLineEdit(this); 43 | connect(mpOptionLineEdit,SIGNAL(textChanged(const QString&)), 44 | this,SLOT(slotTextChanged(const QString&))); 45 | //create pixmap 46 | assignPixmap(); 47 | qgl->addWidget(pixmapWidget(),0,0,2,0); 48 | qgl->addWidget(label,0,1); 49 | qgl->addWidget(mpOptionLineEdit,1,1); 50 | qgl->setSpacing(5); 51 | qgl->setColumnStretch(1,1); 52 | qgl->activate(); 53 | } 54 | /** */ 55 | void QStringOption::setText(const char* text) 56 | { 57 | QString qs(text); 58 | mpOptionLineEdit->setText(qs); 59 | } 60 | /** */ 61 | QString QStringOption::text() 62 | { 63 | return mpOptionLineEdit->text(); 64 | } 65 | /** */ 66 | void QStringOption::slotTextChanged(const QString& qs) 67 | { 68 | mCurrentText = qs; 69 | slotEmitOptionChanged(); 70 | } 71 | /** No descriptions */ 72 | void QStringOption::setMaxLength(int length) 73 | { 74 | mpOptionLineEdit->setMaxLength(length); 75 | } 76 | -------------------------------------------------------------------------------- /qi/sanefixedoption.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | sanefixedoption.h - description 3 | ------------------- 4 | begin : Mon Apr 8 2002 5 | copyright : (C) 2002 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #ifndef SANEFIXEDOPTION_H 19 | #define SANEFIXEDOPTION_H 20 | 21 | #include "qsaneoption.h" 22 | #include 23 | 24 | extern "C" 25 | { 26 | #include 27 | } 28 | /** 29 | *@author M. Herder 30 | */ 31 | //forward declarations 32 | class SaneFixedSpinBox; 33 | class QLabel; 34 | class QString; 35 | 36 | class SaneFixedOption : public QSaneOption 37 | { 38 | Q_OBJECT 39 | public: 40 | /** 41 | *@author Michael Herder 42 | */ 43 | SaneFixedOption(QString title,QWidget * parent, 44 | SANE_Value_Type type=SANE_TYPE_INT,const char * name=0); 45 | ~SaneFixedOption(); 46 | /** */ 47 | void setUnit(SANE_Unit unit); 48 | /** */ 49 | void setValue(int val); 50 | /** */ 51 | int value(); 52 | /** */ 53 | SANE_Value_Type getSaneType(); 54 | /** No descriptions */ 55 | int maxValue(); 56 | /** No descriptions */ 57 | int minValue(); 58 | /** No descriptions */ 59 | void setValueExt(int value); 60 | /** No descriptions */ 61 | double getPercentValue(); 62 | private: // Private attributes 63 | /** */ 64 | SANE_Unit mSaneUnit; 65 | /** */ 66 | SaneFixedSpinBox* mpValueSpinBox; 67 | /** */ 68 | QLabel* mpTitleLabel; 69 | /** */ 70 | QString mUnitString; 71 | /** */ 72 | SANE_Value_Type mSaneValueType; 73 | private: // Private methods 74 | /** */ 75 | void initWidget(); 76 | /** */ 77 | void redrawValueLabel(); 78 | private slots: // Private slots 79 | /** */ 80 | void slotValueChanged(int val); 81 | signals: // Signals 82 | /** */ 83 | void valueChanged(int); 84 | }; 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /qi/qocrprogress.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qocrprogress.h - description 3 | ------------------- 4 | begin : Tue Jan 16 2001 5 | copyright : (C) 2001 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QOCRPROGRESS_H 18 | #define QOCRPROGRESS_H 19 | 20 | #include "resource.h" 21 | #include 22 | #include 23 | #include 24 | 25 | /** 26 | *@author Michael Herder 27 | */ 28 | class QUnknownProgressWidget; 29 | class QPushButton; 30 | class QLabel; 31 | class QGridLayout; 32 | #ifndef USE_QT3 33 | class QProcessBackport; 34 | #else 35 | class QProcess; 36 | #endif 37 | 38 | class QOCRProgress : public QDialog 39 | { 40 | Q_OBJECT 41 | public: 42 | QOCRProgress(QWidget* parent=0,const char* name = 0,bool modal = false); 43 | ~QOCRProgress(); 44 | /** */ 45 | QString ocrText(); 46 | /** No descriptions */ 47 | void setImagePath(QString path); 48 | /** No descriptions */ 49 | void setImage(QImage& image); 50 | private: // Private methods 51 | /** */ 52 | QImage mImage; 53 | /** */ 54 | QString mOcrText; 55 | /** */ 56 | QString mImagePath; 57 | /** */ 58 | QString mOcrImagePath; 59 | /** */ 60 | #ifndef USE_QT3 61 | QProcessBackport* mpOcrProcess; 62 | #else 63 | QProcess* mpOcrProcess; 64 | #endif 65 | /** */ 66 | QGridLayout* mpMainLayout; 67 | /** */ 68 | QLabel* mpInfoLabel; 69 | /** */ 70 | QPushButton* mpCancelButton; 71 | /** */ 72 | QUnknownProgressWidget* mpUnknownProgress; 73 | private: //methods 74 | /** */ 75 | void initDlg(); 76 | /** */ 77 | void startOCR(); 78 | private slots: 79 | /** */ 80 | void slotStopOCR2(); 81 | /** */ 82 | void slotStopOCR(); 83 | /** */ 84 | void slotReceivedStdout(); 85 | /** */ 86 | void slotReceivedStderr(); 87 | protected: // Protected methods 88 | /** */ 89 | virtual void showEvent(QShowEvent * e); 90 | }; 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /mem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | 28 | #include "err.h" 29 | #include "mem.h" 30 | 31 | 32 | void mem_check (void) 33 | { 34 | void *ptr; 35 | int i; 36 | 37 | for (i = 0; i < 50; i++) 38 | { 39 | ptr = malloc (rand () % 100000); 40 | free (ptr); 41 | } 42 | } 43 | 44 | 45 | err_info *mem_alloc (void **ptr, int size, const char *func_name) 46 | { 47 | *ptr = NULL; 48 | if (size > 0) 49 | *ptr = malloc (size); 50 | if (size != 0 && !*ptr) 51 | return err_make (func_name, ERR_out_of_memory_bytes1, size); 52 | return NULL; 53 | } 54 | 55 | 56 | err_info *mem_realloc (void **ptr, int newsize, const char *func_name) 57 | { 58 | if (newsize > 0) 59 | *ptr = realloc (*ptr, newsize); 60 | if (newsize != 0 && !*ptr) 61 | return err_make (func_name, ERR_out_of_memory_bytes1, newsize); 62 | return NULL; 63 | } 64 | 65 | 66 | err_info *mem_allocz (void **ptr, int size, const char *func_name) 67 | { 68 | CALL (mem_alloc (ptr, size, func_name)); 69 | memset (*ptr, '\0', size); 70 | return NULL; 71 | } 72 | 73 | 74 | void mem_free (void **ptr) 75 | { 76 | free (*ptr); 77 | *ptr = NULL; 78 | } 79 | 80 | 81 | err_info *mem_str (void **ptr, const char *str, const char *func_name) 82 | { 83 | CALL (mem_alloc (ptr, strlen (str) + 1, func_name)); 84 | strcpy ((char *)*ptr, str); 85 | return NULL; 86 | } 87 | 88 | 89 | err_info *mem_restr (void **ptr, const char *str, const char *func_name) 90 | { 91 | CALL (mem_realloc (ptr, strlen (str) + 1, func_name)); 92 | strcpy ((char *)*ptr, str); 93 | return NULL; 94 | } 95 | 96 | -------------------------------------------------------------------------------- /qi/qfiledialogext.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qfiledialogext.cpp - description 3 | ------------------- 4 | begin : Sun Sep 16 2001 5 | copyright : (C) 2001 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License as published by * 13 | * the Free Software Foundation; either version 2 of the License, or * 14 | * (at your option) any later version. * 15 | * * 16 | ***************************************************************************/ 17 | 18 | #include "resource.h" 19 | #include "qfiledialogext.h" 20 | 21 | QFileDialogExt::QFileDialogExt(QWidget* parent,const char* name,bool modal) 22 | :QFileDialog(parent,name,modal) 23 | { 24 | } 25 | QFileDialogExt::QFileDialogExt(const QString& dirName,const QString& filter,QWidget* parent,const char* name,bool modal) 26 | :QFileDialog (dirName,filter,parent,name,modal) 27 | { 28 | } 29 | QFileDialogExt::~QFileDialogExt() 30 | { 31 | } 32 | void QFileDialogExt::reject() 33 | { 34 | mViewMode = int(viewMode()); 35 | //What the hell is this? Not enough, that viewMode() only works, as 36 | //long as the dialog is visible, it also returns the wrong values 37 | //(0 when it should return 1 and vice versa) 38 | //At least, this stupid behaviour is consistent in all versions 39 | //of Qt2.2.x. If this is fixed in Qt3, this class can be removed 40 | //completely. But since we still support Qt2, we better keep it. 41 | #ifndef USE_QT3 42 | if(mViewMode == 0) 43 | mViewMode = 1; 44 | else if(mViewMode == 1) 45 | mViewMode = 0; 46 | #endif 47 | QDialog::reject(); 48 | } 49 | 50 | void QFileDialogExt::accept() 51 | { 52 | mViewMode = int(viewMode()); 53 | //see reject() for stupid hack description 54 | #ifndef USE_QT3 55 | if(mViewMode == 0) 56 | mViewMode = 1; 57 | else if(mViewMode == 1) 58 | mViewMode = 0; 59 | #endif 60 | QDialog::accept(); 61 | } 62 | /** Return the view mode as an int value. This is needed, since 63 | the implementation of viewMode() in QFileDialog only works, 64 | as long as the dialog is visible. 65 | */ 66 | int QFileDialogExt::intViewMode() 67 | { 68 | return mViewMode; 69 | } 70 | -------------------------------------------------------------------------------- /qi/qdevicesettings.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qdevicesettings.h - description 3 | ------------------- 4 | begin : Mon Mar 05 2001 5 | copyright : (C) 2001 by Michael Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QDEVICESETTINGS_H 18 | #define QDEVICESETTINGS_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | /** 26 | *@author M. Herder 27 | */ 28 | //forward declarations 29 | class QListWidget; 30 | class QListWidgetItem; 31 | class QLabel; 32 | class QPushButton; 33 | class QScanner; 34 | class QToolButton; 35 | 36 | class QDeviceSettings : public QDialog 37 | { 38 | Q_OBJECT 39 | public: 40 | QDeviceSettings(QScanner* s,QWidget *parent=0,const char *name=0,bool modal=true,Qt::WindowFlags f=Qt::WindowFlags()); 41 | ~QDeviceSettings(); 42 | /** */ 43 | void createContents(); 44 | /** */ 45 | QString getIncreasingFilename(); 46 | /** */ 47 | int quality(); 48 | /** */ 49 | QString imageType(); 50 | /** */ 51 | bool saveDeviceSettings(QString uname = QString()); 52 | private slots: // Private slots 53 | /** */ 54 | void slotClearList(); 55 | /** */ 56 | void slotDelete(); 57 | /** */ 58 | void slotSelectionChanged(); 59 | /** */ 60 | void slotLoad(); 61 | /** */ 62 | void slotSave(); 63 | /** */ 64 | void slotNew(); 65 | /** */ 66 | void slotDoubleClicked(QListWidgetItem*); 67 | private: // Private attributes 68 | /** */ 69 | QScanner* mpScanner; 70 | /** */ 71 | QListWidget* mpListWidget; 72 | /** */ 73 | QPushButton* mpButtonDelete; 74 | /** */ 75 | QPushButton* mpButtonLoad; 76 | /** */ 77 | QPushButton* mpButtonNew; 78 | /** */ 79 | QPushButton* mpButtonSave; 80 | /** */ 81 | QPushButton* mpButtonCancel; 82 | /** */ 83 | QMap mOptionMap; 84 | /** */ 85 | void initWidget(); 86 | /** */ 87 | void createWhatsThisHelp(); 88 | }; 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /qi/qcurvewidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | qcurvewidget.h - description 3 | ------------------- 4 | begin : Mon Oct 30 2000 5 | copyright : (C) 2000 by M. Herder 6 | email : crapsite@gmx.net 7 | ***************************************************************************/ 8 | 9 | /*************************************************************************** 10 | * * 11 | * This program is free software; you can redistribute it and/or modify * 12 | * it under the terms of the GNU General Public License version 2 as * 13 | * published by the Free Software Foundation. * 14 | * * 15 | ***************************************************************************/ 16 | 17 | #ifndef QCURVEWIDGET_H 18 | #define QCURVEWIDGET_H 19 | 20 | #include 21 | //s #include 22 | #include 23 | #include 24 | #include "qsplinearray.h" 25 | #include 26 | #include 27 | /** 28 | *@author M. Herder 29 | */ 30 | 31 | class QCurveWidget : public QWidget 32 | { 33 | Q_OBJECT 34 | public: 35 | enum CurveType 36 | { 37 | CurveType_Gamma, 38 | CurveType_Free, 39 | CurveType_LineSegments, 40 | CurveType_Interpolated 41 | }; 42 | QCurveWidget(QWidget *parent=0, const char *name=0); 43 | ~QCurveWidget(); 44 | /** */ 45 | void setDataArray(QPolygon qpa); 46 | /** */ 47 | void reset(); 48 | /** */ 49 | void set(); 50 | private: 51 | enum CurveType mCurveType; 52 | QPoint mOldPoint; 53 | /** */ 54 | bool mLmbPressed; 55 | QPoint mNewPoint; 56 | QSplineArray mSplineArray; 57 | QVector mRectArray; 58 | /** */ 59 | int mRectIndex; 60 | /**Holds the previous data */ 61 | QPolygon mOldDataArray; 62 | /**Holds the line that is drawn in the widget */ 63 | QPolygon mNewDataArray; 64 | /** */ 65 | double mGamma; 66 | protected: 67 | /** */ 68 | virtual void mouseMoveEvent(QMouseEvent*); 69 | /** */ 70 | virtual void mousePressEvent(QMouseEvent* me); 71 | /** */ 72 | virtual void mouseReleaseEvent(QMouseEvent* me); 73 | virtual void paintEvent(QPaintEvent*); 74 | private: 75 | /** */ 76 | void calcRectArray(); 77 | /** */ 78 | void calcDataArray(); 79 | public slots: 80 | /** */ 81 | void slotChangeCurveType(int index); 82 | public: 83 | /** */ 84 | QPolygon pointArray(); 85 | /** */ 86 | void setGamma(double gamma); 87 | signals: 88 | /** */ 89 | void signalGamma(bool b); 90 | }; 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /dirview.h: -------------------------------------------------------------------------------- 1 | /* 2 | License: GPL-2 3 | An electronic filing cabinet: scan, print, stack, arrange 4 | Copyright (C) 2009 Simon Glass, chch-kiwi@users.sourceforge.net 5 | . 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | . 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | . 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | X-Comment: On Debian GNU/Linux systems, the complete text of the GNU General 21 | Public License can be found in the /usr/share/common-licenses/GPL file. 22 | */ 23 | /* 24 | dirview - directory viewer 25 | */ 26 | 27 | #include 28 | 29 | /** 30 | * @brief Provides a directory view 31 | * 32 | * This is a QTreeView which uses Dirmodel to provide a directory tree on the 33 | * left size of the Desktopwidget. Clicking on a directory changes to that 34 | * directory and shows its stacks on the right in the Desktopview 35 | */ 36 | class Dirview : public QTreeView 37 | { 38 | Q_OBJECT 39 | public: 40 | Dirview (QWidget *parent = 0); 41 | ~Dirview (); 42 | 43 | /** returns the full path referred to by a context menu click */ 44 | QString menuGetPath (void); 45 | 46 | /** returns the filename leaf referred to by a context menu click */ 47 | QString menuGetName (void); 48 | 49 | /** returns the context menu model index */ 50 | QModelIndex menuGetModelIndex (void); 51 | 52 | /** select a particular item as the current one to be operated on by keypresses/menus */ 53 | void selectContextItem (const QModelIndex &index); 54 | 55 | // void dragEnterEvent(QDragEnterEvent *event); 56 | 57 | void dropEvent (QDropEvent *event); 58 | 59 | protected: 60 | void contextMenuEvent (QContextMenuEvent * e); 61 | 62 | public slots: 63 | void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected); 64 | 65 | public: 66 | // the menu actions which the user can select 67 | QAction *_search, *_new, *_delete, *_rename, *_refresh, *_add_recent; 68 | QAction *_add_repository, *_remove_repository, *_refresh_cache; 69 | 70 | private: 71 | // Holds the index of the tree item currently selected 72 | // Note that Dirview uses Dirproxy for its indexes 73 | QPersistentModelIndex _context; 74 | }; 75 | 76 | -------------------------------------------------------------------------------- /zipentry_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Filename: ZipEntryP.h 3 | ** Last updated [dd/mm/yyyy]: 28/01/2007 4 | ** 5 | ** Wrapper for a ZIP local header. 6 | ** 7 | ** Some of the code has been inspired by other open source projects, 8 | ** (mainly Info-Zip and Gilles Vollant's minizip). 9 | ** Compression and decompression actually uses the zlib library. 10 | ** 11 | ** Copyright (C) 2007-2008 Angius Fabrizio. All rights reserved. 12 | ** 13 | ** This file is part of the OSDaB project (http://osdab.sourceforge.net/). 14 | ** 15 | ** This file may be distributed and/or modified under the terms of the 16 | ** GNU General Public License version 2 as published by the Free Software 17 | ** Foundation and appearing in the file LICENSE.GPL included in the 18 | ** packaging of this file. 19 | ** 20 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 21 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 22 | ** 23 | ** See the file LICENSE.GPL that came with this software distribution or 24 | ** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information. 25 | ** 26 | **********************************************************************/ 27 | 28 | // 29 | // W A R N I N G 30 | // ------------- 31 | // 32 | // This file is not part of the Zip/UnZip API. It exists purely as an 33 | // implementation detail. This header file may change from version to 34 | // version without notice, or even be removed. 35 | // 36 | // We mean it. 37 | // 38 | 39 | #ifndef OSDAB_ZIPENTRY_P__H 40 | #define OSDAB_ZIPENTRY_P__H 41 | 42 | #include 43 | #include 44 | 45 | class ZipEntryP 46 | { 47 | public: 48 | ZipEntryP() 49 | { 50 | lhOffset = 0; 51 | dataOffset = 0; 52 | gpFlag[0] = gpFlag[1] = 0; 53 | compMethod = 0; 54 | modTime[0] = modTime[1] = 0; 55 | modDate[0] = modDate[1] = 0; 56 | crc = 0; 57 | szComp = szUncomp = 0; 58 | lhEntryChecked = false; 59 | } 60 | 61 | quint32 lhOffset; // Offset of the local header record for this entry 62 | quint32 dataOffset; // Offset of the file data for this entry 63 | unsigned char gpFlag[2]; // General purpose flag 64 | quint16 compMethod; // Compression method 65 | unsigned char modTime[2]; // Last modified time 66 | unsigned char modDate[2]; // Last modified date 67 | quint32 crc; // CRC32 68 | quint32 szComp; // Compressed file size 69 | quint32 szUncomp; // Uncompressed file size 70 | QString comment; // File comment 71 | 72 | bool lhEntryChecked; // Is true if the local header record for this entry has been parsed 73 | 74 | inline bool isEncrypted() const { return gpFlag[0] & 0x01; } 75 | inline bool hasDataDescriptor() const { return gpFlag[0] & 0x08; } 76 | }; 77 | 78 | #endif // OSDAB_ZIPENTRY_P__H 79 | --------------------------------------------------------------------------------