summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReader.cpp766
-rw-r--r--noncore/apps/opie-reader/opie-reader.control4
2 files changed, 385 insertions, 385 deletions
diff --git a/noncore/apps/opie-reader/QTReader.cpp b/noncore/apps/opie-reader/QTReader.cpp
index 6251812..fc9cffb 100644
--- a/noncore/apps/opie-reader/QTReader.cpp
+++ b/noncore/apps/opie-reader/QTReader.cpp
@@ -78,50 +78,50 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e )
//void QTReader::mouseDoubleClickEvent( QMouseEvent* _e )
{
if (textarray != NULL)
{
-// printf("(%u, %u)\n", _e->x(), _e->y());
- QString wrd = QString::null;
- int lineno = _e->y()/m_linespacing;
- if (m_bMonoSpaced)
- {
- int chno = _e->x()/m_charWidth;
- if (chno < ustrlen(textarray[lineno]->data()))
- {
- wrd[0] = textarray[lineno]->data()[chno];
- }
- }
- else
- {
- CBuffer* t = textarray[lineno];
- int first = 0;
- while (1)
- {
- int i = first+1;
-// while ((*t)[i] != ' ' && (*t)[i] != 0) i++;
- while (QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++;
- if (m_fm->width(toQString(t->data()), i) > _e->x())
- {
- wrd = toQString(t->data()+first, i - first);
- break;
- }
-// while ((*t)[i] == ' ' && (*t)[i] != 0) i++;
- while (!QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++;
- if ((*t)[i] == 0) break;
- first = i;
- }
- }
- if (!wrd.isEmpty())
- {
- QClipboard* cb = QApplication::clipboard();
- cb->setText(wrd);
- Global::statusMessage(wrd);
- if (!m_targetapp.isEmpty() && !m_targetmsg.isEmpty())
- {
- QCopEnvelope e(("QPE/Application/"+m_targetapp).utf8(), (m_targetmsg+"(QString)").utf8());
- e << wrd;
- }
- }
+// printf("(%u, %u)\n", _e->x(), _e->y());
+ QString wrd = QString::null;
+ int lineno = _e->y()/m_linespacing;
+ if (m_bMonoSpaced)
+ {
+ int chno = _e->x()/m_charWidth;
+ if (chno < ustrlen(textarray[lineno]->data()))
+ {
+ wrd[0] = textarray[lineno]->data()[chno];
+ }
+ }
+ else
+ {
+ CBuffer* t = textarray[lineno];
+ int first = 0;
+ while (1)
+ {
+ int i = first+1;
+// while ((*t)[i] != ' ' && (*t)[i] != 0) i++;
+ while (QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++;
+ if (m_fm->width(toQString(t->data()), i) > _e->x())
+ {
+ wrd = toQString(t->data()+first, i - first);
+ break;
+ }
+// while ((*t)[i] == ' ' && (*t)[i] != 0) i++;
+ while (!QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++;
+ if ((*t)[i] == 0) break;
+ first = i;
+ }
+ }
+ if (!wrd.isEmpty())
+ {
+ QClipboard* cb = QApplication::clipboard();
+ cb->setText(wrd);
+ Global::statusMessage(wrd);
+ if (!m_targetapp.isEmpty() && !m_targetmsg.isEmpty())
+ {
+ QCopEnvelope e(("QPE/Application/"+m_targetapp).utf8(), (m_targetmsg+"(QString)").utf8());
+ e << wrd;
+ }
+ }
}
}
void QTReader::focusInEvent(QFocusEvent* e)
@@ -133,10 +133,10 @@ void QTReader::focusInEvent(QFocusEvent* e)
void QTReader::focusOutEvent(QFocusEvent* e)
{
if (m_autoScroll)
{
- timer->stop();
- m_scrolldy = 0;
+ timer->stop();
+ m_scrolldy = 0;
}
}
#include <qapplication.h>
@@ -146,147 +146,147 @@ void QTReader::focusOutEvent(QFocusEvent* e)
void QTReader::goDown()
{
if (m_bpagemode)
{
- dopagedn();
+ dopagedn();
}
else
{
- lineDown();
+ lineDown();
}
}
void QTReader::goUp()
{
if (m_bpagemode)
{
- dopageup();
+ dopageup();
}
else
{
- lineUp();
+ lineUp();
}
}
void QTReader::keyPressEvent(QKeyEvent* e)
{
switch (e->key())
{
case Key_Down:
- {
- e->accept();
- if (m_autoScroll)
- {
- if (m_delay < 59049)
- {
- m_delay = (3*m_delay)/2;
- timer->changeInterval(real_delay());
- }
- else
- {
- m_delay = 59049;
- }
- }
- else
- {
- goDown();
- }
- }
+ {
+ e->accept();
+ if (m_autoScroll)
+ {
+ if (m_delay < 59049)
+ {
+ m_delay = (3*m_delay)/2;
+ timer->changeInterval(real_delay());
+ }
+ else
+ {
+ m_delay = 59049;
+ }
+ }
+ else
+ {
+ goDown();
+ }
+ }
break;
case Key_Up:
- {
- e->accept();
- if (m_autoScroll)
- {
- if (m_delay > 1024)
- {
- m_delay = (2*m_delay)/3;
- timer->changeInterval(real_delay());
- }
- else
- {
- m_delay = 1024;
- }
- }
- else
- {
- goUp();
- }
- }
+ {
+ e->accept();
+ if (m_autoScroll)
+ {
+ if (m_delay > 1024)
+ {
+ m_delay = (2*m_delay)/3;
+ timer->changeInterval(real_delay());
+ }
+ else
+ {
+ m_delay = 1024;
+ }
+ }
+ else
+ {
+ goUp();
+ }
+ }
break;
/*
case Key_Left:
- {
- e->accept();
- if (m_textfont > 0)
- {
- m_textfont--;
- setfont(NULL);
- locate(pagelocate());
- update();
- }
- }
+ {
+ e->accept();
+ if (m_textfont > 0)
+ {
+ m_textfont--;
+ setfont(NULL);
+ locate(pagelocate());
+ update();
+ }
+ }
break;
case Key_Right:
- {
- e->accept();
- if (fonts[++m_textfont] == 0)
- {
- m_textfont--;
- }
- else
- {
- setfont(NULL);
- locate(pagelocate());
- update();
- }
- }
+ {
+ e->accept();
+ if (fonts[++m_textfont] == 0)
+ {
+ m_textfont--;
+ }
+ else
+ {
+ setfont(NULL);
+ locate(pagelocate());
+ update();
+ }
+ }
break;
*/
case Key_Right:
- {
- e->accept();
- if (fontsizes[++m_textsize] == 0)
- {
- m_textsize--;
- }
- else
- {
- bool sc = m_autoScroll;
- m_autoScroll = false;
- setfont(NULL);
- locate(pagelocate());
- update();
- m_autoScroll = sc;
- if (m_autoScroll) autoscroll();
- }
- }
+ {
+ e->accept();
+ if (fontsizes[++m_textsize] == 0)
+ {
+ m_textsize--;
+ }
+ else
+ {
+ bool sc = m_autoScroll;
+ m_autoScroll = false;
+ setfont(NULL);
+ locate(pagelocate());
+ update();
+ m_autoScroll = sc;
+ if (m_autoScroll) autoscroll();
+ }
+ }
break;
case Key_Left:
- {
- e->accept();
- if (m_textsize > 0)
- {
- bool sc = m_autoScroll;
- m_autoScroll = false;
- m_textsize--;
- setfont(NULL);
- locate(pagelocate());
- update();
- m_autoScroll = sc;
- if (m_autoScroll) autoscroll();
- }
- }
+ {
+ e->accept();
+ if (m_textsize > 0)
+ {
+ bool sc = m_autoScroll;
+ m_autoScroll = false;
+ m_textsize--;
+ setfont(NULL);
+ locate(pagelocate());
+ update();
+ m_autoScroll = sc;
+ if (m_autoScroll) autoscroll();
+ }
+ }
break;
- case Key_Space:
-// case Key_Enter:
- case Key_Return:
- {
- e->accept();
- setautoscroll(!m_autoScroll);
- ((QTReaderApp*)parent()->parent())->setScrollState(m_autoScroll);
- }
- break;
+ case Key_Space:
+// case Key_Enter:
+ case Key_Return:
+ {
+ e->accept();
+ setautoscroll(!m_autoScroll);
+ ((QTReaderApp*)parent()->parent())->setScrollState(m_autoScroll);
+ }
+ break;
default:
e->ignore();
}
}
@@ -295,35 +295,35 @@ void QTReader::setautoscroll(bool _sc)
{
if (_sc == m_autoScroll) return;
if (m_autoScroll)
{
- m_autoScroll = false;
+ m_autoScroll = false;
}
else
{
- m_autoScroll = true;
- autoscroll();
+ m_autoScroll = true;
+ autoscroll();
}
}
bool QTReader::getline(CBuffer *buff)
{
if (m_bMonoSpaced)
{
- return buffdoc.getline(buff ,width(), m_charWidth);
+ return buffdoc.getline(buff ,width(), m_charWidth);
}
else
{
- return buffdoc.getline(buff, width());
+ return buffdoc.getline(buff, width());
}
}
void QTReader::doscroll()
{
if (!m_autoScroll)
{
- timer->stop();
- return;
+ timer->stop();
+ return;
}
// timer->changeInterval(real_delay());
QPainter p( this );
QBrush b( white);
@@ -331,48 +331,48 @@ void QTReader::doscroll()
qDrawPlainRect(&p,0,height() - 2,width(),2,white,1,&b);
if (++m_scrolldy == m_linespacing)
{
- setfont(&p);
- m_scrolldy = 0;
-// qDrawPlainRect(&p,0,height() - m_linespacing,width(),m_linespacing,white,1,&b);
- pagepos = locnarray[1];
- CBuffer* buff = textarray[0];
- for (int i = 1; i < numlines; i++)
- {
- textarray[i-1] = textarray[i];
- locnarray[i-1] = locnarray[i];
- }
- locnarray[numlines-1] = locate();
- if (getline(buff))
- {
- textarray[numlines-1] = buff;
- drawText( p, 0, height() - m_descent - 2, buff->data());
- mylastpos = locate();
- }
- else
- {
-// (*buff)[0] = '\0';
- textarray[numlines-1] = buff;
- m_autoScroll = false;
- ((QTReaderApp*)parent()->parent())->setScrollState(m_autoScroll);
- }
+ setfont(&p);
+ m_scrolldy = 0;
+// qDrawPlainRect(&p,0,height() - m_linespacing,width(),m_linespacing,white,1,&b);
+ pagepos = locnarray[1];
+ CBuffer* buff = textarray[0];
+ for (int i = 1; i < numlines; i++)
+ {
+ textarray[i-1] = textarray[i];
+ locnarray[i-1] = locnarray[i];
+ }
+ locnarray[numlines-1] = locate();
+ if (getline(buff))
+ {
+ textarray[numlines-1] = buff;
+ drawText( p, 0, height() - m_descent - 2, buff->data());
+ mylastpos = locate();
+ }
+ else
+ {
+// (*buff)[0] = '\0';
+ textarray[numlines-1] = buff;
+ m_autoScroll = false;
+ ((QTReaderApp*)parent()->parent())->setScrollState(m_autoScroll);
+ }
}
}
void QTReader::drawText(QPainter& p, int x, int y, tchar* _text)
{
QString text = toQString(_text);
if (m_bMonoSpaced)
{
- for (int i = 0; i < text.length(); i++)
- {
- p.drawText( x+i*m_charWidth, y, QString(text[i]) );
- }
+ for (int i = 0; i < text.length(); i++)
+ {
+ p.drawText( x+i*m_charWidth, y, QString(text[i]) );
+ }
}
else
{
- p.drawText( x, y, text );
+ p.drawText( x, y, text );
}
}
void QTReader::autoscroll()
@@ -391,14 +391,14 @@ void QTReader::setfont(QPainter* p)
// qDebug("Raw name = %s", (const char*)font.rawName());
if (p != NULL) p->setFont( font );
if (m_fm == NULL)
{
- m_fm = new QFontMetrics(font);
- buffdoc.setfm(m_fm);
+ m_fm = new QFontMetrics(font);
+ buffdoc.setfm(m_fm);
}
else
{
- *m_fm = QFontMetrics(font);
+ *m_fm = QFontMetrics(font);
}
m_ascent = m_fm->ascent();
m_descent = m_fm->descent();
m_linespacing = m_fm->lineSpacing();
@@ -416,70 +416,70 @@ void QTReader::drawFonts( QPainter *p )
{
int sl = screenlines();
if (sl < numlines)
{
-// qDebug("df:<%u,%u>",sl,numlines);
-
- size_t newpos = locnarray[sl];
- CBuffer** nta = new CBuffer*[sl];
- size_t* nla = new size_t[sl];
- for (int i = 0; i < sl; i++)
- {
- nta[i] = textarray[i];
- nla[i] = locnarray[i];
- }
- for (int i = sl; i < numlines; i++) delete textarray[i];
- delete [] textarray;
- delete [] locnarray;
- textarray = nta;
- locnarray = nla;
- numlines = sl;
- jumpto(mylastpos = newpos);
-// locate(pagepos);
+// qDebug("df:<%u,%u>",sl,numlines);
+
+ size_t newpos = locnarray[sl];
+ CBuffer** nta = new CBuffer*[sl];
+ size_t* nla = new size_t[sl];
+ for (int i = 0; i < sl; i++)
+ {
+ nta[i] = textarray[i];
+ nla[i] = locnarray[i];
+ }
+ for (int i = sl; i < numlines; i++) delete textarray[i];
+ delete [] textarray;
+ delete [] locnarray;
+ textarray = nta;
+ locnarray = nla;
+ numlines = sl;
+ jumpto(mylastpos = newpos);
+// locate(pagepos);
}
if (sl > numlines)
{
-// qDebug("df:<%u,%u>",sl,numlines);
- CBuffer** nta = new CBuffer*[sl];
- size_t* nla = new size_t[sl];
- for (int i = 0; i < numlines; i++)
- {
- nta[i] = textarray[i];
- nla[i] = locnarray[i];
- }
- if (locate() != mylastpos) jumpto(mylastpos);
- for (int i = numlines; i < sl; i++)
- {
- nta[i] = new CBuffer;
- nla[i] = locate();
- getline(nta[i]);
- }
- mylastpos = locate();
- delete [] textarray;
- delete [] locnarray;
- textarray = nta;
- locnarray = nla;
- numlines = sl;
+// qDebug("df:<%u,%u>",sl,numlines);
+ CBuffer** nta = new CBuffer*[sl];
+ size_t* nla = new size_t[sl];
+ for (int i = 0; i < numlines; i++)
+ {
+ nta[i] = textarray[i];
+ nla[i] = locnarray[i];
+ }
+ if (locate() != mylastpos) jumpto(mylastpos);
+ for (int i = numlines; i < sl; i++)
+ {
+ nta[i] = new CBuffer;
+ nla[i] = locate();
+ getline(nta[i]);
+ }
+ mylastpos = locate();
+ delete [] textarray;
+ delete [] locnarray;
+ textarray = nta;
+ locnarray = nla;
+ numlines = sl;
}
int ypos = (btight) ? 0 : m_ascent-m_linespacing;
// int linespacing = (tight) ? m_ascent : m_ascent+m_descent;
for (int i = 0; i < numlines; i++)
{
- drawText( *p, 0, ypos += m_linespacing, textarray[i]->data());
+ drawText( *p, 0, ypos += m_linespacing, textarray[i]->data());
}
/*
-
-
-
- int nlines = height()/(fontmetric.ascent()+fontmetric.descent());
- tchar buffer[1024];
- for (int i = 0; i < nlines; i++)
- {
- y += fontmetric.ascent();
- sprintf(buffer, "%d:%d:%s[%d]:Lines %d:%s", i+1, m_textfont, fonts[m_textfont], m_fs, nlines, (const tchar*)m_string);
- drawText( *p, 0, y, buffer );
- y += fontmetric.descent();
- }
+
+
+
+ int nlines = height()/(fontmetric.ascent()+fontmetric.descent());
+ tchar buffer[1024];
+ for (int i = 0; i < nlines; i++)
+ {
+ y += fontmetric.ascent();
+ sprintf(buffer, "%d:%d:%s[%d]:Lines %d:%s", i+1, m_textfont, fonts[m_textfont], m_fs, nlines, (const tchar*)m_string);
+ drawText( *p, 0, y, buffer );
+ y += fontmetric.descent();
+ }
*/
}
m_scrolldy = 0;
}
@@ -487,29 +487,29 @@ void QTReader::drawFonts( QPainter *p )
QString QTReader::firstword()
{
if (m_bMonoSpaced)
{
- return toQString(textarray[0]->data());
+ return toQString(textarray[0]->data());
}
else
{
- int start, end, len, j;
- for (j = 0; j < numlines; j++)
- {
- len = textarray[j]->length();
- for (start = 0; start < len && !isalpha((*textarray[j])[start]); start++);
- if (start < len) break;
- }
- if (j < numlines)
- {
- QString ret = "";
- for (end = start; end < len && isalpha((*textarray[j])[end]); end++)
- ret += (*textarray[j])[end];
- if (ret.isEmpty()) ret = "Current position";
- return ret;
- }
- else
- return "Current position";
+ int start, end, len, j;
+ for (j = 0; j < numlines; j++)
+ {
+ len = textarray[j]->length();
+ for (start = 0; start < len && !isalpha((*textarray[j])[start]); start++);
+ if (start < len) break;
+ }
+ if (j < numlines)
+ {
+ QString ret = "";
+ for (end = start; end < len && isalpha((*textarray[j])[end]); end++)
+ ret += (*textarray[j])[end];
+ if (ret.isEmpty()) ret = "Current position";
+ return ret;
+ }
+ else
+ return "Current position";
}
}
//
@@ -526,9 +526,9 @@ void QTReader::ChangeFont(int tgt)
/*
QStringList styles = fdb.styles(m_fontname);
for ( QStringList::Iterator it = styles.begin(); it != styles.end(); ++it )
{
- printf( "%s \n", (*it).latin1() );
+ printf( "%s \n", (*it).latin1() );
}
*/
QValueList<int> sizes = fdb.pointSizes(m_fontname, (m_bBold) ? QString("Bold") : QString::null);
uint n = sizes.count();
@@ -537,23 +537,23 @@ void QTReader::ChangeFont(int tgt)
uint i = 0;
uint best = 0;
for (it = sizes.begin(); it != sizes.end(); it++)
{
- fontsizes[i] = (*it)/10;
- if (abs(tgt-fontsizes[i]) < abs(tgt-fontsizes[best]))
- {
- best = i;
- }
- i++;
+ fontsizes[i] = (*it)/10;
+ if (abs(tgt-fontsizes[i]) < abs(tgt-fontsizes[best]))
+ {
+ best = i;
+ }
+ i++;
}
m_textsize = best;
fontsizes[i] = 0;
setfont(NULL);
QFont font(m_fontname, fontsizes[m_textsize], (m_bBold) ? QFont::Bold : QFont::Normal );
if (m_fm == NULL)
{
- m_fm = new QFontMetrics(font);
- buffdoc.setfm(m_fm);
+ m_fm = new QFontMetrics(font);
+ buffdoc.setfm(m_fm);
}
}
void QTReader::init()
@@ -573,10 +573,10 @@ void QTReader::init()
// QMessageBox::information(this, "init", m_lastfile, 1);
m_lastwidth = width();
if (!m_lastfile.isEmpty())
{
- m_string = DocLnk(m_lastfile).name();
- load_file(m_lastfile);
+ m_string = DocLnk(m_lastfile).name();
+ load_file(m_lastfile);
}
}
//
@@ -681,13 +681,13 @@ bool QTReader::fillbuffer() {
// qDebug("fillbuffer:%u-%u",delta,numlines);
if (delta != numlines)
{
if (textarray != NULL)
- {
- for (int i = 0; i < numlines; i++) delete textarray[i];
- delete [] textarray;
+ {
+ for (int i = 0; i < numlines; i++) delete textarray[i];
+ delete [] textarray;
delete [] locnarray;
- }
+ }
numlines = delta;
textarray = new CBuffer*[numlines];
locnarray = new size_t[numlines];
for (int i = 0; i < numlines; i++) textarray[i] = new CBuffer;
@@ -703,25 +703,25 @@ bool QTReader::fillbuffer() {
locnarray[i] = locate();
ch = getline(textarray[i]);
// if (ch == EOF) {
if (!ch)
- {
- if (i == 0)
- {
- pagepos = oldpagepos;
- return false;
- }
- else
- {
- ret = true;
- for (int j = i+1; j < delta; j++)
+ {
+ if (i == 0)
+ {
+ locate(oldpagepos);
+ return false;
+ }
+ else
+ {
+ ret = true;
+ for (int j = i+1; j < delta; j++)
{
locnarray[j] = locnarray[j-1];
(*(textarray[j]))[0] = '\0';
}
- break;
- }
- }
+ break;
+ }
+ }
if (ch == '\012') ret = true;
}
mylastpos = locate();
// qDebug("fillbuffer:lastpos:%u",mylastpos);
@@ -732,18 +732,18 @@ bool QTReader::fillbuffer() {
void QTReader::dopagedn()
{
if (m_overlap == 0)
{
- if (locate() != mylastpos) jumpto(mylastpos);
+ if (locate() != mylastpos) jumpto(mylastpos);
}
else
{
- if (m_overlap >= screenlines()) m_overlap = screenlines()/2;
- jumpto(locnarray[screenlines()-m_overlap]);
+ if (m_overlap >= screenlines()) m_overlap = screenlines()/2;
+ jumpto(locnarray[screenlines()-m_overlap]);
}
if (fillbuffer())
{
- update();
+ update();
}
}
void QTReader::dopageup()
@@ -760,40 +760,40 @@ void QTReader::dopageup()
if (delta < 64) delta = 64;
if (delta % 2 != 0) delta++;
if (target % 2 != 0) target++;
do
- {
- delta <<= 1;
- if (delta >= target)
- {
- delta = target;
- jumpto(0);
- for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- getline(buff[i]);
- }
- break;
- }
- jumpto(target-delta);
- do
- {
- getline(buff[0]);
+ {
+ delta <<= 1;
+ if (delta >= target)
+ {
+ delta = target;
+ jumpto(0);
+ for (int i = 0; i < numlines; i++)
+ {
+ loc[i] = locate();
+ getline(buff[i]);
+ }
+ break;
+ }
+ jumpto(target-delta);
+ do
+ {
+ getline(buff[0]);
#ifdef WS
- //printf("Trying:%s\n",buff[0]);
+ //printf("Trying:%s\n",buff[0]);
#endif
- if (locate() > target) continue;
- }
- while (!buffdoc.iseol());
- for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- getline(buff[i]);
+ if (locate() > target) continue;
+ }
+ while (!buffdoc.iseol());
+ for (int i = 0; i < numlines; i++)
+ {
+ loc[i] = locate();
+ getline(buff[i]);
#ifdef WS
- //printf("Filling:%s\n",buff[i]);
+ //printf("Filling:%s\n",buff[i]);
#endif
- }
- }
+ }
+ }
while (locate() >= target && delta < 4096);
#ifdef WS
//printf("Delta:%u\n",delta);
#endif
@@ -801,12 +801,12 @@ void QTReader::dopageup()
else
{
jumpto(0);
for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- getline(buff[i]);
- }
+ {
+ loc[i] = locate();
+ getline(buff[i]);
+ }
}
cbptr = 0;
while (locate() < target)
{
@@ -861,20 +861,20 @@ void QTReader::lineDown()
pagepos = locnarray[1];
CBuffer* buff = textarray[0];
for (int i = 1; i < numlines; i++)
{
- textarray[i-1] = textarray[i];
- locnarray[i-1] = locnarray[i];
+ textarray[i-1] = textarray[i];
+ locnarray[i-1] = locnarray[i];
}
locnarray[numlines-1] = locate();
if (getline(buff))
{
- textarray[numlines-1] = buff;
- mylastpos = locate();
+ textarray[numlines-1] = buff;
+ mylastpos = locate();
}
else
{
- textarray[numlines-1] = buff;
+ textarray[numlines-1] = buff;
}
update();
}
/*
@@ -889,40 +889,40 @@ void QTReader::lineUp()
{
unsigned int delta = locate()-pagelocate();
if (delta < 64) delta = 64;
do
- {
- delta <<= 1;
- if (delta >= target)
- {
- delta = target;
- jumpto(0);
- for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- getline(buff[i]);
- }
- break;
- }
- jumpto(target-delta);
- do
- {
- buffdoc.getline(buff[0],width());
+ {
+ delta <<= 1;
+ if (delta >= target)
+ {
+ delta = target;
+ jumpto(0);
+ for (int i = 0; i < numlines; i++)
+ {
+ loc[i] = locate();
+ getline(buff[i]);
+ }
+ break;
+ }
+ jumpto(target-delta);
+ do
+ {
+ buffdoc.getline(buff[0],width());
#ifdef WS
- //printf("Trying:%s\n",buff[0]);
+ //printf("Trying:%s\n",buff[0]);
#endif
- if (locate() > target) continue;
- }
- while (!buffdoc.iseol());
- for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- buffdoc.getline(buff[i],width());
+ if (locate() > target) continue;
+ }
+ while (!buffdoc.iseol());
+ for (int i = 0; i < numlines; i++)
+ {
+ loc[i] = locate();
+ buffdoc.getline(buff[i],width());
#ifdef WS
- //printf("Filling:%s\n",buff[i]);
+ //printf("Filling:%s\n",buff[i]);
#endif
- }
- }
+ }
+ }
while (locate() >= target && delta < 4096);
#ifdef WS
//printf("Delta:%u\n",delta);
#endif
@@ -930,12 +930,12 @@ void QTReader::lineUp()
else
{
jumpto(0);
for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- buffdoc.getline(buff[i],width());
- }
+ {
+ loc[i] = locate();
+ buffdoc.getline(buff[i],width());
+ }
}
cbptr = 0;
while (locate() < target)
{
@@ -972,34 +972,34 @@ void QTReader::lineUp()
{
unsigned int delta = locate()-pagelocate();
if (delta < 64) delta = 64;
do
- {
- delta <<= 1;
- if (delta >= target)
- {
- delta = target;
- jumpto(0);
- for (int i = 0; i < numlines; i++)
- {
- loc = locate();
- getline(buff);
- }
- break;
- }
- jumpto(target-delta);
- do
- {
- getline(buff);
+ {
+ delta <<= 1;
+ if (delta >= target)
+ {
+ delta = target;
+ jumpto(0);
+ for (int i = 0; i < numlines; i++)
+ {
+ loc = locate();
+ getline(buff);
+ }
+ break;
+ }
+ jumpto(target-delta);
+ do
+ {
+ getline(buff);
#ifdef WS
- //printf("Trying:%s\n",buff[0]);
+ //printf("Trying:%s\n",buff[0]);
#endif
- if (locate() > target) continue;
- }
- while (!buffdoc.iseol());
- loc = locate();
- getline(buff);
- }
+ if (locate() > target) continue;
+ }
+ while (!buffdoc.iseol());
+ loc = locate();
+ getline(buff);
+ }
while (locate() >= target && delta < 4096);
}
else
{
diff --git a/noncore/apps/opie-reader/opie-reader.control b/noncore/apps/opie-reader/opie-reader.control
index e8c98bb..1c28648 100644
--- a/noncore/apps/opie-reader/opie-reader.control
+++ b/noncore/apps/opie-reader/opie-reader.control
@@ -2,8 +2,8 @@ Files: bin/uqtreader apps/Applications/uqtreader.desktop pics/uqtreader.png pics
Priority: optional
Section: applications
Maintainer: Tim Wentford <timwentford@hotmail.com>
Architecture: arm
-Version: 0_3r_beta_UTF8
-Depends:
+Version: $QPE_VERSION-$SUB_VERSION
+Depends: zlib
License: GPL
Description: E-Book reader