From bd0f3345a938b35ce6a12f6150373b0955b8dd12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:24:15 -0500 Subject: Add Qt3 development HEAD version --- examples/qwerty/ANSI_X3.110-1983.map | 511 +++++++++++++++++++++++++++++++++++ examples/qwerty/ANSI_X3.110-1983.txt | 7 + examples/qwerty/IBM277.map | 350 ++++++++++++++++++++++++ examples/qwerty/IBM277.txt | 1 + examples/qwerty/eucJP.txt | 7 + examples/qwerty/koi8.txt | 7 + examples/qwerty/latin1.txt | 7 + examples/qwerty/main.cpp | 37 +++ examples/qwerty/msunicode.txt | Bin 0 -> 298 bytes examples/qwerty/qwerty.cpp | 354 ++++++++++++++++++++++++ examples/qwerty/qwerty.doc | 27 ++ examples/qwerty/qwerty.h | 58 ++++ examples/qwerty/qwerty.pro | 11 + examples/qwerty/unicode.txt | Bin 0 -> 208 bytes 14 files changed, 1377 insertions(+) create mode 100644 examples/qwerty/ANSI_X3.110-1983.map create mode 100644 examples/qwerty/ANSI_X3.110-1983.txt create mode 100644 examples/qwerty/IBM277.map create mode 100644 examples/qwerty/IBM277.txt create mode 100644 examples/qwerty/eucJP.txt create mode 100644 examples/qwerty/koi8.txt create mode 100644 examples/qwerty/latin1.txt create mode 100644 examples/qwerty/main.cpp create mode 100644 examples/qwerty/msunicode.txt create mode 100644 examples/qwerty/qwerty.cpp create mode 100644 examples/qwerty/qwerty.doc create mode 100644 examples/qwerty/qwerty.h create mode 100644 examples/qwerty/qwerty.pro create mode 100644 examples/qwerty/unicode.txt (limited to 'examples/qwerty') diff --git a/examples/qwerty/ANSI_X3.110-1983.map b/examples/qwerty/ANSI_X3.110-1983.map new file mode 100644 index 0000000..1b7058e --- /dev/null +++ b/examples/qwerty/ANSI_X3.110-1983.map @@ -0,0 +1,511 @@ + ANSI_X3.110-1983 + % + / +% version: 1.0 +% repertoiremap: mnemonic,ds +% source: ECMA registry + +% alias ISO-IR-99 +% alias CSA_T500-1983 +% alias NAPLPS +CHARMAP + /x00 NULL (NUL) + /x01 START OF HEADING (SOH) + /x02 START OF TEXT (STX) + /x03 END OF TEXT (ETX) + /x04 END OF TRANSMISSION (EOT) + /x05 ENQUIRY (ENQ) + /x06 ACKNOWLEDGE (ACK) + /x07 BELL (BEL) + /x08 BACKSPACE (BS) + /x09 CHARACTER TABULATION (HT) + /x0A LINE FEED (LF) + /x0B LINE TABULATION (VT) + /x0C FORM FEED (FF) + /x0D CARRIAGE RETURN (CR) + /x0E SHIFT OUT (SO) + /x0F SHIFT IN (SI) +
/x10 DATALINK ESCAPE (DLE) + /x11 DEVICE CONTROL ONE (DC1) + /x12 DEVICE CONTROL TWO (DC2) + /x13 DEVICE CONTROL THREE (DC3) + /x14 DEVICE CONTROL FOUR (DC4) + /x15 NEGATIVE ACKNOWLEDGE (NAK) + /x16 SYNCHRONOUS IDLE (SYN) + /x17 END OF TRANSMISSION BLOCK (ETB) + /x18 CANCEL (CAN) + /x19 END OF MEDIUM (EM) + /x1A SUBSTITUTE (SUB) + /x1B ESCAPE (ESC) + /x1C FILE SEPARATOR (IS4) + /x1D GROUP SEPARATOR (IS3) + /x1E RECORD SEPARATOR (IS2) + /x1F UNIT SEPARATOR (IS1) + /x20 SPACE + /x21 EXCLAMATION MARK +<"> /x22 QUOTATION MARK +<%> /x25 PERCENT SIGN +<&> /x26 AMPERSAND +<'> /x27 APOSTROPHE +<(> /x28 LEFT PARENTHESIS +<)> /x29 RIGHT PARENTHESIS +<*> /x2A ASTERISK +<+> /x2B PLUS SIGN +<,> /x2C COMMA +<-> /x2D HYPHEN-MINUS +<.> /x2E FULL STOP + /x2F SOLIDUS +<0> /x30 DIGIT ZERO +<1> /x31 DIGIT ONE +<2> /x32 DIGIT TWO +<3> /x33 DIGIT THREE +<4> /x34 DIGIT FOUR +<5> /x35 DIGIT FIVE +<6> /x36 DIGIT SIX +<7> /x37 DIGIT SEVEN +<8> /x38 DIGIT EIGHT +<9> /x39 DIGIT NINE +<:> /x3A COLON +<;> /x3B SEMICOLON +<<> /x3C LESS-THAN SIGN +<=> /x3D EQUALS SIGN +> /x3E GREATER-THAN SIGN + /x3F QUESTION MARK + /x40 COMMERCIAL AT + /x41 LATIN CAPITAL LETTER A + /x42 LATIN CAPITAL LETTER B + /x43 LATIN CAPITAL LETTER C + /x44 LATIN CAPITAL LETTER D + /x45 LATIN CAPITAL LETTER E + /x46 LATIN CAPITAL LETTER F + /x47 LATIN CAPITAL LETTER G + /x48 LATIN CAPITAL LETTER H + /x49 LATIN CAPITAL LETTER I + /x4A LATIN CAPITAL LETTER J + /x4B LATIN CAPITAL LETTER K + /x4C LATIN CAPITAL LETTER L + /x4D LATIN CAPITAL LETTER M + /x4E LATIN CAPITAL LETTER N + /x4F LATIN CAPITAL LETTER O +

