diff -Naur vendor\current/readme.os2 trunk/readme.os2 --- vendor\current/readme.os2 1970-01-01 01:00:00.000000000 +0100 +++ trunk/readme.os2 2013-05-27 15:35:12.000000000 +0200 @@ -0,0 +1,170 @@ +DjView4 4.8 README 25.03.2013 + + + +0. CONTENTS OF THIS FILE +======================== + +1. INTRODUCTION + +2. REQUIREMENTS + +3. INSTALLATION + +4. LICENSE, COPYRIGHT, DISCLAIMER + +5. CONTACT + +6. CREDITS + +7. SUPPORT AND DONATIONS + +8. HISTORY + + +1. INTRODUCTION +=============== + +Welcome to DjView4 4.8 port for OS/2 and eComStation. + + + +2. REQUIREMENTS +=============== + +* klibc 0.6.5 or later + + ftp://ftp.netlabs.org/pub/gcc/libc-0_6_5-csd5.wpi + +* djvulibre + + ftp://ftp.netlabs.org/pub/unixos2/djvulibre-3_5_25.zip + +* jpeg + + ftp://ftp.netlabs.org/pub/unixos2/libjpeg.zip + +* Qt4 dll + + see http://svn.netlabs.org/qt4 for more information whats needed and where to get the latest + +* Cups + + see http://svn.netlabs.org/ecups for more information + +* pthread + + http://rpm.netlabs.org/release/00/zip/pthread-20120924-11_oc00.zip + + +3. INSTALLATION +=============== + +To install DjView4, do the following: + +klibc +----- + + 1. Download klibc 0.6.3 csd3 or later. + 2. Install the package by double-clicking on the WPI file. + + +Qt4 dll +------- + + 1. Download the zip or rpm and follow the instructions + + +Cups +---- + + 1. Download the latest cups version which is 1.4.8 or better + 2. Install it and be sure to put the cups.dll somewhere to your path + + +DjView4 +------- + + 1. Create a directory for DjView4. + 2. Extract the DjView4 package to the new directory. + 3. Create a WPS object for djview.exe. + 4. Start djview + 5. Enjoy the app :) + + + +4. LICENSE, COPYRIGHT, DISCLAIMER +================================= + +see COPYRIGHT and COPYING + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + + +5. CONTACT +========== + +if you find a bug, then add a ticket to the trac at http://svn.netlabs.org/qtapps + + + +6. CREDITS +========== + +The port was done by: + +Silvan Scherrer aka _diver + +Thanks go to: + + * Dmitry A. Kuminov + * Oliver Cremer + +They either helped me when I had some nasty questions or did some testing for +me. + + +7. SUPPORT AND DONATIONS +======================== + +DjView4 is based on volunteer work. If you would like to support further +development, you can do so in one of the following ways: + + + * Donate to the Qt4 project: see qt.netlabs.org for more information + + * Contribute to the project: Besides actual development, this also includes + maintaining the documentation and the project web site as well as help + for users. + + +8. HISTORY +========== + +2013-03-25 + + * updated to djviewlibre 3.5.25 code + +2011-09-27 + + * updated to 4.8 code level of djview + * updated to djviewlibre 3.5.24 + * updated to Qt 4.7.3 + * cups >= 1.4.8 required + +2010-10-13 + + * added printing support + +2010-09-02 + + * updated to 4.6 code level of djview + * updated to 3.5.23 code level of djvulibre + +2010-09-01 + + * initial port + diff -Naur vendor\current/src/djview_os2.rc trunk/src/djview_os2.rc --- vendor\current/src/djview_os2.rc 1970-01-01 01:00:00.000000000 +0100 +++ trunk/src/djview_os2.rc 2010-09-02 16:19:00.000000000 +0200 @@ -0,0 +1 @@ +ICON 1 DISCARDABLE "images/DjVuApp_os2.ico" \ No newline at end of file diff -Naur vendor\current/src/djview.pro trunk/src/djview.pro --- vendor\current/src/djview.pro 2011-08-17 16:24:20.000000000 +0200 +++ trunk/src/djview.pro 2011-09-30 11:58:02.000000000 +0200 @@ -33,6 +33,10 @@ # for use under unix with pkgconfig CONFIG += link_pkgconfig PKGCONFIG += ddjvuapi +} else:os2 { + INCLUDEPATH += . e:/trees/djvulibre/trunk d:/cups/include + LIBS += -ldjvulibre -lpthread -ljpeg -Le:/trees/djvulibre/trunk/libdjvu/.libs -Ld:/cups/lib -llibcups + RC_FILE = djview_os2.rc } else { # for use on other platforms # LIBS += -ldjvulibre @@ -113,3 +117,13 @@ TRANSLATIONS += djview_de.ts TRANSLATIONS += djview_cs.ts TRANSLATIONS += djview_ru.ts + +# -- needed that shadowbuild works nicely +qtPrepareTool(LRELEASE, lrelease) +updateqm.input = TRANSLATIONS +updateqm.output = ${QMAKE_FILE_BASE}.qm +updateqm.variable_out = PRE_TARGETDEPS +updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} +updateqm.name = LRELEASE ${QMAKE_FILE_IN} +updateqm.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += updateqm diff -Naur vendor\current/src/images/djvuapp_os2.ico trunk/src/images/djvuapp_os2.ico --- vendor\current/src/images/djvuapp_os2.ico 1970-01-01 01:00:00.000000000 +0100 +++ trunk/src/images/djvuapp_os2.ico 2011-08-31 19:06:40.000000000 +0200 @@ -0,0 +1,5 @@ +BA(HCI 0`CI 00yYU$oɓf0Bp@xjik;|;ȞV0s3z9ek"~ǵMVqNPBiݳxynUC9Y(v1ץu^HYX[Svh0bnnuQIdTobaҲo,z;R9‘\Ms~~;bUsb᥎Ҥݹd0`2'SATo`vG@f^iz꿅Botk{u_t~iɽj.ּU7௭q֠sKɂg}n_,kT%^Bk-リ羝bpͧt+|q/x4ӱvzJqo%hdв<ҩ}}¹>IIݺw|%%a:dв<3h}}\ߢXXƛJqKw%ooqZ\dN<\ܢj>JJ |oqN<[}\Sj>>>J IqhN\jIVzI IKInhНbeh\"۹IV> 顛IzIzJZ\͟5\sX۹V>>TIJJН j$IVVTVzJq!}ehj$VVVVzZ}e1[cj$$$VVVVae1}~j$$$$$Iݸ61ehh~jjjIvθ6Zh,11}hcjjj613}hc~6h}p}h666Qp0`p(50#ppe F}x,pH_fgrr3hHf}x5P@([[d  -7#b5jN74~~~ WVݓ,?7;T!Fzwvă濿9\+m+O߿wZ U]fOtP̊19/%R,v9ζ6 OQ/ÚvvˇEa+܀*Hv(EaS+܌0&yEa{ی0D2f&(kGEaL{\Sf0Ѐo)G$Yl>JA0@M)kG6K>heh<Aw0[p6yiK0x= 6|>90MX Ƅ6` sS,2nvX rrƅgCv 8uư.^c醮qʌɻ'_IBw"3wwdf +}f:9ff0I deD'5"1t7uP~`;}G4M+!68\qmQ%WlRH|= F]i?r,9JU ^kV#3{BpXTc.zY_Lf[nChEo- x*gAs \ No newline at end of file diff -Naur vendor\current/src/qdjviewexporters.cpp trunk/src/qdjviewexporters.cpp --- vendor\current/src/qdjviewexporters.cpp 2011-08-17 16:24:20.000000000 +0200 +++ trunk/src/qdjviewexporters.cpp 2011-09-26 13:31:18.000000000 +0200 @@ -91,6 +91,10 @@ #include "qdjvuwidget.h" #include "qdjvu.h" +#ifdef Q_WS_PM +# include +#endif + #ifdef WIN32 # define wdup(fh) _dup(fh) #else @@ -783,6 +787,7 @@ } else if (printer) { +#ifndef Q_WS_PM QString printerName = printer->printerName(); // disable sigpipe #ifdef SIGPIPE @@ -923,6 +928,24 @@ closeFile(); } #endif +#else + char filename[512]; + int fd = cupsTempFd(filename, 512); + if (fd < 0) { + qWarning("QPdfPrinter: Could not open temporary file to print"); + return; + } +/* we need to close the cups fd, so djview can open it again */ + close(fd); + file.close(); + file.setFileName(filename); + if (! file.fileName().isEmpty()) + { + file.remove(); + if (file.open(QIODevice::WriteOnly)) + output = ::fdopen(file.handle(), "wb"); + } +#endif } } @@ -936,6 +959,64 @@ ::close(outputfd); if (file.openMode()) file.close(); +#ifdef Q_WS_PM + if (printer) + { + QString printerName = printer->printerName(); + + // Set up print options. + QByteArray prnName; + QList > options; + QVector cupsOptStruct; + + if (!printerName.isEmpty()) { + prnName = printerName.toLocal8Bit(); + + QPrintEngine *engine = printer->printEngine(); +# define PPK_CupsOptions QPrintEngine::PrintEnginePropertyKey(0xfe00) +# define PPK_CupsStringPageSize QPrintEngine::PrintEnginePropertyKey(0xfe03) + QVariant cPageSize = engine->property(PPK_CupsStringPageSize); + QVariant cOptions = engine->property(PPK_CupsOptions); + QStringList cupsOptions = cOptions.toStringList(); + + if (!cPageSize.toString().isEmpty()) { + options.append(QPair("media", cPageSize.toString().toLocal8Bit())); + } + + if (copies > 1) { + options.append(QPair("copies", QString::number(copies).toLocal8Bit())); + } + + if (collate) { + options.append(QPair("Collate", "True")); + } + + if (duplex) { + options.append(QPair("sides", "two-sided-long-edge")); + } + + QStringList::const_iterator it = cupsOptions.constBegin(); + while (it != cupsOptions.constEnd()) { + options.append(QPair((*it).toLocal8Bit(), (*(it+1)).toLocal8Bit())); + it += 2; + } + + for (int c = 0; c < options.size(); ++c) { + cups_option_t opt; + opt.name = options[c].first.data(); + opt.value = options[c].second.data(); + cupsOptStruct.append(opt); + } + + // Print the file. + QString title = djview->getDocumentFileName(); + cups_option_t* optPtr = cupsOptStruct.size() ? &cupsOptStruct.first() : 0; + cupsPrintFile(prnName.constData(), file.fileName().toLocal8Bit().constData(), + title.toLocal8Bit().constData(), cupsOptStruct.size(), optPtr); + } + file.remove(); + } +#endif output = 0; outputfd = -1; printer = 0; diff -Naur vendor\current/src/qdjvu.cpp trunk/src/qdjvu.cpp --- vendor\current/src/qdjvu.cpp 2011-08-17 16:24:20.000000000 +0200 +++ trunk/src/qdjvu.cpp 2011-08-31 19:09:40.000000000 +0200 @@ -413,7 +413,7 @@ qWarning("QDjVuDocument::setFileName: cannot read file"); return false; } -#if DDJVUAPI_VERSION >= 19 +#if DDJVUAPI_VERSION >= 19 && !defined(Q_WS_PM) // as our wcrtomb() is broken QByteArray b = f.toUtf8(); document = ddjvu_document_create_by_filename_utf8(*ctx, b, cache); #else