-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 | 8 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 8 |
5 files changed, 18 insertions, 12 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 @@ // SettingsStore.cpp // ///////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002 Iain Murray // ///////////////////////////////////////////////////////////////////////////// #include "SettingsStore.h" using namespace std; /* TODO: Consider using Template functions to make this neater. */ +CSettingsStore::~CSettingsStore() +{ +} + + bool CSettingsStore::GetBoolOption(const string& Key) { if (BoolMap.find(Key)==BoolMap.end()) { bool Value = false; LoadSetting(Key, &Value); BoolMap[Key] = Value; } return BoolMap[Key]; } long CSettingsStore::GetLongOption(const string& Key) { if (LongMap.find(Key)==LongMap.end()) { long Value = 0l; LoadSetting(Key, &Value); LongMap[Key] = Value; } return LongMap[Key]; } string& CSettingsStore::GetStringOption(const string& Key) { if (StringMap.find(Key)==StringMap.end()) { string Value = ""; LoadSetting(Key, &Value); StringMap[Key] = Value; } 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 @@ // SettingsStore.h // ///////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002 Iain Murray // ///////////////////////////////////////////////////////////////////////////// #ifndef __SettingsStore_h__ #define __SettingsStore_h__ #include "MSVC_Unannoy.h" #include <string> #include <map> /* The public interface uses UTF-8 strings. All Keys should be in American English and encodable in ASCII. However, string Values may contain special characters where appropriate. */ class CSettingsStore { public: + virtual ~CSettingsStore(); bool GetBoolOption(const std::string& Key); long GetLongOption(const std::string& Key); std::string& GetStringOption(const std::string& Key); void SetBoolOption(const std::string& Key, bool Value); void SetLongOption(const std::string& Key, long Value); void SetStringOption(const std::string& Key, const std::string& Value); void SetBoolDefault(const std::string& Key, bool Value); void SetLongDefault(const std::string& Key, long Value); void SetStringDefault(const std::string& Key, const std::string& Value); private: // Platform Specific settings file management // LoadSetting changes Value only if it succeeds in loading the setting, // in which case it also returns true. Failure is indicated by returning false. //! Load a setting with a boolean value // //! Load a setting with a boolean value. Return true if successful //! \param Key Name of the setting //! \param Value Value of the setting virtual bool LoadSetting(const std::string& Key, bool* Value); //! Load a setting with a long value // //! Load a setting with a long value. Return true if successful //! \param Key Name of the setting //! \param Value Value of the setting virtual bool LoadSetting(const std::string& Key, long* Value); //! Load a setting with a string value // 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*) picks->setGeometry( 0, 0, width(), ph ); keyHeight = (height()-ph)/5; int nk; if ( useOptiKeys ) { nk = 15; } else if ( useLargeKeys ) { nk = 15; } else { nk = 19; } defaultKeyWidth = width()/nk; xoffs = (width()-defaultKeyWidth*nk)/2; } void KeyboardPicks::initialise() { setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); mode = 0; dc = new KeyboardConfig(this); configs.append(dc); } QSize KeyboardPicks::sizeHint() const { return QSize(240,fontMetrics().lineSpacing()); } void KeyboardConfig::generateText(const QString &s) { #if defined(Q_WS_QWS) || defined(_WS_QWS_) for (int i=0; i<(int)backspaces; i++) { - parent->emitKey( 0, Qt::Key_Backspace, 0, true, false ); - parent->emitKey( 0, Qt::Key_Backspace, 0, false, false ); + parent->emitKey( 0, ::Qt::Key_Backspace, 0, true, false ); + parent->emitKey( 0, ::Qt::Key_Backspace, 0, false, false ); } for (int i=0; i<(int)s.length(); i++) { parent->emitKey( s[i].unicode(), 0, 0, true, false ); parent->emitKey( s[i].unicode(), 0, 0, false, false ); } - parent->emitKey( 0, Qt::Key_Space, 0, true, false ); - parent->emitKey( 0, Qt::Key_Space, 0, false, false ); + parent->emitKey( 0, ::Qt::Key_Space, 0, true, false ); + parent->emitKey( 0, ::Qt::Key_Space, 0, false, false ); backspaces = 0; #endif } //PC keyboard layout and scancodes /* Format: length, code, length, code, ..., 0 length is measured in half the width of a standard key. If code < 0x80 we have length/2 consecutive standard keys, starting with scancode code. Special keys are hardcoded, one at a time, with length of key and code >= 0x80, these are NOT standard PC scancodes, but are looked up in specialM[]. (The special keys are not keymappable.) */ static const uchar * const keyboard_opti[5] = { (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", (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", (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", (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", (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" }; static const uchar * const keyboard_standard[5] = { #ifdef USE_SMALL_BACKSPACE (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 @@ -73,73 +73,73 @@ void Keyboard::resizeEvent(QResizeEvent*) picks->setGeometry( 0, 0, width(), ph ); keyHeight = (height()-ph)/5; int nk; if ( useOptiKeys ) { nk = 15; } else if ( useLargeKeys ) { nk = 15; } else { nk = 19; } defaultKeyWidth = width()/nk; xoffs = (width()-defaultKeyWidth*nk)/2; } void KeyboardPicks::initialise() { setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); mode = 0; dc = new KeyboardConfig(this); configs.append(dc); } QSize KeyboardPicks::sizeHint() const { return QSize(240,fontMetrics().lineSpacing()); } void KeyboardConfig::generateText(const QString &s) { #if defined(Q_WS_QWS) || defined(_WS_QWS_) for (int i=0; i<(int)backspaces; i++) { - parent->emitKey( 0, Qt::Key_Backspace, 0, true, false ); - parent->emitKey( 0, Qt::Key_Backspace, 0, false, false ); + parent->emitKey( 0, ::Qt::Key_Backspace, 0, true, false ); + parent->emitKey( 0, ::Qt::Key_Backspace, 0, false, false ); } for (int i=0; i<(int)s.length(); i++) { parent->emitKey( s[i].unicode(), 0, 0, true, false ); parent->emitKey( s[i].unicode(), 0, 0, false, false ); } - parent->emitKey( 0, Qt::Key_Space, 0, true, false ); - parent->emitKey( 0, Qt::Key_Space, 0, false, false ); + parent->emitKey( 0, ::Qt::Key_Space, 0, true, false ); + parent->emitKey( 0, ::Qt::Key_Space, 0, false, false ); backspaces = 0; #endif } //PC keyboard layout and scancodes /* Format: length, code, length, code, ..., 0 length is measured in half the width of a standard key. If code < 0x80 we have length/2 consecutive standard keys, starting with scancode code. Special keys are hardcoded, one at a time, with length of key and code >= 0x80, these are NOT standard PC scancodes, but are looked up in specialM[]. (The special keys are not keymappable.) */ static const uchar * const keyboard_opti[5] = { (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", (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", (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", (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", (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" }; static const uchar * const keyboard_standard[5] = { #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 @@ -118,73 +118,73 @@ void Keyboard::resizeEvent(QResizeEvent*) int nk; // number of keys? if ( useLargeKeys ) { nk = 15; } else { nk = 19; } defaultKeyWidth = (width()/nk)/2; xoffs = (width()-defaultKeyWidth*nk)/2; // empty key spaces? } /* KeyboardPicks::initialize {{{1 */ void KeyboardPicks::initialise() { setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); mode = 0; dc = new KeyboardConfig(this); configs.append(dc); } /* KeyboardPicks::sizeHint {{{1 */ QSize KeyboardPicks::sizeHint() const { return QSize(240,fontMetrics().lineSpacing()); } /* KeyboardConfig::generateText {{{1 */ void KeyboardConfig::generateText(const QString &s) { #if defined(Q_WS_QWS) || defined(_WS_QWS_) for (int i=0; i<(int)backspaces; i++) { - parent->emitKey( 0, Qt::Key_Backspace, 0, true, false ); - parent->emitKey( 0, Qt::Key_Backspace, 0, false, false ); + parent->emitKey( 0, ::Qt::Key_Backspace, 0, true, false ); + parent->emitKey( 0, ::Qt::Key_Backspace, 0, false, false ); } for (int i=0; i<(int)s.length(); i++) { parent->emitKey( s[i].unicode(), 0, 0, true, false ); parent->emitKey( s[i].unicode(), 0, 0, false, false ); } - parent->emitKey( 0, Qt::Key_Space, 0, true, false ); - parent->emitKey( 0, Qt::Key_Space, 0, false, false ); + parent->emitKey( 0, ::Qt::Key_Space, 0, true, false ); + parent->emitKey( 0, ::Qt::Key_Space, 0, false, false ); backspaces = 0; #endif } /* Keyboard::paintEvent {{{1 */ void Keyboard::paintEvent(QPaintEvent* e) { QPainter painter(this); painter.setClipRect(e->rect()); drawKeyboard( painter ); picks->dc->draw( &painter ); } /* Keyboard::drawKeyboard {{{1 */ void Keyboard::drawKeyboard(QPainter &p, int row, int col) { if (row != -1 && col != -1) { //just redraw one key int x = 0; for (int i = 0; i < col; i++) { x += keys->width(row, i) * defaultKeyWidth; } int y = (row - 1) * keyHeight + (usePicks ? picks->height() : 0); |