/x70 LATIN SMALL LETTER P + /x71 LATIN SMALL LETTER Q + /x72 LATIN SMALL LETTER R + /x73 LATIN SMALL LETTER S + /x74 LATIN SMALL LETTER T + /x75 LATIN SMALL LETTER U + /x76 LATIN SMALL LETTER V + /x77 LATIN SMALL LETTER W + /x78 LATIN SMALL LETTER X + /x79 LATIN SMALL LETTER Y + /x7A LATIN SMALL LETTER Z +<(!> /x7B LEFT CURLY BRACKET + /x7C VERTICAL LINE + /x7D RIGHT CURLY BRACKET +<'?> /x7E TILDE +

/x7F DELETE (DEL) + /x80 PADDING CHARACTER (PAD) + /x81 HIGH OCTET PRESET (HOP) + /x82 BREAK PERMITTED HERE (BPH) + /x83 NO BREAK HERE (NBH) + /x84 INDEX (IND) + /x85 NEXT LINE (NEL) + /x86 START OF SELECTED AREA (SSA) + /x87 END OF SELECTED AREA (ESA) + /x88 CHARACTER TABULATION SET (HTS) + /x89 CHARACTER TABULATION WITH JUSTIFICATION (HTJ) + /x8A LINE TABULATION SET (VTS) + /x8B PARTIAL LINE FORWARD (PLD) + /x8C PARTIAL LINE BACKWARD (PLU) + /x8D REVERSE LINE FEED (RI) + /x8E SINGLE-SHIFT TWO (SS2) + /x8F SINGLE-SHIFT THREE (SS3) + /x90 DEVICE CONTROL STRING (DCS) + /x91 PRIVATE USE ONE (PU1) + /x92 PRIVATE USE TWO (PU2) + /x93 SET TRANSMIT STATE (STS) + /x94 CANCEL CHARACTER (CCH) + /x95 MESSAGE WAITING (MW) + /x96 START OF GUARDED AREA (SPA) + /x97 END OF GUARDED AREA (EPA) + /x98 START OF STRING (SOS) + /x99 SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI) + /x9A SINGLE CHARACTER INTRODUCER (SCI) + /x9B CONTROL SEQUENCE INTRODUCER (CSI) + /x9C STRING TERMINATOR (ST) + /x9D OPERATING SYSTEM COMMAND (OSC) + /x9E PRIVACY MESSAGE (PM) + /x9F APPLICATION PROGRAM COMMAND (APC) + /xA1 INVERTED EXCLAMATION MARK + /xA2 CENT SIGN + /xA3 POUND SIGN + /xA4 DOLLAR SIGN + /xA5 YEN SIGN + /xA6 NUMBER SIGN + /xA7 SECTION SIGN + /xA8 CURRENCY SIGN +<'6> /xA9 LEFT SINGLE QUOTATION MARK +<"6> /xAA LEFT DOUBLE QUOTATION MARK +<<<> /xAB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +<<-> /xAC LEFTWARDS ARROW +<-!> /xAD UPWARDS ARROW +<-/>> /xAE RIGHTWARDS ARROW +<-v> /xAF DOWNWARDS ARROW + /xB0 DEGREE SIGN +<+-> /xB1 PLUS-MINUS SIGN +<2S> /xB2 SUPERSCRIPT TWO +<3S> /xB3 SUPERSCRIPT THREE +<*X> /xB4 MULTIPLICATION SIGN + /xB5 MICRO SIGN + /xB6 PILCROW SIGN +<.M> /xB7 MIDDLE DOT +<-:> /xB8 DIVISION SIGN +<'9> /xB9 RIGHT SINGLE QUOTATION MARK +<"9> /xBA RIGHT DOUBLE QUOTATION MARK +/>> /xBB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +<14> /xBC VULGAR FRACTION ONE QUARTER +<12> /xBD VULGAR FRACTION ONE HALF +<34> /xBE VULGAR FRACTION THREE QUARTERS + /xBF INVERTED QUESTION MARK +<"!> /xC1 NON-SPACING GRAVE ACCENT (not a real character) +<"'> /xC2 NON-SPACING ACUTE ACCENT (not a real character) +<"/>> /xC3 NON-SPACING CIRCUMFLEX ACCENT (not a real character) +<"?> /xC4 NON-SPACING TILDE (not a real character) +<"-> /xC5 NON-SPACING MACRON (not a real character) +<"(> /xC6 NON-SPACING BREVE (not a real character) +<".> /xC7 NON-SPACING DOT ABOVE (not a real character) +<":> /xC8 NON-SPACING DIAERESIS (not a real character) +<"//> /xC9 NON-SPACING LONG SOLIDUS OVERLAY (not a real character) +<"0> /xCA NON-SPACING RING ABOVE (not a real character) +<",> /xCB NON-SPACING CEDILLA (not a real character) +<"_> /xCC NON-SPACING LOW LINE (not a real character) +<""> /xCD NON-SPACING DOUBLE ACCUTE ACCENT (not a real character) +<";> /xCE NON-SPACING OGONEK (not a real character) +<"<> /xCF NON-SPACING CARON (not a real character) +<-M> /xD0 EM DASH +<1S> /xD1 SUPERSCRIPT ONE + /xD2 REGISTERED SIGN + /xD3 COPYRIGHT SIGN + /xD4 TRADE MARK SIGN + /xD5 EIGHTH NOTE + /xD6 BOX DRAWINGS LIGHT HORIZONTAL + /xD7 BOX DRAWINGS LIGHT VERTICAL + /xD8 BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT + /xD9 BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT + /xDA BLACK LOWER RIGHT TRIANGLE + /xDB BLACK LOWER LEFT TRIANGLE +<18> /xDC VULGAR FRACTION ONE EIGHTH +<38> /xDD VULGAR FRACTION THREE EIGHTHS +<58> /xDE VULGAR FRACTION FIVE EIGHTHS +<78> /xDF VULGAR FRACTION SEVEN EIGHTHS + /xE0 OHM SIGN + /xE1 LATIN CAPITAL LETTER AE + /xE2 LATIN CAPITAL LETTER ETH (Icelandic) +<-a> /xE3 FEMININE ORDINAL INDICATOR + /xE4 LATIN CAPITAL LETTER H WITH STROKE + /xE5 BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL + /xE6 LATIN CAPITAL LIGATURE IJ + /xE7 LATIN CAPITAL LETTER L WITH MIDDLE DOT + /xE8 LATIN CAPITAL LETTER L WITH STROKE + /xE9 LATIN CAPITAL LETTER O WITH STROKE + /xEA LATIN CAPITAL LIGATURE OE +<-o> /xEB MASCULINE ORDINAL INDICATOR + /xEC LATIN CAPITAL LETTER THORN (Icelandic) + /xED LATIN CAPITAL LETTER T WITH STROKE + /xEE LATIN CAPITAL LETTER ENG (Sami) +<'n> /xEF LATIN SMALL LETTER N PRECEDED BY APOSTROPHE + /xF0 LATIN SMALL LETTER KRA (Greenlandic) + /xF1 LATIN SMALL LETTER AE + /xF2 LATIN SMALL LETTER D WITH STROKE + /xF3 LATIN SMALL LETTER ETH (Icelandic) + /xF4 LATIN SMALL LETTER H WITH STROKE + /xF5 LATIN SMALL LETTER DOTLESS I + /xF6 LATIN SMALL LIGATURE IJ + /xF7 LATIN SMALL LETTER L WITH MIDDLE DOT + /xF8 LATIN SMALL LETTER L WITH STROKE + /xF9 LATIN SMALL LETTER O WITH STROKE + /xFA LATIN SMALL LIGATURE OE + /xFB LATIN SMALL LETTER SHARP S (German) + /xFC LATIN SMALL LETTER THORN (Icelandic) + /xFD LATIN SMALL LETTER T WITH STROKE + /xFE LATIN SMALL LETTER ENG (Sami) +<''> /xC2/x20 ACUTE ACCENT + /xC2/x61 LATIN SMALL LETTER A WITH ACUTE + /xC2/x41 LATIN CAPITAL LETTER A WITH ACUTE + /xC2/x65 LATIN SMALL LETTER E WITH ACUTE + /xC2/x45 LATIN CAPITAL LETTER E WITH ACUTE + /xC2/x69 LATIN SMALL LETTER I WITH ACUTE + /xC2/x49 LATIN CAPITAL LETTER I WITH ACUTE + /xC2/x6F LATIN SMALL LETTER O WITH ACUTE + /xC2/x4F LATIN CAPITAL LETTER O WITH ACUTE + /xC2/x75 LATIN SMALL LETTER U WITH ACUTE + /xC2/x55 LATIN CAPITAL LETTER U WITH ACUTE + /xC2/x79 LATIN SMALL LETTER Y WITH ACUTE + /xC2/x59 LATIN CAPITAL LETTER Y WITH ACUTE + /xC2/x63 LATIN SMALL LETTER C WITH ACUTE + /xC2/x43 LATIN CAPITAL LETTER C WITH ACUTE + /xC2/x6C LATIN SMALL LETTER L WITH ACUTE + /xC2/x4C LATIN CAPITAL LETTER L WITH ACUTE + /xC2/x6E LATIN SMALL LETTER N WITH ACUTE + /xC2/x4E LATIN CAPITAL LETTER N WITH ACUTE + /xC2/x72 LATIN SMALL LETTER R WITH ACUTE + /xC2/x52 LATIN CAPITAL LETTER R WITH ACUTE + /xC2/x73 LATIN SMALL LETTER S WITH ACUTE + /xC2/x53 LATIN CAPITAL LETTER S WITH ACUTE + /xC2/x7A LATIN SMALL LETTER Z WITH ACUTE + /xC2/x5A LATIN CAPITAL LETTER Z WITH ACUTE +<'(> /xC6/x20 BREVE + /xC6/x61 LATIN SMALL LETTER A WITH BREVE + /xC6/x41 LATIN CAPITAL LETTER A WITH BREVE + /xC6/x67 LATIN SMALL LETTER G WITH BREVE + /xC6/x47 LATIN CAPITAL LETTER G WITH BREVE + /xC6/x75 LATIN SMALL LETTER U WITH BREVE + /xC6/x55 LATIN CAPITAL LETTER U WITH BREVE +<'<> /xCF/x20 CARON (Mandarin Chinese third tone) + /xCF/x63 LATIN SMALL LETTER C WITH CARON + /xCF/x43 LATIN CAPITAL LETTER C WITH CARON + /xCF/x64 LATIN SMALL LETTER D WITH CARON + /xCF/x44 LATIN CAPITAL LETTER D WITH CARON + /xCF/x65 LATIN SMALL LETTER E WITH CARON + /xCF/x45 LATIN CAPITAL LETTER E WITH CARON + /xCF/x6C LATIN SMALL LETTER L WITH CARON + /xCF/x4C LATIN CAPITAL LETTER L WITH CARON + /xCF/x6E LATIN SMALL LETTER N WITH CARON + /xCF/x4E LATIN CAPITAL LETTER N WITH CARON + /xCF/x72 LATIN SMALL LETTER R WITH CARON + /xCF/x52 LATIN CAPITAL LETTER R WITH CARON + /xCF/x73 LATIN SMALL LETTER S WITH CARON + /xCF/x53 LATIN CAPITAL LETTER S WITH CARON + /xCF/x74 LATIN SMALL LETTER T WITH CARON + /xCF/x54 LATIN CAPITAL LETTER T WITH CARON + /xCF/x7A LATIN SMALL LETTER Z WITH CARON + /xCF/x5A LATIN CAPITAL LETTER Z WITH CARON +<',> /xCB/x20 CEDILLA + /xCB/x63 LATIN SMALL LETTER C WITH CEDILLA + /xCB/x43 LATIN CAPITAL LETTER C WITH CEDILLA + /xCB/x67 LATIN SMALL LETTER G WITH CEDILLA + /xCB/x47 LATIN CAPITAL LETTER G WITH CEDILLA + /xCB/x6B LATIN SMALL LETTER K WITH CEDILLA + /xCB/x4B LATIN CAPITAL LETTER K WITH CEDILLA + /xCB/x6C LATIN SMALL LETTER L WITH CEDILLA + /xCB/x4C LATIN CAPITAL LETTER L WITH CEDILLA + /xCB/x6E LATIN SMALL LETTER N WITH CEDILLA + /xCB/x4E LATIN CAPITAL LETTER N WITH CEDILLA + /xCB/x72 LATIN SMALL LETTER R WITH CEDILLA + /xCB/x52 LATIN CAPITAL LETTER R WITH CEDILLA + /xCB/x73 LATIN SMALL LETTER S WITH CEDILLA + /xCB/x53 LATIN CAPITAL LETTER S WITH CEDILLA + /xCB/x74 LATIN SMALL LETTER T WITH CEDILLA + /xCB/x54 LATIN CAPITAL LETTER T WITH CEDILLA +> /xC3/x61 LATIN SMALL LETTER A WITH CIRCUMFLEX +> /xC3/x41 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +> /xC3/x65 LATIN SMALL LETTER E WITH CIRCUMFLEX +> /xC3/x45 LATIN CAPITAL LETTER E WITH CIRCUMFLEX +> /xC3/x69 LATIN SMALL LETTER I WITH CIRCUMFLEX +> /xC3/x49 LATIN CAPITAL LETTER I WITH CIRCUMFLEX +> /xC3/x6F LATIN SMALL LETTER O WITH CIRCUMFLEX +> /xC3/x4F LATIN CAPITAL LETTER O WITH CIRCUMFLEX +> /xC3/x75 LATIN SMALL LETTER U WITH CIRCUMFLEX +> /xC3/x55 LATIN CAPITAL LETTER U WITH CIRCUMFLEX +> /xC3/x79 LATIN SMALL LETTER Y WITH CIRCUMFLEX +> /xC3/x59 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX +> /xC3/x63 LATIN SMALL LETTER C WITH CIRCUMFLEX +> /xC3/x43 LATIN CAPITAL LETTER C WITH CIRCUMFLEX +> /xC3/x67 LATIN SMALL LETTER G WITH CIRCUMFLEX +> /xC3/x47 LATIN CAPITAL LETTER G WITH CIRCUMFLEX +> /xC3/x68 LATIN SMALL LETTER H WITH CIRCUMFLEX +> /xC3/x48 LATIN CAPITAL LETTER H WITH CIRCUMFLEX +> /xC3/x6A LATIN SMALL LETTER J WITH CIRCUMFLEX +> /xC3/x4A LATIN CAPITAL LETTER J WITH CIRCUMFLEX +> /xC3/x73 LATIN SMALL LETTER S WITH CIRCUMFLEX +> /xC3/x53 LATIN CAPITAL LETTER S WITH CIRCUMFLEX +> /xC3/x77 LATIN SMALL LETTER W WITH CIRCUMFLEX +> /xC3/x57 LATIN CAPITAL LETTER W WITH CIRCUMFLEX +<':> /xC8/x20 DIAERESIS + /xC8/x61 LATIN SMALL LETTER A WITH DIAERESIS + /xC8/x41 LATIN CAPITAL LETTER A WITH DIAERESIS + /xC8/x65 LATIN SMALL LETTER E WITH DIAERESIS + /xC8/x45 LATIN CAPITAL LETTER E WITH DIAERESIS + /xC8/x69 LATIN SMALL LETTER I WITH DIAERESIS + /xC8/x49 LATIN CAPITAL LETTER I WITH DIAERESIS + /xC8/x6F LATIN SMALL LETTER O WITH DIAERESIS + /xC8/x4F LATIN CAPITAL LETTER O WITH DIAERESIS + /xC8/x75 LATIN SMALL LETTER U WITH DIAERESIS + /xC8/x55 LATIN CAPITAL LETTER U WITH DIAERESIS + /xC8/x79 LATIN SMALL LETTER Y WITH DIAERESIS + /xC8/x59 LATIN CAPITAL LETTER Y WITH DIAERESIS +<'.> /xC7/x20 DOT ABOVE (Mandarin Chinese light tone) + /xC7/x63 LATIN SMALL LETTER C WITH DOT ABOVE + /xC7/x43 LATIN CAPITAL LETTER C WITH DOT ABOVE + /xC7/x65 LATIN SMALL LETTER E WITH DOT ABOVE + /xC7/x45 LATIN CAPITAL LETTER E WITH DOT ABOVE + /xC7/x67 LATIN SMALL LETTER G WITH DOT ABOVE + /xC7/x47 LATIN CAPITAL LETTER G WITH DOT ABOVE + /xC7/x49 LATIN CAPITAL LETTER I WITH DOT ABOVE + /xC7/x7A LATIN SMALL LETTER Z WITH DOT ABOVE + /xC7/x5A LATIN CAPITAL LETTER Z WITH DOT ABOVE +<'"> /xCD/x20 DOUBLE ACUTE ACCENT + /xCD/x6F LATIN SMALL LETTER O WITH DOUBLE ACUTE + /xCD/x4F LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + /xCD/x75 LATIN SMALL LETTER U WITH DOUBLE ACUTE + /xCD/x55 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + /xC1/x61 LATIN SMALL LETTER A WITH GRAVE + /xC1/x41 LATIN CAPITAL LETTER A WITH GRAVE + /xC1/x65 LATIN SMALL LETTER E WITH GRAVE + /xC1/x45 LATIN CAPITAL LETTER E WITH GRAVE + /xC1/x69 LATIN SMALL LETTER I WITH GRAVE + /xC1/x49 LATIN CAPITAL LETTER I WITH GRAVE + /xC1/x6F LATIN SMALL LETTER O WITH GRAVE + /xC1/x4F LATIN CAPITAL LETTER O WITH GRAVE + /xC1/x75 LATIN SMALL LETTER U WITH GRAVE + /xC1/x55 LATIN CAPITAL LETTER U WITH GRAVE +<'m> /xC5/x20 MACRON + /xC5/x61 LATIN SMALL LETTER A WITH MACRON + /xC5/x41 LATIN CAPITAL LETTER A WITH MACRON + /xC5/x65 LATIN SMALL LETTER E WITH MACRON + /xC5/x45 LATIN CAPITAL LETTER E WITH MACRON + /xC5/x69 LATIN SMALL LETTER I WITH MACRON + /xC5/x49 LATIN CAPITAL LETTER I WITH MACRON + /xC5/x6F LATIN SMALL LETTER O WITH MACRON + /xC5/x4F LATIN CAPITAL LETTER O WITH MACRON + /xC5/x75 LATIN SMALL LETTER U WITH MACRON + /xC5/x55 LATIN CAPITAL LETTER U WITH MACRON +<';> /xCE/x20 OGONEK + /xCE/x61 LATIN SMALL LETTER A WITH OGONEK + /xCE/x41 LATIN CAPITAL LETTER A WITH OGONEK + /xCE/x65 LATIN SMALL LETTER E WITH OGONEK + /xCE/x45 LATIN CAPITAL LETTER E WITH OGONEK + /xCE/x69 LATIN SMALL LETTER I WITH OGONEK + /xCE/x49 LATIN CAPITAL LETTER I WITH OGONEK + /xCE/x75 LATIN SMALL LETTER U WITH OGONEK + /xCE/x55 LATIN CAPITAL LETTER U WITH OGONEK +<'0> /xCA/x20 RING ABOVE + /xCA/x61 LATIN SMALL LETTER A WITH RING ABOVE + /xCA/x41 LATIN CAPITAL LETTER A WITH RING ABOVE + /xCA/x75 LATIN SMALL LETTER U WITH RING ABOVE + /xCA/x55 LATIN CAPITAL LETTER U WITH RING ABOVE + /xC4/x61 LATIN SMALL LETTER A WITH TILDE + /xC4/x41 LATIN CAPITAL LETTER A WITH TILDE + /xC4/x6E LATIN SMALL LETTER N WITH TILDE + /xC4/x4E LATIN CAPITAL LETTER N WITH TILDE + /xC4/x69 LATIN SMALL LETTER I WITH TILDE + /xC4/x49 LATIN CAPITAL LETTER I WITH TILDE + /xC4/x6F LATIN SMALL LETTER O WITH TILDE + /xC4/x4F LATIN CAPITAL LETTER O WITH TILDE + /xC4/x75 LATIN SMALL LETTER U WITH TILDE + /xC4/x55 LATIN CAPITAL LETTER U WITH TILDE + /x00 NUL + /x01 START OF HEADING (SOH) + /x02 START OF TEXT (STX) + /x03 END OF TEXT (ETX) + /x04 END OF TRANSMISSION (EOT) + /x05 ENQUIRY (ENQ) + /x06 ACKNOWLEDGE (ACK) + /x07 BELL (BEL) + /x07 BELL (BEL) + /x08 BACKSPACE (BS) + /x09 CHARACTER TABULATION (HT) + /x0A LINE FEED (LF) + /x0B LINE TABULATION (VT) + /x0C FORM FEED (FF) + /x0D CARRIAGE RETURN (CR) + /x10 DATALINK ESCAPE (DLE) + /x11 DEVICE CONTROL ONE (DC1) + /x12 DEVICE CONTROL TWO (DC2) + /x13 DEVICE CONTROL THREE (DC3) + /x14 DEVICE CONTROL FOUR (DC4) + /x15 NEGATIVE ACKNOWLEDGE (NAK) + /x16 SYNCHRONOUS IDLE (SYN) + /x17 END OF TRANSMISSION BLOCK (ETB) + /x18 CANCEL (CAN) + /x1A SUBSTITUTE (SUB) + /x1B ESCAPE (ESC) + /x1C FILE SEPARATOR (IS4) + /x1D GROUP SEPARATOR (IS3) + /x1D GROUP SEPARATOR (IS3) + /x1E RECORD SEPARATOR (IS2) + /x1F UNIT SEPARATOR (IS1) + /x7F DELETE (DEL) + /x20 SPACE + /x21 EXCLAMATION MARK + /x22 QUOTATION MARK + /xA6 NUMBER SIGN + /xA4 DOLLAR SIGN + /x25 PERCENT SIGN + /x26 AMPERSAND + /x27 APOSTROPHE + /x28 LEFT PARENTHESIS + /x29 RIGHT PARENTHESIS + /x2A ASTERISK + /x2B PLUS SIGN + /x2C COMMA + /x2D HYPHEN-MINUS + /x2D HYPHEN-MINUS + /x2E FULL STOP + /x2E FULL STOP + /x2F SOLIDUS + /x2F SOLIDUS + /x30 DIGIT ZERO + /x31 DIGIT ONE + /x32 DIGIT TWO + /x33 DIGIT THREE + /x34 DIGIT FOUR + /x35 DIGIT FIVE + /x36 DIGIT SIX + /x37 DIGIT SEVEN + /x38 DIGIT EIGHT + /x39 DIGIT NINE + /x3A COLON + /x3B SEMICOLON + /x3C LESS-THAN SIGN + /x3D EQUALS SIGN + /x3E GREATER-THAN SIGN + /x3F QUESTION MARK + /x40 COMMERCIAL AT + /x5B LEFT SQUARE BRACKET + /x5C REVERSE SOLIDUS + /x5C REVERSE SOLIDUS + /x5D RIGHT SQUARE BRACKET + /x5E CIRCUMFLEX ACCENT + /x5E CIRCUMFLEX ACCENT + /x5F LOW LINE + /x5F LOW LINE + /x60 GRAVE ACCENT + /x7B LEFT CURLY BRACKET + /x7B LEFT CURLY BRACKET + /x7C VERTICAL LINE + /x7D RIGHT CURLY BRACKET + /x7D RIGHT CURLY BRACKET + /x7E TILDE +END CHARMAP diff --git a/examples/qwerty/ANSI_X3.110-1983.txt b/examples/qwerty/ANSI_X3.110-1983.txt new file mode 100644 index 0000000..eab6308 --- /dev/null +++ b/examples/qwerty/ANSI_X3.110-1983.txt @@ -0,0 +1,7 @@ +ABCDE +ÂaÃaÄaÈaÊañËcÁeÂeÃeÈeÁiÂiÃiÈióÄnÁoÂoÃoÄoÈoùÁuÂa +????? +????? +????? +?????? +?????? \ No newline at end of file diff --git a/examples/qwerty/IBM277.map b/examples/qwerty/IBM277.map new file mode 100644 index 0000000..51a2472 --- /dev/null +++ b/examples/qwerty/IBM277.map @@ -0,0 +1,350 @@ + IBM277 + % + / +% version: 1.0 +% repertoiremap: mnemonic,ds +% source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + +% alias EBCDIC-CP-DK +% alias EBCDIC-CP-NO +CHARMAP + /x00 NULL (NUL) + /x01 START OF HEADING (SOH) + /x02 START OF TEXT (STX) + /x03 END OF TEXT (ETX) + /x04 STRING TERMINATOR (ST) + /x05 CHARACTER TABULATION (HT) + /x06 START OF SELECTED AREA (SSA) +
/x07 DELETE (DEL) + /x08 END OF GUARDED AREA (EPA) + /x09 REVERSE LINE FEED (RI) + /x0A SINGLE-SHIFT TWO (SS2) + /x0B LINE TABULATION (VT) + /x0C FORM FEED (FF) + /x0D CARRIAGE RETURN (CR) + /x0E SHIFT OUT (SO) + /x0F SHIFT IN (SI) +
/x10 DATALINK ESCAPE (DLE) + /x11 DEVICE CONTROL ONE (DC1) + /x12 DEVICE CONTROL TWO (DC2) + /x13 DEVICE CONTROL THREE (DC3) + /x14 OPERATING SYSTEM COMMAND (OSC) + /x15 NEXT LINE (NEL) + /x16 BACKSPACE (BS) + /x17 END OF SELECTED AREA (ESA) + /x18 CANCEL (CAN) + /x19 END OF MEDIUM (EM) + /x1A PRIVATE USE TWO (PU2) + /x1B SINGLE-SHIFT THREE (SS3) + /x1C FILE SEPARATOR (IS4) + /x1D GROUP SEPARATOR (IS3) + /x1E RECORD SEPARATOR (IS2) + /x1F UNIT SEPARATOR (IS1) + /x20 PADDING CHARACTER (PAD) + /x21 HIGH OCTET PRESET (HOP) + /x22 BREAK PERMITTED HERE (BPH) + /x23 NO BREAK HERE (NBH) + /x24 INDEX (IND) + /x25 LINE FEED (LF) + /x26 END OF TRANSMISSION BLOCK (ETB) + /x27 ESCAPE (ESC) + /x28 CHARACTER TABULATION SET (HTS) + /x29 CHARACTER TABULATION WITH JUSTIFICATION (HTJ) + /x2A LINE TABULATION SET (VTS) + /x2B PARTIAL LINE FORWARD (PLD) + /x2C PARTIAL LINE BACKWARD (PLU) + /x2D ENQUIRY (ENQ) + /x2E ACKNOWLEDGE (ACK) + /x2F BELL (BEL) + /x30 DEVICE CONTROL STRING (DCS) + /x31 PRIVATE USE ONE (PU1) + /x32 SYNCHRONOUS IDLE (SYN) + /x33 SET TRANSMIT STATE (STS) + /x34 CANCEL CHARACTER (CCH) + /x35 MESSAGE WAITING (MW) + /x36 START OF GUARDED AREA (SPA) + /x37 END OF TRANSMISSION (EOT) + /x38 START OF STRING (SOS) + /x39 SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI) + /x3A SINGLE CHARACTER INTRODUCER (SCI) + /x3B CONTROL SEQUENCE INTRODUCER (CSI) + /x3C DEVICE CONTROL FOUR (DC4) + /x3D NEGATIVE ACKNOWLEDGE (NAK) + /x3E PRIVACY MESSAGE (PM) + /x3F SUBSTITUTE (SUB) + /x40 SPACE + /x41 NO-BREAK SPACE +> /x42 LATIN SMALL LETTER A WITH CIRCUMFLEX + /x43 LATIN SMALL LETTER A WITH DIAERESIS + /x44 LATIN SMALL LETTER A WITH GRAVE + /x45 LATIN SMALL LETTER A WITH ACUTE + /x46 LATIN SMALL LETTER A WITH TILDE + /x47 RIGHT CURLY BRACKET + /x48 LATIN SMALL LETTER C WITH CEDILLA + /x49 LATIN SMALL LETTER N WITH TILDE + /x4A NUMBER SIGN +<.> /x4B FULL STOP +<<> /x4C LESS-THAN SIGN +<(> /x4D LEFT PARENTHESIS +<+> /x4E PLUS SIGN + /x4F EXCLAMATION MARK +<&> /x50 AMPERSAND + /x51 LATIN SMALL LETTER E WITH ACUTE +> /x52 LATIN SMALL LETTER E WITH CIRCUMFLEX + /x53 LATIN SMALL LETTER E WITH DIAERESIS + /x54 LATIN SMALL LETTER E WITH GRAVE + /x55 LATIN SMALL LETTER I WITH ACUTE +> /x56 LATIN SMALL LETTER I WITH CIRCUMFLEX + /x57 LATIN SMALL LETTER I WITH DIAERESIS + /x58 LATIN SMALL LETTER I WITH GRAVE + /x59 LATIN SMALL LETTER SHARP S (German) + /x5A CURRENCY SIGN + /x5B LATIN CAPITAL LETTER A WITH RING ABOVE +<*> /x5C ASTERISK +<)> /x5D RIGHT PARENTHESIS +<;> /x5E SEMICOLON +<'/>> /x5F CIRCUMFLEX ACCENT +<-> /x60 HYPHEN-MINUS + /x61 SOLIDUS +> /x62 LATIN CAPITAL LETTER A WITH CIRCUMFLEX + /x63 LATIN CAPITAL LETTER A WITH DIAERESIS + /x64 LATIN CAPITAL LETTER A WITH GRAVE + /x65 LATIN CAPITAL LETTER A WITH ACUTE + /x66 LATIN CAPITAL LETTER A WITH TILDE + /x67 DOLLAR SIGN + /x68 LATIN CAPITAL LETTER C WITH CEDILLA + /x69 LATIN CAPITAL LETTER N WITH TILDE + /x6A LATIN SMALL LETTER O WITH STROKE +<,> /x6B COMMA +<%> /x6C PERCENT SIGN +<_> /x6D LOW LINE +> /x6E GREATER-THAN SIGN + /x6F QUESTION MARK + /x70 BROKEN BAR + /x71 LATIN CAPITAL LETTER E WITH ACUTE +> /x72 LATIN CAPITAL LETTER E WITH CIRCUMFLEX + /x73 LATIN CAPITAL LETTER E WITH DIAERESIS + /x74 LATIN CAPITAL LETTER E WITH GRAVE + /x75 LATIN CAPITAL LETTER I WITH ACUTE +> /x76 LATIN CAPITAL LETTER I WITH CIRCUMFLEX + /x77 LATIN CAPITAL LETTER I WITH DIAERESIS + /x78 LATIN CAPITAL LETTER I WITH GRAVE +<'!> /x79 GRAVE ACCENT +<:> /x7A COLON + /x7B LATIN CAPITAL LETTER AE + /x7C LATIN CAPITAL LETTER O WITH STROKE +<'> /x7D APOSTROPHE +<=> /x7E EQUALS SIGN +<"> /x7F QUOTATION MARK + /x80 COMMERCIAL AT + /x81 LATIN SMALL LETTER A + /x82 LATIN SMALL LETTER B + /x83 LATIN SMALL LETTER C + /x84 LATIN SMALL LETTER D + /x85 LATIN SMALL LETTER E + /x86 LATIN SMALL LETTER F + /x87 LATIN SMALL LETTER G + /x88 LATIN SMALL LETTER H + /x89 LATIN SMALL LETTER I +<<<> /x8A LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +/>> /x8B RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + /x8C LATIN SMALL LETTER ETH (Icelandic) + /x8D LATIN SMALL LETTER Y WITH ACUTE + /x8E LATIN SMALL LETTER THORN (Icelandic) +<+-> /x8F PLUS-MINUS SIGN + /x90 DEGREE SIGN + /x91 LATIN SMALL LETTER J + /x92 LATIN SMALL LETTER K + /x93 LATIN SMALL LETTER L + /x94 LATIN SMALL LETTER M + /x95 LATIN SMALL LETTER N + /x96 LATIN SMALL LETTER O +

