From 724e5b6eaf8f67bb1e06fc83da5099defd193f67 Mon Sep 17 00:00:00 2001 From: Sabine Date: Fri, 14 Jun 2024 11:45:00 +0200 Subject: [PATCH] feat(linux): rename symbols more --- linux/mcompile/keymap/deadkey.cpp | 13 ++- linux/mcompile/keymap/keymap.cpp | 94 +++++++++---------- linux/mcompile/keymap/mc_import_rules.cpp | 18 ++-- linux/mcompile/keymap/mc_kmxfile.cpp | 4 +- linux/mcompile/keymap/mcompile.cpp | 16 ++-- .../src/engine/mcompile/mc_savekeyboard.cpp | 4 +- 6 files changed, 74 insertions(+), 75 deletions(-) diff --git a/linux/mcompile/keymap/deadkey.cpp b/linux/mcompile/keymap/deadkey.cpp index bb5fa4fb65..89344b57a4 100755 --- a/linux/mcompile/keymap/deadkey.cpp +++ b/linux/mcompile/keymap/deadkey.cpp @@ -28,11 +28,11 @@ std::vector create_deadkeys_by_basechar() { } void refine_alDead(KMX_WCHAR dk, std::vector &dkVec, std::vector *p_All_Vec) { - if( dk == 0) + if (dk == 0) return; for (int j=0; j < (int) (*p_All_Vec).size()-1;j++) { - if( dk == (*p_All_Vec)[j]->KMX_GetDeadCharacter()) { + if (dk == (*p_All_Vec)[j]->KMX_GetDeadCharacter()) { if(! found_dk_inVector(dk, dkVec)) { dkVec.push_back((*p_All_Vec)[j]); return; @@ -44,9 +44,9 @@ void refine_alDead(KMX_WCHAR dk, std::vector &dkVec, std::vector &dkVec) { int i=0; - if( dkVec.size() > 0) { + if (dkVec.size() > 0) { do { - if( dk == dkVec[i]->KMX_GetDeadCharacter()) + if (dk == dkVec[i]->KMX_GetDeadCharacter()) return true; i++; } while (i < (int) dkVec.size()); @@ -67,7 +67,7 @@ bool query_dk_combinations_for_specific_dk(vec_dword_2D * p_dk_ComposeTable, vec } } - if( dk_SingleTable.size()>0) + if (dk_SingleTable.size()>0) return true; else return false; @@ -79,7 +79,7 @@ KMX_DWORD KMX_change_keyname_to_capital(KMX_DWORD kVal, KMX_DWORD &shift, GdkKey gint n_keys; KMX_DWORD capitalKeyval = (KMX_DWORD) gdk_keyval_to_upper (kVal); - if( keyval !=0) { + if (keyval !=0) { gdk_keymap_get_entries_for_keyval(keymap, keyval, &keys, &n_keys); for (int i = 0; i < n_keys; i++) { if (keys[i].group == 0) { @@ -382,7 +382,6 @@ void create_DKTable(vec_dword_2D & dk_ComposeTable) { dk_ComposeTable.push_back(line); line.clear(); line = createLine("dead_ogonek", "U", 0x0172, "capital U with ogonek"); dk_ComposeTable.push_back(line); line.clear(); - line = createLine("dead_circumflex", "space", 0x005E, "CIRCUMFLEX_ACCENT"); dk_ComposeTable.push_back(line); line.clear(); diff --git a/linux/mcompile/keymap/keymap.cpp b/linux/mcompile/keymap/keymap.cpp index a2c26742ec..206f6a4d7a 100755 --- a/linux/mcompile/keymap/keymap.cpp +++ b/linux/mcompile/keymap/keymap.cpp @@ -278,7 +278,7 @@ KMX_DWORD convertNamesTo_DWORD_Value(std::string tok_str) { first["acute accent"] = 0xB4; - if ( tok_str.size() == 1) { + if (tok_str.size() == 1) { return (KMX_DWORD) ( *tok_str.c_str() ); } else { @@ -291,9 +291,9 @@ KMX_DWORD convertNamesTo_DWORD_Value(std::string tok_str) { return INVALID_NAME; } -int createOneVectorFromBothKeyboards(vec_dword_3D &All_Vector,GdkKeymap *keymap) { +int createOneVectorFromBothKeyboards(vec_dword_3D &all_vector,GdkKeymap *keymap) { // create a 3D-Vector which contains data of the US keyboard and the underlying Keyboard: - // All_Vector[ US_Keyboard ] + // all_vector[ US_Keyboard ] // [KeyCode_US ] // [Keyval unshifted ] // [Keyval shifted ] @@ -305,13 +305,13 @@ int createOneVectorFromBothKeyboards(vec_dword_3D &All_Vector,GdkKeymap *keymap) std::string us_language = "us"; const char* text_us = "xkb_symbols \"basic\""; - if(write_US_ToVector(All_Vector,us_language, text_us)) { + if (write_US_ToVector(all_vector,us_language, text_us)) { wprintf(L"ERROR: can't write US to Vector \n"); return 1; } - // add contents of other keyboard to All_Vector - if( append_underlying_ToVector(All_Vector,keymap)) { + // add contents of other keyboard to all_vector + if (append_underlying_ToVector(all_vector,keymap)) { wprintf(L"ERROR: can't append underlying ToVector \n"); return 2; } @@ -324,20 +324,20 @@ int write_US_ToVector( vec_dword_3D &vec,std::string language, const char* secti const char* path = fullPathName.c_str(); FILE* fp = fopen((path), "r"); - if ( !fp) { + if (!fp) { wprintf(L"ERROR: could not open file!\n"); return 1; } // create 1D-vector of the complete line vec_string_1D vector_completeUS; - if( createCompleteVector_US(fp, section , vector_completeUS)) { + if (createCompleteVector_US(fp, section, vector_completeUS)) { wprintf(L"ERROR: can't Create complete row US \n"); return 1; } // split contents of 1D Vector to 3D vector - if( split_US_To_3D_Vector( vec,vector_completeUS)) { + if (split_US_To_3D_Vector(vec,vector_completeUS)) { return 1; } @@ -345,7 +345,7 @@ int write_US_ToVector( vec_dword_3D &vec,std::string language, const char* secti return 0; } -bool createCompleteVector_US(FILE* fp, const char* section , vec_string_1D &complete_List) { +bool createCompleteVector_US(FILE* fp, const char* section, vec_string_1D &complete_List) { // in the Configuration file we find the appopriate paragraph between "xkb_symbol " and the next xkb_symbol // and then copy all rows starting with "key <" to a 1D-Vector @@ -353,7 +353,7 @@ bool createCompleteVector_US(FILE* fp, const char* section , vec_string_1D &comp char line[buffer_size]; bool create_row = false; const char* key = "key <"; - std::string str_us_kbd_name(section ); + std::string str_us_kbd_name(section); std::string xbk_mark = "xkb_symbol"; if (fp) { @@ -442,7 +442,7 @@ int replace_KeyName_with_Keycode(std::string in) { return out; } -int split_US_To_3D_Vector(vec_dword_3D &all_US,vec_string_1D completeList) { +int split_US_To_3D_Vector(vec_dword_3D& all_US, vec_string_1D completeList) { // 1: take the whole line of the 1D-Vector and remove unwanted characters. // 2: seperate the name e.g. key from the shiftstates // 3: convert to KMX_DWORD @@ -500,7 +500,7 @@ int split_US_To_3D_Vector(vec_dword_3D &all_US,vec_string_1D completeList) { } all_US.push_back(shift_states); - if ( all_US.size() == 0) { + if (all_US.size() == 0) { wprintf(L"ERROR: Can't split US to 3D-Vector\n"); return 1; } @@ -522,30 +522,30 @@ vec_dword_2D create_empty_2D_Vector( int dim_rows,int dim_ss) { return vector_2D; } -int append_underlying_ToVector(vec_dword_3D &All_Vector,GdkKeymap *keymap) { +int append_underlying_ToVector(vec_dword_3D& all_vector,GdkKeymap *keymap) { // create a 2D vector all filled with " " and push to 3D-Vector - vec_dword_2D underlying_Vector2D = create_empty_2D_Vector(All_Vector[0].size(),All_Vector[0][0].size()); + vec_dword_2D underlying_Vector2D = create_empty_2D_Vector(all_vector[0].size(),all_vector[0][0].size()); if (underlying_Vector2D.size() == 0) { wprintf(L"ERROR: can't create empty 2D-Vector\n"); return 1; } - All_Vector.push_back(underlying_Vector2D); + all_vector.push_back(underlying_Vector2D); - if (All_Vector.size() < 2) { + if (all_vector.size() < 2) { wprintf(L"ERROR: creation of 3D-Vector failed\n"); return 1; } - for(int i =0; i< (int) All_Vector[1].size();i++) { + for(int i =0; i< (int) all_vector[1].size();i++) { // get key name US stored in [0][i][0] and copy to name in "underlying"-block[1][i][0] - All_Vector[1][i][0] = All_Vector[0][i][0]; + all_vector[1][i][0] = all_vector[0][i][0]; // get Keyvals of this key and copy to unshifted/shifted in "underlying"-block[1][i][1] / block[1][i][2] - All_Vector[1][i][0+1] = KMX_get_KeyValUnderlying_From_KeyCodeUnderlying(keymap,All_Vector[0][i][0],0); //shift state: unshifted:0 - All_Vector[1][i][1+1] = KMX_get_KeyValUnderlying_From_KeyCodeUnderlying(keymap,All_Vector[0][i][0],1); //shift state: shifted:1 + all_vector[1][i][0+1] = KMX_get_KeyValUnderlying_From_KeyCodeUnderlying(keymap,all_vector[0][i][0],0); //shift state: unshifted:0 + all_vector[1][i][1+1] = KMX_get_KeyValUnderlying_From_KeyCodeUnderlying(keymap,all_vector[0][i][0],1); //shift state: shifted:1 } return 0; @@ -583,9 +583,9 @@ std::u16string convert_DeadkeyValues_To_U16str(int in) { if (in == 0 ) return u"\0"; - std::string long_name((const char*) gdk_keyval_name (in)); // e.g. "dead_circumflex" , "U+017F" , "t" + std::string long_name((const char*) gdk_keyval_name (in)); // e.g. "dead_circumflex", "U+017F", "t" - if ( long_name.substr (0,2) == "U+" ) // U+... Unicode value + if (long_name.substr (0,2) == "U+" ) // U+... Unicode value return CodePointToU16String(in-0x1000000); // GDK's gdk_keymap_translate_keyboard_state() returns (Keyvalue | 0x01000000) // since we never have a carry-over we can just subtract 0x01000000 if (in < (int) deadkey_min) { // no deadkey; no Unicode @@ -614,7 +614,7 @@ int KMX_get_KeyVal_From_KeyCode(GdkKeymap *keymap, guint keycode, ShiftState ss, //BASE (shiftstate: 0) if (( ss == Base ) && ( caps == 0 )) { GdkModifierType MOD_base = (GdkModifierType) ( ~GDK_MODIFIER_MASK ); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_base , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_base, 0, keyvals, NULL, NULL, & consumed); } //BASE + CAPS (shiftstate: 0) @@ -626,61 +626,61 @@ int KMX_get_KeyVal_From_KeyCode(GdkKeymap *keymap, guint keycode, ShiftState ss, //SHIFT (shiftstate: 1) else if (( ss == Shft ) && ( caps == 0 )) { GdkModifierType MOD_Shift = (GdkModifierType) ( GDK_SHIFT_MASK ); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_Shift , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_Shift, 0, keyvals, NULL, NULL, & consumed); } //SHIFT + CAPS (shiftstate: 1) - else if ( ( ss == Shft ) && ( caps ==1 )) { + else if (( ss == Shft ) && ( caps ==1 )) { GdkModifierType MOD_ShiftCaps= (GdkModifierType) ((GDK_SHIFT_MASK | GDK_LOCK_MASK)); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_ShiftCaps , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_ShiftCaps, 0, keyvals, NULL, NULL, & consumed); } // Ctrl (shiftstate: 2) else if (( ss == Ctrl ) && ( caps == 0 )){ GdkModifierType MOD_Ctrl = (GdkModifierType) ( GDK_MOD5_MASK ); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_Ctrl , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_Ctrl, 0, keyvals, NULL, NULL, & consumed); } // Ctrl + CAPS (shiftstate: 2) else if (( ss == Ctrl ) && ( caps == 1 )){ GdkModifierType MOD_CtrlCaps = (GdkModifierType) (GDK_MOD5_MASK | GDK_LOCK_MASK); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_CtrlCaps , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_CtrlCaps, 0, keyvals, NULL, NULL, & consumed); } // SHIFT+Ctrl (shiftstate: 3) else if (( ss == ShftCtrl ) && ( caps == 0 )){ GdkModifierType MOD_Ctrl = (GdkModifierType) (GDK_SHIFT_MASK | GDK_MOD5_MASK ); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_Ctrl , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_Ctrl, 0, keyvals, NULL, NULL, & consumed); } // SHIFT+Ctrl + CAPS (shiftstate: 3) else if (( ss == ShftCtrl ) && ( caps == 1 )){ GdkModifierType MOD_CtrlCaps = (GdkModifierType) ( GDK_SHIFT_MASK | GDK_MOD5_MASK | GDK_LOCK_MASK); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_CtrlCaps , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_CtrlCaps, 0, keyvals, NULL, NULL, & consumed); } //ALT-GR (shiftstate: 6) else if (( ss == MenuCtrl ) && ( caps == 0 )){ GdkModifierType MOD_AltGr = (GdkModifierType) (GDK_MOD2_MASK | GDK_MOD5_MASK); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_AltGr , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_AltGr, 0, keyvals, NULL, NULL, & consumed); } //ALT-GR + CAPS (shiftstate: 6) else if (( ss == MenuCtrl ) && ( caps == 1 )){ GdkModifierType MOD_AltGr = (GdkModifierType) (GDK_MOD2_MASK | GDK_MOD5_MASK | GDK_LOCK_MASK); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_AltGr , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_AltGr, 0, keyvals, NULL, NULL, & consumed); } //ALT-GR (shiftstate: 7) else if (( ss == ShftMenuCtrl ) && ( caps == 0 )){ GdkModifierType MOD_AltGr = (GdkModifierType) ( (GDK_SHIFT_MASK | GDK_MOD2_MASK | GDK_MOD5_MASK) ); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_AltGr , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_AltGr, 0, keyvals, NULL, NULL, & consumed); } //ALT-GR +CAPS (shiftstate: 7) else if (( ss == ShftMenuCtrl ) && ( caps == 1 )){ GdkModifierType MOD_AltGr = (GdkModifierType) ( (GDK_SHIFT_MASK | GDK_MOD2_MASK | GDK_MOD5_MASK | GDK_LOCK_MASK) ); - gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_AltGr , 0, keyvals, NULL, NULL, & consumed); + gdk_keymap_translate_keyboard_state (keymap, keycode, MOD_AltGr, 0, keyvals, NULL, NULL, & consumed); } else return 0; @@ -738,18 +738,18 @@ KMX_DWORD KMX_get_KeyValUnderlying_From_KeyCodeUnderlying(GdkKeymap *keymap, UIN *deadkey = *dky; return 0xFFFF; } - else if((keyV > deadkey_max) || ((keyV < deadkey_min) && ( keyV > 0xFF))) // out of range + else if ((keyV > deadkey_max) || ((keyV < deadkey_min) && ( keyV > 0xFF))) // out of range return 0xFFFE; else // usable char return keyV; } //_S2 vk_us or underlying!!"!!" -KMX_WCHAR KMX_get_KeyValUnderlying_From_KeyValUS(vec_dword_3D & All_Vector, KMX_DWORD vk_US) { +KMX_WCHAR KMX_get_KeyValUnderlying_From_KeyValUS(vec_dword_3D & all_vector, KMX_DWORD vk_US) { KMX_DWORD vk_underlying; - for( int i=0; i< (int)All_Vector[0].size()-1 ;i++) { - for( int j=1; j< (int)All_Vector[0][0].size();j++) { - if ( ( All_Vector[0][i][j] == vk_US ) ) { - vk_underlying = All_Vector[1][i][j]; + for( int i=0; i< (int)all_vector[0].size()-1 ;i++) { + for( int j=1; j< (int)all_vector[0][0].size();j++) { + if (( all_vector[0][i][j] == vk_US ) ) { + vk_underlying = all_vector[1][i][j]; return vk_underlying; } } @@ -757,14 +757,14 @@ KMX_WCHAR KMX_get_KeyValUnderlying_From_KeyValUS(vec_dword_3D & All_Vector, KMX_ return vk_US; } -KMX_DWORD KMX_get_KeyCodeUnderlying_From_KeyCodeUS(GdkKeymap *keymap, vec_dword_3D &All_Vector, KMX_DWORD kc_us, ShiftState ss, int caps) { +KMX_DWORD KMX_get_KeyCodeUnderlying_From_KeyCodeUS(GdkKeymap *keymap, vec_dword_3D &all_vector, KMX_DWORD kc_us, ShiftState ss, int caps) { KMX_DWORD kc_underlying; std::u16string u16str = convert_DeadkeyValues_To_U16str(KMX_get_KeyVal_From_KeyCode(keymap, kc_us, ss, caps)); - for( int i=0; i< (int)All_Vector[1].size()-1 ;i++) { - for( int j=1; j< (int)All_Vector[1][0].size();j++) { - if ( ( All_Vector[1][i][j] == (KMX_DWORD) *u16str.c_str() ) ) { - kc_underlying = All_Vector[1][i][0]; + for( int i=0; i< (int)all_vector[1].size()-1 ;i++) { + for( int j=1; j< (int)all_vector[1][0].size();j++) { + if (( all_vector[1][i][j] == (KMX_DWORD) *u16str.c_str() ) ) { + kc_underlying = all_vector[1][i][0]; return kc_underlying; } } @@ -777,7 +777,7 @@ UINT KMX_get_KeyCodeUnderlying_From_VKUS(KMX_DWORD virtualKeyUS) { } KMX_DWORD KMX_get_VKUS_From_KeyCodeUnderlying(KMX_DWORD keycode) { - if ( keycode >7) + if (keycode >7) return (KMX_DWORD) ScanCodeToUSVirtualKey[keycode-8]; return 0; diff --git a/linux/mcompile/keymap/mc_import_rules.cpp b/linux/mcompile/keymap/mc_import_rules.cpp index bdc9e0c1ff..447711c571 100755 --- a/linux/mcompile/keymap/mc_import_rules.cpp +++ b/linux/mcompile/keymap/mc_import_rules.cpp @@ -241,7 +241,7 @@ public: return nkeys; } - bool KMX_LayoutRow(int MaxShiftState, LPKMX_KEY key, std::vector *deadkeys, int deadkeyBase, BOOL bDeadkeyConversion,vec_dword_3D &All_Vector, GdkKeymap *keymap) { // I4552 + bool KMX_LayoutRow(int MaxShiftState, LPKMX_KEY key, std::vector *deadkeys, int deadkeyBase, BOOL bDeadkeyConversion,vec_dword_3D& all_vector, GdkKeymap *keymap) { // I4552 // Get the CAPSLOCK value int capslock = (this->KMX_IsCapsEqualToShift() ? 1 : 0) | @@ -301,7 +301,7 @@ public: // key->Key stores VK-US ( not underlying !!) // key->dpOutput stores character Underlying - KMX_DWORD SC_Underlying = KMX_get_KeyCodeUnderlying_From_KeyCodeUS(keymap, All_Vector, this->SC(), (ShiftState) ss, caps); + KMX_DWORD SC_Underlying = KMX_get_KeyCodeUnderlying_From_KeyCodeUS(keymap, all_vector, this->SC(), (ShiftState) ss, caps); key->Key = KMX_get_VKUS_From_KeyCodeUnderlying( SC_Underlying); key->Line = 0; @@ -362,7 +362,7 @@ int KMX_GetMaxDeadkeyIndex(KMX_WCHAR *p) { return n; } -bool KMX_ImportRules(LPKMX_KEYBOARD kp,vec_dword_3D &All_Vector, GdkKeymap **keymap, std::vector *FDeadkeys, KMX_BOOL bDeadkeyConversion) { // I4353 // I4552 +bool KMX_ImportRules(LPKMX_KEYBOARD kp, vec_dword_3D& all_vector, GdkKeymap **keymap, std::vector *FDeadkeys, KMX_BOOL bDeadkeyConversion) { // I4353 // I4552 KMX_Loader loader; std::vector rgKey; //= new VirtualKey[256]; @@ -380,7 +380,7 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,vec_dword_3D &All_Vector, GdkKeymap **ke // ( mcompile win uses MapVirtualKeyEx() to fill m_vk with the VK of the Underlying keyboard) // Linux can get a VK for the US Keyboard using USVirtualKeyToScanCode/ScanCodeToUSVirtualKey // Linux cannot get a VK for the underling Keyboard - // this "connection" is possible only when using All_Vector + // this "connection" is possible only when using all_vector KMX_VirtualKey *key = new KMX_VirtualKey(sc); @@ -409,9 +409,9 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,vec_dword_3D &All_Vector, GdkKeymap **ke } //_S2 TOP_6 TODO to compare win-lin kmn-files skip ss6+7; MUST BE removed later!!!! - /*if(ss == MenuCtrl|| ss == ShftMenuCtrl) { + if(ss == MenuCtrl|| ss == ShftMenuCtrl) { continue; - }*/ + } KMX_DWORD kc_us = (KMX_DWORD) KMX_get_KeyCodeUnderlying_From_VKUS(iKey); @@ -423,7 +423,7 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,vec_dword_3D &All_Vector, GdkKeymap **ke rgKey[iKey]->KMX_SetShiftState(ss, u"", false, (caps)); // different to windows since behavior on Linux is different } else { - if( (ss == Ctrl || ss == ShftCtrl) ) { + if ((ss == Ctrl || ss == ShftCtrl) ) { continue; } sbBuffer[rc] = 0; @@ -432,7 +432,7 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,vec_dword_3D &All_Vector, GdkKeymap **ke } else if(rc < 0) { sbBuffer[2] = 0; - rgKey[iKey]->KMX_SetShiftState(ss, sbBuffer, true, (caps )); // different to windows since behavior on Linux is different + rgKey[iKey]->KMX_SetShiftState(ss, sbBuffer, true, (caps)); // different to windows since behavior on Linux is different refine_alDead(sbBuffer[0], alDead, &alDead_cpl); } @@ -498,7 +498,7 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,vec_dword_3D &All_Vector, GdkKeymap **ke // for (UINT iKey = 0; iKey < rgKey.size(); iKey++) { if ((rgKey[iKey] != NULL) && rgKey[iKey]->KMX_IsKeymanUsedKey() && (!rgKey[iKey]->KMX_IsEmpty())) { - if(rgKey[iKey]->KMX_LayoutRow(loader.KMX_MaxShiftState(), &gp->dpKeyArray[nkeys], &alDead, nDeadkey, bDeadkeyConversion, All_Vector,*keymap)) { // I4552 + if(rgKey[iKey]->KMX_LayoutRow(loader.KMX_MaxShiftState(), &gp->dpKeyArray[nkeys], &alDead, nDeadkey, bDeadkeyConversion, all_vector,*keymap)) { // I4552 nkeys+=rgKey[iKey]->KMX_GetKeyCount(loader.KMX_MaxShiftState()); } } diff --git a/linux/mcompile/keymap/mc_kmxfile.cpp b/linux/mcompile/keymap/mc_kmxfile.cpp index 30d780a192..a96a01a022 100755 --- a/linux/mcompile/keymap/mc_kmxfile.cpp +++ b/linux/mcompile/keymap/mc_kmxfile.cpp @@ -70,8 +70,8 @@ KMX_DWORD KMX_WriteCompiledKeyboardToFile(LPKMX_KEYBOARD fk, FILE* hOutfile, KMX size += u16len(fkp->dpContext)*2 + 2; } - if( fgp->dpMatch ) size += u16len(fgp->dpMatch)*2 + 2; - if( fgp->dpNoMatch ) size += u16len(fgp->dpNoMatch)*2 + 2; + if (fgp->dpMatch ) size += u16len(fgp->dpMatch)*2 + 2; + if (fgp->dpNoMatch ) size += u16len(fgp->dpNoMatch)*2 + 2; } for(i = 0; i < fk->cxStoreArray; i++) diff --git a/linux/mcompile/keymap/mcompile.cpp b/linux/mcompile/keymap/mcompile.cpp index cc797a94cf..933299cdd9 100755 --- a/linux/mcompile/keymap/mcompile.cpp +++ b/linux/mcompile/keymap/mcompile.cpp @@ -31,7 +31,7 @@ KMX_BOOL KMX_DoConvert(LPKMX_KEYBOARD kbd, KMX_BOOL bDeadkeyConversion, gint argc, gchar *argv[]); -bool KMX_ImportRules( LPKMX_KEYBOARD kp,vec_dword_3D &All_Vector, GdkKeymap **keymap,std::vector *KMX_FDeadkeys, KMX_BOOL bDeadkeyConversion); // I4353 // I4327 +bool KMX_ImportRules( LPKMX_KEYBOARD kp,vec_dword_3D& all_vector, GdkKeymap **keymap,std::vector *KMX_FDeadkeys, KMX_BOOL bDeadkeyConversion); // I4353 // I4327 std::vector KMX_FDeadkeys; // I4353 @@ -348,7 +348,7 @@ KMX_WCHAR KMX_GetUniqueDeadkeyID(LPKMX_KEYBOARD kbd, KMX_WCHAR deadkey) { return s_dkids[s_ndkids++].dst_deadkey = s_next_dkid = ++dkid; } -void KMX_ConvertDeadkey(LPKMX_KEYBOARD kbd, KMX_WORD vk_US, UINT shift, KMX_WCHAR deadkey, vec_dword_3D &All_Vector, GdkKeymap* keymap,vec_dword_2D dk_Table) { +void KMX_ConvertDeadkey(LPKMX_KEYBOARD kbd, KMX_WORD vk_US, UINT shift, KMX_WCHAR deadkey, vec_dword_3D& all_vector, GdkKeymap* keymap,vec_dword_2D dk_Table) { KMX_WORD deadkeys[512], *pdk; // Lookup the deadkey table for the deadkey in the physical keyboard @@ -365,7 +365,7 @@ void KMX_ConvertDeadkey(LPKMX_KEYBOARD kbd, KMX_WORD vk_US, UINT shift, KMX_WCHA while(*pdk) { // Look up the ch - UINT KeyValUnderlying = KMX_get_KeyValUnderlying_From_KeyValUS(All_Vector, *pdk); + UINT KeyValUnderlying = KMX_get_KeyValUnderlying_From_KeyValUS(all_vector, *pdk); KMX_TranslateDeadkeyKeyboard(kbd, dkid, KeyValUnderlying, *(pdk+1), *(pdk+2)); pdk+=3; } @@ -405,14 +405,14 @@ KMX_BOOL KMX_DoConvert(LPKMX_KEYBOARD kbd, KMX_BOOL bDeadkeyConversion, gint arg // For now, we get the least shifted version, which is hopefully adequate. GdkKeymap *keymap; - if(InitializeGDK(&keymap , argc, argv)) { + if(InitializeGDK(&keymap, argc, argv)) { wprintf(L"ERROR: can't Initialize GDK\n"); return FALSE; } // create vector that contains Keycode, base, shift for US-KEyboard and underlying keyboard - vec_dword_3D All_Vector; - if(createOneVectorFromBothKeyboards(All_Vector, keymap)){ + vec_dword_3D all_vector; + if(createOneVectorFromBothKeyboards(all_vector, keymap)){ wprintf(L"ERROR: can't create one vector from both keyboards\n"); return FALSE; } @@ -439,7 +439,7 @@ KMX_BOOL KMX_DoConvert(LPKMX_KEYBOARD kbd, KMX_BOOL bDeadkeyConversion, gint arg switch(ch) { case 0x0000: break; - case 0xFFFF: KMX_ConvertDeadkey(kbd, KMX_VKMap[i], VKShiftState[j], DeadKey, All_Vector, keymap , dk_Table); break; + case 0xFFFF: KMX_ConvertDeadkey(kbd, KMX_VKMap[i], VKShiftState[j], DeadKey, all_vector, keymap, dk_Table); break; default: KMX_TranslateKeyboard(kbd, KMX_VKMap[i], VKShiftState[j], ch); } } @@ -447,7 +447,7 @@ KMX_BOOL KMX_DoConvert(LPKMX_KEYBOARD kbd, KMX_BOOL bDeadkeyConversion, gint arg KMX_ReportUnconvertedKeyboardRules(kbd); - if(!KMX_ImportRules(kbd, All_Vector, &keymap, &KMX_FDeadkeys, bDeadkeyConversion)) { // I4353 // I4552 + if(!KMX_ImportRules(kbd, all_vector, &keymap, &KMX_FDeadkeys, bDeadkeyConversion)) { // I4353 // I4552 return FALSE; } return TRUE; diff --git a/windows/src/engine/mcompile/mc_savekeyboard.cpp b/windows/src/engine/mcompile/mc_savekeyboard.cpp index ce270104e7..781d6b1cbd 100644 --- a/windows/src/engine/mcompile/mc_savekeyboard.cpp +++ b/windows/src/engine/mcompile/mc_savekeyboard.cpp @@ -67,8 +67,8 @@ DWORD WriteCompiledKeyboard(LPKEYBOARD fk, HANDLE hOutfile, BOOL FSaveDebug) size += wcslen(fkp->dpContext)*2 + 2; } - if( fgp->dpMatch ) size += wcslen(fgp->dpMatch)*2 + 2; - if( fgp->dpNoMatch ) size += wcslen(fgp->dpNoMatch)*2 + 2; + if (fgp->dpMatch ) size += wcslen(fgp->dpMatch)*2 + 2; + if (fgp->dpNoMatch ) size += wcslen(fgp->dpNoMatch)*2 + 2; } for(i = 0; i < fk->cxStoreArray; i++)