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 | |
parent | f7b5905d990f374dd6cb177b7a03628cc593b7cf (diff) | |
download | opie-629ced22fc26892442be433403a9cfa9f662f08a.zip opie-629ced22fc26892442be433403a9cfa9f662f08a.tar.gz opie-629ced22fc26892442be433403a9cfa9f662f08a.tar.bz2 |
gcc 3.4 fixes
-rw-r--r-- | inputmethods/dasher/SettingsStore.cpp | 5 | ||||
-rw-r--r-- | inputmethods/dasher/SettingsStore.h | 1 | ||||
-rw-r--r-- | inputmethods/dvorak/dvorak.cpp | 8 | ||||
-rw-r--r-- | inputmethods/keyboard/keyboard.cpp | 10 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 10 |
5 files changed, 20 insertions, 14 deletions
diff --git a/inputmethods/dasher/SettingsStore.cpp b/inputmethods/dasher/SettingsStore.cpp index f7661bd..7e0fa58 100644 --- a/inputmethods/dasher/SettingsStore.cpp +++ b/inputmethods/dasher/SettingsStore.cpp | |||
@@ -1,50 +1,55 @@ | |||
1 | // SettingsStore.cpp | 1 | // SettingsStore.cpp |
2 | // | 2 | // |
3 | ///////////////////////////////////////////////////////////////////////////// | 3 | ///////////////////////////////////////////////////////////////////////////// |
4 | // | 4 | // |
5 | // Copyright (c) 2002 Iain Murray | 5 | // Copyright (c) 2002 Iain Murray |
6 | // | 6 | // |
7 | ///////////////////////////////////////////////////////////////////////////// | 7 | ///////////////////////////////////////////////////////////////////////////// |
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | 11 | ||
12 | #include "SettingsStore.h" | 12 | #include "SettingsStore.h" |
13 | 13 | ||
14 | using namespace std; | 14 | using namespace std; |
15 | 15 | ||
16 | /* TODO: Consider using Template functions to make this neater. */ | 16 | /* TODO: Consider using Template functions to make this neater. */ |
17 | 17 | ||
18 | 18 | ||
19 | CSettingsStore::~CSettingsStore() | ||
20 | { | ||
21 | } | ||
22 | |||
23 | |||
19 | bool CSettingsStore::GetBoolOption(const string& Key) | 24 | bool CSettingsStore::GetBoolOption(const string& Key) |
20 | { | 25 | { |
21 | if (BoolMap.find(Key)==BoolMap.end()) { | 26 | if (BoolMap.find(Key)==BoolMap.end()) { |
22 | bool Value = false; | 27 | bool Value = false; |
23 | LoadSetting(Key, &Value); | 28 | LoadSetting(Key, &Value); |
24 | BoolMap[Key] = Value; | 29 | BoolMap[Key] = Value; |
25 | } | 30 | } |
26 | 31 | ||
27 | return BoolMap[Key]; | 32 | return BoolMap[Key]; |
28 | } | 33 | } |
29 | 34 | ||
30 | 35 | ||
31 | long CSettingsStore::GetLongOption(const string& Key) | 36 | long CSettingsStore::GetLongOption(const string& Key) |
32 | { | 37 | { |
33 | if (LongMap.find(Key)==LongMap.end()) { | 38 | if (LongMap.find(Key)==LongMap.end()) { |
34 | long Value = 0l; | 39 | long Value = 0l; |
35 | LoadSetting(Key, &Value); | 40 | LoadSetting(Key, &Value); |
36 | LongMap[Key] = Value; | 41 | LongMap[Key] = Value; |
37 | } | 42 | } |
38 | 43 | ||
39 | return LongMap[Key]; | 44 | return LongMap[Key]; |
40 | } | 45 | } |
41 | 46 | ||
42 | 47 | ||
43 | string& CSettingsStore::GetStringOption(const string& Key) | 48 | string& CSettingsStore::GetStringOption(const string& Key) |
44 | { | 49 | { |
45 | if (StringMap.find(Key)==StringMap.end()) { | 50 | if (StringMap.find(Key)==StringMap.end()) { |
46 | string Value = ""; | 51 | string Value = ""; |
47 | LoadSetting(Key, &Value); | 52 | LoadSetting(Key, &Value); |
48 | StringMap[Key] = Value; | 53 | StringMap[Key] = Value; |
49 | } | 54 | } |
50 | 55 | ||
diff --git a/inputmethods/dasher/SettingsStore.h b/inputmethods/dasher/SettingsStore.h index 8ef9fcf..2ddf152 100644 --- a/inputmethods/dasher/SettingsStore.h +++ b/inputmethods/dasher/SettingsStore.h | |||
@@ -1,61 +1,62 @@ | |||
1 | // SettingsStore.h | 1 | // SettingsStore.h |
2 | // | 2 | // |
3 | ///////////////////////////////////////////////////////////////////////////// | 3 | ///////////////////////////////////////////////////////////////////////////// |
4 | // | 4 | // |
5 | // Copyright (c) 2002 Iain Murray | 5 | // Copyright (c) 2002 Iain Murray |
6 | // | 6 | // |
7 | ///////////////////////////////////////////////////////////////////////////// | 7 | ///////////////////////////////////////////////////////////////////////////// |
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | #ifndef __SettingsStore_h__ | 11 | #ifndef __SettingsStore_h__ |
12 | #define __SettingsStore_h__ | 12 | #define __SettingsStore_h__ |
13 | 13 | ||
14 | 14 | ||
15 | #include "MSVC_Unannoy.h" | 15 | #include "MSVC_Unannoy.h" |
16 | #include <string> | 16 | #include <string> |
17 | #include <map> | 17 | #include <map> |
18 | 18 | ||
19 | 19 | ||
20 | /* | 20 | /* |
21 | The public interface uses UTF-8 strings. All Keys should be | 21 | The public interface uses UTF-8 strings. All Keys should be |
22 | in American English and encodable in ASCII. However, | 22 | in American English and encodable in ASCII. However, |
23 | string Values may contain special characters where appropriate. | 23 | string Values may contain special characters where appropriate. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | 26 | ||
27 | class CSettingsStore | 27 | class CSettingsStore |
28 | { | 28 | { |
29 | public: | 29 | public: |
30 | virtual ~CSettingsStore(); | ||
30 | bool GetBoolOption(const std::string& Key); | 31 | bool GetBoolOption(const std::string& Key); |
31 | long GetLongOption(const std::string& Key); | 32 | long GetLongOption(const std::string& Key); |
32 | std::string& GetStringOption(const std::string& Key); | 33 | std::string& GetStringOption(const std::string& Key); |
33 | 34 | ||
34 | void SetBoolOption(const std::string& Key, bool Value); | 35 | void SetBoolOption(const std::string& Key, bool Value); |
35 | void SetLongOption(const std::string& Key, long Value); | 36 | void SetLongOption(const std::string& Key, long Value); |
36 | void SetStringOption(const std::string& Key, const std::string& Value); | 37 | void SetStringOption(const std::string& Key, const std::string& Value); |
37 | 38 | ||
38 | void SetBoolDefault(const std::string& Key, bool Value); | 39 | void SetBoolDefault(const std::string& Key, bool Value); |
39 | void SetLongDefault(const std::string& Key, long Value); | 40 | void SetLongDefault(const std::string& Key, long Value); |
40 | void SetStringDefault(const std::string& Key, const std::string& Value); | 41 | void SetStringDefault(const std::string& Key, const std::string& Value); |
41 | private: | 42 | private: |
42 | // Platform Specific settings file management | 43 | // Platform Specific settings file management |
43 | 44 | ||
44 | // LoadSetting changes Value only if it succeeds in loading the setting, | 45 | // LoadSetting changes Value only if it succeeds in loading the setting, |
45 | // in which case it also returns true. Failure is indicated by returning false. | 46 | // in which case it also returns true. Failure is indicated by returning false. |
46 | //! Load a setting with a boolean value | 47 | //! Load a setting with a boolean value |
47 | // | 48 | // |
48 | //! Load a setting with a boolean value. Return true if successful | 49 | //! Load a setting with a boolean value. Return true if successful |
49 | //! \param Key Name of the setting | 50 | //! \param Key Name of the setting |
50 | //! \param Value Value of the setting | 51 | //! \param Value Value of the setting |
51 | virtual bool LoadSetting(const std::string& Key, bool* Value); | 52 | virtual bool LoadSetting(const std::string& Key, bool* Value); |
52 | 53 | ||
53 | //! Load a setting with a long value | 54 | //! Load a setting with a long value |
54 | // | 55 | // |
55 | //! Load a setting with a long value. Return true if successful | 56 | //! Load a setting with a long value. Return true if successful |
56 | //! \param Key Name of the setting | 57 | //! \param Key Name of the setting |
57 | //! \param Value Value of the setting | 58 | //! \param Value Value of the setting |
58 | virtual bool LoadSetting(const std::string& Key, long* Value); | 59 | virtual bool LoadSetting(const std::string& Key, long* Value); |
59 | 60 | ||
60 | //! Load a setting with a string value | 61 | //! Load a setting with a string value |
61 | // | 62 | // |
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 | |||
@@ -60,73 +60,73 @@ void Keyboard::resizeEvent(QResizeEvent*) | |||
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", |
diff --git a/inputmethods/keyboard/keyboard.cpp b/inputmethods/keyboard/keyboard.cpp index a85a7b1..fb88f2a 100644 --- a/inputmethods/keyboard/keyboard.cpp +++ b/inputmethods/keyboard/keyboard.cpp | |||
@@ -69,77 +69,77 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : | |||
69 | 69 | ||
70 | void Keyboard::resizeEvent(QResizeEvent*) | 70 | void Keyboard::resizeEvent(QResizeEvent*) |
71 | { | 71 | { |
72 | int ph = picks->sizeHint().height(); | 72 | int ph = picks->sizeHint().height(); |
73 | picks->setGeometry( 0, 0, width(), ph ); | 73 | picks->setGeometry( 0, 0, width(), ph ); |
74 | keyHeight = (height()-ph)/5; | 74 | keyHeight = (height()-ph)/5; |
75 | int nk; | 75 | int nk; |
76 | if ( useOptiKeys ) { | 76 | if ( useOptiKeys ) { |
77 | nk = 15; | 77 | nk = 15; |
78 | } else if ( useLargeKeys ) { | 78 | } else if ( useLargeKeys ) { |
79 | nk = 15; | 79 | nk = 15; |
80 | } else { | 80 | } else { |
81 | nk = 19; | 81 | nk = 19; |
82 | } | 82 | } |
83 | defaultKeyWidth = width()/nk; | 83 | defaultKeyWidth = width()/nk; |
84 | xoffs = (width()-defaultKeyWidth*nk)/2; | 84 | xoffs = (width()-defaultKeyWidth*nk)/2; |
85 | } | 85 | } |
86 | 86 | ||
87 | void KeyboardPicks::initialise() | 87 | void KeyboardPicks::initialise() |
88 | { | 88 | { |
89 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); | 89 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); |
90 | mode = 0; | 90 | mode = 0; |
91 | dc = new KeyboardConfig(this); | 91 | dc = new KeyboardConfig(this); |
92 | configs.append(dc); | 92 | configs.append(dc); |
93 | } | 93 | } |
94 | 94 | ||
95 | QSize KeyboardPicks::sizeHint() const | 95 | QSize KeyboardPicks::sizeHint() const |
96 | { | 96 | { |
97 | return QSize(240,fontMetrics().lineSpacing()); | 97 | return QSize(240,fontMetrics().lineSpacing()); |
98 | } | 98 | } |
99 | 99 | ||
100 | 100 | ||
101 | void KeyboardConfig::generateText(const QString &s) | 101 | void KeyboardConfig::generateText(const QString &s) |
102 | { | 102 | { |
103 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 103 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
104 | for (int i=0; i<(int)backspaces; i++) { | 104 | for (int i=0; i<(int)backspaces; i++) { |
105 | parent->emitKey( 0, Qt::Key_Backspace, 0, true, false ); | 105 | parent->emitKey( 0, ::Qt::Key_Backspace, 0, true, false ); |
106 | parent->emitKey( 0, Qt::Key_Backspace, 0, false, false ); | 106 | parent->emitKey( 0, ::Qt::Key_Backspace, 0, false, false ); |
107 | } | 107 | } |
108 | for (int i=0; i<(int)s.length(); i++) { | 108 | for (int i=0; i<(int)s.length(); i++) { |
109 | parent->emitKey( s[i].unicode(), 0, 0, true, false ); | 109 | parent->emitKey( s[i].unicode(), 0, 0, true, false ); |
110 | parent->emitKey( s[i].unicode(), 0, 0, false, false ); | 110 | parent->emitKey( s[i].unicode(), 0, 0, false, false ); |
111 | } | 111 | } |
112 | parent->emitKey( 0, Qt::Key_Space, 0, true, false ); | 112 | parent->emitKey( 0, ::Qt::Key_Space, 0, true, false ); |
113 | parent->emitKey( 0, Qt::Key_Space, 0, false, false ); | 113 | parent->emitKey( 0, ::Qt::Key_Space, 0, false, false ); |
114 | backspaces = 0; | 114 | backspaces = 0; |
115 | #endif | 115 | #endif |
116 | } | 116 | } |
117 | 117 | ||
118 | 118 | ||
119 | //PC keyboard layout and scancodes | 119 | //PC keyboard layout and scancodes |
120 | 120 | ||
121 | /* | 121 | /* |
122 | Format: length, code, length, code, ..., 0 | 122 | Format: length, code, length, code, ..., 0 |
123 | 123 | ||
124 | length is measured in half the width of a standard key. | 124 | length is measured in half the width of a standard key. |
125 | If code < 0x80 we have length/2 consecutive standard keys, | 125 | If code < 0x80 we have length/2 consecutive standard keys, |
126 | starting with scancode code. | 126 | starting with scancode code. |
127 | 127 | ||
128 | Special keys are hardcoded, one at a time, with length of key | 128 | Special keys are hardcoded, one at a time, with length of key |
129 | and code >= 0x80, these are NOT standard PC scancodes, but are looked | 129 | and code >= 0x80, these are NOT standard PC scancodes, but are looked |
130 | up in specialM[]. (The special keys are not keymappable.) | 130 | up in specialM[]. (The special keys are not keymappable.) |
131 | 131 | ||
132 | */ | 132 | */ |
133 | 133 | ||
134 | static const uchar * const keyboard_opti[5] = { | 134 | static const uchar * const keyboard_opti[5] = { |
135 | (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", | 135 | (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", |
136 | (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", | 136 | (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", |
137 | (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", | 137 | (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", |
138 | (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", | 138 | (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", |
139 | (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" | 139 | (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" |
140 | }; | 140 | }; |
141 | 141 | ||
142 | 142 | ||
143 | static const uchar * const keyboard_standard[5] = { | 143 | static const uchar * const keyboard_standard[5] = { |
144 | 144 | ||
145 | #ifdef USE_SMALL_BACKSPACE | 145 | #ifdef USE_SMALL_BACKSPACE |
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index 4f4f25f..7ddfd3e 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp | |||
@@ -114,77 +114,77 @@ void Keyboard::resizeEvent(QResizeEvent*) | |||
114 | int ph = picks->sizeHint().height(); | 114 | int ph = picks->sizeHint().height(); |
115 | picks->setGeometry( 0, 0, width(), ph ); | 115 | picks->setGeometry( 0, 0, width(), ph ); |
116 | keyHeight = (height()-(usePicks ? ph : 0))/(keys->rows()?keys->rows():1); | 116 | keyHeight = (height()-(usePicks ? ph : 0))/(keys->rows()?keys->rows():1); |
117 | 117 | ||
118 | int nk; // number of keys? | 118 | int nk; // number of keys? |
119 | if ( useLargeKeys ) { | 119 | if ( useLargeKeys ) { |
120 | nk = 15; | 120 | nk = 15; |
121 | } else { | 121 | } else { |
122 | nk = 19; | 122 | nk = 19; |
123 | } | 123 | } |
124 | defaultKeyWidth = (width()/nk)/2; | 124 | defaultKeyWidth = (width()/nk)/2; |
125 | xoffs = (width()-defaultKeyWidth*nk)/2; // empty key spaces? | 125 | xoffs = (width()-defaultKeyWidth*nk)/2; // empty key spaces? |
126 | 126 | ||
127 | } | 127 | } |
128 | 128 | ||
129 | /* KeyboardPicks::initialize {{{1 */ | 129 | /* KeyboardPicks::initialize {{{1 */ |
130 | void KeyboardPicks::initialise() | 130 | void KeyboardPicks::initialise() |
131 | { | 131 | { |
132 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); | 132 | setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); |
133 | mode = 0; | 133 | mode = 0; |
134 | dc = new KeyboardConfig(this); | 134 | dc = new KeyboardConfig(this); |
135 | configs.append(dc); | 135 | configs.append(dc); |
136 | } | 136 | } |
137 | 137 | ||
138 | /* KeyboardPicks::sizeHint {{{1 */ | 138 | /* KeyboardPicks::sizeHint {{{1 */ |
139 | QSize KeyboardPicks::sizeHint() const | 139 | QSize KeyboardPicks::sizeHint() const |
140 | { | 140 | { |
141 | return QSize(240,fontMetrics().lineSpacing()); | 141 | return QSize(240,fontMetrics().lineSpacing()); |
142 | } | 142 | } |
143 | 143 | ||
144 | 144 | ||
145 | /* KeyboardConfig::generateText {{{1 */ | 145 | /* KeyboardConfig::generateText {{{1 */ |
146 | void KeyboardConfig::generateText(const QString &s) | 146 | void KeyboardConfig::generateText(const QString &s) |
147 | { | 147 | { |
148 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 148 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
149 | for (int i=0; i<(int)backspaces; i++) { | 149 | for (int i=0; i<(int)backspaces; i++) { |
150 | parent->emitKey( 0, Qt::Key_Backspace, 0, true, false ); | 150 | parent->emitKey( 0, ::Qt::Key_Backspace, 0, true, false ); |
151 | parent->emitKey( 0, Qt::Key_Backspace, 0, false, false ); | 151 | parent->emitKey( 0, ::Qt::Key_Backspace, 0, false, false ); |
152 | } | 152 | } |
153 | for (int i=0; i<(int)s.length(); i++) { | 153 | for (int i=0; i<(int)s.length(); i++) { |
154 | parent->emitKey( s[i].unicode(), 0, 0, true, false ); | 154 | parent->emitKey( s[i].unicode(), 0, 0, true, false ); |
155 | parent->emitKey( s[i].unicode(), 0, 0, false, false ); | 155 | parent->emitKey( s[i].unicode(), 0, 0, false, false ); |
156 | } | 156 | } |
157 | parent->emitKey( 0, Qt::Key_Space, 0, true, false ); | 157 | parent->emitKey( 0, ::Qt::Key_Space, 0, true, false ); |
158 | parent->emitKey( 0, Qt::Key_Space, 0, false, false ); | 158 | parent->emitKey( 0, ::Qt::Key_Space, 0, false, false ); |
159 | backspaces = 0; | 159 | backspaces = 0; |
160 | #endif | 160 | #endif |
161 | } | 161 | } |
162 | 162 | ||
163 | 163 | ||
164 | 164 | ||
165 | 165 | ||
166 | /* Keyboard::paintEvent {{{1 */ | 166 | /* Keyboard::paintEvent {{{1 */ |
167 | void Keyboard::paintEvent(QPaintEvent* e) | 167 | void Keyboard::paintEvent(QPaintEvent* e) |
168 | { | 168 | { |
169 | QPainter painter(this); | 169 | QPainter painter(this); |
170 | painter.setClipRect(e->rect()); | 170 | painter.setClipRect(e->rect()); |
171 | drawKeyboard( painter ); | 171 | drawKeyboard( painter ); |
172 | picks->dc->draw( &painter ); | 172 | picks->dc->draw( &painter ); |
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
176 | /* Keyboard::drawKeyboard {{{1 */ | 176 | /* Keyboard::drawKeyboard {{{1 */ |
177 | 177 | ||
178 | void Keyboard::drawKeyboard(QPainter &p, int row, int col) | 178 | void Keyboard::drawKeyboard(QPainter &p, int row, int col) |
179 | { | 179 | { |
180 | 180 | ||
181 | 181 | ||
182 | if (row != -1 && col != -1) { //just redraw one key | 182 | if (row != -1 && col != -1) { //just redraw one key |
183 | 183 | ||
184 | int x = 0; | 184 | int x = 0; |
185 | for (int i = 0; i < col; i++) { | 185 | for (int i = 0; i < col; i++) { |
186 | 186 | ||
187 | x += keys->width(row, i) * defaultKeyWidth; | 187 | x += keys->width(row, i) * defaultKeyWidth; |
188 | } | 188 | } |
189 | int y = (row - 1) * keyHeight + (usePicks ? picks->height() : 0); | 189 | int y = (row - 1) * keyHeight + (usePicks ? picks->height() : 0); |
190 | 190 | ||