Author: dchapyshev
Date: Fri May 2 01:41:59 2008
New Revision: 33228
URL:
http://svn.reactos.org/svn/reactos?rev=33228&view=rev
Log:
- Getting a localized layout names from input.dll
- Add some layouts to resources
Modified:
trunk/reactos/dll/cpl/input/add.c
trunk/reactos/dll/cpl/input/input.h
trunk/reactos/dll/cpl/input/lang/bg-BG.rc
trunk/reactos/dll/cpl/input/lang/de-DE.rc
trunk/reactos/dll/cpl/input/lang/el-GR.rc
trunk/reactos/dll/cpl/input/lang/en-US.rc
trunk/reactos/dll/cpl/input/lang/es-ES.rc
trunk/reactos/dll/cpl/input/lang/fr-FR.rc
trunk/reactos/dll/cpl/input/lang/it-IT.rc
trunk/reactos/dll/cpl/input/lang/pl-PL.rc
trunk/reactos/dll/cpl/input/lang/ru-RU.rc
trunk/reactos/dll/cpl/input/lang/sk-SK.rc
trunk/reactos/dll/cpl/input/lang/uk-UA.rc
trunk/reactos/dll/cpl/input/resource.h
trunk/reactos/dll/cpl/input/settings.c
Modified: trunk/reactos/dll/cpl/input/add.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/add.c?rev=33…
==============================================================================
--- trunk/reactos/dll/cpl/input/add.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/add.c [iso-8859-1] Fri May 2 01:41:59 2008
@@ -72,7 +72,7 @@
VOID
CreateKeyboardLayoutList(VOID)
{
- HKEY hKey, hSubKey;
+ HKEY hKey;
PTSTR pstrLayoutID;
TCHAR szLayoutID[CCH_LAYOUT_ID + 1], KeyName[MAX_PATH];
DWORD dwIndex = 0;
@@ -84,31 +84,21 @@
while (RegEnumKeyEx(hKey, dwIndex, szLayoutID, &dwSize, NULL, NULL, NULL,
NULL) == ERROR_SUCCESS)
{
- wsprintf(KeyName, _T("System\\CurrentControlSet\\Control\\Keyboard
Layouts\\%s"), szLayoutID);
+ GetLayoutName(szLayoutID, KeyName);
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, KeyName, 0, KEY_QUERY_VALUE,
&hSubKey) == ERROR_SUCCESS)
+ INT iIndex = (INT) SendMessage(hLayoutList, CB_ADDSTRING, 0,
(LPARAM)KeyName);
+
+ pstrLayoutID = (PTSTR)HeapAlloc(hProcessHeap, 0, sizeof(szLayoutID));
+ lstrcpy(pstrLayoutID, szLayoutID);
+ SendMessage(hLayoutList, CB_SETITEMDATA, iIndex, (LPARAM)pstrLayoutID);
+
+ // FIXME!
+ if (_tcscmp(szLayoutID, _T("00000409")) == 0)
{
- DWORD dwKeyNameSize = sizeof(KeyName);
+ SendMessage(hLayoutList, CB_SETCURSEL, (WPARAM)iIndex, (LPARAM)0);
+ }
- if (RegQueryValueEx(hSubKey, _T("Layout Text"), NULL, NULL,
(LPBYTE)KeyName, &dwKeyNameSize) == ERROR_SUCCESS)
- {
- INT iIndex = (INT) SendMessage(hLayoutList, CB_ADDSTRING, 0,
(LPARAM)KeyName);
-
- pstrLayoutID = (PTSTR)HeapAlloc(hProcessHeap, 0,
sizeof(szLayoutID));
- lstrcpy(pstrLayoutID, szLayoutID);
- SendMessage(hLayoutList, CB_SETITEMDATA, iIndex,
(LPARAM)pstrLayoutID);
-
- // FIXME!
- if (_tcscmp(szLayoutID, _T("00000409")) == 0)
- {
- SendMessage(hLayoutList, CB_SETCURSEL, (WPARAM)iIndex,
(LPARAM)0);
- }
-
- dwIndex++;
- }
-
- RegCloseKey(hSubKey);
- }
+ dwIndex++;
dwSize = sizeof(szLayoutID) / sizeof(TCHAR);
}
Modified: trunk/reactos/dll/cpl/input/input.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/input.h?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/input/input.h [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/input.h [iso-8859-1] Fri May 2 01:41:59 2008
@@ -38,7 +38,7 @@
INT_PTR CALLBACK
SettingPageProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
BOOL
-GetLayoutName(LPCTSTR lcid, LPTSTR name);
+GetLayoutName(LPCTSTR szLCID, LPTSTR szName);
VOID
UpdateLayoutsList(VOID);
Modified: trunk/reactos/dll/cpl/input/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/bg-BG.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/bg-BG.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/bg-BG.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -223,4 +223,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Äõèâåõñêà ìàëòèéñêà"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Áúëãàðñêà ßÂÅÐÒÚ"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Áúëãàðñêà ×ØÅÐÒÚ"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/de-DE.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/de-DE.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -224,4 +224,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Divehi (Schreibmaschine)"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Bulgarian Phonetic
(Classic)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Bulgarian Phonetic (BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/el-GR.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/el-GR.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/el-GR.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -223,4 +223,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Divehi Typewriter"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Bulgarian Phonetic
(Classic)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Bulgarian Phonetic (BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/en-US.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/en-US.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -222,5 +222,10 @@
IDS_DIVEHI_PHONETIC_LAYOUT, "Divehi Phonetic"
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Divehi Typewriter"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Bulgarian Phonetic
(Classic)"
- IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Bulgarian Phonetic (BDS)"
-END
+ IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Bulgarian Phonetic (BDS
5237-1978)"
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/es-ES.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/es-ES.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -228,4 +228,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Divehi Typewriter"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Búlgaro Fonético (Classic)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Búlgaro Fonético (BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/fr-FR.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/fr-FR.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -225,4 +225,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Divehi Typewriter"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Bulgarian Phonetic
(Classic)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Bulgarian Phonetic (BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/it-IT.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/it-IT.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -223,4 +223,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Divehi Typewriter"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Bulgarian Phonetic
(Classic)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Bulgarian Phonetic (BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/pl-PL.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/pl-PL.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -230,4 +230,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Malediwski (Maszynisty)"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Bu³garski (Fonetyczny)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Bu³garski (Fonetyczny, BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/ru-RU.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/ru-RU.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -223,4 +223,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Äèâèõàé ìàøèíîïèñü"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Áîëãàðñêàÿ ôîíåòè÷åñêàÿ
(êëàññè÷åñêàÿ)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Áîëãàðñêàÿ ôîíåòè÷åñêàÿ
(BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Áîëãàðñêàÿ (BDS
5237-1978)"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/sk-SK.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/sk-SK.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -227,4 +227,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Divehi Typewriter"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Bulgarian Phonetic
(Classic)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Bulgarian Phonetic (BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/lang/uk-UA.r…
==============================================================================
--- trunk/reactos/dll/cpl/input/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/lang/uk-UA.rc [iso-8859-1] Fri May 2 01:41:59 2008
@@ -232,4 +232,9 @@
IDS_DIVEHI_TYPEWRITER_LAYOUT, "Ìàëüä³âñüêà (äðóêàðñüêà
ìàøèíêà)"
IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT, "Áîëãàðñüêà ôîíåòè÷íà
(êëàñè÷íà)"
IDS_BULGARIAN_PHONETIC_BDS_LAYOUT, "Áîëãàðñüêà ôîíåòè÷íà (BDS)"
-END
+ IDS_BULGARIAN_BDS_LAYOUT, "Bulgarian BDS 5237-1978"
+ IDS_GERMAN_RISTOME_LAYOUT, "German (RISTOME)"
+ IDS_GERMAN_NEO_11_LAYOUT, "German (NEO-1.1)"
+ IDS_GERMAN_DE_ERGO_LAYOUT, "German (de_ergo)"
+ IDS_BURMESE_LAYOUT, "Burmese"
+END
Modified: trunk/reactos/dll/cpl/input/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/resource.h?r…
==============================================================================
--- trunk/reactos/dll/cpl/input/resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/resource.h [iso-8859-1] Fri May 2 01:41:59 2008
@@ -185,6 +185,11 @@
#define IDS_DIVEHI_TYPEWRITER_LAYOUT 5133
#define IDS_BULGARIAN_PHONETIC_CLASSIC_LAYOUT 5134
#define IDS_BULGARIAN_PHONETIC_BDS_LAYOUT 5135
+#define IDS_BULGARIAN_BDS_LAYOUT 5136
+#define IDS_GERMAN_RISTOME_LAYOUT 5137
+#define IDS_GERMAN_NEO_11_LAYOUT 5138
+#define IDS_GERMAN_DE_ERGO_LAYOUT 5139
+#define IDS_BURMESE_LAYOUT 5140
#endif /* __CPL_RESOURCE_H */
Modified: trunk/reactos/dll/cpl/input/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/settings.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/input/settings.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/input/settings.c [iso-8859-1] Fri May 2 01:41:59 2008
@@ -86,19 +86,58 @@
}
BOOL
-GetLayoutName(LPCTSTR lcid, LPTSTR name)
+GetLayoutName(LPCTSTR szLCID, LPTSTR szName)
{
HKEY hKey;
DWORD dwBufLen;
- TCHAR szBuf[MAX_PATH];
-
- wsprintf(szBuf, _T("SYSTEM\\CurrentControlSet\\Control\\Keyboard
Layouts\\%s"), lcid);
+ TCHAR szBuf[MAX_PATH], szDispName[MAX_PATH], szIndex[MAX_PATH], szPath[MAX_PATH];
+ HANDLE hLib;
+ int i, j, k;
+
+ wsprintf(szBuf, _T("SYSTEM\\CurrentControlSet\\Control\\Keyboard
Layouts\\%s"), szLCID);
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPCTSTR)szBuf, 0, KEY_QUERY_VALUE, &hKey)
== ERROR_SUCCESS)
{
dwBufLen = sizeof(szBuf);
- if (RegQueryValueEx(hKey, _T("Layout Text"), NULL, NULL, (LPBYTE)name,
&dwBufLen) == ERROR_SUCCESS)
+ if (RegQueryValueEx(hKey, _T("Layout Display Name"), NULL, NULL,
(LPBYTE)szDispName, &dwBufLen) == ERROR_SUCCESS)
+ {
+ if (szDispName[0] == '@')
+ {
+ for (i = 0; i < _tcslen(szDispName); i++)
+ {
+ if ((szDispName[i] == ',') && (szDispName[i + 1] ==
'-'))
+ {
+ for (j = i + 2, k = 0; j < _tcslen(szDispName)+1; j++, k++)
+ {
+ szIndex[k] = szDispName[j];
+ }
+ szDispName[i - 1] = '\0';
+ break;
+ }
+ else szDispName[i] = szDispName[i + 1];
+ }
+
+ if (ExpandEnvironmentStrings(szDispName, szPath, MAX_PATH))
+ {
+ hLib = LoadLibrary(szPath);
+ if (hLib)
+ {
+ if (LoadString(hLib, _ttoi(szIndex), szPath, sizeof(szPath) /
sizeof(TCHAR)) != 0)
+ {
+ _tcscpy(szName, szPath);
+ RegCloseKey(hKey);
+ return TRUE;
+ }
+ FreeLibrary(hLib);
+ }
+ }
+ }
+ }
+
+ dwBufLen = sizeof(szBuf);
+
+ if (RegQueryValueEx(hKey, _T("Layout Text"), NULL, NULL,
(LPBYTE)szName, &dwBufLen) == ERROR_SUCCESS)
{
RegCloseKey(hKey);
return TRUE;