summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CDrawBuffer.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/CDrawBuffer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CDrawBuffer.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/noncore/apps/opie-reader/CDrawBuffer.cpp b/noncore/apps/opie-reader/CDrawBuffer.cpp
index ec36fb2..b137ac3 100644
--- a/noncore/apps/opie-reader/CDrawBuffer.cpp
+++ b/noncore/apps/opie-reader/CDrawBuffer.cpp
@@ -39,9 +39,9 @@ void CDrawBuffer::setright(CDrawBuffer& rhs, int f)
39 39
40CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs) 40CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs)
41{ 41{
42 int i; 42 int i;
43// //qDebug("Trying 2"); 43// //odebug << "Trying 2" << oendl;
44 len = rhs.len; 44 len = rhs.len;
45 m_maxstyle = rhs.m_maxstyle; 45 m_maxstyle = rhs.m_maxstyle;
46 m_ascent = rhs.m_ascent; 46 m_ascent = rhs.m_ascent;
47 m_descent = rhs.m_descent; 47 m_descent = rhs.m_descent;
@@ -57,9 +57,9 @@ CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs)
57 } 57 }
58 for (i = 0; rhs[i] != '\0'; i++) (*this)[i] = rhs[i]; 58 for (i = 0; rhs[i] != '\0'; i++) (*this)[i] = rhs[i];
59 (*this)[i] = '\0'; 59 (*this)[i] = '\0';
60 len = i; 60 len = i;
61// //qDebug("Tried 2"); 61// //odebug << "Tried 2" << oendl;
62 return *this; 62 return *this;
63} 63}
64 64
65CDrawBuffer& CDrawBuffer::operator=(const tchar*sztmp) 65CDrawBuffer& CDrawBuffer::operator=(const tchar*sztmp)
@@ -207,9 +207,9 @@ int CDrawBuffer::width(int numchars, bool onscreen, int scwidth, unsigned char _
207 } 207 }
208 else 208 else
209 { 209 {
210 QString nstr = str.mid(lastspace+1, nsp-lastspace); 210 QString nstr = str.mid(lastspace+1, nsp-lastspace);
211 // qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); 211 // odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl;
212 int lw = fm.width(nstr); 212 int lw = fm.width(nstr);
213 cx += lw; 213 cx += lw;
214 lastspace = nsp; 214 lastspace = nsp;
215 } 215 }
@@ -316,9 +316,9 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int
316 int end = (textend != segs.end()) ? textend->start : len; 316 int end = (textend != segs.end()) ? textend->start : len;
317 CStyle currentstyle = textstart->style; 317 CStyle currentstyle = textstart->style;
318 QFont f((currentstyle.isMono() && fc->hasCourier()) ? fc->fixedfontname() : fc->name(), fc->getsize(currentstyle), (currentstyle.isBold()) ? QFont::Bold : QFont::Normal, (currentstyle.isItalic()) ); 318 QFont f((currentstyle.isMono() && fc->hasCourier()) ? fc->fixedfontname() : fc->name(), fc->getsize(currentstyle), (currentstyle.isBold()) ? QFont::Bold : QFont::Normal, (currentstyle.isItalic()) );
319 //f.setUnderline(currentstyle.isUnderline()); 319 //f.setUnderline(currentstyle.isUnderline());
320 //if (currentstyle.isUnderline()) qDebug("UNDERLINE"); 320 //if (currentstyle.isUnderline()) odebug << "UNDERLINE" << oendl;
321 _p->setFont(f); 321 _p->setFont(f);
322 QString str = text.mid(textstart->start, end-textstart->start); 322 QString str = text.mid(textstart->start, end-textstart->start);
323#if defined(OPIE) || !defined(USEQPE) 323#if defined(OPIE) || !defined(USEQPE)
324 _p->setPen(QPen(QColor(currentstyle.Red(), currentstyle.Green(), currentstyle.Blue()), fc->getsize(currentstyle)/100)); 324 _p->setPen(QPen(QColor(currentstyle.Red(), currentstyle.Green(), currentstyle.Blue()), fc->getsize(currentstyle)/100));
@@ -407,9 +407,9 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int
407 { 407 {
408 spacenumber++; 408 spacenumber++;
409 int nexttoadd = (extraspace*spacenumber+spaces/2)/spaces - spacesofar; 409 int nexttoadd = (extraspace*spacenumber+spaces/2)/spaces - spacesofar;
410 QString nstr = str.mid(lastspace+1, nsp-lastspace); 410 QString nstr = str.mid(lastspace+1, nsp-lastspace);
411 // qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); 411 // odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl;
412 int lw = fm.width(nstr); 412 int lw = fm.width(nstr);
413 _p->drawText( cx, _y+voffset, nstr); 413 _p->drawText( cx, _y+voffset, nstr);
414 cx += lw+nexttoadd; 414 cx += lw+nexttoadd;
415 spacesofar += nexttoadd; 415 spacesofar += nexttoadd;
@@ -417,9 +417,9 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int
417 } 417 }
418 else 418 else
419 { 419 {
420 QString nstr = str.mid(lastspace+1, nsp-lastspace); 420 QString nstr = str.mid(lastspace+1, nsp-lastspace);
421 // qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); 421 // odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl;
422 int lw = fm.width(nstr); 422 int lw = fm.width(nstr);
423 _p->drawText( cx, _y+voffset, nstr); 423 _p->drawText( cx, _y+voffset, nstr);
424 cx += lw; 424 cx += lw;
425 lastspace = nsp; 425 lastspace = nsp;
@@ -469,16 +469,16 @@ linkType CDrawBuffer::getLinkType(int numchars, size_t& tgt)
469 textend++; 469 textend++;
470 end = (textend != segs.end()) ? textend->start : len; 470 end = (textend != segs.end()) ? textend->start : len;
471 currentstyle = textstart->style; 471 currentstyle = textstart->style;
472/* 472/*
473 if (currentstyle.isPicture()) qDebug("Passed thru picture"); 473 if (currentstyle.isPicture()) odebug << "Passed thru picture" << oendl;
474 if (currentstyle.getLink()) qDebug("Passed thru link"); 474 if (currentstyle.getLink()) odebug << "Passed thru link" << oendl;
475 //qDebug("islink:%d - %d", numchars, end); 475 //odebug << "islink:" << numchars << " - " << end << "" << oendl;
476*/ 476*/
477 textstart = textend; 477 textstart = textend;
478 } 478 }
479 while (textend != segs.end() && end <= numchars); 479 while (textend != segs.end() && end <= numchars);
480// if (currentstyle.isPicture()) qDebug("Clicked on picture"); 480// if (currentstyle.isPicture()) odebug << "Clicked on picture" << oendl;
481 if (currentstyle.getPictureLink()) 481 if (currentstyle.getPictureLink())
482 { 482 {
483 tgt = currentstyle.getPictureLinkData(); 483 tgt = currentstyle.getPictureLinkData();
484 return ePicture; 484 return ePicture;
@@ -538,9 +538,9 @@ void CDrawBuffer::resize()
538 } 538 }
539 if (m_bSop) 539 if (m_bSop)
540 { 540 {
541 int xt = ((segs.begin()->style.getExtraSpace()+fc->getextraspace())*fc->getsize(segs.begin()->style)+5)/10; 541 int xt = ((segs.begin()->style.getExtraSpace()+fc->getextraspace())*fc->getsize(segs.begin()->style)+5)/10;
542 //qDebug("ExtraSpace:%d", xt); 542 //odebug << "ExtraSpace:" << xt << "" << oendl;
543 m_ascent += xt; 543 m_ascent += xt;
544 m_lineSpacing += xt; 544 m_lineSpacing += xt;
545 } 545 }
546} 546}