summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/QTReader.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/QTReader.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReader.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/noncore/apps/opie-reader/QTReader.cpp b/noncore/apps/opie-reader/QTReader.cpp
index 03c8fbe..d64abb4 100644
--- a/noncore/apps/opie-reader/QTReader.cpp
+++ b/noncore/apps/opie-reader/QTReader.cpp
@@ -1,55 +1,48 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 4** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
5** 5**
6** This file is part of an example program for Qt. This example 6** This file is part of an example program for Qt. This example
7** program may be used, distributed and modified without limitation. 7** program may be used, distributed and modified without limitation.
8** 8**
9*****************************************************************************/ 9*****************************************************************************/
10 10
11#include "useqpe.h"
12#include <qpainter.h>
13#include <qimage.h>
14#include <qtimer.h>
15#include "config.h"
16#include "QTReader.h" 11#include "QTReader.h"
17#include "QTReaderApp.h" 12#include "QTReaderApp.h"
18#include "CDrawBuffer.h"
19#ifdef USEQPE 13#ifdef USEQPE
20#include <qpe/qpeapplication.h> 14#include <qpe/qpeapplication.h>
21#endif 15#endif
22#include <math.h> 16#include <math.h>
23#include <ctype.h> 17#include <ctype.h>
24#include <stdio.h> //for sprintf 18#include <stdio.h> //for sprintf
25#ifdef USEQPE 19#ifdef USEQPE
26#include <qpe/config.h> 20#include <qpe/config.h>
27#include <qpe/applnk.h> 21#include <qpe/applnk.h>
28#include <qpe/global.h> 22#include <qpe/global.h>
29#include <qpe/qcopenvelope_qws.h> 23#include <qpe/qcopenvelope_qws.h>
30#endif 24#endif
31#include <qfontdatabase.h>
32 25
33#ifdef _UNICODE 26#ifdef _UNICODE
34const char *QTReader::fonts[] = { "unifont", "Courier", "Times", 0 }; 27const char *QTReader::fonts[] = { "unifont", "Courier", "Times", 0 };
35#else 28#else
36const char *QTReader::fonts[] = { "Helvetica", "Courier", "Times", 0 }; 29const char *QTReader::fonts[] = { "Helvetica", "Courier", "Times", 0 };
37#endif 30#endif
38//const int QTReader::fontsizes[] = { 8, 10, 12, 14, 18, 24, 30, 40, 50, 60, 70, 80, 90, 100, 0 }; 31//const int QTReader::fontsizes[] = { 8, 10, 12, 14, 18, 24, 30, 40, 50, 60, 70, 80, 90, 100, 0 };
39 32
40//const tchar *QTReader::fonts[] = { "unifont", "fixed", "micro", "smoothtimes", "Courier", "Times", 0 }; 33//const tchar *QTReader::fonts[] = { "unifont", "fixed", "micro", "smoothtimes", "Courier", "Times", 0 };
41//const int QTReader::fontsizes[] = {10,16,17,22,0}; 34//const int QTReader::fontsizes[] = {10,16,17,22,0};
42//const tchar *QTReader::fonts[] = { "verdana", "Courier", "Times", 0 }; 35//const tchar *QTReader::fonts[] = { "verdana", "Courier", "Times", 0 };
43//const int QTReader::fontsizes[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,0}; 36//const int QTReader::fontsizes[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,0};
44 37
45tchar QTReader::pluckernextpart[] = { 'C','l','i','c','k',' ','h','e','r','e',' ','f','o','r',' ','t','h','e',' ','n','e','x','t',' ','p','a','r','t',0 }; 38tchar QTReader::pluckernextpart[] = { 'C','l','i','c','k',' ','h','e','r','e',' ','f','o','r',' ','t','h','e',' ','n','e','x','t',' ','p','a','r','t',0 };
46tchar QTReader::jplucknextpart[] = { 'N','e','x','t',' ','P','a','r','t',' ','>','>',0 }; 39tchar QTReader::jplucknextpart[] = { 'N','e','x','t',' ','P','a','r','t',' ','>','>',0 };
47//tchar QTReader::jplucknextpart[] = { 10,'#',10,'N','e','x','t',' ','P','a','r','t',' ','>','>',0 }; 40//tchar QTReader::jplucknextpart[] = { 10,'#',10,'N','e','x','t',' ','P','a','r','t',' ','>','>',0 };
48 41
49QTReader::QTReader( QWidget *parent, const char *name, WFlags f) : 42QTReader::QTReader( QWidget *parent, const char *name, WFlags f) :
50 QWidget(parent, name, f), 43 QWidget(parent, name, f),
51 m_delay(100), 44 m_delay(100),
52 m_scrolldy1(0), 45 m_scrolldy1(0),
53 m_scrolldy2(0), 46 m_scrolldy2(0),
54 m_autoScroll(false), 47 m_autoScroll(false),
55 //textarray(NULL), 48 //textarray(NULL),
@@ -427,50 +420,48 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e )
427 } 420 }
428 } 421 }
429 else 422 else
430 { 423 {
431 mouseUpOn = true; 424 mouseUpOn = true;
432 } 425 }
433 } 426 }
434} 427}
435 428
436void QTReader::focusInEvent(QFocusEvent* e) 429void QTReader::focusInEvent(QFocusEvent* e)
437{ 430{
438 if (m_autoScroll) timer->start(real_delay(), false); 431 if (m_autoScroll) timer->start(real_delay(), false);
439 update(); 432 update();
440} 433}
441 434
442void QTReader::focusOutEvent(QFocusEvent* e) 435void QTReader::focusOutEvent(QFocusEvent* e)
443{ 436{
444 if (m_autoScroll) 437 if (m_autoScroll)
445 { 438 {
446 timer->stop(); 439 timer->stop();
447 //m_scrolldy1 = m_scrolldy2 = 0; 440 //m_scrolldy1 = m_scrolldy2 = 0;
448 } 441 }
449} 442}
450 443
451#include <qapplication.h>
452#include <qdrawutil.h>
453#ifndef _WINDOWS 444#ifndef _WINDOWS
454#include <unistd.h> 445#include <unistd.h>
455#endif 446#endif
456 447
457void QTReader::goDown() 448void QTReader::goDown()
458{ 449{
459 if (m_bpagemode) 450 if (m_bpagemode)
460 { 451 {
461 dopagedn(); 452 dopagedn();
462 } 453 }
463 else 454 else
464 { 455 {
465 lineDown(); 456 lineDown();
466 } 457 }
467} 458}
468 459
469void QTReader::goUp() 460void QTReader::goUp()
470{ 461{
471 if (m_bpagemode) 462 if (m_bpagemode)
472 { 463 {
473 dopageup(); 464 dopageup();
474 } 465 }
475 else 466 else
476 { 467 {