From 6bfdfc1c4fab71196b0d40f08c209d7819874686 Mon Sep 17 00:00:00 2001 From: groucho Date: Wed, 07 May 2003 14:10:02 +0000 Subject: Hopefully things are now fixed in CVS --- (limited to 'noncore/apps/opie-reader') diff --git a/noncore/apps/opie-reader/CEncoding_tables.cpp b/noncore/apps/opie-reader/CEncoding_tables.cpp new file mode 100644 index 0000000..667bda0 --- a/dev/null +++ b/noncore/apps/opie-reader/CEncoding_tables.cpp @@ -0,0 +1,534 @@ +#include "CEncoding_tables.h" +#include "config.h" + +static const unicodetable unicodevalues[] = { + // from RFC 1489, ftp://ftp.isi.edu/in-notes/rfc1489.txt + { "KOI8-R", "KOI8-R", 2084, + { 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, + 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, + 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219/**/, 0x221A, 0x2248, + 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7, + 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, + 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x255C, 0x255D, 0x255E, + 0x255F, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, + 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x256B, 0x256C, 0x00A9, + 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, + 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, + 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, + 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A, + 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, + 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, + 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, + 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A } }, + // /**/ - The BULLET OPERATOR is confused. Some people think + // it should be 0x2022 (BULLET). + + // from RFC 2319, ftp://ftp.isi.edu/in-notes/rfc2319.txt + { "KOI8-U", "KOI8-U", 2088, + { 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, + 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, + 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248, + 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7, + 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, + 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x0491, 0x255D, 0x255E, + 0x255F, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407, + 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x0490, 0x256C, 0x00A9, + 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, + 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, + 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, + 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A, + 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, + 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, + 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, + 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A } }, + + // next bits generated from tables on the Unicode 2.0 CD. we can + // use these tables since this is part of the transition to using + // unicode everywhere in qt. + + // $ for A in 8 9 A B C D E F ; do for B in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; do echo 0x${A}${B} 0xFFFD ; done ; done > /tmp/digits ; for a in 8859-* ; do ( awk '/^0x[89ABCDEF]/{ print $1, $2 }' < $a ; cat /tmp/digits ) | sort | uniq -w4 | cut -c6- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/$a ; done + + // then I inserted the files manually. + { "ISO-8859-2", "ISO 8859-2", 5, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, + 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, + 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, + 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C, + 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, + 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, + 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, + 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, + 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, + 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, + 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, + 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9} }, + { "ISO-8859-3", "ISO 8859-3", 6, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0xFFFD, 0x0124, 0x00A7, + 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0xFFFD, 0x017B, + 0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7, + 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0xFFFD, 0x017C, + 0x00C0, 0x00C1, 0x00C2, 0xFFFD, 0x00C4, 0x010A, 0x0108, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0xFFFD, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7, + 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0xFFFD, 0x00E4, 0x010B, 0x0109, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0xFFFD, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x0121, 0x00F6, 0x00F7, + 0x011D, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x016D, 0x015D, 0x02D9} }, + { "ISO-8859-4", "ISO 8859-4", 7, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7, + 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF, + 0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7, + 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B, + 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, + 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A, + 0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF, + 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, + 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B, + 0x0111, 0x0146, 0x014D, 0x0137, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x0169, 0x016B, 0x02D9} }, + { "ISO-8859-5", "ISO 8859-5", 8, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, + 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F, + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00A7, 0x045E, 0x045F} }, + { "ISO-8859-6", "ISO 8859-6", 82, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0xFFFD, 0xFFFD, 0xFFFD, 0x00A4, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x060C, 0x00AD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0x061B, 0xFFFD, 0xFFFD, 0xFFFD, 0x061F, + 0xFFFD, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, + 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, + 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, + 0x0638, 0x0639, 0x063A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, + 0x0648, 0x0649, 0x064A, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, + 0x0650, 0x0651, 0x0652, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} }, + { "ISO-8859-7", "ISO 8859-7", 10, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x2018, 0x2019, 0x00A3, 0xFFFD, 0xFFFD, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0xFFFD, 0x2015, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7, + 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F, + 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, + 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, + 0x03A0, 0x03A1, 0xFFFD, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, + 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, + 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0xFFFD} }, + { "ISO-8859-8-I", "ISO 8859-8-I", 85, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0xFFFD, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x203E, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x2017, + 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, + 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, + 0x05E8, 0x05E9, 0x05EA, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} }, + { "ISO-8859-9", "ISO 8859-9", 12, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF} }, + { "ISO-8859-10", "ISO 8859-10", 13, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, + 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A, + 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, + 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B, + 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, + 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF, + 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, + 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, + 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, + 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169, + 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138} }, + { "ISO-8859-13", "ISO 8859-13", 109, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x201D, 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, + 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, + 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, + 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, + 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, + 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, + 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, + 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, + 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, + 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, + 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019} }, + { "ISO-8859-14", "ISO 8859-14", 110, + { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x1E02, 0x1E03, 0x00A3, 0x010A, 0x010B, 0x1E0A, 0x00A7, + 0x1E80, 0x00A9, 0x1E82, 0x1E0B, 0x1EF2, 0x00AD, 0x00AE, 0x0178, + 0x1E1E, 0x1E1F, 0x0120, 0x0121, 0x1E40, 0x1E41, 0x00B6, 0x1E56, + 0x1E81, 0x1E57, 0x1E83, 0x1E60, 0x1EF3, 0x1E84, 0x1E85, 0x1E61, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x0174, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x1E6A, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x0176, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF} }, + + // next bits generated again from tables on the Unicode 3.0 CD. + + // $ for a in CP* ; do ( awk '/^0x[89ABCDEF]/{ print $1, $2 }' < $a ) | sort | sed -e 's/#UNDEF.*$/0xFFFD/' | cut -c6- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/$a ; done + + { "CP 850", "IBM 850", 2009, + { 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, + 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, + 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, + 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0, + 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, + 0x00F0, 0x00D0, 0x00CA, 0x00CB, 0x00C8, 0x0131, 0x00CD, 0x00CE, + 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580, + 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x00FE, + 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4, + 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, + 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0} }, + { "CP 874", "CP 874", 0, //### what is the mib? + { 0x20AC, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x2026, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, + 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F, + 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, + 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F, + 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, + 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F, + 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, + 0x0E38, 0x0E39, 0x0E3A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0E3F, + 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, + 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F, + 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, + 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} }, + { "IBM 866", "IBM 866", 2086, + { 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, + 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, + 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040E, 0x045E, + 0x00B0, 0x2219, 0x00B7, 0x221A, 0x2116, 0x00A4, 0x25A0, 0x00A0} }, + + { "windows-1250", "CP 1250", 2250, + { 0x20AC, 0xFFFD, 0x201A, 0xFFFD, 0x201E, 0x2026, 0x2020, 0x2021, + 0xFFFD, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0xFFFD, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A, + 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B, + 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C, + 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, + 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, + 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, + 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, + 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, + 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, + 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, + 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9} }, + { "windows-1251", "CP 1251", 2251, + { 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, + 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, + 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0xFFFD, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F, + 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7, + 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407, + 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7, + 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457, + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F} }, + { "windows-1252", "CP 1252", 2252, + { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0xFFFD, 0x017D, 0xFFFD, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0xFFFD, 0x017E, 0x0178, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF} }, + { "windows-1253", "CP 1253", 2253, + { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0xFFFD, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0xFFFD, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7, + 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F, + 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, + 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, + 0x03A0, 0x03A1, 0xFFFD, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, + 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, + 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0xFFFD} }, + { "windows-1254", "CP 1254", 2254, + { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0xFFFD, 0xFFFD, 0x0178, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF} }, + { "windows-1255", "CP 1255", 2255, + { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, + 0x05B8, 0x05B9, 0xFFFD, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF, + 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3, + 0x05F4, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, + 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, + 0x05E8, 0x05E9, 0x05EA, 0xFFFD, 0xFFFD, 0x200E, 0x200F, 0xFFFD} }, + { "windows-1256", "CP 1256", 2256, + { 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688, + 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA, + 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F, + 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, + 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, + 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7, + 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643, + 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF, + 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7, + 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2} }, + { "windows-1257", "CP 1257", 2257, + { 0x20AC, 0xFFFD, 0x201A, 0xFFFD, 0x201E, 0x2026, 0x2020, 0x2021, + 0xFFFD, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0x00A8, 0x02C7, 0x00B8, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0xFFFD, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0x00AF, 0x02DB, 0xFFFD, + 0x00A0, 0xFFFD, 0x00A2, 0x00A3, 0x00A4, 0xFFFD, 0x00A6, 0x00A7, + 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, + 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, + 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, + 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, + 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, + 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, + 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, + 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, + 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9} }, + { "windows-1258", "CP 1258", 2258, + { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0xFFFD, 0x2039, 0x0152, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0xFFFD, 0x203A, 0x0153, 0xFFFD, 0xFFFD, 0x0178, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x0300, 0x00CD, 0x00CE, 0x00CF, + 0x0110, 0x00D1, 0x0309, 0x00D3, 0x00D4, 0x01A0, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x01AF, 0x0303, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0301, 0x00ED, 0x00EE, 0x00EF, + 0x0111, 0x00F1, 0x0323, 0x00F3, 0x00F4, 0x01A1, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x01B0, 0x20AB, 0x00FF} }, + + { "Apple Roman", "Apple Roman", 0, + { 0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1, + 0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8, + 0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3, + 0x00F2, 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, 0x00FB, 0x00FC, + 0x2020, 0x00B0, 0x00A2, 0x00A3, 0x00A7, 0x2022, 0x00B6, 0x00DF, + 0x00AE, 0x00A9, 0x2122, 0x00B4, 0x00A8, 0x2260, 0x00C6, 0x00D8, + 0x221E, 0x00B1, 0x2264, 0x2265, 0x00A5, 0x00B5, 0x2202, 0x2211, + 0x220F, 0x03C0, 0x222B, 0x00AA, 0x00BA, 0x03A9, 0x00E6, 0x00F8, + 0x00BF, 0x00A1, 0x00AC, 0x221A, 0x0192, 0x2248, 0x2206, 0x00AB, + 0x00BB, 0x2026, 0x00A0, 0x00C0, 0x00C3, 0x00D5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x25CA, + 0x00FF, 0x0178, 0x2044, 0x20AC, 0x2039, 0x203A, 0xFB01, 0xFB02, + 0x2021, 0x00B7, 0x201A, 0x201E, 0x2030, 0x00C2, 0x00CA, 0x00C1, + 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x00D3, 0x00D4, + 0xF8FF, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC, + 0x00AF, 0x02D8, 0x02D9, 0x02DA, 0x00B8, 0x02DD, 0x02DB, 0x02C7} }, + + + + // This one is based on the charmap file + // /usr/share/i18n/charmaps/SAMI-WS2.gz, which is manually adapted + // to this format by Børre Gaup + { "WINSAMI2", "WS2", 0, + { 0x20AC, 0xFFFD, 0x010C, 0x0192, 0x010D, 0x01B7, 0x0292, 0x01EE, + 0x01EF, 0x0110, 0x0160, 0x2039, 0x0152, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x0111, 0x01E6, 0x0161, 0x203A, 0x0153, 0xFFFD, 0xFFFD, 0x0178, + 0x00A0, 0x01E7, 0x01E4, 0x00A3, 0x00A4, 0x01E5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x021E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x021F, + 0x00B0, 0x00B1, 0x01E8, 0x01E9, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x014A, 0x014B, 0x0166, 0x00BB, 0x0167, 0x00BD, 0x017D, 0x017E, + 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, + 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, + 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF} }, + + + // this one is generated from the charmap file located in /usr/share/i18n/charmaps + // on most Linux distributions. The thai character set tis620 is byte by byte equivalent + // to iso8859-11, so we name it 8859-11 here, but recognise the name tis620 too. + + // $ for A in 8 9 A B C D E F ; do for B in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; do echo x${A}${B} 0xFFFD ; done ; done > /tmp/digits ; ( cut -c25- < TIS-620 ; cat /tmp/digits ) | awk '/^x[89ABCDEF]/{ print $1, $2 }' | sed -e 's///' | sort | uniq -w4 | cut -c5- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/tis-620 + { "TIS-620", "ISO 8859-11", 2259, // Thai character set mib enum taken from tis620 (which is byte by byte equivalent) + { 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, + 0xFFFD, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, + 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F, + 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, + 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F, + 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, + 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F, + 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, + 0x0E38, 0x0E39, 0x0E3A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0E3F, + 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, + 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F, + 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, + 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} }, + + // if you add more chacater sets at the end, change LAST_MIB above +}; + +const unicodetable& unicodetable::iterator::operator*() +{ + return unicodevalues[offset]; +} + +const unicodetable* unicodetable::iterator::operator->() +{ + return unicodevalues+offset; +} + +unsigned short unicodetable::unicodevalue(int offset, unsigned short c) +{ + if (c > 127 && c < 256) + return unicodevalues[offset].values[c-128]; + else + return c; +} diff --git a/noncore/apps/opie-reader/CEncoding_tables.h b/noncore/apps/opie-reader/CEncoding_tables.h new file mode 100644 index 0000000..eb8744f --- a/dev/null +++ b/noncore/apps/opie-reader/CEncoding_tables.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** $Id$ +** +** Implementation of QTextCodec class +** +** Created : 981015 +** +** Copyright (C) 1998-2002 Trolltech AS. All rights reserved. +** +** This file is part of the tools module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + + +#ifndef __CENCODING_TABLES_H +#define __CENCODING_TABLES_H + +struct unicodetable +{ + const char *mime; + const char * cs; + int mib; + unsigned short values[128]; + class iterator + { + int offset; + public: + iterator(int _i) : offset(_i) {} + const unicodetable& operator*(); + const unicodetable* operator->(); + iterator& operator++() { offset++; return *this; } + iterator& operator++(int) { offset++; return *this; } + bool operator!=(const iterator& rhs) { return (offset != rhs.offset); } + int reference() { return offset; } + }; + static iterator begin() { return iterator(0); } + static iterator end() { return iterator(28); } + static unsigned short unicodevalue(int offset, unsigned short c); +}; + +#endif diff --git a/noncore/apps/opie-reader/CloseDialog.cpp b/noncore/apps/opie-reader/CloseDialog.cpp new file mode 100644 index 0000000..741fa67 --- a/dev/null +++ b/noncore/apps/opie-reader/CloseDialog.cpp @@ -0,0 +1,18 @@ +#include "CloseDialog.h" +#include "qlayout.h" + +CCloseDialog::CCloseDialog(const QString& fname, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) +{ + setCaption(tr("Tidy-up")); + QVBoxLayout *tmp = new QVBoxLayout(this); + QVButtonGroup* vb = new QVButtonGroup(tr("Delete"), this); + tmp->addWidget(vb); + QString filestring = tr("Delete") + " " + fname; + file = new QCheckBox(filestring, vb); + marks = new QCheckBox(tr("Delete Bookmarks"), vb); + config = new QCheckBox(tr("Delete Configuration"), vb); + file->setChecked(false); + marks->setChecked(true); + config->setChecked(true); + if (fs) showMaximized(); +} diff --git a/noncore/apps/opie-reader/CloseDialog.h b/noncore/apps/opie-reader/CloseDialog.h new file mode 100644 index 0000000..62e6423 --- a/dev/null +++ b/noncore/apps/opie-reader/CloseDialog.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'Prefs.ui' +** +** Created: Tue Feb 11 23:53:32 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef __CLOSEDIALOG_H +#define __CLOSEDIALOG_H + +#include "useqpe.h" +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include + +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +//class QCheckBox; +class QLabel; +//class QSpinBox; + +class CCloseDialog : public QDialog +{ +Q_OBJECT + QCheckBox *file, *marks, *config; +#ifndef USEQPE + void keyPressEvent(QKeyEvent* e) + { + switch (e->key()) + { + case Key_Escape: + e->accept(); + reject(); + break; + case Key_Space: + case Key_Return: + e->accept(); + accept(); + break; + default: + QWidget::keyPressEvent(e); + } + } +#endif + public: + CCloseDialog(const QString&, bool fs = true, QWidget* parent = 0, const char* name = 0); + ~CCloseDialog() {} + bool delFile() { return file->isChecked(); } + bool delMarks() { return marks->isChecked(); } + bool delConfig() { return config->isChecked(); } + +}; +#endif // CPREFS_H diff --git a/noncore/apps/opie-reader/FixedFont.h b/noncore/apps/opie-reader/FixedFont.h new file mode 100755 index 0000000..8b67ffc --- a/dev/null +++ b/noncore/apps/opie-reader/FixedFont.h @@ -0,0 +1,6 @@ +#ifndef __FIXEDFONT_H +#define __FIXEDFONT_H + +#define FIXEDFONT "courier" + +#endif diff --git a/noncore/apps/opie-reader/Prefs.cpp b/noncore/apps/opie-reader/Prefs.cpp new file mode 100644 index 0000000..825608e --- a/dev/null +++ b/noncore/apps/opie-reader/Prefs.cpp @@ -0,0 +1,636 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'Prefs.ui' +** +** Created: Tue Feb 11 23:53:35 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "useqpe.h" +#include "Prefs.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef USEQPE +#include +#include +#else +#include +#endif + +CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QHBoxLayout* hb = new QHBoxLayout(this); + QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Text", this); + hb->addWidget(bg); + + StripCR = new QCheckBox( bg ); + StripCR->setText( tr( "Strip CR" ) ); + + Dehyphen = new QCheckBox( bg ); + Dehyphen->setText( tr( "Dehyphen" ) ); + + SingleSpace = new QCheckBox( bg ); + SingleSpace->setText( tr( "Single Space" ) ); + + Unindent = new QCheckBox( bg ); + Unindent->setText( tr( "Unindent" ) ); + + Reparagraph = new QCheckBox( bg ); + Reparagraph->setText( tr( "Reparagraph" ) ); + + DoubleSpace = new QCheckBox( bg ); + DoubleSpace->setText( tr( "Double Space" ) ); + + Remap = new QCheckBox( bg ); + Remap->setText( tr( "Remap" ) ); + + Embolden = new QCheckBox( bg ); + Embolden->setText( tr( "Embolden" ) ); + + FullJustify = new QCheckBox( bg ); + FullJustify->setText( tr( "Full Justify" ) ); + +} + +/* + * Destroys the object and frees any allocated resources + */ +CLayoutPrefs::~CLayoutPrefs() +{ + // no need to delete child widgets, Qt does it all for us +} + + + +CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + + QVBoxLayout* vb = new QVBoxLayout(this); + QGridLayout* gl = new QGridLayout(vb, 4, 3); + + QLabel *TextLabel; + + TextLabel = new QLabel( this, "TextLabel1" ); + TextLabel->setText( tr( "Indent" ) ); + gl->addWidget(TextLabel, 0, 0); + + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Page\nOverlap" ) ); + gl->addWidget(TextLabel, 0, 1); + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Graphics\nZoom" ) ); + gl->addWidget(TextLabel, 0, 2); + + Indent = new QSpinBox( this, "Indent" ); + Indent->setRange(0,20); + gl->addWidget(Indent, 1, 0); + + pageoverlap = new QSpinBox( this ); + pageoverlap->setRange(0,20); + gl->addWidget(pageoverlap, 1, 1); + + gfxzoom = new QSpinBox( this ); + gfxzoom->setRange(0,100); + gl->addWidget(gfxzoom, 1, 2); + + TextLabel = new QLabel( this, "TextLabel4" ); + TextLabel->setText( tr( "Margin" ) ); + gl->addWidget(TextLabel, 2, 0); + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Paragraph\nLeading" ) ); + gl->addWidget(TextLabel, 2, 1); + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Line\nLeading" ) ); + gl->addWidget(TextLabel, 2, 2); + + Margin = new QSpinBox( this, "Margin" ); + Margin->setRange(0, 100); + gl->addWidget(Margin, 3, 0); + + ParaLead = new QSpinBox( this ); + ParaLead->setRange(-5, 50); + gl->addWidget(ParaLead, 3, 1); + + LineLead = new QSpinBox( this ); + LineLead->setRange(-5, 50); + gl->addWidget(LineLead, 3, 2); + + gl = new QGridLayout(vb, 2, 2); + + TextLabel = new QLabel( this); + TextLabel->setText( tr( "Markup" ) ); + gl->addWidget(TextLabel, 0, 0, Qt::AlignBottom); + TextLabel = new QLabel( this); + TextLabel->setText( tr( "Font" ) ); + gl->addWidget(TextLabel, 0, 1, Qt::AlignBottom); + + +#ifdef USECOMBO + Markup = new QComboBox( this); +#else + Markup = new MenuButton( this); +#endif + Markup->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + Markup->insertItem("Auto"); + Markup->insertItem("None"); + Markup->insertItem("Text"); + Markup->insertItem("HTML"); + Markup->insertItem("PML"); + gl->addWidget(Markup, 1, 0, Qt::AlignTop); + +#ifdef USECOMBO + fontselector = new QComboBox( this); +#else + fontselector = new MenuButton( this); +#endif + fontselector->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + { +#ifdef USEQPE + FontDatabase f; +#else + QFontDatabase f; +#endif + QStringList flist = f.families(); + for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) + { + fontselector->insertItem(*nm); + } + } // delete the FontDatabase!!! + gl->addWidget(fontselector, 1, 1, Qt::AlignTop); +} +/* +CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QHBoxLayout* hb = new QHBoxLayout(this); + + QVBoxLayout* vb = new QVBoxLayout; + hb->addLayout(vb); + + QLabel *TextLabel; + + TextLabel = new QLabel( this, "TextLabel1" ); + TextLabel->setText( tr( "Indent" ) ); + vb->addWidget( TextLabel, 0, Qt::AlignBottom ); + Indent = new QSpinBox( this, "Indent" ); + Indent->setRange(0,20); + vb->addWidget( Indent, 0, Qt::AlignLeft ); + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Page\nOverlap" ) ); + vb->addWidget( TextLabel, 0, Qt::AlignBottom ); + pageoverlap = new QSpinBox( this ); + pageoverlap->setRange(0,20); + vb->addWidget( pageoverlap, 0, Qt::AlignLeft ); + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Graphics\nZoom" ) ); + vb->addWidget( TextLabel, 0, Qt::AlignBottom ); + gfxzoom = new QSpinBox( this ); + gfxzoom->setRange(0,100); + vb->addWidget( gfxzoom, 0, Qt::AlignLeft ); + + vb->addStretch(); + + vb = new QVBoxLayout; + hb->addLayout(vb); + + TextLabel = new QLabel( this, "TextLabel4" ); + TextLabel->setText( tr( "Margin" ) ); + vb->addWidget( TextLabel, 0, Qt::AlignBottom ); + Margin = new QSpinBox( this, "Margin" ); + Margin->setRange(0, 100); + vb->addWidget( Margin, 0, Qt::AlignLeft ); + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Paragraph\nLeading" ) ); + vb->addWidget( TextLabel, 0, Qt::AlignBottom ); + ParaLead = new QSpinBox( this ); + ParaLead->setRange(-5, 50); + vb->addWidget( ParaLead, 0, Qt::AlignLeft ); + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Line\nLeading" ) ); + vb->addWidget( TextLabel, 0, Qt::AlignBottom ); + LineLead = new QSpinBox( this ); + LineLead->setRange(-5, 50); + vb->addWidget( LineLead, 0, Qt::AlignLeft ); + + vb->addStretch(); + + vb = new QVBoxLayout; + hb->addLayout(vb); + + + TextLabel = new QLabel( this); + TextLabel->setText( tr( "Markup" ) ); + vb->addWidget( TextLabel, 0, Qt::AlignBottom ); + Markup = new MenuButton( this); + Markup->insertItem("Auto"); + Markup->insertItem("None"); + Markup->insertItem("Text"); + Markup->insertItem("HTML"); + Markup->insertItem("PML"); + vb->addWidget( Markup, 0, Qt::AlignLeft ); + + TextLabel = new QLabel( this); + TextLabel->setText( tr( "Font" ) ); + vb->addWidget( TextLabel, 0, Qt::AlignBottom ); + fontselector = new MenuButton( this); + fontselector->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + { + FontDatabase f; + QStringList flist = f.families(); + for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) + { + fontselector->insertItem(*nm); + } + } // delete the FontDatabase!!! + vb->addWidget( fontselector, 0, Qt::AlignLeft ); + + vb->addStretch(); +} +*/ +/* + * Destroys the object and frees any allocated resources + */ +CLayoutPrefs2::~CLayoutPrefs2() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* +CPluckerPrefs::CPluckerPrefs( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + Layout11 = new QVBoxLayout(this); + Layout11->setMargin( 0 ); + + Depluck = new QCheckBox( this, "Depluck" ); + Depluck->setText( tr( "Depluck" ) ); + Layout11->addWidget( Depluck ); + + Dejpluck = new QCheckBox( this, "Dejpluck" ); + Dejpluck->setText( tr( "Dejpluck" ) ); + Layout11->addWidget( Dejpluck ); + + Continuous = new QCheckBox( this, "Continuous" ); + Continuous->setText( tr( "Continuous" ) ); + Layout11->addWidget( Continuous ); + +} + +CPluckerPrefs::~CPluckerPrefs() +{ + // no need to delete child widgets, Qt does it all for us +} +*/ +/* +CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + + QVBoxLayout* Layout11 = new QVBoxLayout(this); + Layout11->setMargin( 0 ); + + + QHBoxLayout* hl = new QHBoxLayout; + + QLabel* TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Action for\nSelect Button" ) ); + hl->addWidget(TextLabel); + + action = new QComboBox( this ); + action->insertItem("Open file"); + action->insertItem("Autoscroll"); + action->insertItem("Mark"); + action->insertItem("Annotate"); + action->insertItem("Fullscreen"); + hl->addWidget( action ); + + Layout11->addLayout(hl); + + hl = new QHBoxLayout; + + TextLabel = new QLabel( this ); + TextLabel->setText( tr( "Dictionary\nApplication" ) ); + hl->addWidget(TextLabel); + target = new QLineEdit(this); + hl->addWidget( target ); + + Layout11->addLayout(hl); + + + QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Selection Target", this); + Layout11->addWidget( bg ); + + annotation = new QCheckBox( bg ); + annotation->setText( tr( "Annotation" ) ); + + dictionary = new QCheckBox( bg ); + dictionary->setText( tr( "Dictionary" ) ); + + clipboard = new QCheckBox( bg ); + clipboard->setText( tr( "Clipboard" ) ); + +} + +CMiscPrefs::~CMiscPrefs() +{ + // no need to delete child widgets, Qt does it all for us +} +*/ + +CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + + QGridLayout* hl = new QGridLayout(this,1,2); + + hl->setMargin( 0 ); + + QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Select Action", this); + hl->addWidget( gb, 0, 0 ); + + annotation = new QCheckBox( gb ); + annotation->setText( tr( "Annotation" ) ); + + dictionary = new QCheckBox( gb ); + dictionary->setText( tr( "Dictionary" ) ); + + clipboard = new QCheckBox( gb ); + clipboard->setText( tr( "Clipboard" ) ); + + QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Plucker", this); + hl->addWidget( bg, 0 , 1 ); + + Depluck = new QCheckBox( bg ); + Depluck->setText( tr( "Depluck" ) ); + + Dejpluck = new QCheckBox( bg ); + Dejpluck->setText( tr( "Dejpluck" ) ); + + Continuous = new QCheckBox( bg ); + Continuous->setText( tr( "Continuous" ) ); + + +/* + + QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Navigation", this); + TextLabel = new QLabel( gb ); + TextLabel->setText( tr( "Overlap" ) ); + QSpinBox* sb = new QSpinBox( gb ); + + Internationalisation + Ideogram/Word + Set Width + Set Encoding + Set Font +*/ +} + +CMiscPrefs::~CMiscPrefs() +{ + // no need to delete child widgets, Qt does it all for us +} + +CPrefs::CPrefs(bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) +{ + setCaption(tr( "OpieReader Settings" ) ); + QTabWidget* td = new QTabWidget(this); + layout = new CLayoutPrefs(this); + layout2 = new CLayoutPrefs2(this); + misc = new CMiscPrefs(this); + button = new CButtonPrefs(this); + inter = new CInterPrefs(this); + td->addTab(layout, tr("Layout")); + td->addTab(layout2, tr("Layout(2)")); + td->addTab(inter, tr("Locale")); + td->addTab(misc, tr("Misc")); + td->addTab(button, tr("Buttons")); + QVBoxLayout* v = new QVBoxLayout(this); + v->addWidget(td); + + if (fs) showMaximized(); +} + + +/* + +Unicode + Ideo/Word + Width + Encoding + +*/ + +#include "CEncoding_tables.h" + +CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QHBoxLayout* hb = new QHBoxLayout(this); + + QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, tr("International"), this); + + hb->addWidget(gb); + + QLabel *TextLabel; + + ideogram = new QCheckBox( gb ); + ideogram->setText( tr( "Ideograms" ) ); + + TextLabel = new QLabel( gb ); + TextLabel->setText( tr( "Ideogram Width" ) ); + ideogramwidth = new QSpinBox( gb ); + ideogramwidth->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + ideogramwidth->setRange(1,200); + + propfontchange = new QCheckBox( gb ); + propfontchange->setText( tr( "Apply font\nto dialogs" ) ); + + TextLabel = new QLabel( gb ); + TextLabel->setText( tr( "Encoding" ) ); +#ifdef USECOMBO + encoding = new QComboBox(gb); +#else + encoding = new MenuButton(gb); +#endif + encoding->insertItem("Ascii"); + encoding->insertItem("UTF-8"); + encoding->insertItem("UCS-2(BE)"); + encoding->insertItem("USC-2(LE)"); + encoding->insertItem("Palm"); + for (unicodetable::iterator iter = unicodetable::begin(); iter != unicodetable::end(); iter++) + { + encoding->insertItem(iter->mime); + } + + QVBoxLayout* vb = new QVBoxLayout; + + gb = new QGroupBox(1, Qt::Horizontal, "Dictionary", this); + + TextLabel = new QLabel( gb ); + TextLabel->setText( tr( "Application" ) ); + application = new QLineEdit(gb); + application->setFixedWidth(80); + + TextLabel = new QLabel( gb ); + TextLabel->setText( tr( "Message" ) ); + message = new QLineEdit(gb); + message->setFixedWidth(80); +// message->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + twotouch = new QCheckBox( gb ); + twotouch->setText( tr( "Two/One\nTouch" ) ); + + SwapMouse = new QCheckBox( gb ); + SwapMouse->setText("Swap Tap\nActions"); + + + vb->addWidget(gb); + +// vb->addStretch(); + hb->addLayout(vb); +} + +CInterPrefs::~CInterPrefs() +{ + // no need to delete child widgets, Qt does it all for us +} + + + +#ifdef USECOMBO +void CButtonPrefs::populate(QComboBox *mb) +#else +void CButtonPrefs::populate(MenuButton *mb) +#endif +{ + mb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + mb->insertItem(""); + mb->insertItem("Open file"); + mb->insertItem("Autoscroll"); + mb->insertItem("Bookmark"); + mb->insertItem("Annotate"); + mb->insertItem("Fullscreen"); + + mb->insertItem("Zoom in"); + mb->insertItem("Zoom out"); + mb->insertItem("Back"); + mb->insertItem("Forward"); + mb->insertItem("Home"); + mb->insertItem("Page up"); + mb->insertItem("Page down"); + mb->insertItem("Line up"); + mb->insertItem("Line down"); + mb->insertItem("Beginning"); + mb->insertItem("End"); +} + +CButtonPrefs::CButtonPrefs( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + + QGridLayout* hl = new QGridLayout(this,10,2); + + hl->setMargin( 0 ); + + QLabel* ql = new QLabel("Escape Button", this); + hl->addWidget(ql, 0, 0, Qt::AlignBottom); +#ifdef USECOMBO + escapeAction = new QComboBox( this ); +#else + escapeAction = new MenuButton( this ); +#endif + populate(escapeAction); + hl->addWidget(escapeAction, 1, 0, Qt::AlignTop | Qt::AlignLeft); + + ql = new QLabel("Space Button", this); + hl->addWidget(ql, 2, 0, Qt::AlignBottom); +#ifdef USECOMBO + spaceAction = new QComboBox( this ); +#else + spaceAction = new MenuButton( this ); +#endif + populate(spaceAction); + hl->addWidget(spaceAction, 3, 0, Qt::AlignTop | Qt::AlignLeft); + + ql = new QLabel("Return Button", this); + hl->addWidget(ql, 2, 1, Qt::AlignBottom); +#ifdef USECOMBO + returnAction = new QComboBox( this ); +#else + returnAction = new MenuButton( this ); +#endif + populate(returnAction); + hl->addWidget(returnAction, 3, 1, Qt::AlignTop | Qt::AlignLeft); + + ql = new QLabel("Left Arrow", this); + hl->addWidget(ql, 4, 0, Qt::AlignBottom); +#ifdef USECOMBO + leftAction = new QComboBox( this ); +#else + leftAction = new MenuButton( this ); +#endif + populate(leftAction); + hl->addWidget(leftAction, 5, 0, Qt::AlignTop | Qt::AlignLeft); + leftScroll = new QCheckBox( tr("Scroll Speed"), this ); + hl->addWidget(leftScroll, 6, 0, Qt::AlignTop | Qt::AlignLeft); + + ql = new QLabel("Right Arrow", this); + hl->addWidget(ql, 4, 1, Qt::AlignBottom); +#ifdef USECOMBO + rightAction = new QComboBox( this ); +#else + rightAction = new MenuButton( this ); +#endif + populate(rightAction); + hl->addWidget(rightAction, 5, 1, Qt::AlignTop | Qt::AlignLeft); + rightScroll = new QCheckBox( tr("Scroll Speed"), this ); + hl->addWidget(rightScroll, 6, 1, Qt::AlignTop | Qt::AlignLeft); + + ql = new QLabel("Down Arrow", this); + hl->addWidget(ql, 7, 0, Qt::AlignBottom); +#ifdef USECOMBO + downAction = new QComboBox( this ); +#else + downAction = new MenuButton( this ); +#endif + populate(downAction); + hl->addWidget(downAction, 8, 0, Qt::AlignTop | Qt::AlignLeft); + downScroll = new QCheckBox( tr("Scroll Speed"), this ); + hl->addWidget(downScroll, 9, 0, Qt::AlignTop | Qt::AlignLeft); + + ql = new QLabel("Up Arrow", this); + hl->addWidget(ql, 7, 1, Qt::AlignBottom); +#ifdef USECOMBO + upAction = new QComboBox( this ); +#else + upAction = new MenuButton( this ); +#endif + populate(upAction); + hl->addWidget(upAction, 8, 1, Qt::AlignTop | Qt::AlignLeft); + upScroll = new QCheckBox( tr("Scroll Speed"), this ); + hl->addWidget(upScroll, 9, 1, Qt::AlignTop | Qt::AlignLeft); +} + +CButtonPrefs::~CButtonPrefs() +{ + // no need to delete child widgets, Qt does it all for us +} diff --git a/noncore/apps/opie-reader/Prefs.h b/noncore/apps/opie-reader/Prefs.h new file mode 100644 index 0000000..37d8c9e --- a/dev/null +++ b/noncore/apps/opie-reader/Prefs.h @@ -0,0 +1,340 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'Prefs.ui' +** +** Created: Tue Feb 11 23:53:32 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef CPREFS_H +#define CPREFS_H +#include "useqpe.h" +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef USEQPE +#include +#endif +//#include "opie.h" + +//#ifdef OPIE +#define USECOMBO +//#endif + +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +//class QCheckBox; +class QLabel; +//class QSpinBox; + +class CLayoutPrefs : public QWidget +{ + +public: + + friend class CPrefs; + + CLayoutPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CLayoutPrefs(); + + QCheckBox* StripCR; + QCheckBox* Dehyphen; + QCheckBox* SingleSpace; + QCheckBox* Unindent; + QCheckBox* Reparagraph; + QCheckBox* DoubleSpace; + QCheckBox* Remap; + QCheckBox* Embolden; + QCheckBox* FullJustify; +}; + +class CLayoutPrefs2 : public QWidget +{ + +public: + + friend class CPrefs; + + CLayoutPrefs2( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CLayoutPrefs2(); + + QSpinBox* ParaLead; + QSpinBox* LineLead; + QSpinBox* Indent; + QSpinBox* Margin, *gfxzoom, *pageoverlap; +#ifdef USECOMBO + QComboBox *Markup, *fontselector; +#else + MenuButton *Markup, *fontselector; +#endif +}; + +/* +class CPluckerPrefs : public QWidget +{ + +public: + + friend class CPrefs; + + CPluckerPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CPluckerPrefs(); + + QCheckBox* Depluck; + QCheckBox* Dejpluck; + QCheckBox* Continuous; +protected: + + QHBoxLayout* Layout5; + QVBoxLayout* Layout11; + QGridLayout* Layout4; + +}; +*/ +class CMiscPrefs : public QWidget +{ + +public: + + friend class CPrefs; + + CMiscPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CMiscPrefs(); + + QCheckBox *annotation, *dictionary, *clipboard; + QCheckBox *Depluck, *Dejpluck, *Continuous; +}; + +class CButtonPrefs : public QWidget +{ +#ifdef USECOMBO + void populate(QComboBox*); +#else + void populate(MenuButton*); +#endif +public: + + friend class CPrefs; + + CButtonPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CButtonPrefs(); + +#ifdef USECOMBO + QComboBox *returnAction, *spaceAction, *escapeAction, *leftAction, *rightAction, *upAction, *downAction; +#else + MenuButton *returnAction, *spaceAction, *escapeAction, *leftAction, *rightAction, *upAction, *downAction; +#endif + QCheckBox *leftScroll, *rightScroll, *upScroll, *downScroll; +}; + +class CInterPrefs : public QWidget +{ + +public: + + friend class CPrefs; + + CInterPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CInterPrefs(); + + QCheckBox *ideogram, *propfontchange, *SwapMouse, *twotouch; +#ifdef USECOMBO + QComboBox* encoding; +#else + MenuButton* encoding; +#endif + QSpinBox* ideogramwidth; + QLineEdit *application, *message; +}; + + +class CPrefs : public QDialog +{ +Q_OBJECT + CLayoutPrefs* layout; + CLayoutPrefs2* layout2; + CMiscPrefs* misc; + CButtonPrefs* button; + CInterPrefs* inter; + + void keyPressEvent(QKeyEvent* e) + { + switch (e->key()) + { + case Key_Escape: + e->accept(); + reject(); + break; + case Key_Space: + case Key_Return: + e->accept(); + accept(); + break; + default: + QWidget::keyPressEvent(e); + } + } + public: + CPrefs(bool fs = true, QWidget* parent = 0, const char* name = 0); + ~CPrefs() + { + } + bool StripCR() { return layout->StripCR->isChecked(); } + bool Dehyphen() { return layout->Dehyphen->isChecked(); } + bool SingleSpace() { return layout->SingleSpace->isChecked(); } + bool Unindent() { return layout->Unindent->isChecked(); } + bool Reparagraph() { return layout->Reparagraph->isChecked(); } + bool DoubleSpace() { return layout->DoubleSpace->isChecked(); } + bool Remap() { return layout->Remap->isChecked(); } + bool Embolden() { return layout->Embolden->isChecked(); } + bool FullJustify() { return layout->FullJustify->isChecked(); } + int ParaLead() { return layout2->ParaLead->value(); } + int LineLead() { return layout2->LineLead->value(); } + int Margin() { return layout2->Margin->value(); } + int Indent() { return layout2->Indent->value(); } + int Markup() { return layout2->Markup->currentItem(); } + QString Font() { return layout2->fontselector->currentText(); } + + + void StripCR(bool v) { layout->StripCR->setChecked(v); } + void Dehyphen(bool v) { layout->Dehyphen->setChecked(v); } + void SingleSpace(bool v) { layout->SingleSpace->setChecked(v); } + void Unindent(bool v) { layout->Unindent->setChecked(v); } + void Reparagraph(bool v) { layout->Reparagraph->setChecked(v); } + void DoubleSpace(bool v) { layout->DoubleSpace->setChecked(v); } + void Remap(bool v) { layout->Remap->setChecked(v); } + void Embolden(bool v) { layout->Embolden->setChecked(v); } + void FullJustify(bool v) { layout->FullJustify->setChecked(v); } + void ParaLead(int v) { layout2->ParaLead->setValue(v); } + void LineLead(int v) { layout2->LineLead->setValue(v); } + void Margin(int v) { layout2->Margin->setValue(v); } + void Indent(int v) { layout2->Indent->setValue(v); } +#ifdef USECOMBO + void Markup(int v) { layout2->Markup->setCurrentItem(v); } +#else + void Markup(int v) { layout2->Markup->select(v); } +#endif +#ifdef USECOMBO + void Font(QString& s) + { + for (int i = 1; i <= layout2->fontselector->count(); i++) + { + if (layout2->fontselector->text(i) == s) + { + layout2->fontselector->setCurrentItem(i); + break; + } + } + } +#else + void Font(QString& s) { layout2->fontselector->select(s); } +#endif + + bool Depluck() { return misc->Depluck->isChecked(); } + void Depluck(bool v) { misc->Depluck->setChecked(v); } + bool Dejpluck() { return misc->Dejpluck->isChecked(); } + void Dejpluck(bool v) { misc->Dejpluck->setChecked(v); } + bool Continuous() { return misc->Continuous->isChecked(); } + void Continuous(bool v) { misc->Continuous->setChecked(v); } + bool SwapMouse() { return inter->SwapMouse->isChecked(); } + void SwapMouse(bool v) { inter->SwapMouse->setChecked(v); } + + + void dictApplication(const QString& v) { inter->application->setText(v); } + QString dictApplication() { return inter->application->text(); } + void dictMessage(const QString& v) { inter->message->setText(v); } + QString dictMessage() { return inter->message->text(); } + + void miscannotation(bool v) { misc->annotation->setChecked(v); } + void miscdictionary(bool v) { misc->dictionary->setChecked(v); } + void miscclipboard(bool v) { misc->clipboard->setChecked(v); } + bool miscannotation() { return misc->annotation->isChecked(); } + bool miscdictionary() { return misc->dictionary->isChecked(); } + bool miscclipboard() { return misc->clipboard->isChecked(); } + + int spaceAction() { return button->spaceAction->currentItem(); } +#ifdef USECOMBO + void spaceAction(int v) { button->spaceAction->setCurrentItem(v); } +#else + void spaceAction(int v) { button->spaceAction->select(v); } +#endif + int escapeAction() { return button->escapeAction->currentItem(); } +#ifdef USECOMBO + void escapeAction(int v) { button->escapeAction->setCurrentItem(v); } +#else + void escapeAction(int v) { button->escapeAction->select(v); } +#endif + int returnAction() { return button->returnAction->currentItem(); } +#ifdef USECOMBO + void returnAction(int v) { button->returnAction->setCurrentItem(v); } +#else + void returnAction(int v) { button->returnAction->select(v); } +#endif + int leftAction() { return button->leftAction->currentItem(); } +#ifdef USECOMBO + void leftAction(int v) { button->leftAction->setCurrentItem(v); } +#else + void leftAction(int v) { button->leftAction->select(v); } +#endif + int rightAction() { return button->rightAction->currentItem(); } +#ifdef USECOMBO + void rightAction(int v) { button->rightAction->setCurrentItem(v); } +#else + void rightAction(int v) { button->rightAction->select(v); } +#endif + int upAction() { return button->upAction->currentItem(); } +#ifdef USECOMBO + void upAction(int v) { button->upAction->setCurrentItem(v); } +#else + void upAction(int v) { button->upAction->select(v); } +#endif + int downAction() { return button->downAction->currentItem(); } +#ifdef USECOMBO + void downAction(int v) { button->downAction->setCurrentItem(v); } +#else + void downAction(int v) { button->downAction->select(v); } +#endif + bool leftScroll() { return button->leftScroll->isChecked(); } + void leftScroll(bool v) { button->leftScroll->setChecked(v); } + bool rightScroll() { return button->rightScroll->isChecked(); } + void rightScroll(bool v) { button->rightScroll->setChecked(v); } + bool upScroll() { return button->upScroll->isChecked(); } + void upScroll(bool v) { button->upScroll->setChecked(v); } + bool downScroll() { return button->downScroll->isChecked(); } + void downScroll(bool v) { button->downScroll->setChecked(v); } + + + int gfxsize() { return layout2->gfxzoom->value(); } + void gfxsize(int v) { layout2->gfxzoom->setValue(v); } + int pageoverlap() { return layout2->pageoverlap->value(); } + void pageoverlap(int v) { layout2->pageoverlap->setValue(v); } + + bool twotouch() { return inter->twotouch->isChecked(); } + void twotouch(bool v) { inter->twotouch->setChecked(v); } + + bool ideogram() { return inter->ideogram->isChecked(); } + void ideogram(bool v) { inter->ideogram->setChecked(v); } + + int ideogramwidth() { return inter->ideogramwidth->value(); } + void ideogramwidth(int v) { inter->ideogramwidth->setValue(v); } + + bool propfontchange() { return inter->propfontchange->isChecked(); } + void propfontchange(bool v) { inter->propfontchange->setChecked(v); } + + int encoding() { return inter->encoding->currentItem(); } +#ifdef USECOMBO + void encoding(int v) { inter->encoding->setCurrentItem(v); } +#else + void encoding(int v) { inter->encoding->select(v); } +#endif + + + +}; +#endif // CPREFS_H diff --git a/noncore/apps/opie-reader/ToolbarPrefs.cpp b/noncore/apps/opie-reader/ToolbarPrefs.cpp new file mode 100644 index 0000000..361bf97 --- a/dev/null +++ b/noncore/apps/opie-reader/ToolbarPrefs.cpp @@ -0,0 +1,499 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'Prefs.ui' +** +** Created: Tue Feb 11 23:53:35 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "useqpe.h" +#include "ToolbarPrefs.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef USEQPE +#include +#endif + +CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true), config( appdir ) +{ + setCaption(tr( "Toolbar Settings" ) ); + QTabWidget* td = new QTabWidget(this); + misc = new CMiscBarPrefs(this); + filebar = new CFileBarPrefs(config, this); + navbar = new CNavBarPrefs(config, this); + viewbar = new CViewBarPrefs(config, this); + markbar = new CMarkBarPrefs(config, this); + indbar = new CIndBarPrefs(config, this); + td->addTab(filebar, tr("File")); + td->addTab(navbar, tr("Navigation")); + td->addTab(viewbar, tr("View")); + td->addTab(markbar, tr("Marks")); + td->addTab(indbar, tr("Indicators")); + td->addTab(misc, tr("Policy")); + QVBoxLayout* v = new QVBoxLayout(this); + v->addWidget(td); + + if (fs) showMaximized(); +} + +/* +CBarPrefs1::CBarPrefs1( Config& _config, QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ), config(_config) +{ + config.setGroup( "Toolbar" ); + QVBoxLayout* vb = new QVBoxLayout(this); + + QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "File", this); + vb->addWidget(bg); + + open = new QCheckBox( tr("Open"), bg ); + open->setChecked(config.readBoolEntry( "Open", false )); + connect(open, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + close = new QCheckBox( tr("Close"), bg ); + close->setChecked(config.readBoolEntry( "Close", false )); + connect(close, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + info = new QCheckBox( tr("Info"), bg ); + info->setChecked(config.readBoolEntry( "Info", false )); + connect(info, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + twotouch = new QCheckBox( tr("Two/One\nTouch"), bg ); + twotouch->setChecked(config.readBoolEntry( "Two/One Touch", false )); + connect(twotouch, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + find = new QCheckBox( tr("Find"), bg ); + find->setChecked(config.readBoolEntry( "Find", false )); + connect(find, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + + bg = new QGroupBox(2, Qt::Horizontal, "Navigation", this); + vb->addWidget(bg); + scroll = new QCheckBox( tr("Scroll"), bg ); + scroll->setChecked(config.readBoolEntry( "Scroll", false )); + connect(scroll, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + navigation = new QCheckBox( tr("Back/Home/Forward"), bg ); + navigation->setChecked(config.readBoolEntry( "Back/Home/Forward", false )); + connect(navigation, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + page = new QCheckBox( tr("Page\nUp/Down"), bg ); + page->setChecked(config.readBoolEntry( "Page Up/Down", false )); + connect(page, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + startend = new QCheckBox( tr("Goto Start/End"), bg ); + startend->setChecked(config.readBoolEntry( "Goto Start/End", false )); + connect(startend, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + jump = new QCheckBox( tr("Jump"), bg ); + jump->setChecked(config.readBoolEntry( "Jump", false )); + connect(jump, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + pageline = new QCheckBox( tr("Page/Line Scroll"), bg ); + pageline->setChecked(config.readBoolEntry( "Page/Line Scroll", false )); + connect(pageline, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + m_isChanged = false; +} + +void CBarPrefs1::saveall() +{ + config.setGroup( "Toolbar" ); + config.writeEntry( "Open", open->isChecked()); + config.writeEntry( "Close", close->isChecked()); + config.writeEntry( "Info", info->isChecked()); + config.writeEntry( "Two/One Touch", twotouch->isChecked()); + config.writeEntry( "Find", find->isChecked()); + config.writeEntry( "Scroll", scroll->isChecked()); + config.writeEntry( "Back/Home/Forward", navigation->isChecked()); + config.writeEntry( "Page Up/Down", page->isChecked()); + config.writeEntry( "Goto Start/End", startend->isChecked()); + config.writeEntry( "Jump", jump->isChecked()); + config.writeEntry( "Page/Line Scroll", pageline->isChecked()); +} + +CBarPrefs1::~CBarPrefs1() +{ +} +*/ +/* +CBarPrefs2::CBarPrefs2( Config& _config, QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ), config(_config) +{ + QVBoxLayout* vb = new QVBoxLayout(this); + + QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "View", this); + vb->addWidget(bg); + + config.setGroup( "Toolbar" ); + + fullscreen = new QCheckBox( tr("Fullscreen"), bg ); + fullscreen->setChecked(config.readBoolEntry( "Fullscreen", false )); + connect(fullscreen, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + zoom = new QCheckBox( tr("Zoom"), bg ); + zoom->setChecked(config.readBoolEntry( "Zoom In/Out", false )); + connect(zoom, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + setfont = new QCheckBox( tr("Set Font"), bg ); + setfont->setChecked(config.readBoolEntry( "Set Font", false )); + connect(setfont, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + + encoding = new QCheckBox( tr("Encoding"), bg ); + encoding->setChecked(config.readBoolEntry("Encoding Select", false)); + connect(encoding, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + ideogram = new QCheckBox( tr("Ideogram"), bg ); + ideogram->setChecked(config.readBoolEntry("Ideogram Mode", false)); + connect(ideogram, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + + bg = new QGroupBox(3, Qt::Horizontal, "Marks", this); + vb->addWidget(bg); + mark = new QCheckBox( tr("Bookmark"), bg ); + mark->setChecked(config.readBoolEntry( "Mark", false )); + connect(mark, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + annotate = new QCheckBox( tr("Annotate"), bg ); + annotate->setChecked(config.readBoolEntry( "Annotate", false )); + connect(annotate, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + go_to = new QCheckBox( tr("Goto"), bg ); + go_to->setChecked(config.readBoolEntry( "Goto", false )); + connect(go_to, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + Delete = new QCheckBox( tr("Delete"), bg ); + Delete->setChecked(config.readBoolEntry( "Delete", false )); + connect(Delete, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + autogen = new QCheckBox( tr("Autogen"), bg ); + autogen->setChecked(config.readBoolEntry( "Autogen", false )); + connect(autogen, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + clear = new QCheckBox( tr("Clear"), bg ); + clear->setChecked(config.readBoolEntry( "Clear", false )); + connect(clear, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + save = new QCheckBox( tr("Save"), bg ); + save->setChecked(config.readBoolEntry( "Save", false )); + connect(save, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + tidy = new QCheckBox( tr("Tidy"), bg ); + tidy->setChecked(config.readBoolEntry( "Tidy", false )); + connect(tidy, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + block = new QCheckBox( tr("Mark/Copy"), bg ); + block->setChecked(config.readBoolEntry( "Start/Copy Block", false )); + connect(block, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + + bg = new QGroupBox(1, Qt::Horizontal, "Indicators", this); + vb->addWidget(bg); + indannotate = new QCheckBox( tr("Annotation"), bg ); + indannotate->setChecked(config.readBoolEntry( "Annotation indicator", false )); + connect(indannotate, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + m_isChanged = false; +} + +void CBarPrefs2::saveall() +{ + config.setGroup( "Toolbar" ); + config.writeEntry( "Fullscreen", fullscreen->isChecked()); + config.writeEntry( "Zoom In/Out", zoom->isChecked()); + config.writeEntry( "Set Font", setfont->isChecked()); + config.writeEntry("Encoding Select", encoding->isChecked()); + config.writeEntry("Ideogram Mode", ideogram->isChecked()); + + config.writeEntry( "Mark", mark->isChecked()); + config.writeEntry( "Annotate", annotate->isChecked()); + config.writeEntry( "Goto", go_to->isChecked()); + config.writeEntry( "Delete", Delete->isChecked()); + config.writeEntry( "Autogen", autogen->isChecked()); + config.writeEntry( "Clear", clear->isChecked()); + config.writeEntry( "Save", save->isChecked()); + config.writeEntry( "Tidy", tidy->isChecked()); + config.writeEntry( "Start/Copy Block", block->isChecked()); + config.writeEntry( "Annotation indicator", indannotate->isChecked()); +} + +CBarPrefs2::~CBarPrefs2() +{ +} +*/ + +CFileBarPrefs::CFileBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ), config(_config) +{ + config.setGroup( "Toolbar" ); + QVBoxLayout* vb = new QVBoxLayout(this); + + QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "File", this); + vb->addWidget(bg); + + open = new QCheckBox( tr("Open"), bg ); + open->setChecked(config.readBoolEntry( "Open", false )); + connect(open, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + close = new QCheckBox( tr("Close"), bg ); + close->setChecked(config.readBoolEntry( "Close", false )); + connect(close, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + info = new QCheckBox( tr("Info"), bg ); + info->setChecked(config.readBoolEntry( "Info", false )); + connect(info, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + twotouch = new QCheckBox( tr("Two/One\nTouch"), bg ); + twotouch->setChecked(config.readBoolEntry( "Two/One Touch", false )); + connect(twotouch, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + find = new QCheckBox( tr("Find"), bg ); + find->setChecked(config.readBoolEntry( "Find", false )); + connect(find, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + m_isChanged = false; +} + +void CFileBarPrefs::saveall() +{ + config.setGroup( "Toolbar" ); + config.writeEntry( "Open", open->isChecked()); + config.writeEntry( "Close", close->isChecked()); + config.writeEntry( "Info", info->isChecked()); + config.writeEntry( "Two/One Touch", twotouch->isChecked()); + config.writeEntry( "Find", find->isChecked()); +} + +CFileBarPrefs::~CFileBarPrefs() +{ +} + +CNavBarPrefs::CNavBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ), config(_config) +{ + config.setGroup( "Toolbar" ); + QVBoxLayout* vb = new QVBoxLayout(this); + + QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "Navigation", this); + vb->addWidget(bg); + scroll = new QCheckBox( tr("Scroll"), bg ); + scroll->setChecked(config.readBoolEntry( "Scroll", false )); + connect(scroll, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + + navback = new QCheckBox( tr("Back"), bg ); + navback->setChecked(config.readBoolEntry( "Back", false )); + connect(navback, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + navhome = new QCheckBox( tr("Home"), bg ); + navhome->setChecked(config.readBoolEntry( "Home", false )); + connect(navhome, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + navforward = new QCheckBox( tr("Forward"), bg ); + navforward->setChecked(config.readBoolEntry( "Forward", false )); + connect(navforward, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + + pageup = new QCheckBox( tr("Page Up"), bg ); + pageup->setChecked(config.readBoolEntry( "Page Up", false )); + connect(pageup, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + pagedown = new QCheckBox( tr("Page Down"), bg ); + pagedown->setChecked(config.readBoolEntry( "Page Down", false )); + connect(pagedown, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + gotostart = new QCheckBox( tr("Goto Start"), bg ); + gotostart->setChecked(config.readBoolEntry( "Goto Start", false )); + connect(gotostart, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + gotoend = new QCheckBox( tr("Goto End"), bg ); + gotoend->setChecked(config.readBoolEntry( "Goto End", false )); + connect(gotoend, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + jump = new QCheckBox( tr("Jump"), bg ); + jump->setChecked(config.readBoolEntry( "Jump", false )); + connect(jump, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + pageline = new QCheckBox( tr("Page/Line Scroll"), bg ); + pageline->setChecked(config.readBoolEntry( "Page/Line Scroll", false )); + connect(pageline, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + m_isChanged = false; +} + +void CNavBarPrefs::saveall() +{ + config.setGroup( "Toolbar" ); + config.writeEntry( "Scroll", scroll->isChecked()); + config.writeEntry( "Back", navback->isChecked()); + config.writeEntry( "Home", navhome->isChecked()); + config.writeEntry( "Forward", navforward->isChecked()); + config.writeEntry( "Page Up", pageup->isChecked()); + config.writeEntry( "Page Down", pagedown->isChecked()); + config.writeEntry( "Goto Start", gotostart->isChecked()); + config.writeEntry( "Goto End", gotoend->isChecked()); + config.writeEntry( "Jump", jump->isChecked()); + config.writeEntry( "Page/Line Scroll", pageline->isChecked()); +} + +CNavBarPrefs::~CNavBarPrefs() +{ +} + +CViewBarPrefs::CViewBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ), config(_config) +{ + QVBoxLayout* vb = new QVBoxLayout(this); + + QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "View", this); + vb->addWidget(bg); + + config.setGroup( "Toolbar" ); + + fullscreen = new QCheckBox( tr("Fullscreen"), bg ); + fullscreen->setChecked(config.readBoolEntry( "Fullscreen", false )); + connect(fullscreen, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + zoomin = new QCheckBox( tr("Zoom In"), bg ); + zoomin->setChecked(config.readBoolEntry( "Zoom In", false )); + connect(zoomin, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + zoomout = new QCheckBox( tr("Zoom Out"), bg ); + zoomout->setChecked(config.readBoolEntry( "Zoom Out", false )); + connect(zoomout, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + setfont = new QCheckBox( tr("Set Font"), bg ); + setfont->setChecked(config.readBoolEntry( "Set Font", false )); + connect(setfont, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + + encoding = new QCheckBox( tr("Encoding"), bg ); + encoding->setChecked(config.readBoolEntry("Encoding Select", false)); + connect(encoding, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + ideogram = new QCheckBox( tr("Ideogram"), bg ); + ideogram->setChecked(config.readBoolEntry("Ideogram Mode", false)); + connect(ideogram, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + m_isChanged = false; +} + +void CViewBarPrefs::saveall() +{ + config.setGroup( "Toolbar" ); + config.writeEntry( "Fullscreen", fullscreen->isChecked()); + config.writeEntry( "Zoom In", zoomin->isChecked()); + config.writeEntry( "Zoom Out", zoomout->isChecked()); + config.writeEntry( "Set Font", setfont->isChecked()); + config.writeEntry("Encoding Select", encoding->isChecked()); + config.writeEntry("Ideogram Mode", ideogram->isChecked()); +} + +CViewBarPrefs::~CViewBarPrefs() +{ +} + +CMarkBarPrefs::CMarkBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ), config(_config) +{ + QVBoxLayout* vb = new QVBoxLayout(this); + + QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "Marks", this); + vb->addWidget(bg); + mark = new QCheckBox( tr("Bookmark"), bg ); + mark->setChecked(config.readBoolEntry( "Mark", false )); + connect(mark, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + annotate = new QCheckBox( tr("Annotate"), bg ); + annotate->setChecked(config.readBoolEntry( "Annotate", false )); + connect(annotate, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + go_to = new QCheckBox( tr("Goto"), bg ); + go_to->setChecked(config.readBoolEntry( "Goto", false )); + connect(go_to, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + Delete = new QCheckBox( tr("Delete"), bg ); + Delete->setChecked(config.readBoolEntry( "Delete", false )); + connect(Delete, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + autogen = new QCheckBox( tr("Autogen"), bg ); + autogen->setChecked(config.readBoolEntry( "Autogen", false )); + connect(autogen, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + clear = new QCheckBox( tr("Clear"), bg ); + clear->setChecked(config.readBoolEntry( "Clear", false )); + connect(clear, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + save = new QCheckBox( tr("Save"), bg ); + save->setChecked(config.readBoolEntry( "Save", false )); + connect(save, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + tidy = new QCheckBox( tr("Tidy"), bg ); + tidy->setChecked(config.readBoolEntry( "Tidy", false )); + connect(tidy, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + startblock = new QCheckBox( tr("Mark Block"), bg ); + startblock->setChecked(config.readBoolEntry( "Start Block", false )); + connect(startblock, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + copyblock = new QCheckBox( tr("Copy Block"), bg ); + copyblock->setChecked(config.readBoolEntry( "Copy Block", false )); + connect(copyblock, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + m_isChanged = false; +} + +void CMarkBarPrefs::saveall() +{ + config.setGroup( "Toolbar" ); + config.writeEntry( "Mark", mark->isChecked()); + config.writeEntry( "Annotate", annotate->isChecked()); + config.writeEntry( "Goto", go_to->isChecked()); + config.writeEntry( "Delete", Delete->isChecked()); + config.writeEntry( "Autogen", autogen->isChecked()); + config.writeEntry( "Clear", clear->isChecked()); + config.writeEntry( "Save", save->isChecked()); + config.writeEntry( "Tidy", tidy->isChecked()); + config.writeEntry( "Start Block", startblock->isChecked()); + config.writeEntry( "Copy Block", copyblock->isChecked()); +} + +CMarkBarPrefs::~CMarkBarPrefs() +{ +} + +CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + + QGridLayout* hl = new QGridLayout(this,1,2); + + hl->setMargin( 0 ); + + QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Dialogs", this); + floating = new QCheckBox(gb); + floating->setText(tr("Floating")); + +// QLabel* TextLabel = new QLabel( gb ); +// TextLabel->setText( tr( "Select Button" ) ); + + + hl->addWidget( gb, 0, 0 ); + + + gb = new QGroupBox(1, Qt::Horizontal, "Bars (Restart)", this); + +// QLabel* ql = new QLabel("Restart to apply changes", gb); +// TextLabel = new QLabel( gb ); +// TextLabel->setText( tr( "Policy" ) ); + +#ifdef USECOMBO + tbpolicy = new QComboBox(gb); +#else + tbpolicy = new MenuButton(gb); +#endif + tbpolicy->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + tbpolicy->insertItem(tr("Single bar")); + tbpolicy->insertItem(tr("Menu/tool bar")); + tbpolicy->insertItem(tr("Multiple bars")); + +#ifdef USECOMBO + tbposition = new QComboBox(gb); +#else + tbposition = new MenuButton(gb); +#endif + tbposition->insertItem(tr("Top")); + tbposition->insertItem(tr("Bottom")); + tbposition->insertItem(tr("Right")); + tbposition->insertItem(tr("Left")); + tbposition->insertItem(tr("Minimised")); + + tbmovable = new QCheckBox( tr("Movable"), gb ); +// ch->setChecked(config.readBoolEntry( "Movable", false )); + + hl->addWidget(gb, 0, 1); + +} + +CMiscBarPrefs::~CMiscBarPrefs() +{ + // no need to delete child widgets, Qt does it all for us +} + + +CIndBarPrefs::CIndBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ), config(_config) +{ + QVBoxLayout* vb = new QVBoxLayout(this); + + QGroupBox* bg = new QGroupBox(1, Qt::Horizontal, "Indicators", this); + vb->addWidget(bg); + indannotate = new QCheckBox( tr("Annotation"), bg ); + indannotate->setChecked(config.readBoolEntry( "Annotation indicator", false )); + connect(indannotate, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); + m_isChanged = false; +} + +void CIndBarPrefs::saveall() +{ + config.setGroup( "Toolbar" ); + config.writeEntry( "Annotation indicator", indannotate->isChecked()); +} + +CIndBarPrefs::~CIndBarPrefs() +{ +} diff --git a/noncore/apps/opie-reader/ToolbarPrefs.h b/noncore/apps/opie-reader/ToolbarPrefs.h new file mode 100644 index 0000000..297d63a --- a/dev/null +++ b/noncore/apps/opie-reader/ToolbarPrefs.h @@ -0,0 +1,263 @@ +/**************************************************************************** + ** Form interface generated from reading ui file 'Prefs.ui' + ** + ** Created: Tue Feb 11 23:53:32 2003 + ** by: The User Interface Compiler (uic) + ** + ** WARNING! All changes made in this file will be lost! + ****************************************************************************/ +#ifndef CTOOLBARPREFS_H +#define CTOOLBARPREFS_H +#include "useqpe.h" +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef USEQPE +#include +#include +#else +#include "preferences.h" +#endif +//#include "opie.h" +//#ifdef OPIE +#define USECOMBO +//#endif + +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +//class QCheckBox; +class QLabel; +//class QSpinBox; +/* +class CBarPrefs1 : public QWidget +{ + Q_OBJECT + + Config& config; + QCheckBox *open, *close, *info, *twotouch,*find,*scroll,*navigation,*page,*startend,*jump,*pageline; + + bool m_isChanged; + + private slots: + void isChanged(int _v) { m_isChanged = true; } + + public: + CBarPrefs1( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CBarPrefs1(); + void saveall(); + bool isChanged() { return m_isChanged; } +}; +*/ +class CFileBarPrefs : public QWidget +{ + Q_OBJECT + + Config& config; + QCheckBox *open, *close, *info, *twotouch, *find, *scroll; + + bool m_isChanged; + + private slots: + void isChanged(int _v) { m_isChanged = true; } + + public: + CFileBarPrefs( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CFileBarPrefs(); + void saveall(); + bool isChanged() { return m_isChanged; } +}; + +class CNavBarPrefs : public QWidget +{ + Q_OBJECT + + Config& config; + QCheckBox *scroll, *navback, *navhome, *navforward; + QCheckBox *pageup, *pagedown, *gotostart, *gotoend, *jump, *pageline; + + bool m_isChanged; + + private slots: + void isChanged(int _v) { m_isChanged = true; } + + public: + CNavBarPrefs( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CNavBarPrefs(); + void saveall(); + bool isChanged() { return m_isChanged; } +}; +/* +class CBarPrefs2 : public QWidget +{ + Q_OBJECT + Config& config; + QCheckBox *fullscreen, *zoom, *setfont, *mark, *annotate, *go_to, *Delete, *autogen, *clear, *save, *tidy, *block, *indannotate, *encoding, *ideogram; + + bool m_isChanged; + + private slots: + void isChanged(int _v) { m_isChanged = true; } + + public: + CBarPrefs2( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CBarPrefs2(); + void saveall(); + bool isChanged() { return m_isChanged; } + +}; +*/ +class CViewBarPrefs : public QWidget +{ + Q_OBJECT + Config& config; + QCheckBox *fullscreen, *zoomin, *zoomout, *setfont, *encoding, *ideogram; + + bool m_isChanged; + + private slots: + void isChanged(int _v) { m_isChanged = true; } + + public: + CViewBarPrefs( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CViewBarPrefs(); + void saveall(); + bool isChanged() { return m_isChanged; } + +}; + +class CMarkBarPrefs : public QWidget +{ + Q_OBJECT + Config& config; + QCheckBox *mark, *annotate, *go_to, *Delete, *autogen, *clear, *save, *tidy, *startblock, *copyblock; + + bool m_isChanged; + + private slots: + void isChanged(int _v) { m_isChanged = true; } + + public: + CMarkBarPrefs( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CMarkBarPrefs(); + void saveall(); + bool isChanged() { return m_isChanged; } + +}; + +class CIndBarPrefs : public QWidget +{ + Q_OBJECT + Config& config; + QCheckBox *indannotate; + + bool m_isChanged; + + private slots: + void isChanged(int _v) { m_isChanged = true; } + + public: + CIndBarPrefs( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CIndBarPrefs(); + void saveall(); + bool isChanged() { return m_isChanged; } + +}; + +class CMiscBarPrefs : public QWidget +{ + +public: + + CMiscBarPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~CMiscBarPrefs(); + +#ifdef USECOMBO + QComboBox *tbpolicy, *tbposition; +#else + MenuButton *tbpolicy, *tbposition; +#endif + QCheckBox *tbmovable, *floating; +}; + +class CBarPrefs : public QDialog +{ + Q_OBJECT + ; + CMiscBarPrefs* misc; + CFileBarPrefs* filebar; + CNavBarPrefs* navbar; + CViewBarPrefs* viewbar; + CMarkBarPrefs* markbar; + CIndBarPrefs* indbar; + Config config; + + void keyPressEvent(QKeyEvent* e) + { + switch (e->key()) + { + case Key_Escape: + e->accept(); + reject(); + break; + case Key_Space: + case Key_Return: + e->accept(); + accept(); + break; + default: + QWidget::keyPressEvent(e); + } + } + public: + CBarPrefs(const QString& appdir, bool fs = true, QWidget* parent = 0, const char* name = 0); + ~CBarPrefs() + { + if (result()) + { + if (navbar->isChanged()) navbar->saveall(); + if (filebar->isChanged()) filebar->saveall(); + if (viewbar->isChanged()) viewbar->saveall(); + if (markbar->isChanged()) markbar->saveall(); + if (indbar->isChanged()) indbar->saveall(); + } + } + bool isChanged() + { + return + ( + filebar->isChanged() + || + navbar->isChanged() + || + viewbar->isChanged() + || + markbar->isChanged() + || + indbar->isChanged() + ); + } + bool floating() { return misc->floating->isChecked(); } + void floating(bool v) { misc->floating->setChecked(v); } + int tbpolicy() { return misc->tbpolicy->currentItem(); } +#ifdef USECOMBO + void tbpolicy(int v) { misc->tbpolicy->setCurrentItem(v); } +#else + void tbpolicy(int v) { misc->tbpolicy->select(v); } +#endif + bool tbmovable() { return misc->tbmovable->isChecked(); } + void tbmovable(bool v) { misc->tbmovable->setChecked(v); } + int tbposition() { return misc->tbposition->currentItem(); } +#ifdef USECOMBO + void tbposition(int v) { misc->tbposition->setCurrentItem(v); } +#else + void tbposition(int v) { misc->tbposition->select(v); } +#endif + +}; +#endif // CPREFS_H diff --git a/noncore/apps/opie-reader/URLDialog.cpp b/noncore/apps/opie-reader/URLDialog.cpp new file mode 100644 index 0000000..dd4568b --- a/dev/null +++ b/noncore/apps/opie-reader/URLDialog.cpp @@ -0,0 +1,14 @@ +#include "URLDialog.h" +#include "qlayout.h" + +CURLDialog::CURLDialog(const QString& fname, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) +{ + setCaption(tr("Save URL")); + QVBoxLayout *tmp = new QVBoxLayout(this); + QVButtonGroup* vb = new QVButtonGroup(fname, this); + tmp->addWidget(vb); + m_clipboard = new QCheckBox(tr("Clipboard"), vb); + m_localfile = new QCheckBox(tr("Local file"), vb); + m_globalfile = new QCheckBox(tr("Global file"), vb); + if (fs) showMaximized(); +} diff --git a/noncore/apps/opie-reader/URLDialog.h b/noncore/apps/opie-reader/URLDialog.h new file mode 100644 index 0000000..1bcc4bd --- a/dev/null +++ b/noncore/apps/opie-reader/URLDialog.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'Prefs.ui' +** +** Created: Tue Feb 11 23:53:32 2003 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef __URLDIALOG_H +#define __URLDIALOG_H + +#include "useqpe.h" +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include + +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +//class QCheckBox; +class QLabel; +//class QSpinBox; + +class CURLDialog : public QDialog +{ +Q_OBJECT + QCheckBox *m_localfile, *m_globalfile, *m_clipboard; +#ifndef USEQPE + void keyPressEvent(QKeyEvent* e) + { + switch (e->key()) + { + case Key_Escape: + e->accept(); + reject(); + break; + case Key_Space: + case Key_Return: + e->accept(); + accept(); + break; + default: + QWidget::keyPressEvent(e); + } + } +#endif + public: + CURLDialog(const QString&, bool fs = true, QWidget* parent = 0, const char* name = 0); + ~CURLDialog() {} + bool clipboard() { return m_clipboard->isChecked(); } + bool localfile() { return m_localfile->isChecked(); } + bool globalfile() { return m_globalfile->isChecked(); } + void clipboard(bool _b) { m_clipboard->setChecked(_b); } + void localfile(bool _b) { m_localfile->setChecked(_b); } + void globalfile(bool _b) { m_globalfile->setChecked(_b); } + +}; +#endif // CPREFS_H diff --git a/noncore/apps/opie-reader/linktype.h b/noncore/apps/opie-reader/linktype.h new file mode 100644 index 0000000..fa22b2f --- a/dev/null +++ b/noncore/apps/opie-reader/linktype.h @@ -0,0 +1,11 @@ +#ifndef __LINKTYPE_H +#define __LINKTYPE_H + +enum linkType +{ + eNone, + eLink, + ePicture +}; + +#endif diff --git a/noncore/apps/opie-reader/names.h b/noncore/apps/opie-reader/names.h new file mode 100644 index 0000000..0549750 --- a/dev/null +++ b/noncore/apps/opie-reader/names.h @@ -0,0 +1,14 @@ +#ifndef __NAMES_H +#define __NAMES_H +// For message box titles etc +#define PROGNAME "Opie-Reader" + +// For the caption eg "Anne of Green Gables - Reader" +#define SHORTPROGNAME "Reader" + +// For configuration and bookmark files +#define APPDIR "uqtreader" + +// Name of the configuration file +#define INIFILE ".readerrc" +#endif diff --git a/noncore/apps/opie-reader/plucker_base.cpp b/noncore/apps/opie-reader/plucker_base.cpp new file mode 100644 index 0000000..9047a45 --- a/dev/null +++ b/noncore/apps/opie-reader/plucker_base.cpp @@ -0,0 +1,1240 @@ +#include "useqpe.h" +#include +#include +#include +#include +#ifdef USEQPE +#include +#endif /* USEQPE */ +#ifdef LOCALPICTURES +#include +#endif +#ifdef USEQPE +#include +#endif /* USEQPE */ +#include +#ifndef USEQPE +#include +#else /* USEQPE */ +#include +#endif /* USEQPE */ + +#include "plucker_base.h" +#include "Aportis.h" +#include "Palm2QImage.h" + +CPlucker_base::CPlucker_base() : +#ifdef LOCALPICTURES + m_viewer(NULL), + m_picture(NULL), +#endif + expandedtextbuffer(NULL), + compressedtextbuffer(NULL) +//, urls(NULL) + { /*printf("constructing:%x\n",fin);*/ } + + +void CPlucker_base::Expand(UInt32 reclen, UInt8 type, UInt8* buffer, UInt32 buffersize) +{ + if (type%2 == 0) + { + fread(buffer, reclen, sizeof(char), fin); + } + else + { + UInt8* readbuffer = NULL; + if (reclen > compressedbuffersize) + { + readbuffer = new UInt8[reclen]; + } + else + { + readbuffer = compressedtextbuffer; + } + if (readbuffer != NULL) + { + fread(readbuffer, reclen, sizeof(char), fin); + switch (ntohs(hdr0.version)) + { + case 2: + UnZip(readbuffer, reclen, buffer, buffersize); + break; + case 1: + UnDoc(readbuffer, reclen, buffer, buffersize); + break; + } + if (reclen > compressedbuffersize) + { + delete [] readbuffer; + } + } + } +} + +void CPlucker_base::sizes(unsigned long& _file, unsigned long& _text) +{ + _file = file_length; + if (textlength == 0) + { + for (int recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++) + { + gotorecordnumber(recptr); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (thishdr_type < 2) textlength += thishdr_size; + } + } + _text = textlength; +//ntohl(hdr0.size); +} + +char* CPlucker_base::geturl(UInt16 tgt) +{ + char * pRet = NULL; + gotorecordnumber(0); + fread(&hdr0, 1, 6, fin); + unsigned int nrecs = ntohs(hdr0.nRecords); + //qDebug("Version %u, no. recs %u", ntohs(hdr0.version), nrecs); + UInt16 urlid = 0; + bool urlsfound = false; + char* urls = NULL; + size_t urlsize = 0; + for (unsigned int i = 0; i < nrecs; i++) + { + UInt16 id, name; + fread(&name, 1, sizeof(name), fin); + fread(&id, 1, sizeof(id), fin); + //qDebug("N:%d, I:%d", ntohs(name), ntohs(id)); + if (ntohs(name) == 2) + { + urlsfound = true; + urlid = id; + //qDebug("Found url index:%d", ntohs(urlid)); + } +// //qDebug("%x", id); + } + if (urlsfound) + { + unsigned short recptr = finduid(ntohs(urlid)); + if (recptr != 0) + { + gotorecordnumber(recptr); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + UInt16 urlctr = 0; + while (1) + { + UInt16 tctr; + fread(&tctr, 1, sizeof(tctr), fin); + fread(&urlid, 1, sizeof(urlid), fin); + tctr = ntohs(tctr); + //qDebug("tgt:%u urlctr:%u tctr:%u", tgt, urlctr, tctr); + if (tctr >= tgt) + { + break; + } + urlctr = tctr; + } + //qDebug("urls are in %d", ntohs(urlid)); + recptr = finduid(ntohs(urlid)); + if (recptr != 0) + { + UInt32 reclen = recordlength(recptr) - HeaderSize(); + gotorecordnumber(recptr); + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + //qDebug("Found urls:%x",thishdr_type); + urlsize = thishdr_size; + urls = new char[urlsize]; + Expand(reclen, thishdr_type, (UInt8*)urls, urlsize); + char* ptr = urls; + int rn = urlctr+1; + while (ptr - urls < urlsize) + { + if (rn == tgt) + { + //qDebug("URL:%s", ptr); + int len = strlen(ptr)+1; + pRet = new char[len]; + memcpy(pRet, ptr, len); + break; + } + ptr += strlen(ptr)+1; + rn++; + } + delete [] urls; + } + } + } + else + { + QMessageBox::information(NULL, + QString(PROGNAME), + QString("No external links\nin this pluck") + ); + } + return pRet; +} + +CPlucker_base::~CPlucker_base() +{ + if (expandedtextbuffer != NULL) delete [] expandedtextbuffer; + if (compressedtextbuffer != NULL) delete [] compressedtextbuffer; +#ifdef LOCALPICTURES + if (m_viewer != NULL) delete m_viewer; +#endif +} + +int CPlucker_base::getch() { return getch(false); } + +void CPlucker_base::getch(tchar& ch, CStyle& sty) +{ + ch = getch(false); + sty = mystyle; +} + +unsigned int CPlucker_base::locate() +{ + return currentpos; +/* + UInt16 thisrec = 1; + unsigned long locpos = 0; + gotorecordnumber(thisrec); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + while (thisrec < bufferrec) + { + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (thishdr_type < 2) locpos += thishdr_size; + thisrec++; + gotorecordnumber(thisrec); + } + return locpos+bufferpos; +*/ +} + +void CPlucker_base::locate(unsigned int n) +{ + +// clock_t start = clock(); + UInt32 textlength = currentpos - bufferpos; + UInt16 recptr = bufferrec; + if (n < textlength/2) + { + textlength = 0; + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size = buffercontent; + UInt8 thishdr_type, thishdr_reserved; + for (recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++) + { + gotorecordnumber(recptr); + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (thishdr_type < 2) + { + textlength += thishdr_size; + if (textlength > n) + { + textlength -= thishdr_size; + break; + } + } + } + } + else if (n < textlength) + { + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + while (n < textlength && recptr > 1) + { + recptr--; + gotorecordnumber(recptr); + //qDebug("recptr:%u", recptr); + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (thishdr_type < 2) + { + textlength -= thishdr_size; + } + } + } + else + { + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size = buffercontent; + UInt8 thishdr_type, thishdr_reserved; + while (n > textlength + thishdr_size && recptr < ntohs(head.recordList.numRecords)-1) + { + textlength += thishdr_size; + recptr++; + gotorecordnumber(recptr); + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (!(thishdr_type < 2)) + { + thishdr_size = 0; + } + } + } +// qDebug("Time(1): %u", clock()-start); +/* + expand(recptr); + mystyle.unset(); + bufferpos = n-textlength; + currentpos = n; + while (bufferpos >= m_nextPara && m_nextPara >= 0) + { + UInt16 attr = m_ParaAttrs[m_nextParaIndex]; + m_nextParaIndex++; + if (m_nextParaIndex == m_nParas) + { + m_nextPara = -1; + } + else + { + m_nextPara += m_ParaOffsets[m_nextParaIndex]; + } + } + + return; +*/ +// start = clock(); + + UInt16 thisrec = 0; + unsigned long locpos = 0; + unsigned long bs = 0; + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + do + { + thisrec++; + locpos += bs; + gotorecordnumber(thisrec); + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (thishdr_type < 2) + { + bs = thishdr_size; + } + else + { + bs = 0; + } + } while (locpos + bs <= n); + +// qDebug("Time(2): %u", clock()-start); + if (recptr != thisrec) + { + qDebug("Disaster:recptr:%u thisrec:%u", recptr, thisrec); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size = buffercontent; + UInt8 thishdr_type, thishdr_reserved; + for (recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++) + { + gotorecordnumber(recptr); + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); +// qDebug("UID:%u Paras:%u Size:%u Type:%u Reserved:%u", thishdr_uid, thishdr_nParagraphs, thishdr_size, (unsigned int)thishdr_type, (unsigned int)thishdr_reserved); + } +// QApplication::exit ( 100 ); + } + + currentpos = locpos; + expand(thisrec); + while (currentpos < n && bufferpos < buffercontent) getch_base(true); + +/* // This is faster but the alignment attribute doesn't get set 8^( + bufferpos = n-locpos; + currentpos = n; + while (bufferpos >= m_nextPara && m_nextPara >= 0) + { + UInt16 attr = m_ParaAttrs[m_nextParaIndex]; + m_nextParaIndex++; + if (m_nextParaIndex == m_nParas) + { + m_nextPara = -1; + } + else + { + m_nextPara += m_ParaOffsets[m_nextParaIndex]; + } + } +*/ +} + +bool CPlucker_base::expand(int thisrec) +{ + mystyle.unset(); + size_t reclen = recordlength(thisrec); + gotorecordnumber(thisrec); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + while (1) + { + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + //qDebug("This (%d) type is %d, uid is %u", thisrec, thishdr_type, thishdr_uid); + if (thishdr_type < 2) break; + //qDebug("Skipping paragraph of type %d", thishdr_type); + if (++thisrec >= ntohs(head.recordList.numRecords) - 1) return false; + reclen = recordlength(thisrec); + gotorecordnumber(thisrec); + } + m_nParas = thishdr_nParagraphs; + m_bufferisreserved = (thishdr_reserved != 0); + //qDebug("It has %u paragraphs and is %u bytes", thishdr_nParagraphs, thishdr_size); + uid = thishdr_uid; +// gotorecordnumber(thisrec); +// fread(expandedtextbuffer,1,10,fin); + for (int i = 0; i < m_nParas; i++) + { + UInt16 ubytes, attrs; + fread(&ubytes, 1, sizeof(ubytes), fin); + fread(&attrs, 1, sizeof(attrs), fin); + m_ParaOffsets[i] = ntohs(ubytes); + m_ParaAttrs[i] = ntohs(attrs); +// //qDebug("Bytes %u, Attr %x", ntohs(ubytes), ntohs(attrs)); + } + if (m_nParas > 0) + { + m_nextPara = m_ParaOffsets[0]; + //qDebug("First offset = %u", m_nextPara); + m_nextParaIndex = 0; + } + else + { + m_nextPara = -1; + } + + reclen -= HeaderSize()+4*m_nParas; + + buffercontent = thishdr_size; + + if (thishdr_size > buffersize) + { + delete [] expandedtextbuffer; + buffersize = thishdr_size; + expandedtextbuffer = new UInt8[buffersize]; + } + + Expand(reclen, thishdr_type, expandedtextbuffer, buffercontent); + bufferpos = 0; + bufferrec = thisrec; + //qDebug("BC:%u, HS:%u", buffercontent, thishdr_size); + return true; +} + +void CPlucker_base::UnZip(UInt8* compressedbuffer, size_t reclen, UInt8* tgtbuffer, size_t bsize) +{ + z_stream zstream; + memset(&zstream,sizeof(zstream),0); + zstream.next_in = compressedbuffer; + zstream.next_out = tgtbuffer; + zstream.avail_out = bsize; + zstream.avail_in = reclen; + + int keylen = 0; + + zstream.zalloc = Z_NULL; + zstream.zfree = Z_NULL; + zstream.opaque = Z_NULL; + +// printf("Initialising\n"); + + inflateInit(&zstream); + int err = 0; + do { + if ( zstream.avail_in == 0 && 0 < keylen ) { + zstream.next_in = compressedbuffer + keylen; + zstream.avail_in = reclen - keylen; + keylen = 0; + } + zstream.next_out = tgtbuffer; + zstream.avail_out = bsize; + + err = inflate( &zstream, Z_SYNC_FLUSH ); + +// //qDebug("err:%d - %u", err, zstream.avail_in); + + } while ( err == Z_OK ); + + inflateEnd(&zstream); +} + +void CPlucker_base::UnDoc(UInt8* compressedbuffer, size_t reclen, UInt8* tgtbuffer, size_t bsize) +{ +// UInt16 headerSize; + UInt16 docSize; + UInt16 i; + UInt16 j; + UInt16 k; + + UInt8 *inBuf = compressedbuffer; + UInt8 *outBuf = tgtbuffer; + +// headerSize = sizeof( Header ) + record->paragraphs * sizeof( Paragraph ); + docSize = reclen; + + j = 0; + k = 0; + while ( j < docSize ) { + i = 0; + while ( i < bsize && j < docSize ) { + UInt16 c; + + c = (UInt16) inBuf[ j++ ]; + if ( 0 < c && c < 9 ) { + while ( 0 < c-- ) + outBuf[ i++ ] = inBuf[ j++ ]; + } + else if ( c < 0x80 ) + outBuf[ i++ ] = c; + else if ( 0xc0 <= c ) { + outBuf[ i++ ] = ' '; + outBuf[ i++ ] = c ^ 0x80; + } + else { + Int16 m; + Int16 n; + + c <<= 8; + c += inBuf[ j++ ]; + + m = ( c & 0x3fff ) >> COUNT_BITS; + n = c & ( ( 1 << COUNT_BITS ) - 1 ); + n += 2; + + do { + outBuf[ i ] = outBuf[ i - m ]; + i++; + } while ( 0 < n-- ); + } + } + k += bsize; + } +} + +void CPlucker_base::home() +{ + currentpos = 0; + expand(1); +} + +CList* CPlucker_base::getbkmklist() +{ +/* + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + + for (int i = 1; i < ntohs(head.recordList.numRecords); i++) + { + gotorecordnumber(i); + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (thishdr_type == 8) + { + UInt16 n; + fread(&n, 1, sizeof(n), fin); + n = ntohs(n); + //qDebug("Found %u bookmarks", n); + } + //qDebug("Found:%d, %u", i , thishdr_type); + } +*/ + return NULL; +} + +#include + +QImage* CPlucker_base::expandimg(UInt16 tgt, bool border) +{ + QImage* qimage = getimg(tgt); + QImage* ret; + if (qimage == NULL) return NULL; + if (border) + { + QPixmap* image = new QPixmap(0,0); + image->convertFromImage(*qimage); + delete qimage; + QPixmap* pret = new QPixmap(image->width()+4, image->height()+4); + pret->fill(Qt::red); + bitBlt(pret, 2, 2, image, 0, 0, -1, -1);//, Qt::RasterOp::CopyROP); + delete image; + ret = new QImage(pret->convertToImage()); + } + else + { + ret = qimage; + } + return ret; +} + +#ifdef _BUFFERPICS +#include +#endif + +QImage* CPlucker_base::getPicture(unsigned long tgt) +{ +#ifdef _BUFFERPICS + static QMap pix; + QMap::Iterator t = pix.find(tgt); + if (t == pix.end()) + { + pix[tgt] = *expandimg(tgt); + return &pix[tgt]; + } + else + return &(t.data()); +#else + return expandimg(tgt >> 16); +#endif +} + +#ifdef LOCALPICTURES +#include +#include +void CPlucker_base::showimg(UInt16 tgt) +{ + //qDebug("Crassssssh!"); + QPixmap* qimage = expandimg(tgt); + m_picture->setFixedSize(qimage->size()); + m_picture->setBackgroundPixmap(*qimage); + delete qimage; + m_viewer->show(); + +/* + char tmp[] = "uqtreader.XXXXXX"; + QImage* qimage = getimg(tgt); + QPixmap* image = new QPixmap(0,0); +// //qDebug("New image"); + image->convertFromImage(*qimage); + delete qimage; + char tmpfile[sizeof(tmp)+1]; + strcpy(tmpfile,tmp); + int f = mkstemp(tmpfile); + close(f); + //qDebug("TMPFILE:%s", tmpfile); + if (image->save(tmpfile,"PNG")) + { + QCopEnvelope e("QPE/Application/showimg", "setDocument(QString)"); + e << QString(tmpfile); + } + Global::statusMessage("Opening image"); + sleep(5); + delete image; + unlink(tmpfile); +*/ +} + +#endif + +unsigned short CPlucker_base::finduid(unsigned short urlid) +{ +// //qDebug("Finding %u", urlid); + unsigned short jmin = 1, jmax = ntohs(head.recordList.numRecords); + unsigned short jmid = (jmin+jmax) >> 1; + while (jmax - jmin > 1) + { + gotorecordnumber(jmid); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + unsigned short luid = thishdr_uid; +// //qDebug("%u %u %u : %u", jmin, jmid, jmax, urlid); + if (luid == urlid) + { + return jmid; + } + if (luid < urlid) + { + jmin = jmid; + } + else + { + jmax = jmid; + } + jmid = (jmin+jmax) >> 1; + } + gotorecordnumber(jmin); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + unsigned short luid = thishdr_uid; + //qDebug("jmin at end:%u,%u", jmin, luid); + if (luid == urlid) + { + return jmin; + } + gotorecordnumber(jmax); + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + luid = thishdr_uid; + //qDebug("jmax at end:%u,%u", jmax, luid); + if (luid == urlid) + { + return jmax; + } + //qDebug("Couldn't find %u", urlid); + return 0; // Not found! +} + +#include + +void CPlucker_base::setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen) +{ + unsigned short sz = 0; + for (CList::iterator it = visited.begin(); it != visited.end(); it++) + { + sz++; + } + size_t newlen = srclen+sizeof(sz)+sz*sizeof(unsigned long); + unsigned char* newdata = new unsigned char[newlen]; + unsigned char* pdata = newdata; + memcpy(newdata, src, srclen); + newdata += srclen; + memcpy(newdata, &sz, sizeof(sz)); + newdata += sizeof(sz); +#ifdef _WINDOWS + for (it = visited.begin(); it != visited.end(); it++) +#else + for (CList::iterator it = visited.begin(); it != visited.end(); it++) +#endif + { + unsigned long t = *it; +// qDebug("[%u]", t); + memcpy(newdata, &t, sizeof(t)); + newdata += sizeof(t); + } + m_nav.setSaveData(data, len, pdata, newlen); + delete [] pdata; +} + +void CPlucker_base::putSaveData(unsigned char*& src, unsigned short& srclen) +{ + unsigned short sz; + if (srclen >= sizeof(sz)) + { + memcpy(&sz, src, sizeof(sz)); + src += sizeof(sz); + srclen -= sizeof(sz); + } + for (int i = 0; i < sz; i++) + { + unsigned long t; + if (srclen >= sizeof(t)) + { + memcpy(&t, src, sizeof(t)); +// qDebug("[%u]", t); + visited.push_front(t); + src += sizeof(t); + srclen -= sizeof(t); + } + else + { + QMessageBox::warning(NULL, PROGNAME, "File data mismatch\nMight fix itself"); + break; + } + } + m_nav.putSaveData(src, srclen); +} + +int CPlucker_base::OpenFile(const char *src) +{ + m_lastBreak = 0; + if (!Cpdb::openfile(src)) + { + return -1; + } + + if (!CorrectDecoder()) return -1; + + gotorecordnumber(0); + fread(&hdr0, 1, 6, fin); + setbuffersize(); + compressedtextbuffer = new UInt8[compressedbuffersize]; + expandedtextbuffer = new UInt8[buffersize]; + + //qDebug("Total number of records:%u", ntohs(head.recordList.numRecords)); + + unsigned int nrecs = ntohs(hdr0.nRecords); + //qDebug("Version %u, no. recs %u", ntohs(hdr0.version), nrecs); + UInt16 homerecid = 1; + for (unsigned int i = 0; i < nrecs; i++) + { + UInt16 id, name; + fread(&name, 1, sizeof(name), fin); + fread(&id, 1, sizeof(id), fin); + //qDebug("N:%d, I:%d", ntohs(name), ntohs(id)); + if (ntohs(name) == 0) homerecid = ntohs(id); + } + + textlength = 0; + for (int recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++) + { + gotorecordnumber(recptr); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (thishdr_uid == homerecid) + { + m_homepos = textlength; + break; + } + if (thishdr_type < 2) textlength += thishdr_size; + } + textlength = 0; + home(); +#ifdef LOCALPICTURES + if (m_viewer == NULL) + { + m_viewer = new QScrollView(NULL); + m_picture = new QWidget(m_viewer->viewport()); + m_viewer->addChild(m_picture); + } +#endif + return 0; + +} + +QImage* CPlucker_base::getimg(UInt16 tgt) +{ + size_t reclen; + UInt16 thisrec = finduid(tgt); + reclen = recordlength(thisrec); + gotorecordnumber(thisrec); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + reclen -= HeaderSize(); + + UInt32 imgsize = thishdr_size; + UInt8* imgbuffer = new UInt8[imgsize]; + + Expand(reclen, thishdr_type, imgbuffer, imgsize); + + return imagefromdata(imgbuffer, imgsize); +} + +linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) +{ + visited.push_front(n); + UInt16 tuid = (n >> 16); + n &= 0xffff; +// //qDebug("Hyper:<%u,%u>", tuid, n); + UInt16 thisrec = 1; + currentpos = 0; + gotorecordnumber(thisrec); + UInt16 thishdr_uid, thishdr_nParagraphs; + UInt32 thishdr_size; + UInt8 thishdr_type, thishdr_reserved; + while (1) + { + GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); + if (tuid == thishdr_uid) break; + if (thishdr_type < 2) currentpos += thishdr_size; +// //qDebug("hyper-cp:%u", currentpos); + thisrec++; + if (thisrec >= ntohs(head.recordList.numRecords)) + { + char *turl = geturl(tuid); + if (turl == NULL) + { + QMessageBox::information(NULL, + QString(PROGNAME), + QString("Couldn't find link") + ); + } + else + { + wrd = turl; +#ifdef USEQPE + if (wrd.length() > 10) + { + Global::statusMessage(wrd.left(8) + ".."); + } + else + { + Global::statusMessage(wrd); + } +#else +#endif /* USEQPE */ + //qDebug("Link:%s", (const char*)wrd); +// setlink(fn, wrd); + delete [] turl; + } + return eNone; + } + gotorecordnumber(thisrec); + } + if (thishdr_type > 1) + { + if (thishdr_type == 4) + { + QMessageBox::information(NULL, + QString(PROGNAME), + QString("Mailto links\nnot yet supported (2)")); + } + else + { + if (thishdr_type > 3) + { + QMessageBox::information(NULL, + QString(PROGNAME), + QString("External links\nnot yet supported (2)") + ); + return eNone; + } + else + { +#ifdef LOCALPICTURES + showimg(tuid); +#else + return ePicture; +#endif + } + } + return eNone; + } +/* + if (thishdr_type == 2 || thishdr_type == 3) + { + expandimg(thisrec); + + } +*/ + else + { + expand(thisrec); + if (n != 0) + { + if (n >= m_nParas) + { + QMessageBox::information(NULL, + QString(PROGNAME), + QString("Error in link\nPara # too big") + ); + return eNone; + } + unsigned int noff = 0; + for (unsigned int i = 0; i < n; i++) noff += m_ParaOffsets[i]; + n = noff; + } + if (n > thishdr_size) + { + QMessageBox::information(NULL, + QString(PROGNAME), + QString("Error in link\nOffset too big") + ); + return eNone; + } + //qDebug("Hyper:<%u,%u>", tuid, n); + while (bufferpos < n && bufferpos < buffercontent) getch_base(true); +/* // This is faster but the alignment doesn't get set + mystyle.unset(); + bufferpos = n; + currentpos += n; + while (bufferpos >= m_nextPara && m_nextPara >= 0) + { + UInt16 attr = m_ParaAttrs[m_nextParaIndex]; + m_nextParaIndex++; + if (m_nextParaIndex == m_nParas) + { + m_nextPara = -1; + } + else + { + m_nextPara += m_ParaOffsets[m_nextParaIndex]; + } + } +*/ + } + return eLink; +} + +tchar CPlucker_base::getch_base(bool fast) +{ + int ch = bgetch(); + while (ch == 0) + { + ch = bgetch(); +// //qDebug("Function:%x", ch); + switch (ch) + { + case 0x38: +// //qDebug("Break:%u", locate()); + if (m_lastBreak == locate()) + { + ch = bgetch(); + } + else + { + ch = 10; + } + m_lastBreak = locate(); + break; + case 0x0a: + case 0x0c: + { + unsigned long ln = 0; + int skip = ch & 7; + for (int i = 0; i < 2; i++) + { + int ch = bgetch(); + ln = (ln << 8) + ch; +// //qDebug("ch:%d, ln:%u", ch, ln); + } + if (skip == 2) + { + ln <<= 16; + } + else + { + for (int i = 0; i < 2; i++) + { + int ch = bgetch(); + ln = (ln << 8) + ch; +// //qDebug("ch:%d, ln:%u", ch, ln); + } + } +// //qDebug("ln:%u", ln); + mystyle.setLink(true); + mystyle.setData(ln); +// mystyle.setColour(255, 0, 0); + bool hasseen = false; + for (CList::iterator it = visited.begin(); it != visited.end(); it++) + { + if (*it == ln) + { + hasseen = true; + break; + } + } + if (hasseen) + { + mystyle.setStrikethru(); + } + else + { + mystyle.setUnderline(); + } + ch = bgetch(); + } + break; + case 0x08: + ch = bgetch(); +// mystyle.setColour(0, 0, 0); + mystyle.unsetUnderline(); + mystyle.unsetStrikethru(); + mystyle.setLink(false); + mystyle.setData(0); + break; + case 0x40: + mystyle.setItalic(); + ch = bgetch(); + break; + case 0x48: + mystyle.unsetItalic(); + ch = bgetch(); + break; + case 0x11: + { + ch = bgetch(); +// //qDebug("Font:%d",ch); + mystyle.setVOffset(0); + mystyle.unsetMono(); + mystyle.unsetBold(); + mystyle.setFontSize(0); + switch (ch) + { + case 0: + break; + case 1: + mystyle.setBold(); + mystyle.setFontSize(3); + break; + case 2: + mystyle.setBold(); + mystyle.setFontSize(2); + break; + case 3: + mystyle.setBold(); + mystyle.setFontSize(1); + break; + case 4: + mystyle.setBold(); + break; + case 5: + mystyle.setBold(); + break; + case 6: + mystyle.setBold(); + break; + case 7: + mystyle.setBold(); + break; + case 8: // should be fixed width + //qDebug("Trying fixed width"); + mystyle.setMono(); + break; + case 9: + mystyle.setFontSize(-1); + break; + case 10: + mystyle.setFontSize(-2); + mystyle.setVOffset(1); + break; + case 11: + mystyle.setFontSize(-2); + mystyle.setVOffset(-1); + break; + default: + qDebug("Unrecognised font"); + break; + } + ch = bgetch(); + } + break; + case 0x29: + ch = bgetch(); + switch (ch) + { + case 0: + mystyle.setLeftJustify(); +// //qDebug("left"); + break; + case 1: + mystyle.setRightJustify(); +// //qDebug("right"); + break; + case 2: + mystyle.setCentreJustify(); +// //qDebug("centre"); + break; + case 3: + mystyle.setFullJustify(); +// //qDebug("full"); + break; + + } + ch = bgetch(); + break; + case 0x53: + { + int r = bgetch(); + int g = bgetch(); + int b = bgetch(); + mystyle.setColour(r,g,b); + ch = bgetch(); + } + break; + case 0x1a: + case 0x5c: + { + bool hasalternate = (ch == 0x5c); + UInt16 ir = bgetch(); + ir = (ir << 8) + bgetch(); + if (hasalternate) + { + //qDebug("Alternate image:%x", ir); + UInt16 ir2 = bgetch(); + ir2 = (ir2 << 8) + bgetch(); + if (!fast) mystyle.setPicture(true, expandimg(ir2, true), true, ir << 16); +#ifdef LOCALPICTURES + UInt32 ln = ir; + ln <<= 16; + mystyle.setLink(true); + mystyle.setData(ln); +#endif + } + else + { + if (!fast) mystyle.setPicture(true, expandimg(ir)); + } +// if (mystyle.getLink()) qDebug("Picture link!"); + ch = '#'; + } +// ch = bgetch(); + break; + case 0x33: + { + UInt8 h = bgetch(); + UInt8 wc = bgetch(); + UInt8 pc = bgetch(); + UInt16 w = wc; +// //qDebug("h,w,pc [%u, %u, %u]", h, w, pc); + if (w == 0) + { + w = (m_scrWidth*(unsigned long)pc)/100; + } + if (w == 0) w = m_scrWidth; + mystyle.setPicture(false, hRule(w,h,mystyle.Red(),mystyle.Green(),mystyle.Blue())); +// if (mystyle.getLink()) //qDebug("hRule link!"); + ch = '#'; + } + break; + case 0x60: + mystyle.setUnderline(); + ch = bgetch(); + break; + case 0x68: + mystyle.unsetUnderline(); + ch = bgetch(); + break; + case 0x22: + ch = bgetch(); + mystyle.setLeftMargin(ch); +// //qDebug("Left margin:%d", ch); + ch = bgetch(); + mystyle.setRightMargin(ch); +// //qDebug("Right margin:%d", ch); + ch = bgetch(); + break; + case 0x70: + mystyle.setStrikethru(); + ch = bgetch(); + break; + case 0x78: + mystyle.unsetStrikethru(); + ch = bgetch(); + break; + case 0x83: + { + int tlen = bgetch(); + ch = bgetch(); + ch <<= 8; + ch |= (tchar)bgetch(); + for (int i = 0; i < tlen; i++) bgetch(); + //qDebug("Function 83"); + } + break; + case 0x85: + default: + qDebug("Function:%x NOT IMPLEMENTED", ch); + { + int skip = ch & 7; + for (int i = 0; i < skip; i++) + { + ch = bgetch(); + //qDebug("Arg %d, %d", i, ch); + } + ch = bgetch(); + } + } + } + + if (m_lastIsBreak && !mystyle.isMono()) + { + while (ch == ' ') + { + ch = getch(false); + } + } + + m_lastIsBreak = (ch == 10); + + return (ch == EOF) ? UEOF : ch; +} diff --git a/noncore/apps/opie-reader/plucker_base.h b/noncore/apps/opie-reader/plucker_base.h new file mode 100644 index 0000000..131b999 --- a/dev/null +++ b/noncore/apps/opie-reader/plucker_base.h @@ -0,0 +1,119 @@ +#ifndef __PLUCKER_BASE_H +#define __PLUCKER_BASE_H + +#include "useqpe.h" +#include "CExpander.h" +#include +#include "ztxt.h" +#include "pdb.h" +#include "CBuffer.h" +#include "my_list.h" +#include "Navigation.h" + +struct CPlucker_record0 +{ + UInt16 uid; + UInt16 version; + UInt16 nRecords; +}; + +struct CPluckerbkmk +{ + UInt32 offset; + tchar title[MAX_BMRK_LENGTH]; +}; + +#ifdef LOCALPICTURES +class QScrollView; +class QWidget; +#endif + +class CPlucker_base : public CExpander, public Cpdb +{ +protected: + virtual void setbuffersize() = 0; + virtual void GetHeader(UInt16&, UInt16&, UInt32&, UInt8&, UInt8&) = 0; + virtual int HeaderSize() = 0; + unsigned short finduid(unsigned short); + char* geturl(UInt16); + void Expand(UInt32, UInt8, UInt8*, UInt32); + CList visited; + bool m_lastIsBreak; +#ifdef LOCALPICTURES + QScrollView* m_viewer; + QWidget* m_picture; +#endif + size_t textlength, m_lastBreak; + UInt16 uid; + int m_nextPara, m_nextParaIndex; + CBufferFace m_ParaOffsets; + CBufferFace m_ParaAttrs; + UInt16 m_nParas; + CStyle mystyle; +// bool bInit; + UInt32 buffersize; + UInt32 compressedbuffersize; + UInt32 buffercontent; + UInt8* expandedtextbuffer; + UInt8* compressedtextbuffer; +// char* urls; +// size_t urlsize; + size_t bufferpos; + UInt16 bufferrec; + CPlucker_record0 hdr0; + bool m_bufferisreserved; + size_t currentpos; + bool expand(int); + void UnZip(UInt8*, size_t, UInt8*, size_t); + void UnDoc(UInt8*, size_t, UInt8*, size_t); +#ifdef LOCALPICTURES + void showimg(UInt16 tgt); +#endif + QImage* getimg(UInt16 tgt); + QImage* expandimg(UInt16 tgt, bool border=false); + void home(); + virtual int bgetch() = 0; + CNavigation m_nav; + public: +#ifdef USEQPE + void suspend() + { + CExpander::suspend(fin); + } + void unsuspend() + { + CExpander::unsuspend(fin); + } +#endif + QImage* getPicture(unsigned long tgt); + void sizes(unsigned long& _file, unsigned long& _text); + bool hasrandomaccess() { return true; } + virtual ~CPlucker_base(); + CPlucker_base(); + int OpenFile(const char *src); + virtual tchar getch(bool) = 0; + tchar getch_base(bool); + int getch(); + void getch(tchar&, CStyle&); + unsigned int locate(); + void locate(unsigned int n); + CList* getbkmklist(); + linkType hyperlink(unsigned int n, QString&); + MarkupType PreferredMarkup() + { + return cNONE; + } + void saveposn(size_t posn) { m_nav.saveposn(posn); } + void writeposn(size_t posn) { m_nav.writeposn(posn); } + bool forward(size_t& loc) { return m_nav.forward(loc); } + bool back(size_t& loc) { return m_nav.back(loc); } + bool hasnavigation() { return true; } + void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen); + void putSaveData(unsigned char*& src, unsigned short& srclen); + + virtual bool CorrectDecoder() = 0; +// virtual void setlink(QString&, const QString&) = 0; + virtual QImage* imagefromdata(UInt8*, UInt32) = 0; +}; + +#endif diff --git a/noncore/apps/opie-reader/qtreader.pro b/noncore/apps/opie-reader/qtreader.pro new file mode 100644 index 0000000..db85aa4 --- a/dev/null +++ b/noncore/apps/opie-reader/qtreader.pro @@ -0,0 +1,90 @@ +TEMPLATE = app +CONFIG = qt warn_on release +HEADERS = Aportis.h \ + Bkmks.h \ + BuffDoc.h \ + CAnnoEdit.h \ + CBuffer.h \ + CDrawBuffer.h \ + CEncoding.h \ + CEncoding_tables.h \ + CExpander.h \ + CFilter.h \ + CloseDialog.h \ + Filedata.h \ + FixedFont.h \ + FontControl.h \ + GraphicWin.h \ + Markups.h \ + Navigation.h \ + Palm2QImage.h \ + Prefs.h \ + QFloatBar.h \ + QTReader.h \ + QTReaderApp.h \ + QtrListView.h \ + Queue.h \ + StateData.h \ + StyleConsts.h \ + ToolbarPrefs.h \ + URLDialog.h \ + ZText.h \ + arith.h \ + cbkmkselector.h \ + config.h \ + fileBrowser.h \ + infowin.h \ + linktype.h \ + my_list.h \ + names.h \ + opie.h \ + pdb.h \ + plucker_base.h \ + plucker.h \ + ppm.h \ + ppm_expander.h \ + usenef.h \ + useqpe.h \ + ustring.h \ + utypes.h \ + version.h \ + ztxt.h + +SOURCES = Aportis.cpp \ + Bkmks.cpp \ + BuffDoc.cpp \ + CBuffer.cpp \ + CDrawBuffer.cpp \ + CEncoding.cpp \ + CEncoding_tables.cpp \ + CFilter.cpp \ + CloseDialog.cpp \ + FontControl.cpp \ + Navigation.cpp \ + Palm2QImage.cpp \ + Prefs.cpp \ + QTReader.cpp \ + QTReaderApp.cpp \ + QtrListView.cpp \ + StyleConsts.cpp \ + ToolbarPrefs.cpp \ + URLDialog.cpp \ + arith_d.cpp \ + fileBrowser.cpp \ + infowin.cpp \ + main.cpp \ + pdb.cpp \ + plucker.cpp \ + plucker_base.cpp \ + ppm.cpp \ + ppm_expander.cpp \ + version.cpp \ + ztxt.cpp + +INTERFACES = +DESTDIR = ../bin +#INCLUDEPATH += $(QPEDIR)/include +#DEPENDPATH += $(QPEDIR)/include +TARGET = uqtreader +LIBS += -lqpe + diff --git a/noncore/apps/opie-reader/usenef.h b/noncore/apps/opie-reader/usenef.h new file mode 100644 index 0000000..57898cb --- a/dev/null +++ b/noncore/apps/opie-reader/usenef.h @@ -0,0 +1,6 @@ +#ifndef __USENEF_H +#define __USENEF_H + +//#define USENEF + +#endif diff --git a/noncore/apps/opie-reader/useqpe.h b/noncore/apps/opie-reader/useqpe.h new file mode 100644 index 0000000..1fc39de --- a/dev/null +++ b/noncore/apps/opie-reader/useqpe.h @@ -0,0 +1,3 @@ +#ifndef USEQPE +#define USEQPE +#endif diff --git a/noncore/apps/opie-reader/version.cpp b/noncore/apps/opie-reader/version.cpp new file mode 100644 index 0000000..3796b67 --- a/dev/null +++ b/noncore/apps/opie-reader/version.cpp @@ -0,0 +1,39 @@ +#include "version.h" +#include "names.h" +#include + +bool CheckVersion(int& major, int& bkmktype, char& minor) +{ + if ( + (major != MAJOR) + || + (bkmktype != BKMKTYPE) + || + (minor != MINOR) + ) + { + major = MAJOR; + bkmktype = BKMKTYPE; + minor = MINOR; +/* + QMessageBox::warning(NULL, PROGNAME, + "This is the first time that you have\n" + "run this version of OpieReader.\n\n" + "There are two new icons visible at\n" + "the left end of the toolbar. The left\n" + "one brings up the menus, the next\n" + "one brings up the settings dialog.\n\n" + "Start by tapping the settings icon\n" + "and selecting the Buttons tab to\n" + "make sure that the buttons are\n" + "mapped as you expect\n\n" + "Next go to Settings/Toolbars via the\n" + "menu icon to set up your toolbars."); +*/ + return true; + } + else + { + return false; + } +} -- cgit v0.9.0.2