author | mickeyl <mickeyl> | 2004-04-24 15:51:18 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-24 15:51:18 (UTC) |
commit | 629ced22fc26892442be433403a9cfa9f662f08a (patch) (unidiff) | |
tree | 830973cb7ba701b0a897220e1307ad3f1243384b /inputmethods/dvorak | |
parent | f7b5905d990f374dd6cb177b7a03628cc593b7cf (diff) | |
download | opie-629ced22fc26892442be433403a9cfa9f662f08a.zip opie-629ced22fc26892442be433403a9cfa9f662f08a.tar.gz opie-629ced22fc26892442be433403a9cfa9f662f08a.tar.bz2 |
gcc 3.4 fixes
-rw-r--r-- | inputmethods/dvorak/dvorak.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inputmethods/dvorak/dvorak.cpp b/inputmethods/dvorak/dvorak.cpp index 97afa0a..2137f22 100644 --- a/inputmethods/dvorak/dvorak.cpp +++ b/inputmethods/dvorak/dvorak.cpp | |||
@@ -44,105 +44,105 @@ Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : | |||
44 | setPalette(QPalette(QColor(220,220,220))); // Gray | 44 | setPalette(QPalette(QColor(220,220,220))); // Gray |
45 | 45 | ||
46 | picks = new KeyboardPicks( this ); | 46 | picks = new KeyboardPicks( this ); |
47 | picks->setFont( QFont( "smallsmooth", 9 ) ); | 47 | picks->setFont( QFont( "smallsmooth", 9 ) ); |
48 | setFont( QFont( "smallsmooth", 9 ) ); | 48 | setFont( QFont( "smallsmooth", 9 ) ); |
49 | picks->initialise(); | 49 | picks->initialise(); |
50 | QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), | 50 | QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), |
51 | this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); | 51 | this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); |
52 | 52 | ||
53 | repeatTimer = new QTimer( this ); | 53 | repeatTimer = new QTimer( this ); |
54 | connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) ); | 54 | connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) ); |
55 | } | 55 | } |
56 | 56 | ||
57 | void Keyboard::resizeEvent(QResizeEvent*) | 57 | void Keyboard::resizeEvent(QResizeEvent*) |
58 | { | 58 | { |
59 | int ph = picks->sizeHint().height(); | 59 | int ph = picks->sizeHint().height(); |
60 | picks->setGeometry( 0, 0, width(), ph ); | 60 | picks->setGeometry( 0, 0, width(), ph ); |
61 | keyHeight = (height()-ph)/5; | 61 | keyHeight = (height()-ph)/5; |
62 | int nk; | 62 | int nk; |
63 | if ( useOptiKeys ) { | 63 | if ( useOptiKeys ) { |
64 | nk = 15; | 64 | nk = 15; |
65 | } else if ( useLargeKeys ) { | 65 | } else if ( useLargeKeys ) { |
66 | nk = 15; | 66 | nk = 15; |
67 | } else { | 67 | } else { |
68 | nk = 19; | 68 | nk = 19; |
69 | } | 69 | } |
70 | defaultKeyWidth = width()/nk; | 70 | defaultKeyWidth = width()/nk; |
71 | xoffs = (width()-defaultKeyWidth*nk)/2; | 71 | xoffs = (width()-defaultKeyWidth*nk)/2; |
72 | } | 72 | } |
73 | 73 | ||
74 | void KeyboardPicks::initialise() | 74 | void KeyboardPicks::initialise() |
75 | { | 75 | { |
76 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); | 76 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); |
77 | mode = 0; | 77 | mode = 0; |
78 | dc = new KeyboardConfig(this); | 78 | dc = new KeyboardConfig(this); |
79 | configs.append(dc); | 79 | configs.append(dc); |
80 | } | 80 | } |
81 | 81 | ||
82 | QSize KeyboardPicks::sizeHint() const | 82 | QSize KeyboardPicks::sizeHint() const |
83 | { | 83 | { |
84 | return QSize(240,fontMetrics().lineSpacing()); | 84 | return QSize(240,fontMetrics().lineSpacing()); |
85 | } | 85 | } |
86 | 86 | ||
87 | 87 | ||
88 | void KeyboardConfig::generateText(const QString &s) | 88 | void KeyboardConfig::generateText(const QString &s) |
89 | { | 89 | { |
90 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 90 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
91 | for (int i=0; i<(int)backspaces; i++) { | 91 | for (int i=0; i<(int)backspaces; i++) { |
92 | parent->emitKey( 0, Qt::Key_Backspace, 0, true, false ); | 92 | parent->emitKey( 0, ::Qt::Key_Backspace, 0, true, false ); |
93 | parent->emitKey( 0, Qt::Key_Backspace, 0, false, false ); | 93 | parent->emitKey( 0, ::Qt::Key_Backspace, 0, false, false ); |
94 | } | 94 | } |
95 | for (int i=0; i<(int)s.length(); i++) { | 95 | for (int i=0; i<(int)s.length(); i++) { |
96 | parent->emitKey( s[i].unicode(), 0, 0, true, false ); | 96 | parent->emitKey( s[i].unicode(), 0, 0, true, false ); |
97 | parent->emitKey( s[i].unicode(), 0, 0, false, false ); | 97 | parent->emitKey( s[i].unicode(), 0, 0, false, false ); |
98 | } | 98 | } |
99 | parent->emitKey( 0, Qt::Key_Space, 0, true, false ); | 99 | parent->emitKey( 0, ::Qt::Key_Space, 0, true, false ); |
100 | parent->emitKey( 0, Qt::Key_Space, 0, false, false ); | 100 | parent->emitKey( 0, ::Qt::Key_Space, 0, false, false ); |
101 | backspaces = 0; | 101 | backspaces = 0; |
102 | #endif | 102 | #endif |
103 | } | 103 | } |
104 | 104 | ||
105 | 105 | ||
106 | //PC keyboard layout and scancodes | 106 | //PC keyboard layout and scancodes |
107 | 107 | ||
108 | /* | 108 | /* |
109 | Format: length, code, length, code, ..., 0 | 109 | Format: length, code, length, code, ..., 0 |
110 | 110 | ||
111 | length is measured in half the width of a standard key. | 111 | length is measured in half the width of a standard key. |
112 | If code < 0x80 we have length/2 consecutive standard keys, | 112 | If code < 0x80 we have length/2 consecutive standard keys, |
113 | starting with scancode code. | 113 | starting with scancode code. |
114 | 114 | ||
115 | Special keys are hardcoded, one at a time, with length of key | 115 | Special keys are hardcoded, one at a time, with length of key |
116 | and code >= 0x80, these are NOT standard PC scancodes, but are looked | 116 | and code >= 0x80, these are NOT standard PC scancodes, but are looked |
117 | up in specialM[]. (The special keys are not keymappable.) | 117 | up in specialM[]. (The special keys are not keymappable.) |
118 | 118 | ||
119 | */ | 119 | */ |
120 | 120 | ||
121 | static const uchar * const keyboard_opti[5] = { | 121 | static const uchar * const keyboard_opti[5] = { |
122 | (const uchar *const) "\001\223\003\240\002\20\002\41\002\26\002\62\002\56\002\45\002\54\003\200\001\223\002\226\002\235\002\234\002\236", | 122 | (const uchar *const) "\001\223\003\240\002\20\002\41\002\26\002\62\002\56\002\45\002\54\003\200\001\223\002\226\002\235\002\234\002\236", |
123 | (const uchar *const) "\001\223\003\201\004\207\002\30\002\24\002\43\004\207\003\203\001\223\006\002\002\065", | 123 | (const uchar *const) "\001\223\003\201\004\207\002\30\002\24\002\43\004\207\003\203\001\223\006\002\002\065", |
124 | (const uchar *const) "\001\223\003\202\002\60\002\37\002\23\002\22\002\36\002\21\002\55\003\203\001\223\006\005\002\055", | 124 | (const uchar *const) "\001\223\003\202\002\60\002\37\002\23\002\22\002\36\002\21\002\55\003\203\001\223\006\005\002\055", |
125 | (const uchar *const) "\001\223\003\205\004\207\002\27\002\61\002\40\004\207\003\204\001\223\006\010\002\014", | 125 | (const uchar *const) "\001\223\003\205\004\207\002\27\002\61\002\40\004\207\003\204\001\223\006\010\002\014", |
126 | (const uchar *const) "\001\223\003\206\002\44\002\31\002\57\002\42\002\46\002\25\002\207\003\204\001\223\002\013\002\064\002\015\002\230" | 126 | (const uchar *const) "\001\223\003\206\002\44\002\31\002\57\002\42\002\46\002\25\002\207\003\204\001\223\002\013\002\064\002\015\002\230" |
127 | }; | 127 | }; |
128 | 128 | ||
129 | static const uchar * const keyboard_standard[5] = { | 129 | static const uchar * const keyboard_standard[5] = { |
130 | 130 | ||
131 | #ifdef USE_SMALL_BACKSPACE | 131 | #ifdef USE_SMALL_BACKSPACE |
132 | (const uchar *const)"\002\240\002`\0021\0022\0023\0024\0025\0026\0027\0028\0029\0020\002[\002]\002\200\002\223\002\215\002\216\002\217", | 132 | (const uchar *const)"\002\240\002`\0021\0022\0023\0024\0025\0026\0027\0028\0029\0020\002[\002]\002\200\002\223\002\215\002\216\002\217", |
133 | #else | 133 | #else |
134 | (const uchar *const)"\002\051\0021\0022\0023\0024\0025\0026\0027\0028\0029\0020\002[\002]\004\200\002\223\002\215\002\216\002\217", | 134 | (const uchar *const)"\002\051\0021\0022\0023\0024\0025\0026\0027\0028\0029\0020\002[\002]\004\200\002\223\002\215\002\216\002\217", |
135 | #endif | 135 | #endif |
136 | //~ + 123...+ BACKSPACE //+ INSERT + HOME + PGUP | 136 | //~ + 123...+ BACKSPACE //+ INSERT + HOME + PGUP |
137 | 137 | ||
138 | (const uchar *const)"\003\201\002'\002,\002.\002p\002y\002f\002g\002c\002r\002l\002/\002=\002\\\001\224\002\223\002\221\002\220\002\222", | 138 | (const uchar *const)"\003\201\002'\002,\002.\002p\002y\002f\002g\002c\002r\002l\002/\002=\002\\\001\224\002\223\002\221\002\220\002\222", |
139 | //TAB + qwerty.. + backslash //+ DEL + END + PGDN | 139 | //TAB + qwerty.. + backslash //+ DEL + END + PGDN |
140 | 140 | ||
141 | (const uchar *const)"\004\202\002a\002o\002e\002u\002i\002d\002h\002t\002n\002s\002-\004\203", | 141 | (const uchar *const)"\004\202\002a\002o\002e\002u\002i\002d\002h\002t\002n\002s\002-\004\203", |
142 | //CAPS + asdf.. + RETURN | 142 | //CAPS + asdf.. + RETURN |
143 | 143 | ||
144 | (const uchar *const)"\005\204\002;\002q\002j\002k\002x\002b\002m\002w\002v\002z\005\204\002\223\002\223\002\211", | 144 | (const uchar *const)"\005\204\002;\002q\002j\002k\002x\002b\002m\002w\002v\002z\005\204\002\223\002\223\002\211", |
145 | //SHIFT + zxcv... //+ UP | 145 | //SHIFT + zxcv... //+ UP |
146 | 146 | ||
147 | (const uchar *const)"\003\205\003\206\022\207\003\206\003\205\002\223\002\212\002\213\002\214" | 147 | (const uchar *const)"\003\205\003\206\022\207\003\206\003\205\002\223\002\212\002\213\002\214" |
148 | //CTRL + ALT + SPACE //+ LEFT + DOWN + RIGHT | 148 | //CTRL + ALT + SPACE //+ LEFT + DOWN + RIGHT |