/xD7 LATIN CAPITAL LETTER P + /xD8 LATIN CAPITAL LETTER Q + /xD9 LATIN CAPITAL LETTER R +<1S> /xDA SUPERSCRIPT ONE +> /xDB LATIN SMALL LETTER U WITH CIRCUMFLEX +<'?> /xDC TILDE + /xDD LATIN SMALL LETTER U WITH GRAVE + /xDE LATIN SMALL LETTER U WITH ACUTE + /xDF LATIN SMALL LETTER Y WITH DIAERESIS + /xE0 REVERSE SOLIDUS +<-:> /xE1 DIVISION SIGN + /xE2 LATIN CAPITAL LETTER S + /xE3 LATIN CAPITAL LETTER T + /xE4 LATIN CAPITAL LETTER U + /xE5 LATIN CAPITAL LETTER V + /xE6 LATIN CAPITAL LETTER W + /xE7 LATIN CAPITAL LETTER X + /xE8 LATIN CAPITAL LETTER Y + /xE9 LATIN CAPITAL LETTER Z +<2S> /xEA SUPERSCRIPT TWO +> /xEB LATIN CAPITAL LETTER O WITH CIRCUMFLEX + /xEC LATIN CAPITAL LETTER O WITH DIAERESIS + /xED LATIN CAPITAL LETTER O WITH GRAVE + /xEE LATIN CAPITAL LETTER O WITH ACUTE + /xEF LATIN CAPITAL LETTER O WITH TILDE +<0> /xF0 DIGIT ZERO +<1> /xF1 DIGIT ONE +<2> /xF2 DIGIT TWO +<3> /xF3 DIGIT THREE +<4> /xF4 DIGIT FOUR +<5> /xF5 DIGIT FIVE +<6> /xF6 DIGIT SIX +<7> /xF7 DIGIT SEVEN +<8> /xF8 DIGIT EIGHT +<9> /xF9 DIGIT NINE +<3S> /xFA SUPERSCRIPT THREE +> /xFB LATIN CAPITAL LETTER U WITH CIRCUMFLEX + /xFC LATIN CAPITAL LETTER U WITH DIAERESIS + /xFD LATIN CAPITAL LETTER U WITH GRAVE + /xFE LATIN CAPITAL LETTER U WITH ACUTE + /xFF APPLICATION PROGRAM COMMAND (APC) + /x00 NUL + /x01 START OF HEADING (SOH) + /x02 START OF TEXT (STX) + /x03 END OF TEXT (ETX) + /x37 END OF TRANSMISSION (EOT) + /x2D ENQUIRY (ENQ) + /x2E ACKNOWLEDGE (ACK) + /x2F BELL (BEL) + /x2F BELL (BEL) + /x16 BACKSPACE (BS) + /x05 CHARACTER TABULATION (HT) + /x25 LINE FEED (LF) + /x0B LINE TABULATION (VT) + /x0C FORM FEED (FF) + /x0D CARRIAGE RETURN (CR) + /x10 DATALINK ESCAPE (DLE) + /x11 DEVICE CONTROL ONE (DC1) + /x12 DEVICE CONTROL TWO (DC2) + /x13 DEVICE CONTROL THREE (DC3) + /x3C DEVICE CONTROL FOUR (DC4) + /x3D NEGATIVE ACKNOWLEDGE (NAK) + /x32 SYNCHRONOUS IDLE (SYN) + /x26 END OF TRANSMISSION BLOCK (ETB) + /x18 CANCEL (CAN) + /x3F SUBSTITUTE (SUB) + /x27 ESCAPE (ESC) + /x1C FILE SEPARATOR (IS4) + /x1D GROUP SEPARATOR (IS3) + /x1D GROUP SEPARATOR (IS3) + /x1E RECORD SEPARATOR (IS2) + /x1F UNIT SEPARATOR (IS1) + /x07 DELETE (DEL) + /x40 SPACE + /x4F EXCLAMATION MARK + /x7F QUOTATION MARK + /x4A NUMBER SIGN + /x67 DOLLAR SIGN + /x6C PERCENT SIGN + /x50 AMPERSAND + /x7D APOSTROPHE + /x4D LEFT PARENTHESIS + /x5D RIGHT PARENTHESIS + /x5C ASTERISK + /x4E PLUS SIGN + /x6B COMMA + /x60 HYPHEN-MINUS + /x60 HYPHEN-MINUS + /x4B FULL STOP + /x4B FULL STOP + /x61 SOLIDUS + /x61 SOLIDUS + /xF0 DIGIT ZERO + /xF1 DIGIT ONE + /xF2 DIGIT TWO + /xF3 DIGIT THREE + /xF4 DIGIT FOUR + /xF5 DIGIT FIVE + /xF6 DIGIT SIX + /xF7 DIGIT SEVEN + /xF8 DIGIT EIGHT + /xF9 DIGIT NINE + /x7A COLON + /x5E SEMICOLON + /x4C LESS-THAN SIGN + /x7E EQUALS SIGN + /x6E GREATER-THAN SIGN + /x6F QUESTION MARK + /x80 COMMERCIAL AT + /x9E LEFT SQUARE BRACKET + /xE0 REVERSE SOLIDUS + /xE0 REVERSE SOLIDUS + /x9F RIGHT SQUARE BRACKET + /x5F CIRCUMFLEX ACCENT + /x5F CIRCUMFLEX ACCENT + /x6D LOW LINE + /x6D LOW LINE + /x79 GRAVE ACCENT + /x9C LEFT CURLY BRACKET + /x9C LEFT CURLY BRACKET + /xBB VERTICAL LINE + /x47 RIGHT CURLY BRACKET + /x47 RIGHT CURLY BRACKET + /xDC TILDE +END CHARMAP diff --git a/examples/qwerty/IBM277.txt b/examples/qwerty/IBM277.txt new file mode 100644 index 0000000..e0d659c --- /dev/null +++ b/examples/qwerty/IBM277.txt @@ -0,0 +1 @@ +ÁÂÃÄÅ %EBFCÐÀHTQRSXUVWŒIÍÎËÏÌjÝE %????? %????? %????? %?????? %?????? \ No newline at end of file diff --git a/examples/qwerty/eucJP.txt b/examples/qwerty/eucJP.txt new file mode 100644 index 0000000..f7a8672 --- /dev/null +++ b/examples/qwerty/eucJP.txt @@ -0,0 +1,7 @@ +ABCDE +¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢ +¤¢¤¤¤¦¤¨¤ª +¤«¤­¤¯¤±¤³ +¤µ¤·¤¹¤»¤½ +§«§¸§µ§¬§¦§¯ +§Û§è§å§Ü§Ö§ß \ No newline at end of file diff --git a/examples/qwerty/koi8.txt b/examples/qwerty/koi8.txt new file mode 100644 index 0000000..8d08046 --- /dev/null +++ b/examples/qwerty/koi8.txt @@ -0,0 +1,7 @@ +ABCDE +¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ +¤¤¤¤¤ +¤¤¤¤¤ +¤¤¤¤¤ +êãõëåî +ÊÃÕËÅÎ \ No newline at end of file diff --git a/examples/qwerty/latin1.txt b/examples/qwerty/latin1.txt new file mode 100644 index 0000000..14ddc25 --- /dev/null +++ b/examples/qwerty/latin1.txt @@ -0,0 +1,7 @@ +ABCDE +áâãäåæçèéêëìíîïðñòóôõöøùá +????? +????? +????? +?????? +?????? \ No newline at end of file diff --git a/examples/qwerty/main.cpp b/examples/qwerty/main.cpp new file mode 100644 index 0000000..7162ee1 --- /dev/null +++ b/examples/qwerty/main.cpp @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include +#include "qwerty.h" + + +int main( int argc, char **argv ) +{ + QApplication a( argc, argv ); + + + bool isSmall = qApp->desktop()->size().width() < 450 + || qApp->desktop()->size().height() < 450; + + int i; + for ( i= argc <= 1 ? 0 : 1; isetCaption("Qt Example - QWERTY"); + if ( i > 0 ) + e->load( argv[i] ); + if ( isSmall ) { + e->showMaximized(); + } else { + e->resize( 400, 400 ); + e->show(); + } + } + a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); + return a.exec(); +} diff --git a/examples/qwerty/msunicode.txt b/examples/qwerty/msunicode.txt new file mode 100644 index 0000000..a707a76 Binary files /dev/null and b/examples/qwerty/msunicode.txt differ diff --git a/examples/qwerty/qwerty.cpp b/examples/qwerty/qwerty.cpp new file mode 100644 index 0000000..14bdd8b --- /dev/null +++ b/examples/qwerty/qwerty.cpp @@ -0,0 +1,354 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#include "qwerty.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +const bool no_writing = FALSE; + +static QPtrList *codecList = 0; + +enum { Uni = 0, MBug = 1, Lat1 = 2, Local = 3, Guess = 4, Codec = 5 }; + + +Editor::Editor( QWidget * parent , const char * name ) + : QWidget( parent, name, WDestructiveClose ) +{ + m = new QMenuBar( this, "menu" ); + + QPopupMenu * file = new QPopupMenu(); + Q_CHECK_PTR( file ); + m->insertItem( "&File", file ); + + file->insertItem( "&New", this, SLOT(newDoc()), ALT+Key_N ); + file->insertItem( "&Open...", this, SLOT(load()), ALT+Key_O ); + file->insertItem( "&Save...", this, SLOT(save()), ALT+Key_S ); + file->insertSeparator(); + open_as = new QPopupMenu(); + file->insertItem( "Open &As", open_as ); + save_as = new QPopupMenu(); + file->insertItem( "Sa&ve As", save_as ); + file->insertItem( "Add &Encoding", this, SLOT(addEncoding()) ); +#ifndef QT_NO_PRINTER + file->insertSeparator(); + file->insertItem( "&Print...", this, SLOT(print()), ALT+Key_P ); +#endif + file->insertSeparator(); + file->insertItem( "&Close", this, SLOT(close()),ALT+Key_W ); + file->insertItem( "&Quit", qApp, SLOT(closeAllWindows()), ALT+Key_Q ); + + connect( save_as, SIGNAL(activated(int)), this, SLOT(saveAsEncoding(int)) ); + connect( open_as, SIGNAL(activated(int)), this, SLOT(openAsEncoding(int)) ); + rebuildCodecList(); + + QPopupMenu * edit = new QPopupMenu(); + Q_CHECK_PTR( edit ); + m->insertItem( "&Edit", edit ); + + edit->insertItem( "To &Uppercase", this, SLOT(toUpper()), ALT+Key_U ); + edit->insertItem( "To &Lowercase", this, SLOT(toLower()), ALT+Key_L ); +#ifndef QT_NO_FONTDIALOG + edit->insertSeparator(); + edit->insertItem( "&Select Font" , this, SLOT(font()), ALT+Key_T ); +#endif + changed = FALSE; + e = new QMultiLineEdit( this, "editor" ); + connect( e, SIGNAL( textChanged() ), this, SLOT( textChanged() ) ); + + // We use Unifont - if you have it installed you'll see all + // Unicode character glyphs. + // + // Unifont only comes in one pixel size, so we cannot let + // it change pixel size as the display DPI changes. + // + QFont unifont("unifont",16,50); unifont.setPixelSize(16); + e->setFont( unifont ); + + e->setFocus(); +} + +Editor::~Editor() +{ +} + +void Editor::font() +{ +#ifndef QT_NO_FONTDIALOG + bool ok; + QFont f = QFontDialog::getFont( &ok, e->font() ); + if ( ok ) { + e->setFont( f ); + } +#endif +} + + + +void Editor::rebuildCodecList() +{ + delete codecList; + codecList = new QPtrList; + QTextCodec *codec; + int i; + for (i = 0; (codec = QTextCodec::codecForIndex(i)); i++) + codecList->append( codec ); + int n = codecList->count(); + for (int pm=0; pm<2; pm++) { + QPopupMenu* menu = pm ? open_as : save_as; + menu->clear(); + QString local = "Local ("; + local += QTextCodec::codecForLocale()->name(); + local += ")"; + menu->insertItem( local, Local ); + menu->insertItem( "Unicode", Uni ); + menu->insertItem( "Latin1", Lat1 ); + menu->insertItem( "Microsoft Unicode", MBug ); + if ( pm ) + menu->insertItem( "[guess]", Guess ); + for ( i = 0; i < n; i++ ) + menu->insertItem( codecList->at(i)->name(), Codec + i ); + } +} + +void Editor::newDoc() +{ + Editor *ed = new Editor; + if ( qApp->desktop()->size().width() < 450 + || qApp->desktop()->size().height() < 450 ) { + ed->showMaximized(); + } else { + ed->resize( 400, 400 ); + ed->show(); + } +} + + +void Editor::load() +{ +#ifndef QT_NO_FILEDIALOG + QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, this ); + if ( !fn.isEmpty() ) + load( fn, -1 ); +#endif +} + +void Editor::load( const QString& fileName, int code ) +{ + QFile f( fileName ); + if ( !f.open( IO_ReadOnly ) ) + return; + + e->setAutoUpdate( FALSE ); + + QTextStream t(&f); + if ( code >= Codec ) + t.setCodec( codecList->at(code-Codec) ); + else if ( code == Uni ) + t.setEncoding( QTextStream::Unicode ); + else if ( code == MBug ) + t.setEncoding( QTextStream::UnicodeReverse ); + else if ( code == Lat1 ) + t.setEncoding( QTextStream::Latin1 ); + else if ( code == Guess ) { + QFile f(fileName); + f.open(IO_ReadOnly); + char buffer[256]; + int l = 256; + l=f.readBlock(buffer,l); + QTextCodec* codec = QTextCodec::codecForContent(buffer, l); + if ( codec ) { + QMessageBox::information(this,"Encoding",QString("Codec: ")+codec->name()); + t.setCodec( codec ); + } + } + e->setText( t.read() ); + f.close(); + + e->setAutoUpdate( TRUE ); + e->repaint(); + setCaption( fileName ); + + changed = FALSE; +} + +void Editor::openAsEncoding( int code ) +{ +#ifndef QT_NO_FILEDIALOG + //storing filename (proper save) is left as an exercise... + QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, this ); + if ( !fn.isEmpty() ) + (void) load( fn, code ); +#endif +} + +bool Editor::save() +{ +#ifndef QT_NO_FILEDIALOG + //storing filename (proper save) is left as an exercise... + QString fn = QFileDialog::getSaveFileName( QString::null, QString::null, this ); + if ( !fn.isEmpty() ) + return saveAs( fn ); + return FALSE; +#endif +} + +void Editor::saveAsEncoding( int code ) +{ +#ifndef QT_NO_FILEDIALOG + //storing filename (proper save) is left as an exercise... + QString fn = QFileDialog::getSaveFileName( QString::null, QString::null, this ); + if ( !fn.isEmpty() ) + (void) saveAs( fn, code ); +#endif +} + +void Editor::addEncoding() +{ +#ifndef QT_NO_FILEDIALOG + QString fn = QFileDialog::getOpenFileName( QString::null, "*.map", this ); + if ( !fn.isEmpty() ) { + QFile f(fn); + if (f.open(IO_ReadOnly)) { + if (QTextCodec::loadCharmap(&f)) { + rebuildCodecList(); + } else { + QMessageBox::warning(0,"Charmap error", + "The file did not contain a valid charmap.\n\n" + "A charmap file should look like this:\n" + " thename\n" + " /\n" + " % alias thealias\n" + " CHARMAP\n" + " /x12 \n" + " /xAB/x12 \n" + " ...\n" + " END CHARMAP\n" + ); + } + } + } +#endif +} + + +bool Editor::saveAs( const QString& fileName, int code ) +{ + QFile f( fileName ); + if ( no_writing || !f.open( IO_WriteOnly ) ) { + QMessageBox::warning(this,"I/O Error", + QString("The file could not be opened.\n\n") + +fileName); + return FALSE; + } + QTextStream t(&f); + if ( code >= Codec ) + t.setCodec( codecList->at(code-Codec) ); + else if ( code == Uni ) + t.setEncoding( QTextStream::Unicode ); + else if ( code == MBug ) + t.setEncoding( QTextStream::UnicodeReverse ); + else if ( code == Lat1 ) + t.setEncoding( QTextStream::Latin1 ); + t << e->text(); + f.close(); + setCaption( fileName ); + changed = FALSE; + return TRUE; +} + +void Editor::print() +{ +#ifndef QT_NO_PRINTER + if ( printer.setup(this) ) { // opens printer dialog + printer.setFullPage(TRUE); // we'll set our own margins + QPainter p; + p.begin( &printer ); // paint on printer + p.setFont( e->font() ); + QFontMetrics fm = p.fontMetrics(); + QPaintDeviceMetrics metrics( &printer ); // need width/height + // of printer surface + const int MARGIN = metrics.logicalDpiX() / 2; // half-inch margin + int yPos = MARGIN; // y position for each line + + for( int i = 0 ; i < e->numLines() ; i++ ) { + if ( printer.aborted() ) + break; + if ( yPos + fm.lineSpacing() > metrics.height() - MARGIN ) { + // no more room on this page + if ( !printer.newPage() ) // start new page + break; // some error + yPos = MARGIN; // back to top of page + } + p.drawText( MARGIN, yPos, metrics.width() - 2*MARGIN, + fm.lineSpacing(), ExpandTabs, e->textLine( i ) ); + yPos += fm.lineSpacing(); + } + p.end(); // send job to printer + } +#endif +} + +void Editor::resizeEvent( QResizeEvent * ) +{ + if ( e && m ) + e->setGeometry( 0, m->height(), width(), height() - m->height() ); +} + +void Editor::closeEvent( QCloseEvent *event ) +{ + event->accept(); + + if ( changed ) { // the text has been changed + switch ( QMessageBox::warning( this, "Qwerty", + "Save changes to Document?", + tr("&Yes"), + tr("&No"), + tr("Cancel"), + 0, 2) ) { + case 0: // yes + if ( save() ) + event->accept(); + else + event->ignore(); + break; + case 1: // no + event->accept(); + break; + default: // cancel + event->ignore(); + break; + } + } +} + +void Editor::toUpper() +{ + e->setText(e->text().upper()); +} + +void Editor::toLower() +{ + e->setText(e->text().lower()); +} + +void Editor::textChanged() +{ + changed = TRUE; +} diff --git a/examples/qwerty/qwerty.doc b/examples/qwerty/qwerty.doc new file mode 100644 index 0000000..51a1feb --- /dev/null +++ b/examples/qwerty/qwerty.doc @@ -0,0 +1,27 @@ +/* +*/ +/*! \page qwerty-example.html + + \ingroup examples + \title Simple editor that can load encodings + + +


