summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/Bkmks.cpp182
-rw-r--r--noncore/apps/opie-reader/BuffDoc.cpp86
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp942
3 files changed, 605 insertions, 605 deletions
diff --git a/noncore/apps/opie-reader/Bkmks.cpp b/noncore/apps/opie-reader/Bkmks.cpp
index 92ed69f..0cb9ea9 100644
--- a/noncore/apps/opie-reader/Bkmks.cpp
+++ b/noncore/apps/opie-reader/Bkmks.cpp
@@ -20,4 +20,4 @@ Bkmk::Bkmk(const tchar* _nm, const tchar* _anno, unsigned int _p) : m_position(_
20 { 20 {
21 m_anno = new tchar[1]; 21 m_anno = new tchar[1];
22 m_anno[0] = 0; 22 m_anno[0] = 0;
23 } 23 }
@@ -25,5 +25,5 @@ Bkmk::Bkmk(const tchar* _nm, const tchar* _anno, unsigned int _p) : m_position(_
25 { 25 {
26 len = ustrlen(_anno)+1; 26 len = ustrlen(_anno)+1;
27 m_anno = new tchar[len]; 27 m_anno = new tchar[len];
28 for (int i = 0; i < len; i++) m_anno[i] = _anno[i]; 28 for (int i = 0; i < len; i++) m_anno[i] = _anno[i];
29 } 29 }
@@ -43,4 +43,4 @@ Bkmk& Bkmk::operator=(const Bkmk& rhs)
43 { 43 {
44 delete [] m_name; 44 delete [] m_name;
45 m_name = NULL; 45 m_name = NULL;
46 } 46 }
@@ -48,4 +48,4 @@ Bkmk& Bkmk::operator=(const Bkmk& rhs)
48 { 48 {
49 delete [] m_anno; 49 delete [] m_anno;
50 m_anno = NULL; 50 m_anno = NULL;
51 } 51 }
@@ -53,16 +53,16 @@ Bkmk& Bkmk::operator=(const Bkmk& rhs)
53 { 53 {
54 int len = ustrlen(rhs.m_name)+1; 54 int len = ustrlen(rhs.m_name)+1;
55 m_name = new tchar[len]; 55 m_name = new tchar[len];
56 for (int i = 0; i < len; i++) m_name[i] = rhs.m_name[i]; 56 for (int i = 0; i < len; i++) m_name[i] = rhs.m_name[i];
57 } 57 }
58 else 58 else
59 m_name = NULL; 59 m_name = NULL;
60 if (rhs.m_anno != NULL) 60 if (rhs.m_anno != NULL)
61 { 61 {
62 int len = ustrlen(rhs.m_anno)+1; 62 int len = ustrlen(rhs.m_anno)+1;
63 m_anno = new tchar[len]; 63 m_anno = new tchar[len];
64 for (int i = 0; i < len; i++) m_anno[i] = rhs.m_anno[i]; 64 for (int i = 0; i < len; i++) m_anno[i] = rhs.m_anno[i];
65 } 65 }
66 else 66 else
67 m_anno = NULL; 67 m_anno = NULL;
68 m_position = rhs.m_position; 68 m_position = rhs.m_position;
@@ -80,4 +80,4 @@ void Bkmk::setAnno(tchar* t)
80 { 80 {
81 delete [] m_anno; 81 delete [] m_anno;
82 m_anno = NULL; 82 m_anno = NULL;
83 } 83 }
@@ -85,8 +85,8 @@ void Bkmk::setAnno(tchar* t)
85 { 85 {
86 int len = ustrlen(t)+1; 86 int len = ustrlen(t)+1;
87 m_anno = new tchar[len]; 87 m_anno = new tchar[len];
88 for (int i = 0; i < len; i++) m_anno[i] = t[i]; 88 for (int i = 0; i < len; i++) m_anno[i] = t[i];
89 } 89 }
90 else 90 else
91 m_anno = NULL; 91 m_anno = NULL;
92} 92}
@@ -99,3 +99,3 @@ BkmkFile::BkmkFile(const char *fnm, bool w = false)
99 { 99 {
100 f = fopen(fnm, "wb"); 100 f = fopen(fnm, "wb");
101 } 101 }
@@ -103,3 +103,3 @@ BkmkFile::BkmkFile(const char *fnm, bool w = false)
103 { 103 {
104 f = fopen(fnm, "rb"); 104 f = fopen(fnm, "rb");
105 } 105 }
@@ -116,9 +116,9 @@ void BkmkFile::write(tchar* nm, tchar* an, const unsigned int& pos)
116 { 116 {
117 unsigned short ln = ustrlen(nm); 117 unsigned short ln = ustrlen(nm);
118 fwrite(&ln,sizeof(ln),1,f); 118 fwrite(&ln,sizeof(ln),1,f);
119 fwrite(nm,sizeof(tchar),ln,f); 119 fwrite(nm,sizeof(tchar),ln,f);
120 ln = ustrlen(an); 120 ln = ustrlen(an);
121 fwrite(&ln,sizeof(ln),1,f); 121 fwrite(&ln,sizeof(ln),1,f);
122 if (ln > 0) fwrite(an,sizeof(tchar),ln,f); 122 if (ln > 0) fwrite(an,sizeof(tchar),ln,f);
123 fwrite(&pos,sizeof(pos),1,f); 123 fwrite(&pos,sizeof(pos),1,f);
124 } 124 }
@@ -132,7 +132,7 @@ void BkmkFile::write(CList<Bkmk>& bl)
132 { 132 {
133 fwrite(&magic, sizeof(magic), 1, f); 133 fwrite(&magic, sizeof(magic), 1, f);
134 for (CList<Bkmk>::iterator i = bl.begin(); i != bl.end(); i++) 134 for (CList<Bkmk>::iterator i = bl.begin(); i != bl.end(); i++)
135 { 135 {
136 write(*i); 136 write(*i);
137 } 137 }
138 } 138 }
@@ -145,16 +145,16 @@ Bkmk* BkmkFile::read()
145 { 145 {
146 unsigned short ln; 146 unsigned short ln;
147 if (fread(&ln,sizeof(ln),1,f) == 1) 147 if (fread(&ln,sizeof(ln),1,f) == 1)
148 { 148 {
149 b = new Bkmk; 149 b = new Bkmk;
150 b->m_name = new tchar[ln+1]; 150 b->m_name = new tchar[ln+1];
151 fread(b->m_name,sizeof(tchar),ln,f); 151 fread(b->m_name,sizeof(tchar),ln,f);
152 b->m_name[ln] = 0; 152 b->m_name[ln] = 0;
153 153
154 fread(&ln,sizeof(ln),1,f); 154 fread(&ln,sizeof(ln),1,f);
155 b->m_anno = new tchar[ln+1]; 155 b->m_anno = new tchar[ln+1];
156 if (ln > 0) fread(b->m_anno,sizeof(tchar),ln,f); 156 if (ln > 0) fread(b->m_anno,sizeof(tchar),ln,f);
157 b->m_anno[ln] = 0; 157 b->m_anno[ln] = 0;
158 fread(&b->m_position,sizeof(b->m_position),1,f); 158 fread(&b->m_position,sizeof(b->m_position),1,f);
159 } 159 }
160 } 160 }
@@ -168,22 +168,22 @@ CList<Bkmk>* BkmkFile::readall()
168 { 168 {
169 unsigned long newmagic; 169 unsigned long newmagic;
170 fread(&newmagic, sizeof(newmagic), 1, f); 170 fread(&newmagic, sizeof(newmagic), 1, f);
171 if (newmagic != magic) 171 if (newmagic != magic)
172 { 172 {
173 if (QMessageBox::warning(NULL, "Old bookmark file!", "Which version of QTReader\ndid you upgrade from?", "0_4*", "Any other version") == 0) 173 if (QMessageBox::warning(NULL, "Old bookmark file!", "Which version of OpieReader\ndid you upgrade from?", "0_4*", "Any other version") == 0)
174 { 174 {
175 fseek(f,0,SEEK_SET); 175 fseek(f,0,SEEK_SET);
176 bl = readall04(); 176 bl = readall04();
177 } 177 }
178 else 178 else
179 { 179 {
180 fseek(f,0,SEEK_SET); 180 fseek(f,0,SEEK_SET);
181 bl = readall03(); 181 bl = readall03();
182 } 182 }
183 isUpgraded = true; 183 isUpgraded = true;
184 } 184 }
185 else 185 else
186 { 186 {
187 bl = readall04(); 187 bl = readall04();
188 } 188 }
189 } 189 }
@@ -197,6 +197,6 @@ CList<Bkmk>* BkmkFile::readall04()
197 { 197 {
198 Bkmk* b = read(); 198 Bkmk* b = read();
199 if (b == NULL) break; 199 if (b == NULL) break;
200 bl->push_back(*b); 200 bl->push_back(*b);
201 delete b; 201 delete b;
202 } 202 }
@@ -210,6 +210,6 @@ CList<Bkmk>* BkmkFile::readall03()
210 { 210 {
211 Bkmk* b = read03(); 211 Bkmk* b = read03();
212 if (b == NULL) break; 212 if (b == NULL) break;
213 bl->push_back(*b); 213 bl->push_back(*b);
214 delete b; 214 delete b;
215 } 215 }
@@ -223,16 +223,16 @@ Bkmk* BkmkFile::read03()
223 { 223 {
224 unsigned short ln; 224 unsigned short ln;
225 if (fread(&ln,sizeof(ln),1,f) == 1) 225 if (fread(&ln,sizeof(ln),1,f) == 1)
226 { 226 {
227 b = new Bkmk; 227 b = new Bkmk;
228 b->m_name = new tchar[ln+1]; 228 b->m_name = new tchar[ln+1];
229 fread(b->m_name,sizeof(tchar),ln,f); 229 fread(b->m_name,sizeof(tchar),ln,f);
230 b->m_name[ln] = 0; 230 b->m_name[ln] = 0;
231 231
232 ln = 0; 232 ln = 0;
233 b->m_anno = new tchar[ln+1]; 233 b->m_anno = new tchar[ln+1];
234 b->m_anno[ln] = 0; 234 b->m_anno[ln] = 0;
235 235
236 fread(&b->m_position,sizeof(b->m_position),1,f); 236 fread(&b->m_position,sizeof(b->m_position),1,f);
237 } 237 }
238 } 238 }
diff --git a/noncore/apps/opie-reader/BuffDoc.cpp b/noncore/apps/opie-reader/BuffDoc.cpp
index e37b136..d4541ea 100644
--- a/noncore/apps/opie-reader/BuffDoc.cpp
+++ b/noncore/apps/opie-reader/BuffDoc.cpp
@@ -15,4 +15,4 @@ bool BuffDoc::hyperlink(unsigned int n)
15 { 15 {
16 bRet = exp->hyperlink(n); 16 bRet = exp->hyperlink(n);
17 lastsizes[0] = laststartline = exp->locate(); 17 lastsizes[0] = laststartline = exp->locate();
18 } 18 }
@@ -39,5 +39,5 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w)
39 { 39 {
40 //(*buff)[0] = '\0'; 40// (*buff)[0] = '\0';
41 buff->empty(); 41 buff->empty();
42 return false; 42 return false;
43 } 43 }
@@ -56,5 +56,5 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w)
56 for ( ; len > 0; len--) 56 for ( ; len > 0; len--)
57 { 57 {
58 if (buff->width(len) < w) break; 58 if (buff->width(len) < w) break;
59 } 59 }
60// lastword = buff->data() + len - 1; 60// lastword = buff->data() + len - 1;
@@ -90,6 +90,6 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w)
90 { 90 {
91 len++; 91 len++;
92 buff->addch(ch,cs); 92 buff->addch(ch,cs);
93 allsizes[len] = exp->locate(); 93 allsizes[len] = exp->locate();
94 getch(ch, cs); 94 getch(ch, cs);
95 } 95 }
@@ -102,4 +102,4 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w)
102 { 102 {
103 lastcheck = len; 103 lastcheck = len;
104 break; 104 break;
105 } 105 }
@@ -132,3 +132,3 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w, int cw)
132 { 132 {
133 return false; 133 return false;
134 } 134 }
@@ -139,6 +139,6 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w, int cw)
139 { 139 {
140 getch(ch, cs); 140 getch(ch, cs);
141 if (ch == '\12' || ch == UEOF) break; 141 if (ch == '\12' || ch == UEOF) break;
142 buff->addch(ch,cs); 142 buff->addch(ch,cs);
143 i++; 143 i++;
144 } 144 }
@@ -166,5 +166,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
166 { 166 {
167 delete exp; 167 delete exp;
168 exp = NULL; 168 exp = NULL;
169 return ret; 169 return ret;
170 } 170 }
@@ -173,5 +173,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
173 173
174 delete exp; 174 delete exp;
175 exp = new ztxt; 175 exp = new ztxt;
176 ret = exp->openfile(src); 176 ret = exp->openfile(src);
177 } 177 }
@@ -180,5 +180,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
180 180
181 delete exp; 181 delete exp;
182 exp = new CPlucker; 182 exp = new CPlucker;
183 ret = exp->openfile(src); 183 ret = exp->openfile(src);
184 } 184 }
@@ -187,14 +187,14 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
187 { 187 {
188 delete exp; 188 delete exp;
189 qDebug("Trying ppms"); 189 qDebug("Trying ppms");
190 exp = new ppm_expander; 190 exp = new ppm_expander;
191 ret = exp->openfile(src); 191 ret = exp->openfile(src);
192 } 192 }
193 193
194 if (ret != 0) 194 if (ret != 0)
195 { 195 {
196 delete exp; 196 delete exp;
197 exp = new Text; 197 exp = new Text;
198 // qDebug("Trying text"); 198// qDebug("Trying text");
199 ret = exp->openfile(src); 199 ret = exp->openfile(src);
200 } 200 }
@@ -203,5 +203,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
203 { 203 {
204 delete exp; 204 delete exp;
205 exp = new Text; 205 exp = new Text;
206 ret = exp->openfile(src); 206 ret = exp->openfile(src);
207 } 207 }
@@ -210,5 +210,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
210 { 210 {
211 delete exp; 211 delete exp;
212 QMessageBox::information(_parent, "QTReader", "Unknown file compression type","Try another file"); 212 QMessageBox::information(_parent, "OpieReader", "Unknown file compression type","Try another file");
213 return ret; 213 return ret;
214 } 214 }
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index 0608b66..ef1f4f1 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -76,12 +76,12 @@ void QTReaderApp::listBkmkFiles()
76 { 76 {
77 struct dirent* de; 77 struct dirent* de;
78 struct stat buf; 78 struct stat buf;
79 de = readdir(d); 79 de = readdir(d);
80 if (de == NULL) break; 80 if (de == NULL) break;
81 81
82 if (lstat((const char *)Global::applicationFileName("uqtreader",de->d_name),&buf) == 0 && S_ISREG(buf.st_mode)) 82 if (lstat((const char *)Global::applicationFileName("uqtreader",de->d_name),&buf) == 0 && S_ISREG(buf.st_mode))
83 { 83 {
84 bkmkselector->insertItem(de->d_name); 84 bkmkselector->insertItem(de->d_name);
85 cnt++; 85 cnt++;
86 } 86 }
87 } 87 }
@@ -97,3 +97,3 @@ void QTReaderApp::listBkmkFiles()
97 if (searchVisible) searchBar->hide(); 97 if (searchVisible) searchBar->hide();
98 m_nRegAction = cRmBkmkFile; 98 m_nRegAction = cRmBkmkFile;
99 editorStack->raiseWidget( bkmkselector ); 99 editorStack->raiseWidget( bkmkselector );
@@ -101,3 +101,3 @@ void QTReaderApp::listBkmkFiles()
101 else 101 else
102 QMessageBox::information(this, "QTReader", "No bookmark files"); 102 QMessageBox::information(this, "OpieReader", "No bookmark files");
103} 103}
@@ -113,3 +113,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
113 113
114 m_fBkmksChanged = false; 114 m_fBkmksChanged = false;
115 115
@@ -117,6 +117,6 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
117 117
118 m_autogenstr = "^ *[A-Z].*[a-z] *$"; 118 m_autogenstr = "^ *[A-Z].*[a-z] *$";
119 setToolBarsMovable( FALSE ); 119 setToolBarsMovable( FALSE );
120 120
121 setIcon( Resource::loadPixmap( "uqtreader" ) ); 121 setIcon( Resource::loadPixmap( "opie-reader/uqtreader" ) );
122 122
@@ -257,3 +257,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
257 257
258 a = m_scrollButton = new QAction( tr( "Scroll" ), Resource::loadPixmap( "panel-arrow-down" ), QString::null, 0, this, 0, true ); 258 a = m_scrollButton = new QAction( tr( "Scroll" ), Resource::loadPixmap( "opie-reader/panel-arrow-down" ), QString::null, 0, this, 0, true );
259// connect( a, SIGNAL( activated() ), this, SLOT( autoScroll() ) ); 259// connect( a, SIGNAL( activated() ), this, SLOT( autoScroll() ) );
@@ -539,6 +539,6 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
539 connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 539 connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
540 this, SLOT( search( const QString& ) ) ); 540 this, SLOT( search( const QString& ) ) );
541#else 541#else
542 connect( searchEdit, SIGNAL( returnPressed( ) ), 542 connect( searchEdit, SIGNAL( returnPressed( ) ),
543 this, SLOT( search( ) ) ); 543 this, SLOT( search( ) ) );
544#endif 544#endif
@@ -565,3 +565,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
565 connect( regEdit, SIGNAL( returnPressed( ) ), 565 connect( regEdit, SIGNAL( returnPressed( ) ),
566 this, SLOT( do_regaction() ) ); 566 this, SLOT( do_regaction() ) );
567 567
@@ -584,16 +584,16 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
584 { 584 {
585 FontDatabase f; 585 FontDatabase f;
586 QStringList flist = f.families(); 586 QStringList flist = f.families();
587 m_fontSelector->insertStringList(flist); 587 m_fontSelector->insertStringList(flist);
588 588
589 bool realfont = false; 589 bool realfont = false;
590 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) 590 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
591 { 591 {
592 if (reader->m_fontname == *nm) 592 if (reader->m_fontname == *nm)
593 { 593 {
594 realfont = true; 594 realfont = true;
595 break; 595 break;
596 } 596 }
597 } 597 }
598 if (!realfont) reader->m_fontname = flist[0]; 598 if (!realfont) reader->m_fontname = flist[0];
599 } // delete the FontDatabase!!! 599 } // delete the FontDatabase!!!
@@ -601,3 +601,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
601 connect( m_fontSelector, SIGNAL( activated(const QString& ) ), 601 connect( m_fontSelector, SIGNAL( activated(const QString& ) ),
602 this, SLOT( do_setfont(const QString&) ) ); 602 this, SLOT( do_setfont(const QString&) ) );
603 603
@@ -607,3 +607,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
607 connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ), 607 connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ),
608 this, SLOT( msgHandler(const QCString&, const QByteArray&) ) ); 608 this, SLOT( msgHandler(const QCString&, const QByteArray&) ) );
609 609
@@ -613,4 +613,4 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
613 { 613 {
614 openFile( reader->m_lastfile ); 614 openFile( reader->m_lastfile );
615 doc = new DocLnk(reader->m_lastfile); 615 doc = new DocLnk(reader->m_lastfile);
616 } 616 }
@@ -630,5 +630,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
630 { 630 {
631 QString info; 631 QString info;
632 stream >> info; 632 stream >> info;
633 QMessageBox::information(this, "QTReader", info); 633 QMessageBox::information(this, "OpieReader", info);
634 } 634 }
@@ -636,5 +636,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
636 { 636 {
637 QString info; 637 QString info;
638 stream >> info; 638 stream >> info;
639 QMessageBox::warning(this, "QTReader", info); 639 QMessageBox::warning(this, "OpieReader", info);
640 } 640 }
@@ -644,4 +644,4 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
644 { 644 {
645 m_dontSave = true; 645 m_dontSave = true;
646 close(); 646 close();
647 } 647 }
@@ -649,3 +649,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
649 { 649 {
650 reader->dopagedn(); 650 reader->dopagedn();
651 } 651 }
@@ -653,3 +653,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
653 { 653 {
654 reader->dopageup(); 654 reader->dopageup();
655 } 655 }
@@ -657,3 +657,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
657 { 657 {
658 reader->lineDown(); 658 reader->lineDown();
659 } 659 }
@@ -661,3 +661,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
661 { 661 {
662 reader->lineUp(); 662 reader->lineUp();
663 } 663 }
@@ -665,3 +665,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
665 { 665 {
666 showEditTools(); 666 showEditTools();
667 } 667 }
@@ -669,5 +669,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
669 { 669 {
670 QString info; 670 QString info;
671 stream >> info; 671 stream >> info;
672 openFile( info ); 672 openFile( info );
673 } 673 }
@@ -675,3 +675,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
675 { 675 {
676 showinfo(); 676 showinfo();
677 } 677 }
@@ -679,3 +679,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
679 { 679 {
680 editMark(); 680 editMark();
681 } 681 }
@@ -683,3 +683,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
683 { 683 {
684 editCopy(); 684 editCopy();
685 } 685 }
@@ -687,5 +687,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
687 { 687 {
688 int info; 688 int info;
689 stream >> info; 689 stream >> info;
690 autoScroll(info); 690 autoScroll(info);
691 } 691 }
@@ -693,5 +693,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
693 { 693 {
694 int info; 694 int info;
695 stream >> info; 695 stream >> info;
696 reader->locate(info); 696 reader->locate(info);
697 } 697 }
@@ -699,5 +699,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
699 { 699 {
700 int info; 700 int info;
701 stream >> info; 701 stream >> info;
702 pagemode(info); 702 pagemode(info);
703 } 703 }
@@ -705,5 +705,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
705 { 705 {
706 int info; 706 int info;
707 stream >> info; 707 stream >> info;
708 reader->m_overlap = info; 708 reader->m_overlap = info;
709 } 709 }
@@ -711,5 +711,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
711 { 711 {
712 QString info; 712 QString info;
713 stream >> info; 713 stream >> info;
714 do_settarget(info); 714 do_settarget(info);
715 } 715 }
@@ -717,5 +717,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
717 { 717 {
718 int info; 718 int info;
719 stream >> info; 719 stream >> info;
720 setTwoTouch(info); 720 setTwoTouch(info);
721 } 721 }
@@ -723,5 +723,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
723 { 723 {
724 int info; 724 int info;
725 stream >> info; 725 stream >> info;
726 OnAnnotation(info); 726 OnAnnotation(info);
727 } 727 }
@@ -729,5 +729,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
729 { 729 {
730 int info; 730 int info;
731 stream >> info; 731 stream >> info;
732 OnDictionary(info); 732 OnDictionary(info);
733 } 733 }
@@ -735,5 +735,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
735 { 735 {
736 int info; 736 int info;
737 stream >> info; 737 stream >> info;
738 OnClipboard(info); 738 OnClipboard(info);
739 } 739 }
@@ -741,20 +741,20 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
741 { 741 {
742 QString info; 742 QString info;
743 stream >> info; 743 stream >> info;
744 QRegExp arg(info); 744 QRegExp arg(info);
745 size_t pos = reader->pagelocate(); 745 size_t pos = reader->pagelocate();
746 size_t start = pos; 746 size_t start = pos;
747 CDrawBuffer test(&(reader->m_fontControl)); 747 CDrawBuffer test(&(reader->m_fontControl));
748 reader->buffdoc.getline(&test,reader->width()); 748 reader->buffdoc.getline(&test,reader->width());
749 while (arg.match(toQString(test.data())) == -1) 749 while (arg.match(toQString(test.data())) == -1)
750 { 750 {
751 pos = reader->locate(); 751 pos = reader->locate();
752 if (!reader->buffdoc.getline(&test,reader->width())) 752 if (!reader->buffdoc.getline(&test,reader->width()))
753 { 753 {
754 QMessageBox::information(this, "QTReader", QString("Can't find\n")+info); 754 QMessageBox::information(this, "OpieReader", QString("Can't find\n")+info);
755 pos = start; 755 pos = start;
756 break; 756 break;
757 } 757 }
758 } 758 }
759 reader->locate(pos); 759 reader->locate(pos);
760 } 760 }
@@ -762,5 +762,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
762 { 762 {
763 int info; 763 int info;
764 stream >> info; 764 stream >> info;
765 stripcr(info); 765 stripcr(info);
766 } 766 }
@@ -768,5 +768,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
768 { 768 {
769 int info; 769 int info;
770 stream >> info; 770 stream >> info;
771 autofmt(info); 771 autofmt(info);
772 } 772 }
@@ -774,5 +774,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
774 { 774 {
775 int info; 775 int info;
776 stream >> info; 776 stream >> info;
777 textfmt(info); 777 textfmt(info);
778 } 778 }
@@ -780,5 +780,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
780 { 780 {
781 int info; 781 int info;
782 stream >> info; 782 stream >> info;
783 striphtml(info); 783 striphtml(info);
784 } 784 }
@@ -786,5 +786,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
786 { 786 {
787 int info; 787 int info;
788 stream >> info; 788 stream >> info;
789 peanut(info); 789 peanut(info);
790 } 790 }
@@ -792,5 +792,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
792 { 792 {
793 int info; 793 int info;
794 stream >> info; 794 stream >> info;
795 dehyphen(info); 795 dehyphen(info);
796 } 796 }
@@ -798,5 +798,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
798 { 798 {
799 int info; 799 int info;
800 stream >> info; 800 stream >> info;
801 unindent(info); 801 unindent(info);
802 } 802 }
@@ -804,5 +804,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
804 { 804 {
805 int info; 805 int info;
806 stream >> info; 806 stream >> info;
807 repara(info); 807 repara(info);
808 } 808 }
@@ -810,5 +810,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
810 { 810 {
811 int info; 811 int info;
812 stream >> info; 812 stream >> info;
813 dblspce(info); 813 dblspce(info);
814 } 814 }
@@ -816,6 +816,6 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
816 { 816 {
817 int info; 817 int info;
818 stream >> info; 818 stream >> info;
819 reader->bindenter = info; 819 reader->bindenter = info;
820 reader->setfilter(reader->getfilter()); 820 reader->setfilter(reader->getfilter());
821 } 821 }
@@ -823,5 +823,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
823 { 823 {
824 int info; 824 int info;
825 stream >> info; 825 stream >> info;
826 remap(info); 826 remap(info);
827 } 827 }
@@ -829,5 +829,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
829 { 829 {
830 int info; 830 int info;
831 stream >> info; 831 stream >> info;
832 embolden(info); 832 embolden(info);
833 } 833 }
@@ -835,5 +835,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
835 { 835 {
836 int info; 836 int info;
837 stream >> info; 837 stream >> info;
838 monospace(info); 838 monospace(info);
839 } 839 }
@@ -841,7 +841,7 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
841 { 841 {
842 int info; 842 int info;
843 stream >> info; 843 stream >> info;
844 reader->m_charpc = info; 844 reader->m_charpc = info;
845 reader->setfont(); 845 reader->setfont();
846 reader->refresh(); 846 reader->refresh();
847 } 847 }
@@ -849,5 +849,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
849 { 849 {
850 QString info; 850 QString info;
851 stream >> info; 851 stream >> info;
852 reader->setencoding(EncNameToInt(info)); 852 reader->setencoding(EncNameToInt(info));
853 } 853 }
@@ -855,7 +855,7 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
855 { 855 {
856 QString fontname; 856 QString fontname;
857 int size; 857 int size;
858 stream >> fontname; 858 stream >> fontname;
859 stream >> size; 859 stream >> size;
860 setfontHelper(fontname, size); 860 setfontHelper(fontname, size);
861 } 861 }
@@ -863,5 +863,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
863 { 863 {
864 QString info; 864 QString info;
865 stream >> info; 865 stream >> info;
866 do_autogen(info); 866 do_autogen(info);
867 } 867 }
@@ -873,3 +873,3 @@ ActionTypes QTReaderApp::ActNameToInt(const QString& _enc)
873 { 873 {
874 if (m_buttonAction[i]->text() == _enc) return (ActionTypes)i; 874 if (m_buttonAction[i]->text() == _enc) return (ActionTypes)i;
875 } 875 }
@@ -882,3 +882,3 @@ int QTReaderApp::EncNameToInt(const QString& _enc)
882 { 882 {
883 if (m_EncodingAction[i]->text() == _enc) return i; 883 if (m_EncodingAction[i]->text() == _enc) return i;
884 } 884 }
@@ -916,3 +916,3 @@ void QTReaderApp::TBD()
916{ 916{
917 QMessageBox::information(this, "QTReader", "Not yet implemented", 1); 917 QMessageBox::information(this, "OpieReader", "Not yet implemented", 1);
918} 918}
@@ -921,3 +921,3 @@ void QTReaderApp::TBDzoom()
921{ 921{
922 QMessageBox::information(this, "QTReader", "Zooming is done interactively\nTry left/right cursor keys", 1); 922 QMessageBox::information(this, "OpieReader", "Zooming is done interactively\nTry left/right cursor keys", 1);
923} 923}
@@ -926,5 +926,5 @@ void QTReaderApp::clearBkmkList()
926{ 926{
927 delete pBkmklist; 927 delete pBkmklist;
928 pBkmklist = NULL; 928 pBkmklist = NULL;
929 m_fBkmksChanged = false; 929 m_fBkmksChanged = false;
930} 930}
@@ -941,10 +941,10 @@ void QTReaderApp::fileOpen()
941 { 941 {
942 if (m_fBkmksChanged) 942 if (m_fBkmksChanged)
943 { 943 {
944 if (QMessageBox::warning(this, "QTReader", "Save bookmarks?", "Save", "Don't bother") == 0) 944 if (QMessageBox::warning(this, "OpieReader", "Save bookmarks?", "Save", "Don't bother") == 0)
945 savebkmks(); 945 savebkmks();
946 } 946 }
947 delete pBkmklist; 947 delete pBkmklist;
948 pBkmklist = NULL; 948 pBkmklist = NULL;
949 m_fBkmksChanged = false; 949 m_fBkmksChanged = false;
950 } 950 }
@@ -955,6 +955,6 @@ void QTReaderApp::fileOpen()
955*/ 955*/
956 fileBrowser* fb = new fileBrowser(this,"QTReader",TRUE, 956 fileBrowser* fb = new fileBrowser(this,"OpieReader",TRUE,
957 0, 957 0,
958 // WStyle_Customize | WStyle_NoBorderEx, 958// WStyle_Customize | WStyle_NoBorderEx,
959 "*", QFileInfo(reader->m_lastfile).dirPath(true)); 959 "*", QFileInfo(reader->m_lastfile).dirPath(true));
960 960
@@ -962,5 +962,5 @@ void QTReaderApp::fileOpen()
962 { 962 {
963 QString fn(fb->fileList[0]); 963 QString fn(fb->fileList[0]);
964// fb->populateList(); 964// fb->populateList();
965 if (!fn.isEmpty() && QFileInfo(fn).isFile()) openFile(fn); 965 if (!fn.isEmpty() && QFileInfo(fn).isFile()) openFile(fn);
966 } 966 }
@@ -975,3 +975,3 @@ void QTReaderApp::showinfo()
975 { 975 {
976 QMessageBox::information(this, "QTReader", "No file loaded", 1); 976 QMessageBox::information(this, "OpieReader", "No file loaded", 1);
977 } 977 }
@@ -979,11 +979,11 @@ void QTReaderApp::showinfo()
979 { 979 {
980 reader->sizes(fs,ts); 980 reader->sizes(fs,ts);
981 pl = reader->pagelocate(); 981 pl = reader->pagelocate();
982 m_infoWin->setFileSize(fs); 982 m_infoWin->setFileSize(fs);
983 m_infoWin->setTextSize(ts); 983 m_infoWin->setTextSize(ts);
984 m_infoWin->setRatio(100-(100*fs + (ts >> 1))/ts); 984 m_infoWin->setRatio(100-(100*fs + (ts >> 1))/ts);
985 m_infoWin->setLocation(pl); 985 m_infoWin->setLocation(pl);
986 m_infoWin->setRead((100*pl + (ts >> 1))/ts); 986 m_infoWin->setRead((100*pl + (ts >> 1))/ts);
987 editorStack->raiseWidget( m_infoWin ); 987 editorStack->raiseWidget( m_infoWin );
988 m_infoWin->setFocus(); 988 m_infoWin->setFocus();
989 } 989 }
@@ -999,3 +999,3 @@ void QTReaderApp::addAnno(const QString& name, const QString& text, size_t posn)
999 { 999 {
1000 buff[i] = name[i].unicode(); 1000 buff[i] = name[i].unicode();
1001 } 1001 }
@@ -1005,3 +1005,3 @@ void QTReaderApp::addAnno(const QString& name, const QString& text, size_t posn)
1005 { 1005 {
1006 buff2[i] = text[i].unicode(); 1006 buff2[i] = text[i].unicode();
1007 } 1007 }
@@ -1020,11 +1020,11 @@ void QTReaderApp::addAnno(const QString& name, const QString& text)
1020 { 1020 {
1021 if (name.isEmpty()) 1021 if (name.isEmpty())
1022 { 1022 {
1023 QMessageBox::information(this, "QTReader", "Need a name for the bookmark\nPlease try again", 1); 1023 QMessageBox::information(this, "OpieReader", "Need a name for the bookmark\nPlease try again", 1);
1024 } 1024 }
1025 else 1025 else
1026 { 1026 {
1027 addAnno(name, text, m_annoWin->getPosn()); 1027 addAnno(name, text, m_annoWin->getPosn());
1028 } 1028 }
1029 showEditTools(); 1029 showEditTools();
1030 } 1030 }
@@ -1032,24 +1032,24 @@ void QTReaderApp::addAnno(const QString& name, const QString& text)
1032 { 1032 {
1033 if (m_annoWin->edited()) 1033 if (m_annoWin->edited())
1034 { 1034 {
1035 CBuffer buff(text.length()+1); 1035 CBuffer buff(text.length()+1);
1036 int i; 1036 int i;
1037 for (i = 0; i < text.length(); i++) 1037 for (i = 0; i < text.length(); i++)
1038 { 1038 {
1039 buff[i] = text[i].unicode(); 1039 buff[i] = text[i].unicode();
1040 } 1040 }
1041 buff[i] = 0; 1041 buff[i] = 0;
1042 m_fBkmksChanged = true; 1042 m_fBkmksChanged = true;
1043 m_anno->setAnno(buff.data()); 1043 m_anno->setAnno(buff.data());
1044 } 1044 }
1045 bool found = findNextBookmark(m_anno->value()+1); 1045 bool found = findNextBookmark(m_anno->value()+1);
1046 if (found) 1046 if (found)
1047 { 1047 {
1048 m_annoWin->setName(toQString(m_anno->name())); 1048 m_annoWin->setName(toQString(m_anno->name()));
1049 m_annoWin->setAnno(toQString(m_anno->anno())); 1049 m_annoWin->setAnno(toQString(m_anno->anno()));
1050 } 1050 }
1051 else 1051 else
1052 { 1052 {
1053 showEditTools(); 1053 showEditTools();
1054 } 1054 }
1055 } 1055 }
@@ -1062,11 +1062,11 @@ bool QTReaderApp::findNextBookmark(size_t start)
1062 { 1062 {
1063 if (iter->value() >= start) 1063 if (iter->value() >= start)
1064 { 1064 {
1065 if (iter->value() < reader->locate()) 1065 if (iter->value() < reader->locate())
1066 { 1066 {
1067 found = true; 1067 found = true;
1068 m_anno = iter.pContent(); 1068 m_anno = iter.pContent();
1069 } 1069 }
1070 break; 1070 break;
1071 } 1071 }
1072 } 1072 }
@@ -1079,3 +1079,3 @@ void QTReaderApp::addanno()
1079 { 1079 {
1080 QMessageBox::information(this, "QTReader", "No file loaded", 1); 1080 QMessageBox::information(this, "OpieReader", "No file loaded", 1);
1081 } 1081 }
@@ -1083,8 +1083,8 @@ void QTReaderApp::addanno()
1083 { 1083 {
1084 m_annoWin->setName(""); 1084 m_annoWin->setName("");
1085 m_annoWin->setAnno(""); 1085 m_annoWin->setAnno("");
1086 m_annoWin->setPosn(reader->pagelocate()); 1086 m_annoWin->setPosn(reader->pagelocate());
1087 m_annoIsEditing = true; 1087 m_annoIsEditing = true;
1088 editorStack->raiseWidget( m_annoWin ); 1088 editorStack->raiseWidget( m_annoWin );
1089 m_annoWin->setFocus(); 1089 m_annoWin->setFocus();
1090 } 1090 }
@@ -1118,14 +1118,14 @@ void QTReaderApp::editCopy()
1118{ 1118{
1119 QClipboard* cb = QApplication::clipboard(); 1119 QClipboard* cb = QApplication::clipboard();
1120 QString text; 1120 QString text;
1121 int ch; 1121 int ch;
1122 unsigned long currentpos = reader->pagelocate(); 1122 unsigned long currentpos = reader->pagelocate();
1123 unsigned long endpos = reader->locate(); 1123 unsigned long endpos = reader->locate();
1124 reader->jumpto(m_savedpos); 1124 reader->jumpto(m_savedpos);
1125 while (reader->explocate() < endpos && (ch = reader->getch()) != UEOF) 1125 while (reader->explocate() < endpos && (ch = reader->getch()) != UEOF)
1126 { 1126 {
1127 text += ch; 1127 text += ch;
1128 } 1128 }
1129 cb->setText(text); 1129 cb->setText(text);
1130 reader->locate(currentpos); 1130 reader->locate(currentpos);
1131} 1131}
@@ -1218,4 +1218,4 @@ void QTReaderApp::settarget()
1218 QString text = ((m_targetapp.isEmpty()) ? QString("") : m_targetapp) 1218 QString text = ((m_targetapp.isEmpty()) ? QString("") : m_targetapp)
1219 + "/" 1219 + "/"
1220 + ((m_targetmsg.isEmpty()) ? QString("") : m_targetmsg); 1220 + ((m_targetmsg.isEmpty()) ? QString("") : m_targetmsg);
1221 regEdit->setText(text); 1221 regEdit->setText(text);
@@ -1230,6 +1230,6 @@ void QTReaderApp::do_overlap(const QString& lcn)
1230 { 1230 {
1231 reader->m_overlap = ulcn; 1231 reader->m_overlap = ulcn;
1232 } 1232 }
1233 else 1233 else
1234 QMessageBox::information(this, "QTReader", "Must be a number"); 1234 QMessageBox::information(this, "OpieReader", "Must be a number");
1235} 1235}
@@ -1242,9 +1242,9 @@ void QTReaderApp::do_mono(const QString& lcn)
1242 { 1242 {
1243 reader->m_charpc = ulcn; 1243 reader->m_charpc = ulcn;
1244 reader->setfont(); 1244 reader->setfont();
1245 reader->refresh(); 1245 reader->refresh();
1246 //reader->setmono(true); 1246// reader->setmono(true);
1247 } 1247 }
1248 else 1248 else
1249 QMessageBox::information(this, "QTReader", "Must be a number"); 1249 QMessageBox::information(this, "OpieReader", "Must be a number");
1250} 1250}
@@ -1334,11 +1334,11 @@ bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg)
1334 if (!reader->buffdoc.getline(&test,reader->width())) 1334 if (!reader->buffdoc.getline(&test,reader->width()))
1335 { 1335 {
1336 if (QMessageBox::warning(this, "Can't find", searchEdit->text(), 1, 2) == 2) 1336 if (QMessageBox::warning(this, "Can't find", searchEdit->text(), 1, 2) == 2)
1337 pos = searchStart; 1337 pos = searchStart;
1338 else 1338 else
1339 pos = start; 1339 pos = start;
1340 ret = false; 1340 ret = false;
1341 findClose(); 1341 findClose();
1342 break; 1342 break;
1343 } 1343 }
1344 } 1344 }
@@ -1420,5 +1420,5 @@ void QTReaderApp::openFile( const DocLnk &f )
1420 { 1420 {
1421 QMessageBox::information(this, "QTReader", "File does not exist"); 1421 QMessageBox::information(this, "OpieReader", "File does not exist");
1422 } 1422 }
1423 1423
1424} 1424}
@@ -1428,3 +1428,3 @@ void QTReaderApp::showEditTools()
1428 if ( !doc ) 1428 if ( !doc )
1429 close(); 1429 close();
1430// fileSelector->hide(); 1430// fileSelector->hide();
@@ -1433,5 +1433,5 @@ void QTReaderApp::showEditTools()
1433 if ( searchVisible ) 1433 if ( searchVisible )
1434 searchBar->show(); 1434 searchBar->show();
1435 if ( regVisible ) 1435 if ( regVisible )
1436 regBar->show(); 1436 regBar->show();
1437 if (m_fontVisible) m_fontBar->show(); 1437 if (m_fontVisible) m_fontBar->show();
@@ -1446,5 +1446,5 @@ void QTReaderApp::save()
1446 if ( !doc ) 1446 if ( !doc )
1447 return; 1447 return;
1448 if ( !editor->edited() ) 1448 if ( !editor->edited() )
1449 return; 1449 return;
1450 1450
@@ -1454,15 +1454,15 @@ void QTReaderApp::save()
1454 if ( doc->name().isEmpty() ) { 1454 if ( doc->name().isEmpty() ) {
1455 unsigned ispace = pt.find( ' ' ); 1455 unsigned ispace = pt.find( ' ' );
1456 unsigned ienter = pt.find( '\n' ); 1456 unsigned ienter = pt.find( '\n' );
1457 int i = (ispace < ienter) ? ispace : ienter; 1457 int i = (ispace < ienter) ? ispace : ienter;
1458 QString docname; 1458 QString docname;
1459 if ( i == -1 ) { 1459 if ( i == -1 ) {
1460 if ( pt.isEmpty() ) 1460 if ( pt.isEmpty() )
1461 docname = "Empty Text"; 1461 docname = "Empty Text";
1462 else 1462 else
1463 docname = pt; 1463 docname = pt;
1464 } else { 1464 } else {
1465 docname = pt.left( i ); 1465 docname = pt.left( i );
1466 } 1466 }
1467 doc->setName(docname); 1467 doc->setName(docname);
1468 } 1468 }
@@ -1478,5 +1478,5 @@ void QTReaderApp::clear()
1478// QMessageBox::information(this, "QTReader", "Deleting doc", 1); 1478// QMessageBox::information(this, "QTReader", "Deleting doc", 1);
1479 delete doc; 1479 delete doc;
1480// QMessageBox::information(this, "QTReader", "Deleted doc", 1); 1480// QMessageBox::information(this, "QTReader", "Deleted doc", 1);
1481 doc = 0; 1481 doc = 0;
1482 } 1482 }
@@ -1488,8 +1488,8 @@ void QTReaderApp::updateCaption()
1488 if ( !doc ) 1488 if ( !doc )
1489 setCaption( tr("QTReader") ); 1489 setCaption( tr("OpieReader") );
1490 else { 1490 else {
1491 QString s = doc->name(); 1491 QString s = doc->name();
1492 if ( s.isEmpty() ) 1492 if ( s.isEmpty() )
1493 s = tr( "Unnamed" ); 1493 s = tr( "Unnamed" );
1494 setCaption( s + " - " + tr("QTReader") ); 1494 setCaption( s + " - " + tr("OpieReader") );
1495 } 1495 }
@@ -1509,3 +1509,3 @@ void QTReaderApp::closeEvent( QCloseEvent *e )
1509 { 1509 {
1510 e->accept(); 1510 e->accept();
1511 } 1511 }
@@ -1513,37 +1513,37 @@ void QTReaderApp::closeEvent( QCloseEvent *e )
1513 { 1513 {
1514 if (editorStack->visibleWidget() == reader) 1514 if (editorStack->visibleWidget() == reader)
1515 { 1515 {
1516 if (m_fontVisible) 1516 if (m_fontVisible)
1517 { 1517 {
1518 m_fontBar->hide(); 1518 m_fontBar->hide();
1519 m_fontVisible = false; 1519 m_fontVisible = false;
1520 } 1520 }
1521 if (regVisible) 1521 if (regVisible)
1522 { 1522 {
1523 regBar->hide(); 1523 regBar->hide();
1524 regVisible = false; 1524 regVisible = false;
1525 return; 1525 return;
1526 } 1526 }
1527 if (searchVisible) 1527 if (searchVisible)
1528 { 1528 {
1529 searchBar->hide(); 1529 searchBar->hide();
1530 searchVisible = false; 1530 searchVisible = false;
1531 return; 1531 return;
1532 } 1532 }
1533 if (m_fBkmksChanged && pBkmklist != NULL) 1533 if (m_fBkmksChanged && pBkmklist != NULL)
1534 { 1534 {
1535 if (QMessageBox::warning(this, "QTReader", "Save bookmarks?", "Save", "Don't bother") == 0) 1535 if (QMessageBox::warning(this, "OpieReader", "Save bookmarks?", "Save", "Don't bother") == 0)
1536 savebkmks(); 1536 savebkmks();
1537 delete pBkmklist; 1537 delete pBkmklist;
1538 pBkmklist = NULL; 1538 pBkmklist = NULL;
1539 m_fBkmksChanged = false; 1539 m_fBkmksChanged = false;
1540 } 1540 }
1541 bFromDocView = FALSE; 1541 bFromDocView = FALSE;
1542 saveprefs(); 1542 saveprefs();
1543 e->accept(); 1543 e->accept();
1544 } 1544 }
1545 else 1545 else
1546 { 1546 {
1547 showEditTools(); 1547 showEditTools();
1548 } 1548 }
1549 } 1549 }
@@ -1569,11 +1569,11 @@ void QTReaderApp::listbkmk()
1569 { 1569 {
1570 for (CList<Bkmk>::iterator i = pBkmklist->begin(); i != pBkmklist->end(); i++) 1570 for (CList<Bkmk>::iterator i = pBkmklist->begin(); i != pBkmklist->end(); i++)
1571 { 1571 {
1572#ifdef _UNICODE 1572#ifdef _UNICODE
1573 bkmkselector->insertItem(toQString(i->name())); 1573 bkmkselector->insertItem(toQString(i->name()));
1574#else 1574#else
1575 bkmkselector->insertItem(i->name()); 1575 bkmkselector->insertItem(i->name());
1576#endif 1576#endif
1577 cnt++; 1577 cnt++;
1578 } 1578 }
1579 } 1579 }
@@ -1589,3 +1589,3 @@ void QTReaderApp::listbkmk()
1589 else 1589 else
1590 QMessageBox::information(this, "QTReader", "No bookmarks in memory"); 1590 QMessageBox::information(this, "OpieReader", "No bookmarks in memory");
1591} 1591}
@@ -1611,14 +1611,14 @@ void QTReaderApp::gotobkmk(int ind)
1611 { 1611 {
1612 case cGotoBkmk: 1612 case cGotoBkmk:
1613 reader->locate((*pBkmklist)[ind]->value()); 1613 reader->locate((*pBkmklist)[ind]->value());
1614 break; 1614 break;
1615 case cDelBkmk: 1615 case cDelBkmk:
1616 // qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name()); 1616// qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name());
1617 pBkmklist->erase(ind); 1617 pBkmklist->erase(ind);
1618 m_fBkmksChanged = true; 1618 m_fBkmksChanged = true;
1619 // pBkmklist->sort(); 1619// pBkmklist->sort();
1620 break; 1620 break;
1621 case cRmBkmkFile: 1621 case cRmBkmkFile:
1622 unlink((const char *)Global::applicationFileName("uqtreader",bkmkselector->text(ind))); 1622 unlink((const char *)Global::applicationFileName("uqtreader",bkmkselector->text(ind)));
1623 break; 1623 break;
1624 } 1624 }
@@ -1646,5 +1646,5 @@ void QTReaderApp::do_jump(const QString& lcn)
1646 if (ok) 1646 if (ok)
1647 reader->locate(ulcn); 1647 reader->locate(ulcn);
1648 else 1648 else
1649 QMessageBox::information(this, "QTReader", "Must be a number"); 1649 QMessageBox::information(this, "OpieReader", "Must be a number");
1650} 1650}
@@ -1658,19 +1658,19 @@ void QTReaderApp::do_regaction()
1658 case cAutoGen: 1658 case cAutoGen:
1659 do_autogen(regEdit->text()); 1659 do_autogen(regEdit->text());
1660 break; 1660 break;
1661 case cAddBkmk: 1661 case cAddBkmk:
1662 do_addbkmk(regEdit->text()); 1662 do_addbkmk(regEdit->text());
1663 break; 1663 break;
1664 case cJump: 1664 case cJump:
1665 do_jump(regEdit->text()); 1665 do_jump(regEdit->text());
1666 break; 1666 break;
1667 case cMonoSpace: 1667 case cMonoSpace:
1668 do_mono(regEdit->text()); 1668 do_mono(regEdit->text());
1669 break; 1669 break;
1670 case cOverlap: 1670 case cOverlap:
1671 do_overlap(regEdit->text()); 1671 do_overlap(regEdit->text());
1672 break; 1672 break;
1673 case cSetTarget: 1673 case cSetTarget:
1674 do_settarget(regEdit->text()); 1674 do_settarget(regEdit->text());
1675 break; 1675 break;
1676 } 1676 }
@@ -1686,5 +1686,5 @@ void QTReaderApp::do_settarget(const QString& _txt)
1686 { 1686 {
1687 m_targetapp = ""; 1687 m_targetapp = "";
1688 m_targetmsg = ""; 1688 m_targetmsg = "";
1689 QMessageBox::information(this, "QTReader", "Format is\nappname/messagename"); 1689 QMessageBox::information(this, "OpieReader", "Format is\nappname/messagename");
1690 } 1690 }
@@ -1692,4 +1692,4 @@ void QTReaderApp::do_settarget(const QString& _txt)
1692 { 1692 {
1693 m_targetapp = _txt.left(ind); 1693 m_targetapp = _txt.left(ind);
1694 m_targetmsg = _txt.right(_txt.length()-ind-1); 1694 m_targetmsg = _txt.right(_txt.length()-ind-1);
1695 } 1695 }
@@ -1701,7 +1701,7 @@ void QTReaderApp::setfont()
1701 { 1701 {
1702 if (m_fontSelector->text(i) == reader->m_fontname) 1702 if (m_fontSelector->text(i) == reader->m_fontname)
1703 { 1703 {
1704 m_fontSelector->setCurrentItem(i); 1704 m_fontSelector->setCurrentItem(i);
1705 break; 1705 break;
1706 } 1706 }
1707 } 1707 }
@@ -1722,3 +1722,3 @@ void QTReaderApp::setfontHelper(const QString& lcn, int size = 0)
1722 { 1722 {
1723 reader->ChangeFont(size); 1723 reader->ChangeFont(size);
1724 } 1724 }
@@ -1761,5 +1761,5 @@ pbar->resize(width(), editBar->height());
1761 pbar->setProgress(pc); 1761 pbar->setProgress(pc);
1762 qApp->processEvents(); 1762 qApp->processEvents();
1763 if (reader->locate() != lcn) reader->jumpto(lcn); 1763 if (reader->locate() != lcn) reader->jumpto(lcn);
1764 reader->setFocus(); 1764 reader->setFocus();
1765 lastpc = pc; 1765 lastpc = pc;
@@ -1772,3 +1772,3 @@ pbar->resize(width(), editBar->height());
1772#endif 1772#endif
1773 pBkmklist->push_back(Bkmk(buff.data(), NULL, lcn)); 1773 pBkmklist->push_back(Bkmk(buff.data(), NULL, lcn));
1774 } 1774 }
@@ -1846,14 +1846,14 @@ void info_cb(Fl_Widget* o, void* _data)
1846 { 1846 {
1847 1847
1848 infowin = new Fl_Window(160,240); 1848 infowin = new Fl_Window(160,240);
1849 filename = new Fl_Output(45,5,110,14,"Filename"); 1849 filename = new Fl_Output(45,5,110,14,"Filename");
1850 filesize = new Fl_Output(45,25,110,14,"Filesize"); 1850 filesize = new Fl_Output(45,25,110,14,"Filesize");
1851 textsize = new Fl_Output(45,45,110,14,"Textsize"); 1851 textsize = new Fl_Output(45,45,110,14,"Textsize");
1852 comprat = new CBar(45,65,110,14,"Ratio %"); 1852 comprat = new CBar(45,65,110,14,"Ratio %");
1853 posn = new Fl_Output(45,85,110,14,"Location"); 1853 posn = new Fl_Output(45,85,110,14,"Location");
1854 frcn = new CBar(45,105,110,14,"% Read"); 1854 frcn = new CBar(45,105,110,14,"% Read");
1855 about = new Fl_Multiline_Output(5,125,150,90); 1855 about = new Fl_Multiline_Output(5,125,150,90);
1856 about->value("TWReader - $Name$\n\nA file reader program for the Agenda\n\nReads text, PalmDoc and ppms format files"); 1856 about->value("TWReader - $Name$\n\nA file reader program for the Agenda\n\nReads text, PalmDoc and ppms format files");
1857 Fl_Button *jump_accept = new Fl_Button(62,220,35,14,"Okay"); 1857 Fl_Button *jump_accept = new Fl_Button(62,220,35,14,"Okay");
1858 infowin->set_modal(); 1858 infowin->set_modal();
1859 } 1859 }
@@ -1861,21 +1861,21 @@ void info_cb(Fl_Widget* o, void* _data)
1861 { 1861 {
1862 unsigned long fs,ts; 1862 unsigned long fs,ts;
1863 tchar sz[20]; 1863 tchar sz[20];
1864 ((reader_ui *)_data)->input->sizes(fs,ts); 1864 ((reader_ui *)_data)->input->sizes(fs,ts);
1865 unsigned long pl = ((reader_ui *)_data)->input->locate(); 1865 unsigned long pl = ((reader_ui *)_data)->input->locate();
1866 1866
1867 filename->value(((reader_ui *)_data)->g_filename); 1867 filename->value(((reader_ui *)_data)->g_filename);
1868 1868
1869 sprintf(sz,"%u",fs); 1869 sprintf(sz,"%u",fs);
1870 filesize->value(sz); 1870 filesize->value(sz);
1871 1871
1872 sprintf(sz,"%u",ts); 1872 sprintf(sz,"%u",ts);
1873 textsize->value(sz); 1873 textsize->value(sz);
1874 1874
1875 comprat->value(100-(100*fs + (ts >> 1))/ts); 1875 comprat->value(100-(100*fs + (ts >> 1))/ts);
1876 1876
1877 sprintf(sz,"%u",pl); 1877 sprintf(sz,"%u",pl);
1878 posn->value(sz); 1878 posn->value(sz);
1879 1879
1880 frcn->value((100*pl + (ts >> 1))/ts); 1880 frcn->value((100*pl + (ts >> 1))/ts);
1881 } 1881 }
@@ -1889,6 +1889,6 @@ void QTReaderApp::savebkmks()
1889 { 1889 {
1890 BkmkFile bf((const char *)Global::applicationFileName("uqtreader",reader->m_string), true); 1890 BkmkFile bf((const char *)Global::applicationFileName("uqtreader",reader->m_string), true);
1891 bf.write(*pBkmklist); 1891 bf.write(*pBkmklist);
1892 } 1892 }
1893 m_fBkmksChanged = false; 1893 m_fBkmksChanged = false;
1894} 1894}
@@ -1899,3 +1899,3 @@ void QTReaderApp::readbkmks()
1899 { 1899 {
1900 delete pBkmklist; 1900 delete pBkmklist;
1901 } 1901 }
@@ -1906,6 +1906,6 @@ void QTReaderApp::readbkmks()
1906 { 1906 {
1907 pBkmklist = reader->getbkmklist(); 1907 pBkmklist = reader->getbkmklist();
1908 } 1908 }
1909 if (pBkmklist != NULL) 1909 if (pBkmklist != NULL)
1910 pBkmklist->sort(); 1910 pBkmklist->sort();
1911} 1911}
@@ -1921,24 +1921,24 @@ void QTReaderApp::do_addbkmk(const QString& text)
1921{ 1921{
1922 if (text.isEmpty()) 1922 if (text.isEmpty())
1923 { 1923 {
1924 QMessageBox::information(this, "QTReader", "Need a name for the bookmark\nSelect add again", 1); 1924 QMessageBox::information(this, "OpieReader", "Need a name for the bookmark\nSelect add again", 1);
1925 } 1925 }
1926 else 1926 else
1927 { 1927 {
1928 if (pBkmklist == NULL) pBkmklist = new CList<Bkmk>; 1928 if (pBkmklist == NULL) pBkmklist = new CList<Bkmk>;
1929#ifdef _UNICODE 1929#ifdef _UNICODE
1930 CBuffer buff; 1930 CBuffer buff;
1931 int i = 0; 1931 int i = 0;
1932 for (i = 0; i < text.length(); i++) 1932 for (i = 0; i < text.length(); i++)
1933 { 1933 {
1934 buff[i] = text[i].unicode(); 1934 buff[i] = text[i].unicode();
1935 } 1935 }
1936 buff[i] = 0; 1936 buff[i] = 0;
1937 pBkmklist->push_front(Bkmk(buff.data(), NULL, reader->pagelocate())); 1937 pBkmklist->push_front(Bkmk(buff.data(), NULL, reader->pagelocate()));
1938#else 1938#else
1939 pBkmklist->push_front(Bkmk((const tchar*)text,reader->pagelocate())); 1939 pBkmklist->push_front(Bkmk((const tchar*)text,reader->pagelocate()));
1940#endif 1940#endif
1941 m_fBkmksChanged = true; 1941 m_fBkmksChanged = true;
1942 pBkmklist->sort(); 1942 pBkmklist->sort();
1943 } 1943 }
1944} 1944}
@@ -1949,4 +1949,4 @@ void QTReaderApp::OnRedraw()
1949 { 1949 {
1950 bool found = findNextBookmark(reader->pagelocate()); 1950 bool found = findNextBookmark(reader->pagelocate());
1951 m_bkmkAvail->setEnabled(found); 1951 m_bkmkAvail->setEnabled(found);
1952 } 1952 }
@@ -1969,12 +1969,12 @@ void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString&
1969 { 1969 {
1970 QClipboard* cb = QApplication::clipboard(); 1970 QClipboard* cb = QApplication::clipboard();
1971 cb->setText(wrd); 1971 cb->setText(wrd);
1972 if (wrd.length() > 10) 1972 if (wrd.length() > 10)
1973 { 1973 {
1974 Global::statusMessage(wrd.left(8) + ".."); 1974 Global::statusMessage(wrd.left(8) + "..");
1975 } 1975 }
1976 else 1976 else
1977 { 1977 {
1978 Global::statusMessage(wrd); 1978 Global::statusMessage(wrd);
1979 } 1979 }
1980 } 1980 }
@@ -1982,8 +1982,8 @@ void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString&
1982 { 1982 {
1983 //addAnno(wrd, "Need to be able to edit this", posn); 1983// addAnno(wrd, "Need to be able to edit this", posn);
1984 m_annoWin->setName(line); 1984 m_annoWin->setName(line);
1985 m_annoWin->setAnno(""); 1985 m_annoWin->setAnno("");
1986 m_annoWin->setPosn(posn); 1986 m_annoWin->setPosn(posn);
1987 m_annoIsEditing = true; 1987 m_annoIsEditing = true;
1988 editorStack->raiseWidget( m_annoWin ); 1988 editorStack->raiseWidget( m_annoWin );
1989 } 1989 }
@@ -1991,7 +1991,7 @@ void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString&
1991 { 1991 {
1992 if (!m_targetapp.isEmpty() && !m_targetmsg.isEmpty()) 1992 if (!m_targetapp.isEmpty() && !m_targetmsg.isEmpty())
1993 { 1993 {
1994 QCopEnvelope e(("QPE/Application/"+m_targetapp).utf8(), (m_targetmsg+"(QString)").utf8()); 1994 QCopEnvelope e(("QPE/Application/"+m_targetapp).utf8(), (m_targetmsg+"(QString)").utf8());
1995 e << wrd; 1995 e << wrd;
1996 } 1996 }
1997 } 1997 }
@@ -2003,23 +2003,23 @@ void QTReaderApp::OnActionPressed()
2003 { 2003 {
2004 case cesOpenFile: 2004 case cesOpenFile:
2005 { 2005 {
2006 fileOpen(); 2006 fileOpen();
2007 } 2007 }
2008 break; 2008 break;
2009 case cesAutoScroll: 2009 case cesAutoScroll:
2010 { 2010 {
2011 reader->setautoscroll(!reader->m_autoScroll); 2011 reader->setautoscroll(!reader->m_autoScroll);
2012 setScrollState(reader->m_autoScroll); 2012 setScrollState(reader->m_autoScroll);
2013 } 2013 }
2014 break; 2014 break;
2015 case cesActionMark: 2015 case cesActionMark:
2016 { 2016 {
2017 addbkmk(); 2017 addbkmk();
2018 } 2018 }
2019 break; 2019 break;
2020 default: 2020 default:
2021 { 2021 {
2022 qDebug("Unknown ActionType:%u", m_spaceTarget); 2022 qDebug("Unknown ActionType:%u", m_spaceTarget);
2023 } 2023 }
2024 break; 2024 break;
2025 } 2025 }