summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/ppm_expander.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/ppm_expander.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/ppm_expander.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/ppm_expander.h b/noncore/apps/opie-reader/ppm_expander.h
index ccc89c2..c5f8a17 100644
--- a/noncore/apps/opie-reader/ppm_expander.h
+++ b/noncore/apps/opie-reader/ppm_expander.h
@@ -1,61 +1,64 @@
1#ifndef __ppm_expander_h 1#ifndef __ppm_expander_h
2#define __ppm_expander_h 2#define __ppm_expander_h
3 3
4#include "CExpander.h" 4#include "CExpander.h"
5#include <sys/stat.h> 5#include <sys/stat.h>
6 6
7 7
8#include "utypes.h" 8#include "utypes.h"
9#include "ppm.h" 9#include "ppm.h"
10#include "arith.h"
11 10
11class PPM_ReadBuf;
12 12
13#define SYM_EOF 256 13#define SYM_EOF 256
14 14
15class ppm_expander : public CExpander { 15class ppm_expander : public CExpander {
16 UCHAR *buf_in,*buf_out; 16 UCHAR *buf_in,*buf_out;
17 unsigned int bufsize; 17 unsigned int bufsize;
18 unsigned int outbytes; 18 unsigned int outbytes;
19 unsigned long blocksize; 19 unsigned long blocksize;
20 unsigned short numblocks; 20 unsigned short numblocks;
21 unsigned short curblock; 21 unsigned short curblock;
22 unsigned short maxnode; 22 unsigned short maxnode;
23 bool needppmend; 23 bool needppmend;
24 int home(); 24 int home();
25 FILE* my_file_in; 25 FILE* my_file_in;
26 PPM_ReadBuf* my_read_buf; 26 PPM_ReadBuf* my_read_buf;
27 ppm_worker ppm; 27 ppm_worker ppm;
28public: 28public:
29 QString about() { return QString("ppms Codec (c) Tim Wentford\nCompression code (c) Fabrice Bellard"); } 29 QString about() { return QString("ppms Codec (c) Tim Wentford\nCompression code (c) Fabrice Bellard"); }
30#ifdef USEQPE 30#ifdef USEQPE
31 void suspend() 31 void suspend()
32 { 32 {
33 CExpander::suspend(my_file_in); 33 CExpander::suspend(my_file_in);
34 } 34 }
35 void unsuspend() 35 void unsuspend()
36 { 36 {
37 CExpander::unsuspend(my_file_in); 37 CExpander::unsuspend(my_file_in);
38 } 38 }
39#else
40 void suspend() {}
41 void unsuspend() {}
39#endif 42#endif
40 ppm_expander() : needppmend(false), my_file_in(NULL), my_read_buf(NULL) 43 ppm_expander() : needppmend(false), my_file_in(NULL), my_read_buf(NULL)
41 { 44 {
42 bufsize = 1024; 45 bufsize = 1024;
43 buf_in = new UCHAR[bufsize]; 46 buf_in = new UCHAR[bufsize];
44 buf_out = new UCHAR[bufsize]; 47 buf_out = new UCHAR[bufsize];
45 outbytes = 0; 48 outbytes = 0;
46 } 49 }
47 int OpenFile(const char* infile); 50 int OpenFile(const char* infile);
48 int getch(); 51 int getch();
49 void locate(unsigned short block, unsigned int n); 52 void locate(unsigned short block, unsigned int n);
50 virtual ~ppm_expander(); 53 virtual ~ppm_expander();
51 unsigned int locate() { return outbytes; } 54 unsigned int locate() { return outbytes; }
52 void locate(unsigned int n); 55 void locate(unsigned int n);
53 bool hasrandomaccess() { return (numblocks > 1); } 56 bool hasrandomaccess() { return (numblocks > 1); }
54 void sizes(unsigned long& file, unsigned long& text); 57 void sizes(unsigned long& file, unsigned long& text);
55 MarkupType PreferredMarkup() 58 MarkupType PreferredMarkup()
56 { 59 {
57 return cTEXT; 60 return cTEXT;
58 } 61 }
59}; 62};
60 63
61#endif 64#endif