+ + Header file: + + \include qwerty/qwerty.h + +
+ + Implementation: + + \include qwerty/qwerty.cpp + +
+ + Main: + + \include qwerty/main.cpp +*/ + diff --git a/examples/qwerty/qwerty.h b/examples/qwerty/qwerty.h new file mode 100644 index 0000000..fb75572 --- /dev/null +++ b/examples/qwerty/qwerty.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +*****************************************************************************/ + +#ifndef QWERTY_H +#define QWERTY_H + +#include +#include +#include +#include + +class Editor : public QWidget +{ + Q_OBJECT +public: + Editor( QWidget *parent=0, const char *name="qwerty" ); + ~Editor(); + + void load( const QString& fileName, int code=-1 ); + +public slots: + void newDoc(); + void load(); + bool save(); + void print(); + void addEncoding(); + void toUpper(); + void toLower(); + void font(); +protected: + void resizeEvent( QResizeEvent * ); + void closeEvent( QCloseEvent * ); + +private slots: + void saveAsEncoding( int ); + void openAsEncoding( int ); + void textChanged(); + +private: + bool saveAs( const QString& fileName, int code=-1 ); + void rebuildCodecList(); + QMenuBar *m; + QMultiLineEdit *e; +#ifndef QT_NO_PRINTER + QPrinter printer; +#endif + QPopupMenu *save_as; + QPopupMenu *open_as; + bool changed; +}; + +#endif // QWERTY_H diff --git a/examples/qwerty/qwerty.pro b/examples/qwerty/qwerty.pro new file mode 100644 index 0000000..474333a --- /dev/null +++ b/examples/qwerty/qwerty.pro @@ -0,0 +1,11 @@ +TEMPLATE = app +TARGET = qwerty + +CONFIG += qt warn_on release +DEPENDPATH = ../../include + +REQUIRES = large-config + +HEADERS = qwerty.h +SOURCES = main.cpp \ + qwerty.cpp diff --git a/examples/qwerty/unicode.txt b/examples/qwerty/unicode.txt new file mode 100644 index 0000000..1d08d41 Binary files /dev/null and b/examples/qwerty/unicode.txt differ -- cgit v1.2.1

