Author: cfinck
Date: Wed Mar 12 08:50:30 2008
New Revision: 32665
URL:
http://svn.reactos.org/svn/reactos?rev=3D32665&view=3Drev
Log:
[FORMATTING] Fix indentation
Modified:
trunk/reactos/dll/cpl/input/add.c
trunk/reactos/dll/cpl/input/input.c
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?r=
ev=3D32665&r1=3D32664&r2=3D32665&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/dll/cpl/input/add.c (original)
+++ trunk/reactos/dll/cpl/input/add.c Wed Mar 12 08:50:30 2008
@@ -18,97 +18,97 @@
SelectLayoutByLang(VOID)
{
TCHAR Layout[MAX_PATH], Lang[MAX_PATH], LangID[MAX_PATH];
- INT iIndex;
- LCID Lcid;
+ INT iIndex;
+ LCID Lcid;
=
iIndex =3D SendMessage(hLangList, CB_GETCURSEL, 0, 0);
Lcid =3D SendMessage(hLangList, CB_GETITEMDATA, iIndex, 0);
=
- GetLocaleInfo(MAKELCID(Lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, (WORD*)Lang=
, sizeof(Lang));
+ GetLocaleInfo(MAKELCID(Lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, (WORD*)L=
ang, sizeof(Lang));
=
- _stprintf(LangID, _T("0000%s"), Lang);
+ _stprintf(LangID, _T("0000%s"), Lang);
=
- if (GetLayoutName(LangID, Layout))
- {
- SendMessage(hLayoutList, CB_SELECTSTRING,
- (WPARAM) -1, (LPARAM)Layout);
- }
+ if (GetLayoutName(LangID, Layout))
+ {
+ SendMessage(hLayoutList, CB_SELECTSTRING,
+ (WPARAM) -1, (LPARAM)Layout);
+ }
}
=
static VOID
AddNewLayout(HWND hwndDlg)
{
- TCHAR Lang[MAX_PATH], LangID[MAX_PATH], LayoutID[MAX_PATH];
- INT iLang, iLayout;
- LCID Lcid;
+ TCHAR Lang[MAX_PATH], LangID[MAX_PATH], LayoutID[MAX_PATH];
+ INT iLang, iLayout;
+ LCID Lcid;
=
- iLang =3D SendMessage(hLangList, CB_GETCURSEL, 0, 0);
- iLayout =3D SendMessage(hLayoutList, CB_GETCURSEL, 0, 0);
+ iLang =3D SendMessage(hLangList, CB_GETCURSEL, 0, 0);
+ iLayout =3D SendMessage(hLayoutList, CB_GETCURSEL, 0, 0);
=
- if ((iLang =3D=3D CB_ERR) || (iLayout =3D=3D CB_ERR)) return;
+ if ((iLang =3D=3D CB_ERR) || (iLayout =3D=3D CB_ERR)) return;
=
- Lcid =3D (LCID) SendMessage(hLangList, CB_GETITEMDATA, iLang, 0);
- GetLocaleInfo(MAKELCID(Lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, (WORD*)Lang=
, sizeof(Lang));
- _stprintf(LangID, _T("0000%s"), Lang);
+ Lcid =3D (LCID) SendMessage(hLangList, CB_GETITEMDATA, iLang, 0);
+ GetLocaleInfo(MAKELCID(Lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, (WORD*)L=
ang, sizeof(Lang));
+ _stprintf(LangID, _T("0000%s"), Lang);
=
- _tcscpy(LayoutID, (LPTSTR)SendMessage(hLayoutList, CB_GETITEMDATA, iLayou=
t, 0));
+ _tcscpy(LayoutID, (LPTSTR)SendMessage(hLayoutList, CB_GETITEMDATA, iLa=
yout, 0));
=
- if (_tcscmp(LangID, LayoutID) =3D=3D 0)
- {
- MessageBox(0, L"", L"", MB_OK);
- HKEY hKey;
+ if (_tcscmp(LangID, LayoutID) =3D=3D 0)
+ {
+ MessageBox(0, L"", L"", MB_OK);
+ HKEY hKey;
=
- if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\Preload"), 0, K=
EY_WRITE, &hKey))
- {
- =
- }
- }
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\Preload")=
, 0, KEY_WRITE, &hKey))
+ {
+ =
+ }
+ }
}
=
VOID
CreateKeyboardLayoutList(VOID)
{
- HKEY hKey, hSubKey;
- TCHAR szBuf[MAX_PATH], KeyName[MAX_PATH];
- LONG Ret;
- DWORD dwIndex =3D 0;
+ HKEY hKey, hSubKey;
+ TCHAR szBuf[MAX_PATH], KeyName[MAX_PATH];
+ LONG Ret;
+ DWORD dwIndex =3D 0;
=
- if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control=
\\Keyboard Layouts"), &hKey) =3D=3D ERROR_SUCCESS)
- {
- Ret =3D RegEnumKey(hKey, dwIndex, szBuf, sizeof(szBuf) / sizeof(TCHAR));
- if (Ret =3D=3D ERROR_SUCCESS)
- {
- while (Ret =3D=3D ERROR_SUCCESS)
- {
- _stprintf(KeyName, _T("System\\CurrentControlSet\\Control\\Keyboard La=
youts\\%s"), szBuf);
- if (RegOpenKey(HKEY_LOCAL_MACHINE, KeyName, &hSubKey) =3D=3D ERROR_SUC=
CESS)
- {
- DWORD Length =3D MAX_PATH;
+ if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Cont=
rol\\Keyboard Layouts"), &hKey) =3D=3D ERROR_SUCCESS)
+ {
+ Ret =3D RegEnumKey(hKey, dwIndex, szBuf, sizeof(szBuf) / sizeof(TC=
HAR));
+ if (Ret =3D=3D ERROR_SUCCESS)
+ {
+ while (Ret =3D=3D ERROR_SUCCESS)
+ {
+ _stprintf(KeyName, _T("System\\CurrentControlSet\\Control\=
\Keyboard Layouts\\%s"), szBuf);
+ if (RegOpenKey(HKEY_LOCAL_MACHINE, KeyName, &hSubKey) =3D=
=3D ERROR_SUCCESS)
+ {
+ DWORD Length =3D MAX_PATH;
=
- if (RegQueryValueEx(hSubKey, _T("Layout Text"), NULL, NULL, (LPBYTE)K=
eyName, &Length) =3D=3D ERROR_SUCCESS)
- {
- UINT iIndex;
- iIndex =3D (UINT) SendMessage(hLayoutList, CB_ADDSTRING, 0, (LPARAM)=
KeyName);
+ if (RegQueryValueEx(hSubKey, _T("Layout Text"), NULL, =
NULL, (LPBYTE)KeyName, &Length) =3D=3D ERROR_SUCCESS)
+ {
+ UINT iIndex;
+ iIndex =3D (UINT) SendMessage(hLayoutList, CB_ADDS=
TRING, 0, (LPARAM)KeyName);
=
- SendMessage(hLayoutList, CB_SETITEMDATA, iIndex, (LPARAM)szBuf);
+ SendMessage(hLayoutList, CB_SETITEMDATA, iIndex, (=
LPARAM)szBuf);
=
- // FIXME!
- if (_tcscmp(szBuf, _T("00000409")) =3D=3D 0)
- {
- SendMessage(hLayoutList, CB_SELECTSTRING, (WPARAM) -1, (LPARAM)KeyN=
ame);
- }
+ // FIXME!
+ if (_tcscmp(szBuf, _T("00000409")) =3D=3D 0)
+ {
+ SendMessage(hLayoutList, CB_SELECTSTRING, (WPA=
RAM) -1, (LPARAM)KeyName);
+ }
=
- dwIndex++;
- Ret =3D RegEnumKey(hKey, dwIndex, szBuf, sizeof(szBuf) / sizeof(TCHA=
R));
- }
- }
+ dwIndex++;
+ Ret =3D RegEnumKey(hKey, dwIndex, szBuf, sizeof(sz=
Buf) / sizeof(TCHAR));
+ }
+ }
=
- RegCloseKey(hSubKey);
- }
- }
- }
+ RegCloseKey(hSubKey);
+ }
+ }
+ }
=
- RegCloseKey(hKey);
+ RegCloseKey(hKey);
}
=
/* Language enumerate procedure */
@@ -128,12 +128,12 @@
SendMessage(hLangList, CB_SETITEMDATA,
Index, (LPARAM)Lcid);
=
- // FIXME!
- if (Lcid =3D=3D 0x0409)
- {
- SendMessage(hLangList, CB_SELECTSTRING,
+ // FIXME!
+ if (Lcid =3D=3D 0x0409)
+ {
+ SendMessage(hLangList, CB_SELECTSTRING,
(WPARAM) -1, (LPARAM)Lang);
- }
+ }
=
return TRUE;
}
@@ -149,42 +149,42 @@
switch (message)
{
case WM_INITDIALOG:
- {
- hLangList =3D GetDlgItem(hDlg, IDC_INPUT_LANG_COMBO);
- hLayoutList =3D GetDlgItem(hDlg, IDC_KEYBOARD_LO_COMBO);
+ {
+ hLangList =3D GetDlgItem(hDlg, IDC_INPUT_LANG_COMBO);
+ hLayoutList =3D GetDlgItem(hDlg, IDC_KEYBOARD_LO_COMBO);
EnumSystemLocales(LanguagesEnumProc, LCID_INSTALLED);
CreateKeyboardLayoutList();
- }
+ }
break;
=
case WM_COMMAND:
- {
+ {
switch (LOWORD(wParam))
{
case IDC_INPUT_LANG_COMBO:
- {
+ {
if (HIWORD(wParam) =3D=3D CBN_SELCHANGE)
{
SelectLayoutByLang();
}
- }
+ }
break;
=
case IDOK:
- {
- AddNewLayout(hDlg);
- EndDialog(hDlg, LOWORD(wParam));
- }
+ {
+ AddNewLayout(hDlg);
+ EndDialog(hDlg, LOWORD(wParam));
+ }
break;
=
case IDCANCEL:
- {
+ {
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
- }
+ }
}
- }
- break;
+ }
+ break;
}
=
return FALSE;
Modified: trunk/reactos/dll/cpl/input/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/input.c=
?rev=3D32665&r1=3D32664&r2=3D32665&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/dll/cpl/input/input.c (original)
+++ trunk/reactos/dll/cpl/input/input.c Wed Mar 12 08:50:30 2008
@@ -37,7 +37,7 @@
/* Applets */
APPLET Applets[NUM_APPLETS] =3D
{
- {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApple=
t}
+ {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApp=
let}
};
=
=
Modified: trunk/reactos/dll/cpl/input/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/input/setting=
s.c?rev=3D32665&r1=3D32664&r2=3D32665&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/dll/cpl/input/settings.c (original)
+++ trunk/reactos/dll/cpl/input/settings.c Wed Mar 12 08:50:30 2008
@@ -15,12 +15,12 @@
=
typedef struct
{
- LANGID LangId;
- TCHAR LangName[MAX_PATH];
- TCHAR LayoutName[MAX_PATH];
- TCHAR ValName[MAX_PATH];
- TCHAR IndName[MAX_PATH];
- TCHAR SubName[MAX_PATH];
+ LANGID LangId;
+ TCHAR LangName[MAX_PATH];
+ TCHAR LayoutName[MAX_PATH];
+ TCHAR ValName[MAX_PATH];
+ TCHAR IndName[MAX_PATH];
+ TCHAR SubName[MAX_PATH];
} LAYOUT_ITEM, *LPLAYOUT_ITEM;
=
BOOL
@@ -50,7 +50,7 @@
{
LV_COLUMN column;
TCHAR szBuf[MAX_PATH];
- HWND hList =3D GetDlgItem(hWnd, IDC_KEYLAYOUT_LIST);
+ HWND hList =3D GetDlgItem(hWnd, IDC_KEYLAYOUT_LIST);
=
ZeroMemory(&column, sizeof(LV_COLUMN));
column.mask =3D LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBIT=
EM;
@@ -67,7 +67,7 @@
column.cx =3D 160;
(VOID) ListView_InsertColumn(hList, 1, &column);
=
- column.fmt =3D LVCFMT_RIGHT;
+ column.fmt =3D LVCFMT_RIGHT;
column.cx =3D 145;
column.iSubItem =3D 2;
LoadString(hApplet, IDS_LAYOUT, szBuf, sizeof(szBuf) / sizeof(TCHAR));
@@ -78,88 +78,88 @@
static BOOL
InitLangList(HWND hWnd)
{
- HKEY hKey, hSubKey;
- TCHAR szBuf[MAX_PATH], szPreload[MAX_PATH], szSub[MAX_PATH];
- LAYOUT_ITEM lItem;
- AddListColumn(hWnd);
- LONG Ret;
- DWORD dwIndex =3D 0, dwType, dwSize;
- LV_ITEM item;
- HWND hList =3D GetDlgItem(hWnd, IDC_KEYLAYOUT_LIST);
-
- (VOID) ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT);
- =
+ HKEY hKey, hSubKey;
+ TCHAR szBuf[MAX_PATH], szPreload[MAX_PATH], szSub[MAX_PATH];
+ LAYOUT_ITEM lItem;
+ AddListColumn(hWnd);
+ LONG Ret;
+ DWORD dwIndex =3D 0, dwType, dwSize;
+ LV_ITEM item;
+ HWND hList =3D GetDlgItem(hWnd, IDC_KEYLAYOUT_LIST);
+
+ (VOID) ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT);
+ =
if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\Preload"),
- 0, KEY_QUERY_VALUE, &hKey) =3D=3D ERROR_SUCCESS)
+ 0, KEY_QUERY_VALUE, &hKey) =3D=3D ERROR_SUCCESS)
{
- dwSize =3D MAX_PATH;
- Ret =3D RegEnumValue(hKey, dwIndex, szBuf, &dwSize, NULL, &dwType, NULL,=
NULL);
- if (Ret =3D=3D ERROR_SUCCESS)
- {
- while (Ret =3D=3D ERROR_SUCCESS)
- {
- _tcscpy(lItem.ValName, szBuf);
-
- dwSize =3D MAX_PATH;
- RegQueryValueEx(hKey, szBuf, NULL, NULL, (LPBYTE)szPreload, &dwSize);
-
- lItem.LangId =3D _tcstoul(szPreload, NULL, 16);
-
- GetLocaleInfo(lItem.LangId, LOCALE_SISO639LANGNAME, (LPTSTR) szBuf, si=
zeof(szBuf));
- _tcscpy(lItem.IndName, _tcsupr(szBuf));
-
- GetLocaleInfo(lItem.LangId, LOCALE_SLANGUAGE, (LPTSTR)szBuf, sizeof(sz=
Buf));
- _tcscpy(lItem.LangName, szBuf);
- =
- if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\Substitutes"),
- 0, KEY_QUERY_VALUE, &hSubKey) =3D=3D ERROR_SUCCESS)
- {
- dwSize =3D MAX_PATH;
- if (RegQueryValueEx(hSubKey, szPreload, NULL, NULL, (LPBYTE)szSub, &d=
wSize) =3D=3D ERROR_SUCCESS)
- {
- _tcscpy(lItem.SubName, szPreload);
- if (GetLayoutName(szSub, szBuf))
- {
- _tcscpy(lItem.LayoutName, szBuf);
- }
- }
- else
- {
- _tcscpy(lItem.SubName, _T(""));
- }
- }
-
- if (_tcslen(lItem.SubName) < 2)
- {
- if (GetLayoutName(szPreload, szBuf))
- {
- _tcscpy(lItem.LayoutName, szBuf);
- }
- }
- =
- ZeroMemory(&item, sizeof(LV_ITEM));
- item.mask =3D LVIF_TEXT | LVIF_PARAM | LVIF_STATE;
- item.pszText =3D lItem.IndName;
- item.lParam =3D (LPARAM)&lItem;
- item.iItem =3D (INT) dwIndex;
- INT i =3D ListView_InsertItem(hList, &item);
-
- ListView_SetItemText(hList, i, 1, lItem.LangName);
- ListView_SetItemText(hList, i, 2, lItem.LayoutName);
-
- dwIndex++;
- Ret =3D RegEnumValue(hKey, dwIndex, szBuf, &dwSize, NULL, &dwType, NUL=
L, NULL);
- RegCloseKey(hSubKey);
-
- if (_tcscmp(lItem.ValName, _T("1")) =3D=3D 0)
- {
- (VOID) ListView_SetHotItem(hList, i);
- }
- }
- }
- }
-
- RegCloseKey(hKey);
+ dwSize =3D MAX_PATH;
+ Ret =3D RegEnumValue(hKey, dwIndex, szBuf, &dwSize, NULL, &dwType,=
NULL, NULL);
+ if (Ret =3D=3D ERROR_SUCCESS)
+ {
+ while (Ret =3D=3D ERROR_SUCCESS)
+ {
+ _tcscpy(lItem.ValName, szBuf);
+
+ dwSize =3D MAX_PATH;
+ RegQueryValueEx(hKey, szBuf, NULL, NULL, (LPBYTE)szPreload=
, &dwSize);
+
+ lItem.LangId =3D _tcstoul(szPreload, NULL, 16);
+
+ GetLocaleInfo(lItem.LangId, LOCALE_SISO639LANGNAME, (LPTST=
R) szBuf, sizeof(szBuf));
+ _tcscpy(lItem.IndName, _tcsupr(szBuf));
+
+ GetLocaleInfo(lItem.LangId, LOCALE_SLANGUAGE, (LPTSTR)szBu=
f, sizeof(szBuf));
+ _tcscpy(lItem.LangName, szBuf);
+ =
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\S=
ubstitutes"),
+ 0, KEY_QUERY_VALUE, &hSubKey) =3D=3D ERRO=
R_SUCCESS)
+ {
+ dwSize =3D MAX_PATH;
+ if (RegQueryValueEx(hSubKey, szPreload, NULL, NULL, (L=
PBYTE)szSub, &dwSize) =3D=3D ERROR_SUCCESS)
+ {
+ _tcscpy(lItem.SubName, szPreload);
+ if (GetLayoutName(szSub, szBuf))
+ {
+ _tcscpy(lItem.LayoutName, szBuf);
+ }
+ }
+ else
+ {
+ _tcscpy(lItem.SubName, _T(""));
+ }
+ }
+
+ if (_tcslen(lItem.SubName) < 2)
+ {
+ if (GetLayoutName(szPreload, szBuf))
+ {
+ _tcscpy(lItem.LayoutName, szBuf);
+ }
+ }
+ =
+ ZeroMemory(&item, sizeof(LV_ITEM));
+ item.mask =3D LVIF_TEXT | LVIF_PARAM | LVIF_STATE;
+ item.pszText =3D lItem.IndName;
+ item.lParam =3D (LPARAM)&lItem;
+ item.iItem =3D (INT) dwIndex;
+ INT i =3D ListView_InsertItem(hList, &item);
+
+ ListView_SetItemText(hList, i, 1, lItem.LangName);
+ ListView_SetItemText(hList, i, 2, lItem.LayoutName);
+
+ dwIndex++;
+ Ret =3D RegEnumValue(hKey, dwIndex, szBuf, &dwSize, NULL, =
&dwType, NULL, NULL);
+ RegCloseKey(hSubKey);
+
+ if (_tcscmp(lItem.ValName, _T("1")) =3D=3D 0)
+ {
+ (VOID) ListView_SetHotItem(hList, i);
+ }
+ }
+ }
+ }
+
+ RegCloseKey(hKey);
return TRUE;
}
=