author | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
---|---|---|
committer | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
commit | 39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91 (patch) (unidiff) | |
tree | 96e66fdc18dca4d4ab8611133e072f57dea224b9 /noncore/apps/opie-reader/CFilter.cpp | |
parent | 279fc4fd1986074acbadd3a8e86fcf3968a8dd5c (diff) | |
download | opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.zip opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.gz opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.bz2 |
new opie-reader sources with support for ArriereGo, Reb input and flite output plugins
Diffstat (limited to 'noncore/apps/opie-reader/CFilter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CFilter.cpp | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/CFilter.cpp b/noncore/apps/opie-reader/CFilter.cpp index ab98829..25cdfae 100644 --- a/noncore/apps/opie-reader/CFilter.cpp +++ b/noncore/apps/opie-reader/CFilter.cpp | |||
@@ -1,17 +1,17 @@ | |||
1 | #include <qmap.h> | 1 | #include <qmap.h> |
2 | #include <qfileinfo.h> | 2 | #include <qfileinfo.h> |
3 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
4 | #include <qdir.h> | 4 | #include <qdir.h> |
5 | |||
5 | #ifdef USEQPE | 6 | #ifdef USEQPE |
6 | #include <qpe/global.h> | 7 | #include <qpe/global.h> |
7 | #endif | 8 | #endif |
8 | #include "CDrawBuffer.h" | 9 | #include "CDrawBuffer.h" |
9 | #include "CFilter.h" | 10 | #include "CFilter.h" |
10 | #include "hrule.h" | 11 | #include "hrule.h" |
11 | #include "util.h" | ||
12 | 12 | ||
13 | #include <qregexp.h> | 13 | #include <qregexp.h> |
14 | #include <qimage.h> | 14 | #include <qimage.h> |
15 | #include <qpixmap.h> | 15 | #include <qpixmap.h> |
16 | //#include <qprogressdialog.h> | 16 | //#include <qprogressdialog.h> |
17 | //#include <qapplication.h> | 17 | //#include <qapplication.h> |
@@ -662,14 +662,23 @@ class ErrorFilter : public CFilter | |||
662 | QString about() { return parent->about(); } | 662 | QString about() { return parent->about(); } |
663 | }; | 663 | }; |
664 | 664 | ||
665 | #ifndef __STATIC | 665 | #ifndef __STATIC |
666 | ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NULL), handle(NULL) | 666 | ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NULL), handle(NULL) |
667 | { | 667 | { |
668 | QString filterpath(QTReaderUtil::getPluginPath("filters")); | 668 | #ifdef USEQPE |
669 | filterpath += "/lib"; | 669 | #ifdef OPIE |
670 | QString filterpath(getenv("OPIEDIR")); | ||
671 | #else | ||
672 | QString filterpath(getenv("QTDIR")); | ||
673 | #endif | ||
674 | filterpath += "/plugins/reader/filters/lib"; | ||
675 | #else | ||
676 | QString filterpath(getenv("READERDIR")); | ||
677 | filterpath += "/filters/lib"; | ||
678 | #endif | ||
670 | filterpath += nm; | 679 | filterpath += nm; |
671 | filterpath += ".so"; | 680 | filterpath += ".so"; |
672 | if (QFile::exists(filterpath)) | 681 | if (QFile::exists(filterpath)) |
673 | { | 682 | { |
674 | qDebug("Filter:%s", (const char*)filterpath); | 683 | qDebug("Filter:%s", (const char*)filterpath); |
675 | handle = dlopen(filterpath, RTLD_LAZY); | 684 | handle = dlopen(filterpath, RTLD_LAZY); |
@@ -689,13 +698,13 @@ ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NU | |||
689 | return; | 698 | return; |
690 | } | 699 | } |
691 | filt = (*newfilter)(optional); | 700 | filt = (*newfilter)(optional); |
692 | } | 701 | } |
693 | else | 702 | else |
694 | { | 703 | { |
695 | qDebug("No filter path"); | 704 | qDebug("No filter path:%s", (const char*)filterpath); |
696 | filt = new ErrorFilter(QString("No filter plugins installed:")+nm); | 705 | filt = new ErrorFilter(QString("No filter plugins installed:")+nm); |
697 | } | 706 | } |
698 | if (filt == NULL) | 707 | if (filt == NULL) |
699 | { | 708 | { |
700 | qDebug("Can't do newfilter"); | 709 | qDebug("Can't do newfilter"); |
701 | filt = new ErrorFilter(QString("Filter creation failed:")+nm); | 710 | filt = new ErrorFilter(QString("Filter creation failed:")+nm); |
@@ -810,6 +819,43 @@ void repara::getch(tchar& ch, CStyle& sty, unsigned long& pos) | |||
810 | } | 819 | } |
811 | } | 820 | } |
812 | tch = ch; | 821 | tch = ch; |
813 | */ | 822 | */ |
814 | return; | 823 | return; |
815 | } | 824 | } |
825 | |||
826 | void tableLink::getch(tchar& ch, CStyle& sty, unsigned long& pos) | ||
827 | { | ||
828 | if (offset >= (int)text.length()) | ||
829 | { | ||
830 | offset = -1; | ||
831 | sty.setColour(m_r, m_g, m_b); | ||
832 | do | ||
833 | { | ||
834 | parent->getch(ch, sty, pos); | ||
835 | } | ||
836 | while (sty.isTable()); | ||
837 | return; | ||
838 | } | ||
839 | if (offset >= 0) | ||
840 | { | ||
841 | ch = text[offset++].unicode(); | ||
842 | return; | ||
843 | } | ||
844 | parent->getch(ch, sty, pos); | ||
845 | if (sty.isTable()) | ||
846 | { | ||
847 | offset = 1; | ||
848 | ch = text[0].unicode(); | ||
849 | m_r = sty.Red(), m_g = sty.Green(), m_b = sty.Blue(); | ||
850 | sty.setColour(255, 0, 0); | ||
851 | } | ||
852 | return; | ||
853 | } | ||
854 | |||
855 | void underlineLink::getch(tchar& ch, CStyle& sty, unsigned long& pos) | ||
856 | { | ||
857 | parent->getch(ch, sty, pos); | ||
858 | if (sty.getLink()) sty.setUnderline(); | ||
859 | //if (isLink && !sty.getLink()) sty.unsetUnderline(); | ||
860 | //isLink = sty.getLink(); | ||
861 | } | ||