summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/plucker_base.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/plucker_base.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/plucker_base.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/noncore/apps/opie-reader/plucker_base.cpp b/noncore/apps/opie-reader/plucker_base.cpp
index 9047a45..caa945d 100644
--- a/noncore/apps/opie-reader/plucker_base.cpp
+++ b/noncore/apps/opie-reader/plucker_base.cpp
@@ -1,39 +1,36 @@
1#include "useqpe.h" 1#include "useqpe.h"
2#include <stdio.h> 2#include <stdio.h>
3#include <string.h> 3#include <string.h>
4#include <qmessagebox.h>
5#include <qpixmap.h>
6#ifdef USEQPE 4#ifdef USEQPE
7#include <qpe/qcopenvelope_qws.h> 5#include <qpe/qcopenvelope_qws.h>
8#endif /* USEQPE */ 6#endif /* USEQPE */
9#ifdef LOCALPICTURES 7#ifdef LOCALPICTURES
10#include <qscrollview.h> 8#include <qscrollview.h>
11#endif 9#endif
12#ifdef USEQPE 10#ifdef USEQPE
13#include <qpe/global.h> 11#include <qpe/global.h>
14#endif /* USEQPE */ 12#endif /* USEQPE */
15#include <qclipboard.h>
16#ifndef USEQPE 13#ifndef USEQPE
17#include <qapplication.h> 14#include <qapplication.h>
18#else /* USEQPE */ 15#else /* USEQPE */
19#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
20#endif /* USEQPE */ 17#endif /* USEQPE */
21 18
22#include "plucker_base.h" 19#include "plucker_base.h"
23#include "Aportis.h" 20#include "Aportis.h"
24#include "Palm2QImage.h" 21#include "Palm2QImage.h"
25 22
26CPlucker_base::CPlucker_base() : 23CPlucker_base::CPlucker_base() :
27#ifdef LOCALPICTURES 24#ifdef LOCALPICTURES
28 m_viewer(NULL), 25 m_viewer(NULL),
29 m_picture(NULL), 26 m_picture(NULL),
30#endif 27#endif
31 expandedtextbuffer(NULL), 28 expandedtextbuffer(NULL),
32 compressedtextbuffer(NULL) 29 compressedtextbuffer(NULL)
33//, urls(NULL) 30//, urls(NULL)
34 { /*printf("constructing:%x\n",fin);*/ } 31 { /*printf("constructing:%x\n",fin);*/ }
35 32
36 33
37void CPlucker_base::Expand(UInt32 reclen, UInt8 type, UInt8* buffer, UInt32 buffersize) 34void CPlucker_base::Expand(UInt32 reclen, UInt8 type, UInt8* buffer, UInt32 buffersize)
38{ 35{
39 if (type%2 == 0) 36 if (type%2 == 0)
@@ -524,49 +521,48 @@ void CPlucker_base::home()
524CList<Bkmk>* CPlucker_base::getbkmklist() 521CList<Bkmk>* CPlucker_base::getbkmklist()
525{ 522{
526/* 523/*
527 UInt16 thishdr_uid, thishdr_nParagraphs; 524 UInt16 thishdr_uid, thishdr_nParagraphs;
528 UInt32 thishdr_size; 525 UInt32 thishdr_size;
529 UInt8 thishdr_type, thishdr_reserved; 526 UInt8 thishdr_type, thishdr_reserved;
530 527
531 for (int i = 1; i < ntohs(head.recordList.numRecords); i++) 528 for (int i = 1; i < ntohs(head.recordList.numRecords); i++)
532 { 529 {
533 gotorecordnumber(i); 530 gotorecordnumber(i);
534 GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); 531 GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
535 if (thishdr_type == 8) 532 if (thishdr_type == 8)
536 { 533 {
537 UInt16 n; 534 UInt16 n;
538 fread(&n, 1, sizeof(n), fin); 535 fread(&n, 1, sizeof(n), fin);
539 n = ntohs(n); 536 n = ntohs(n);
540 //qDebug("Found %u bookmarks", n); 537 //qDebug("Found %u bookmarks", n);
541 } 538 }
542 //qDebug("Found:%d, %u", i , thishdr_type); 539 //qDebug("Found:%d, %u", i , thishdr_type);
543 } 540 }
544*/ 541*/
545 return NULL; 542 return NULL;
546} 543}
547 544
548#include <qnamespace.h>
549 545
550QImage* CPlucker_base::expandimg(UInt16 tgt, bool border) 546QImage* CPlucker_base::expandimg(UInt16 tgt, bool border)
551{ 547{
552 QImage* qimage = getimg(tgt); 548 QImage* qimage = getimg(tgt);
553 QImage* ret; 549 QImage* ret;
554 if (qimage == NULL) return NULL; 550 if (qimage == NULL) return NULL;
555 if (border) 551 if (border)
556 { 552 {
557 QPixmap* image = new QPixmap(0,0); 553 QPixmap* image = new QPixmap(0,0);
558 image->convertFromImage(*qimage); 554 image->convertFromImage(*qimage);
559 delete qimage; 555 delete qimage;
560 QPixmap* pret = new QPixmap(image->width()+4, image->height()+4); 556 QPixmap* pret = new QPixmap(image->width()+4, image->height()+4);
561 pret->fill(Qt::red); 557 pret->fill(Qt::red);
562 bitBlt(pret, 2, 2, image, 0, 0, -1, -1);//, Qt::RasterOp::CopyROP); 558 bitBlt(pret, 2, 2, image, 0, 0, -1, -1);//, Qt::RasterOp::CopyROP);
563 delete image; 559 delete image;
564 ret = new QImage(pret->convertToImage()); 560 ret = new QImage(pret->convertToImage());
565 } 561 }
566 else 562 else
567 { 563 {
568 ret = qimage; 564 ret = qimage;
569 } 565 }
570 return ret; 566 return ret;
571} 567}
572 568
@@ -659,49 +655,48 @@ unsigned short CPlucker_base::finduid(unsigned short urlid)
659 } 655 }
660 gotorecordnumber(jmin); 656 gotorecordnumber(jmin);
661 UInt16 thishdr_uid, thishdr_nParagraphs; 657 UInt16 thishdr_uid, thishdr_nParagraphs;
662 UInt32 thishdr_size; 658 UInt32 thishdr_size;
663 UInt8 thishdr_type, thishdr_reserved; 659 UInt8 thishdr_type, thishdr_reserved;
664 GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); 660 GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
665 unsigned short luid = thishdr_uid; 661 unsigned short luid = thishdr_uid;
666 //qDebug("jmin at end:%u,%u", jmin, luid); 662 //qDebug("jmin at end:%u,%u", jmin, luid);
667 if (luid == urlid) 663 if (luid == urlid)
668 { 664 {
669 return jmin; 665 return jmin;
670 } 666 }
671 gotorecordnumber(jmax); 667 gotorecordnumber(jmax);
672 GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); 668 GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
673 luid = thishdr_uid; 669 luid = thishdr_uid;
674 //qDebug("jmax at end:%u,%u", jmax, luid); 670 //qDebug("jmax at end:%u,%u", jmax, luid);
675 if (luid == urlid) 671 if (luid == urlid)
676 { 672 {
677 return jmax; 673 return jmax;
678 } 674 }
679 //qDebug("Couldn't find %u", urlid); 675 //qDebug("Couldn't find %u", urlid);
680 return 0; // Not found! 676 return 0; // Not found!
681} 677}
682 678
683#include <qnamespace.h>
684 679
685void CPlucker_base::setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen) 680void CPlucker_base::setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen)
686{ 681{
687 unsigned short sz = 0; 682 unsigned short sz = 0;
688 for (CList<unsigned long>::iterator it = visited.begin(); it != visited.end(); it++) 683 for (CList<unsigned long>::iterator it = visited.begin(); it != visited.end(); it++)
689 { 684 {
690 sz++; 685 sz++;
691 } 686 }
692 size_t newlen = srclen+sizeof(sz)+sz*sizeof(unsigned long); 687 size_t newlen = srclen+sizeof(sz)+sz*sizeof(unsigned long);
693 unsigned char* newdata = new unsigned char[newlen]; 688 unsigned char* newdata = new unsigned char[newlen];
694 unsigned char* pdata = newdata; 689 unsigned char* pdata = newdata;
695 memcpy(newdata, src, srclen); 690 memcpy(newdata, src, srclen);
696 newdata += srclen; 691 newdata += srclen;
697 memcpy(newdata, &sz, sizeof(sz)); 692 memcpy(newdata, &sz, sizeof(sz));
698 newdata += sizeof(sz); 693 newdata += sizeof(sz);
699#ifdef _WINDOWS 694#ifdef _WINDOWS
700 for (it = visited.begin(); it != visited.end(); it++) 695 for (it = visited.begin(); it != visited.end(); it++)
701#else 696#else
702 for (CList<unsigned long>::iterator it = visited.begin(); it != visited.end(); it++) 697 for (CList<unsigned long>::iterator it = visited.begin(); it != visited.end(); it++)
703#endif 698#endif
704 { 699 {
705 unsigned long t = *it; 700 unsigned long t = *it;
706 //qDebug("[%u]", t); 701 //qDebug("[%u]", t);
707 memcpy(newdata, &t, sizeof(t)); 702 memcpy(newdata, &t, sizeof(t));