/x97 LATIN SMALL LETTER P + /x98 LATIN SMALL LETTER Q + /x99 LATIN SMALL LETTER R +<-a> /x9A FEMININE ORDINAL INDICATOR +<-o> /x9B MASCULINE ORDINAL INDICATOR +<(!> /x9C LEFT CURLY BRACKET +<',> /x9D CEDILLA +<<(> /x9E LEFT SQUARE BRACKET +<)/>> /x9F RIGHT SQUARE BRACKET + /xA0 MICRO SIGN + /xA1 LATIN SMALL LETTER U WITH DIAERESIS + /xA2 LATIN SMALL LETTER S + /xA3 LATIN SMALL LETTER T + /xA4 LATIN SMALL LETTER U + /xA5 LATIN SMALL LETTER V + /xA6 LATIN SMALL LETTER W + /xA7 LATIN SMALL LETTER X + /xA8 LATIN SMALL LETTER Y + /xA9 LATIN SMALL LETTER Z + /xAA INVERTED EXCLAMATION MARK + /xAB INVERTED QUESTION MARK + /xAC LATIN CAPITAL LETTER ETH (Icelandic) + /xAD LATIN CAPITAL LETTER Y WITH ACUTE + /xAE LATIN CAPITAL LETTER THORN (Icelandic) + /xAF REGISTERED SIGN + /xB0 CENT SIGN + /xB1 POUND SIGN + /xB2 YEN SIGN +<.M> /xB3 MIDDLE DOT + /xB4 COPYRIGHT SIGN + /xB5 SECTION SIGN + /xB6 PILCROW SIGN +<14> /xB7 VULGAR FRACTION ONE QUARTER +<12> /xB8 VULGAR FRACTION ONE HALF +<34> /xB9 VULGAR FRACTION THREE QUARTERS + /xBA NOT SIGN + /xBB VERTICAL LINE +<'-> /xBC OVERLINE +<':> /xBD DIAERESIS +<''> /xBE ACUTE ACCENT +<*X> /xBF MULTIPLICATION SIGN + /xC0 LATIN SMALL LETTER AE + /xC1 LATIN CAPITAL LETTER A + /xC2 LATIN CAPITAL LETTER B + /xC3 LATIN CAPITAL LETTER C + /xC4 LATIN CAPITAL LETTER D + /xC5 LATIN CAPITAL LETTER E + /xC6 LATIN CAPITAL LETTER F + /xC7 LATIN CAPITAL LETTER G + /xC8 LATIN CAPITAL LETTER H + /xC9 LATIN CAPITAL LETTER I +<--> /xCA SOFT HYPHEN +> /xCB LATIN SMALL LETTER O WITH CIRCUMFLEX + /xCC LATIN SMALL LETTER O WITH DIAERESIS + /xCD LATIN SMALL LETTER O WITH GRAVE + /xCE LATIN SMALL LETTER O WITH ACUTE + /xCF LATIN SMALL LETTER O WITH TILDE + /xD0 LATIN SMALL LETTER A WITH RING ABOVE + /xD1 LATIN CAPITAL LETTER J + /xD2 LATIN CAPITAL LETTER K + /xD3 LATIN CAPITAL LETTER L + /xD4 LATIN CAPITAL LETTER M + /xD5 LATIN CAPITAL LETTER N + /xD6 LATIN CAPITAL LETTER O +

/x50 LATIN CAPITAL LETTER P + /x51 LATIN CAPITAL LETTER Q + /x52 LATIN CAPITAL LETTER R + /x53 LATIN CAPITAL LETTER S + /x54 LATIN CAPITAL LETTER T + /x55 LATIN CAPITAL LETTER U + /x56 LATIN CAPITAL LETTER V + /x57 LATIN CAPITAL LETTER W + /x58 LATIN CAPITAL LETTER X + /x59 LATIN CAPITAL LETTER Y + /x5A LATIN CAPITAL LETTER Z +<<(> /x5B LEFT SQUARE BRACKET + /x5C REVERSE SOLIDUS +<)/>> /x5D RIGHT SQUARE BRACKET +<'/>> /x5E CIRCUMFLEX ACCENT +<_> /x5F LOW LINE +<'!> /x60 GRAVE ACCENT + /x61 LATIN SMALL LETTER A + /x62 LATIN SMALL LETTER B + /x63 LATIN SMALL LETTER C + /x64 LATIN SMALL LETTER D + /x65 LATIN SMALL LETTER E + /x66 LATIN SMALL LETTER F + /x67 LATIN SMALL LETTER G + /x68 LATIN SMALL LETTER H + /x69 LATIN SMALL LETTER I + /x6A LATIN SMALL LETTER J + /x6B LATIN SMALL LETTER K + /x6C LATIN SMALL LETTER L + /x6D LATIN SMALL LETTER M + /x6E LATIN SMALL LETTER N + /x6F LATIN SMALL LETTER O +