From 374a272eacb002ec70b18c20ab33a502012987ef Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Wed, 12 Mar 2008 13:50:30 +0000 Subject: [PATCH] [FORMATTING] Fix indentation svn path=/trunk/; revision=32665 --- reactos/dll/cpl/input/add.c | 164 +++++++++++++++---------------- reactos/dll/cpl/input/input.c | 2 +- reactos/dll/cpl/input/settings.c | 156 ++++++++++++++--------------- 3 files changed, 161 insertions(+), 161 deletions(-) diff --git a/reactos/dll/cpl/input/add.c b/reactos/dll/cpl/input/add.c index 2821993e165..ce5f695f4c3 100644 --- a/reactos/dll/cpl/input/add.c +++ b/reactos/dll/cpl/input/add.c @@ -18,97 +18,97 @@ static VOID SelectLayoutByLang(VOID) { TCHAR Layout[MAX_PATH], Lang[MAX_PATH], LangID[MAX_PATH]; - INT iIndex; - LCID Lcid; + INT iIndex; + LCID Lcid; iIndex = SendMessage(hLangList, CB_GETCURSEL, 0, 0); Lcid = 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*)Lang, 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 = SendMessage(hLangList, CB_GETCURSEL, 0, 0); - iLayout = SendMessage(hLayoutList, CB_GETCURSEL, 0, 0); + iLang = SendMessage(hLangList, CB_GETCURSEL, 0, 0); + iLayout = SendMessage(hLayoutList, CB_GETCURSEL, 0, 0); - if ((iLang == CB_ERR) || (iLayout == CB_ERR)) return; + if ((iLang == CB_ERR) || (iLayout == CB_ERR)) return; - Lcid = (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 = (LCID) SendMessage(hLangList, CB_GETITEMDATA, iLang, 0); + GetLocaleInfo(MAKELCID(Lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, (WORD*)Lang, sizeof(Lang)); + _stprintf(LangID, _T("0000%s"), Lang); - _tcscpy(LayoutID, (LPTSTR)SendMessage(hLayoutList, CB_GETITEMDATA, iLayout, 0)); + _tcscpy(LayoutID, (LPTSTR)SendMessage(hLayoutList, CB_GETITEMDATA, iLayout, 0)); - if (_tcscmp(LangID, LayoutID) == 0) - { - MessageBox(0, L"", L"", MB_OK); - HKEY hKey; + if (_tcscmp(LangID, LayoutID) == 0) + { + MessageBox(0, L"", L"", MB_OK); + HKEY hKey; - if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\Preload"), 0, KEY_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 = 0; + HKEY hKey, hSubKey; + TCHAR szBuf[MAX_PATH], KeyName[MAX_PATH]; + LONG Ret; + DWORD dwIndex = 0; - if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control\\Keyboard Layouts"), &hKey) == ERROR_SUCCESS) - { - Ret = RegEnumKey(hKey, dwIndex, szBuf, sizeof(szBuf) / sizeof(TCHAR)); - if (Ret == ERROR_SUCCESS) - { - while (Ret == ERROR_SUCCESS) - { - _stprintf(KeyName, _T("System\\CurrentControlSet\\Control\\Keyboard Layouts\\%s"), szBuf); - if (RegOpenKey(HKEY_LOCAL_MACHINE, KeyName, &hSubKey) == ERROR_SUCCESS) - { - DWORD Length = MAX_PATH; + if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control\\Keyboard Layouts"), &hKey) == ERROR_SUCCESS) + { + Ret = RegEnumKey(hKey, dwIndex, szBuf, sizeof(szBuf) / sizeof(TCHAR)); + if (Ret == ERROR_SUCCESS) + { + while (Ret == ERROR_SUCCESS) + { + _stprintf(KeyName, _T("System\\CurrentControlSet\\Control\\Keyboard Layouts\\%s"), szBuf); + if (RegOpenKey(HKEY_LOCAL_MACHINE, KeyName, &hSubKey) == ERROR_SUCCESS) + { + DWORD Length = MAX_PATH; - if (RegQueryValueEx(hSubKey, _T("Layout Text"), NULL, NULL, (LPBYTE)KeyName, &Length) == ERROR_SUCCESS) - { - UINT iIndex; - iIndex = (UINT) SendMessage(hLayoutList, CB_ADDSTRING, 0, (LPARAM)KeyName); + if (RegQueryValueEx(hSubKey, _T("Layout Text"), NULL, NULL, (LPBYTE)KeyName, &Length) == ERROR_SUCCESS) + { + UINT iIndex; + iIndex = (UINT) SendMessage(hLayoutList, CB_ADDSTRING, 0, (LPARAM)KeyName); - SendMessage(hLayoutList, CB_SETITEMDATA, iIndex, (LPARAM)szBuf); + SendMessage(hLayoutList, CB_SETITEMDATA, iIndex, (LPARAM)szBuf); - // FIXME! - if (_tcscmp(szBuf, _T("00000409")) == 0) - { - SendMessage(hLayoutList, CB_SELECTSTRING, (WPARAM) -1, (LPARAM)KeyName); - } + // FIXME! + if (_tcscmp(szBuf, _T("00000409")) == 0) + { + SendMessage(hLayoutList, CB_SELECTSTRING, (WPARAM) -1, (LPARAM)KeyName); + } - dwIndex++; - Ret = RegEnumKey(hKey, dwIndex, szBuf, sizeof(szBuf) / sizeof(TCHAR)); - } - } + dwIndex++; + Ret = RegEnumKey(hKey, dwIndex, szBuf, sizeof(szBuf) / sizeof(TCHAR)); + } + } - RegCloseKey(hSubKey); - } - } - } + RegCloseKey(hSubKey); + } + } + } - RegCloseKey(hKey); + RegCloseKey(hKey); } /* Language enumerate procedure */ @@ -128,12 +128,12 @@ LanguagesEnumProc(LPTSTR lpLanguage) SendMessage(hLangList, CB_SETITEMDATA, Index, (LPARAM)Lcid); - // FIXME! - if (Lcid == 0x0409) - { - SendMessage(hLangList, CB_SELECTSTRING, + // FIXME! + if (Lcid == 0x0409) + { + SendMessage(hLangList, CB_SELECTSTRING, (WPARAM) -1, (LPARAM)Lang); - } + } return TRUE; } @@ -149,42 +149,42 @@ AddDlgProc(HWND hDlg, switch (message) { case WM_INITDIALOG: - { - hLangList = GetDlgItem(hDlg, IDC_INPUT_LANG_COMBO); - hLayoutList = GetDlgItem(hDlg, IDC_KEYBOARD_LO_COMBO); + { + hLangList = GetDlgItem(hDlg, IDC_INPUT_LANG_COMBO); + hLayoutList = 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) == 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; diff --git a/reactos/dll/cpl/input/input.c b/reactos/dll/cpl/input/input.c index 8a2d75e07f5..0daec55c6f2 100644 --- a/reactos/dll/cpl/input/input.c +++ b/reactos/dll/cpl/input/input.c @@ -37,7 +37,7 @@ HINSTANCE hApplet = 0; /* Applets */ APPLET Applets[NUM_APPLETS] = { - {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet} + {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet} }; diff --git a/reactos/dll/cpl/input/settings.c b/reactos/dll/cpl/input/settings.c index 6d3d65d862e..ff4931a2018 100644 --- a/reactos/dll/cpl/input/settings.c +++ b/reactos/dll/cpl/input/settings.c @@ -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 @@ AddListColumn(HWND hWnd) { LV_COLUMN column; TCHAR szBuf[MAX_PATH]; - HWND hList = GetDlgItem(hWnd, IDC_KEYLAYOUT_LIST); + HWND hList = GetDlgItem(hWnd, IDC_KEYLAYOUT_LIST); ZeroMemory(&column, sizeof(LV_COLUMN)); column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; @@ -67,7 +67,7 @@ AddListColumn(HWND hWnd) column.cx = 160; (VOID) ListView_InsertColumn(hList, 1, &column); - column.fmt = LVCFMT_RIGHT; + column.fmt = LVCFMT_RIGHT; column.cx = 145; column.iSubItem = 2; LoadString(hApplet, IDS_LAYOUT, szBuf, sizeof(szBuf) / sizeof(TCHAR)); @@ -78,88 +78,88 @@ AddListColumn(HWND hWnd) 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 = 0, dwType, dwSize; - LV_ITEM item; - HWND hList = GetDlgItem(hWnd, IDC_KEYLAYOUT_LIST); + HKEY hKey, hSubKey; + TCHAR szBuf[MAX_PATH], szPreload[MAX_PATH], szSub[MAX_PATH]; + LAYOUT_ITEM lItem; + AddListColumn(hWnd); + LONG Ret; + DWORD dwIndex = 0, dwType, dwSize; + LV_ITEM item; + HWND hList = GetDlgItem(hWnd, IDC_KEYLAYOUT_LIST); - (VOID) ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT); - + (VOID) ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT); + if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\Preload"), - 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) + 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) { - dwSize = MAX_PATH; - Ret = RegEnumValue(hKey, dwIndex, szBuf, &dwSize, NULL, &dwType, NULL, NULL); - if (Ret == ERROR_SUCCESS) - { - while (Ret == ERROR_SUCCESS) - { - _tcscpy(lItem.ValName, szBuf); + dwSize = MAX_PATH; + Ret = RegEnumValue(hKey, dwIndex, szBuf, &dwSize, NULL, &dwType, NULL, NULL); + if (Ret == ERROR_SUCCESS) + { + while (Ret == ERROR_SUCCESS) + { + _tcscpy(lItem.ValName, szBuf); - dwSize = MAX_PATH; - RegQueryValueEx(hKey, szBuf, NULL, NULL, (LPBYTE)szPreload, &dwSize); + dwSize = MAX_PATH; + RegQueryValueEx(hKey, szBuf, NULL, NULL, (LPBYTE)szPreload, &dwSize); - lItem.LangId = _tcstoul(szPreload, NULL, 16); + lItem.LangId = _tcstoul(szPreload, NULL, 16); - GetLocaleInfo(lItem.LangId, LOCALE_SISO639LANGNAME, (LPTSTR) szBuf, sizeof(szBuf)); - _tcscpy(lItem.IndName, _tcsupr(szBuf)); + GetLocaleInfo(lItem.LangId, LOCALE_SISO639LANGNAME, (LPTSTR) szBuf, sizeof(szBuf)); + _tcscpy(lItem.IndName, _tcsupr(szBuf)); - GetLocaleInfo(lItem.LangId, LOCALE_SLANGUAGE, (LPTSTR)szBuf, sizeof(szBuf)); - _tcscpy(lItem.LangName, szBuf); - - if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\Substitutes"), - 0, KEY_QUERY_VALUE, &hSubKey) == ERROR_SUCCESS) - { - dwSize = MAX_PATH; - if (RegQueryValueEx(hSubKey, szPreload, NULL, NULL, (LPBYTE)szSub, &dwSize) == ERROR_SUCCESS) - { - _tcscpy(lItem.SubName, szPreload); - if (GetLayoutName(szSub, szBuf)) - { - _tcscpy(lItem.LayoutName, szBuf); - } - } - else - { - _tcscpy(lItem.SubName, _T("")); - } - } + GetLocaleInfo(lItem.LangId, LOCALE_SLANGUAGE, (LPTSTR)szBuf, sizeof(szBuf)); + _tcscpy(lItem.LangName, szBuf); + + if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Keyboard Layout\\Substitutes"), + 0, KEY_QUERY_VALUE, &hSubKey) == ERROR_SUCCESS) + { + dwSize = MAX_PATH; + if (RegQueryValueEx(hSubKey, szPreload, NULL, NULL, (LPBYTE)szSub, &dwSize) == 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 = LVIF_TEXT | LVIF_PARAM | LVIF_STATE; - item.pszText = lItem.IndName; - item.lParam = (LPARAM)&lItem; - item.iItem = (INT) dwIndex; - INT i = ListView_InsertItem(hList, &item); + if (_tcslen(lItem.SubName) < 2) + { + if (GetLayoutName(szPreload, szBuf)) + { + _tcscpy(lItem.LayoutName, szBuf); + } + } + + ZeroMemory(&item, sizeof(LV_ITEM)); + item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE; + item.pszText = lItem.IndName; + item.lParam = (LPARAM)&lItem; + item.iItem = (INT) dwIndex; + INT i = ListView_InsertItem(hList, &item); - ListView_SetItemText(hList, i, 1, lItem.LangName); - ListView_SetItemText(hList, i, 2, lItem.LayoutName); + ListView_SetItemText(hList, i, 1, lItem.LangName); + ListView_SetItemText(hList, i, 2, lItem.LayoutName); - dwIndex++; - Ret = RegEnumValue(hKey, dwIndex, szBuf, &dwSize, NULL, &dwType, NULL, NULL); - RegCloseKey(hSubKey); + dwIndex++; + Ret = RegEnumValue(hKey, dwIndex, szBuf, &dwSize, NULL, &dwType, NULL, NULL); + RegCloseKey(hSubKey); - if (_tcscmp(lItem.ValName, _T("1")) == 0) - { - (VOID) ListView_SetHotItem(hList, i); - } - } - } - } + if (_tcscmp(lItem.ValName, _T("1")) == 0) + { + (VOID) ListView_SetHotItem(hList, i); + } + } + } + } - RegCloseKey(hKey); + RegCloseKey(hKey); return TRUE; }