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� 00�����yYU$�o���ɓf0B�p����@x�jik������;��|;ȞV0s3z9���e�������k��"~��ǵ�MVqN�PBi���ݳ�������������xyn������U���C9Y(�v1��ץu�^H����YX[Sv����h0b�nn���uQI������d��To�baҲ�o,�z;R9���‘�\Ms����~~;��bUsb����᥎�����Ҥ����ݹ�d�0��`2�'��SATo`�vG������@f���^iz꿅Bo����tk{�u_t��~i�������ɽ�j.��ּ���U7���௭����q��֠sKɂ���g��}n���_,k���T%��^B���k-����リ������羝bp�������ͧt��+|�q/�x4���ӱ��v<��X}v7`�ן������d-z.~ˆm�_Lx���jaxn2m�kx����μ���b��~=F ���������ʛgR�Z3����xvw�]�����̶��ۻ���ڰve�6�ԏQb�����׋KJ��_&��u�]Ug�Ҭq5Ye/��`V������z7k�����˕���w3�Q-����ų����b8�c.V�Í���fT}%y�ܻ�����ķ�����ŠI?pB�}~}�ۦ___rrrQ=r���`)�+�����}C�g0L���mP�tK��О����ౘl����]Emƶ��tt���g)��Ͻ�ί�ᵥ�|�������ݹ����۫hco�F0U&��볷��[?��׵�̭��������vWCt�Й�Ǜk��t�������BA(�CI� @���CI� �����|b���W,��˒K�����E�����|a����q�ύ�����ʫ���G��}:x���m�˽����sH����������z��4��bI�Mf��ީ�����•gy������������Ʀ㾉n2������� +�������򃄃�оyb���ӂNx�l���E���ڡ��ҏ��~A�ʸ��ζ��̦��������Z(qgA�q0}��ת���Ǖ��������z�ݴ����͡B�Ǽ���Ŭ���h�����rX� �ᎂ�}n��؞��Ŗ��e/�Ķ���������������ˎh��նjO��ի����ޠ������xk��Π��簞�sT��Ë����������������������e,|�گ������������Y�������ӻ����������߳�קñ���������œ�������gJ�����{������������}������o0�����М���g6����¾���ᒄ��Ⱦm8�eG��������ӡ�z�������I��������|<�lA��ݻ������֨[+{_3�0��D���Ǫ����ɟ ��������ze�����Ϊ����������͝���wb��߸�����������������ڻƹ�������qP���草��ԧ�ղ�������˦�Iu�i������������������㍂�Ƭ�qD�yf�Ԟ˹�������٢�ԡ�Ϝ��������������ăR{�h}�����˭�����Ĩ�iC�F����Ү~f�������������ФBA(CI�  ���CIX ��� �ޞ���Ҝ���xH�@�����=�����ǫ�hh����������u����[�簾͂_�!�����6��ֻ�ʻ��w���֠����������~o���հ���ި�ǹֳ��ԫ�������������̛��Ƽ��ڸ���R������������٩�����~W�����������������������������������~������Ԫ����A����Ɓi�����̙����۶�����������������խ�П����ڪ�������¹�������ް����Ƿ��㮢�T��|����������׸��ʺ����޶~k��������������޲���=������������������٩�����~i����ɾ����~m�����������ӝ�������������������������������������������������������������������������������������������������������?�����������������C-�S�E&a*E��*E�*E�Y*E�?9{Lm/*E?�9�i+���^�Q�� +*E˫�8��Lm���^�Q��� П�d3��OE��R�ٜ�D�.....�� ҕ����55����]OE�4U��3ggҞ��333��5����ҩ����������=E�k�<��5��������������h!SBGS!h������}�MW'�� ʩ�����������aGyS��Ⱦ�Bya������7��l '�D������������B��z�qqqq�ZG2ah��}�7�t �')�ҩ��������aG����J�����%%��h�h�}A� �'���h������������V��J�����%�%�Bᴴ}}}}� ;���xꩩ������θ�V�JJ��o� �����B�!}}}}�� ;�<;d���}}���$��V�J�q�o� ����}ZB�}}}}5� u�;[}}}}}����$�V�J��o�������%Sa}}}}5��u�u��}}}}}S��$$�II�JJ�qo���������y}}}�5d�u���}}���j�����>zJ�qo��������%�h����dв<�ҩ}}��¹>I�Iݺ���w�|���%�%a�:��dв<��3h}}\ߢ�XX���ƛJ�qKw��%oo��qZ\��d�N<�����\ܢ�j���>JJ�� �|oq���������N<�[}��\S�j��>�>>�J�� I��q�����h��N�����\���j��IV���z�I �IK�I���nh�Н�beh��\"����۹IV���>� 顛IzIzJZ\�͟����5\s��X۹�V���>>��T�I��JJ����Н����� ����j$��I�V��V�T�V�zJ�q!}��e��h��j�$�VVV��V��z�����Z�}��e1�[c�j$$$�����VVVV�ae1���}�~�j�$$$$$I�ݸ��6���1�eh�h~�jjj����Ivθ�6Zh,11��}hc���jjj�����6���1��3}h�c����~6h�}�p�}h��666����Qp���0`�p(��5�0�#ppe F�}x,p����H_f�g�rr�3hH�f}�x�5�P@����(�[[�������d��������������������������������������������������������� �� ��-�7��#�b��5jN7���4�~~~ �W�V��ݓ�,?7��;T�����!Fz�����w�v����ă����濿�9\+m+O�߿�wZ U�]������fOtP̊�1���9�/%R���,����v9ζ6 ������O�Q�/Ú����vv�ˇ����E��a����+��܀��*H���v(����E��a���S+�܌�0������&���y�E��a���{�ی��0�D2f�&�(�kG��E�aL�{�\S�f0�Ѐ���o)G�����$Y�l�>�JA�0�����@M�)kG6���K>��h<�A�0����@M� �y�6eiK�>eh<Aw0�[p����6���yi��K�����0x���=� ����6�|���>9�0���MX Ƅ��6` sS�,2nv��X rrƅg������C�v��� �8uư���.�^c���醮qʌ����ɻ'��_�IB�w"3����w��wd��f +}���f�:9f���f����������������������0I deD'5"1t7u�P~`;}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