ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2023
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
155 discussions
Start a n
N
ew thread
[reactos] 01/01: [IPCONFIG] Use conutils and replace hardcoded strings
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aaa0cb67240655feca095…
commit aaa0cb67240655feca095293adc121ee114f6f76 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Jun 17 15:23:18 2023 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Jun 17 15:23:18 2023 +0200 [IPCONFIG] Use conutils and replace hardcoded strings --- base/applications/network/ipconfig/CMakeLists.txt | 4 +- base/applications/network/ipconfig/ipconfig.c | 518 ++++++++++------------ base/applications/network/ipconfig/lang/bg-BG.rc | 39 ++ base/applications/network/ipconfig/lang/de-DE.rc | 39 ++ base/applications/network/ipconfig/lang/el-GR.rc | 39 ++ base/applications/network/ipconfig/lang/en-US.rc | 41 +- base/applications/network/ipconfig/lang/es-ES.rc | 38 ++ base/applications/network/ipconfig/lang/fr-FR.rc | 39 ++ base/applications/network/ipconfig/lang/id-ID.rc | 39 ++ base/applications/network/ipconfig/lang/it-IT.rc | 39 ++ base/applications/network/ipconfig/lang/no-NO.rc | 39 ++ base/applications/network/ipconfig/lang/pl-PL.rc | 39 ++ base/applications/network/ipconfig/lang/ro-RO.rc | 39 ++ base/applications/network/ipconfig/lang/ru-RU.rc | 39 ++ base/applications/network/ipconfig/lang/sk-SK.rc | 39 ++ base/applications/network/ipconfig/lang/sq-AL.rc | 39 ++ base/applications/network/ipconfig/lang/sv-SE.rc | 39 ++ base/applications/network/ipconfig/lang/tr-TR.rc | 39 ++ base/applications/network/ipconfig/lang/uk-UA.rc | 39 ++ base/applications/network/ipconfig/lang/zh-CN.rc | 39 ++ base/applications/network/ipconfig/lang/zh-TW.rc | 39 ++ base/applications/network/ipconfig/resource.h | 58 ++- 22 files changed, 1018 insertions(+), 304 deletions(-) diff --git a/base/applications/network/ipconfig/CMakeLists.txt b/base/applications/network/ipconfig/CMakeLists.txt index f91e1969a28..cd0a65d0c8e 100644 --- a/base/applications/network/ipconfig/CMakeLists.txt +++ b/base/applications/network/ipconfig/CMakeLists.txt @@ -1,5 +1,7 @@ +include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) add_executable(ipconfig ipconfig.c ipconfig.rc) -set_module_type(ipconfig win32cui) +set_module_type(ipconfig win32cui UNICODE) +target_link_libraries(ipconfig conutils ${PSEH_LIB}) add_importlibs(ipconfig user32 iphlpapi dnsapi advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET ipconfig DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/ipconfig/ipconfig.c b/base/applications/network/ipconfig/ipconfig.c index 8124d8c85d2..3a5702d065d 100644 --- a/base/applications/network/ipconfig/ipconfig.c +++ b/base/applications/network/ipconfig/ipconfig.c @@ -19,6 +19,7 @@ #include <winnls.h> #include <winuser.h> #include <winreg.h> +#include <winnls.h> #include <stdio.h> #include <tchar.h> #include <time.h> @@ -27,6 +28,8 @@ #include <inaddr.h> #include <windns.h> #include <windns_undoc.h> +#include <strsafe.h> +#include <conutils.h> #include "resource.h" @@ -120,119 +123,12 @@ GetRecordTypeName(WORD wType) return szType; } -int LoadStringAndOem(HINSTANCE hInst, - UINT uID, - LPTSTR szNode, - int byteSize) -{ - TCHAR *szTmp; - int res; - - szTmp = (LPTSTR)HeapAlloc(ProcessHeap, 0, byteSize); - if (szTmp == NULL) - { - return 0; - } - - res = LoadString(hInst, uID, szTmp, byteSize); - CharToOem(szTmp, szNode); - HeapFree(ProcessHeap, 0, szTmp); - return res; -} - -LPTSTR GetNodeTypeName(UINT NodeType) -{ - static TCHAR szNode[14]; - - switch (NodeType) - { - case 1: - if (!LoadStringAndOem(hInstance, IDS_BCAST, szNode, sizeof(szNode))) - return NULL; - break; - - case 2: - if (!LoadStringAndOem(hInstance, IDS_P2P, szNode, sizeof(szNode))) - return NULL; - break; - - case 4: - if (!LoadStringAndOem(hInstance, IDS_MIXED, szNode, sizeof(szNode))) - return NULL; - break; - - case 8: - if (!LoadStringAndOem(hInstance, IDS_HYBRID, szNode, sizeof(szNode))) - return NULL; - break; - - default : - if (!LoadStringAndOem(hInstance, IDS_UNKNOWN, szNode, sizeof(szNode))) - return NULL; - break; - } - - return szNode; -} - - -LPTSTR GetInterfaceTypeName(UINT InterfaceType) -{ - static TCHAR szIntType[25]; - - switch (InterfaceType) - { - case MIB_IF_TYPE_OTHER: - if (!LoadStringAndOem(hInstance, IDS_OTHER, szIntType, sizeof(szIntType))) - return NULL; - break; - - case MIB_IF_TYPE_ETHERNET: - if (!LoadStringAndOem(hInstance, IDS_ETH, szIntType, sizeof(szIntType))) - return NULL; - break; - - case MIB_IF_TYPE_TOKENRING: - if (!LoadStringAndOem(hInstance, IDS_TOKEN, szIntType, sizeof(szIntType))) - return NULL; - break; - - case MIB_IF_TYPE_FDDI: - if (!LoadStringAndOem(hInstance, IDS_FDDI, szIntType, sizeof(szIntType))) - return NULL; - break; - - case MIB_IF_TYPE_PPP: - if (!LoadStringAndOem(hInstance, IDS_PPP, szIntType, sizeof(szIntType))) - return NULL; - break; - - case MIB_IF_TYPE_LOOPBACK: - if (!LoadStringAndOem(hInstance, IDS_LOOP, szIntType, sizeof(szIntType))) - return NULL; - break; - - case MIB_IF_TYPE_SLIP: - if (!LoadStringAndOem(hInstance, IDS_SLIP, szIntType, sizeof(szIntType))) - return NULL; - break; - - default: - if (!LoadStringAndOem(hInstance, IDS_UNKNOWN, szIntType, sizeof(szIntType))) - return NULL; - break; - } - - return szIntType; -} - - /* print MAC address */ -PTCHAR PrintMacAddr(PBYTE Mac) +PCHAR PrintMacAddr(PBYTE Mac) { - static TCHAR MacAddr[20]; + static CHAR MacAddr[20]; - _stprintf(MacAddr, _T("%02x-%02x-%02x-%02x-%02x-%02x"), + sprintf(MacAddr, "%02X-%02X-%02X-%02X-%02X-%02X", Mac[0], Mac[1], Mac[2], Mac[3], Mac[4], Mac[5]); return MacAddr; @@ -326,89 +222,87 @@ VOID DoFormatMessage(LONG ErrorCode) } } - -LPTSTR GetConnectionType(LPTSTR lpClass) +VOID +PrintAdapterFriendlyName(LPSTR lpClass) { HKEY hKey = NULL; - LPTSTR ConType = NULL; - LPTSTR ConTypeTmp = NULL; - TCHAR Path[256]; - LPTSTR PrePath = _T("SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\"); - LPTSTR PostPath = _T("\\Connection"); + LPSTR ConType = NULL; + LPSTR ConTypeTmp = NULL; + CHAR Path[256]; + LPSTR PrePath = "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\"; + LPSTR PostPath = "\\Connection"; DWORD PathSize; DWORD dwType; DWORD dwDataSize; /* don't overflow the buffer */ - PathSize = lstrlen(PrePath) + lstrlen(lpClass) + lstrlen(PostPath) + 1; + PathSize = strlen(PrePath) + strlen(lpClass) + strlen(PostPath) + 1; if (PathSize >= 255) - return NULL; + return; - wsprintf(Path, _T("%s%s%s"), PrePath, lpClass, PostPath); + sprintf(Path, "%s%s%s", PrePath, lpClass, PostPath); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, - Path, - 0, - KEY_READ, - &hKey) == ERROR_SUCCESS) + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, + Path, + 0, + KEY_READ, + &hKey) == ERROR_SUCCESS) { - if (RegQueryValueEx(hKey, - _T("Name"), - NULL, - &dwType, - NULL, - &dwDataSize) == ERROR_SUCCESS) + if (RegQueryValueExA(hKey, + "Name", + NULL, + &dwType, + NULL, + &dwDataSize) == ERROR_SUCCESS) { - ConTypeTmp = (LPTSTR)HeapAlloc(ProcessHeap, - 0, - dwDataSize); - + ConTypeTmp = (LPSTR)HeapAlloc(ProcessHeap, + 0, + dwDataSize); if (ConTypeTmp == NULL) - return NULL; - - ConType = (LPTSTR)HeapAlloc(ProcessHeap, - 0, - dwDataSize); + return; + ConType = (LPSTR)HeapAlloc(ProcessHeap, + 0, + dwDataSize); if (ConType == NULL) { HeapFree(ProcessHeap, 0, ConTypeTmp); - return NULL; + return; } - if (RegQueryValueEx(hKey, - _T("Name"), - NULL, - &dwType, - (PBYTE)ConTypeTmp, - &dwDataSize) != ERROR_SUCCESS) + if (RegQueryValueExA(hKey, + "Name", + NULL, + &dwType, + (PBYTE)ConTypeTmp, + &dwDataSize) != ERROR_SUCCESS) { - HeapFree(ProcessHeap, - 0, - ConType); - + HeapFree(ProcessHeap, 0, ConType); ConType = NULL; } if (ConType) - CharToOem(ConTypeTmp, ConType); + CharToOemA(ConTypeTmp, ConType); + + printf("%s\n", ConType); + HeapFree(ProcessHeap, 0, ConTypeTmp); + HeapFree(ProcessHeap, 0, ConType); } } if (hKey != NULL) RegCloseKey(hKey); - - return ConType; } - -LPTSTR GetConnectionDescription(LPTSTR lpClass) +static +VOID +PrintAdapterDescription(LPSTR lpClass) { HKEY hBaseKey = NULL; HKEY hClassKey = NULL; - LPTSTR lpKeyClass = NULL; - LPTSTR lpConDesc = NULL; + LPSTR lpKeyClass = NULL; + LPSTR lpConDesc = NULL; LPTSTR lpPath = NULL; TCHAR szPrePath[] = _T("SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\"); DWORD dwType; @@ -421,7 +315,7 @@ LPTSTR GetConnectionDescription(LPTSTR lpClass) KEY_READ, &hBaseKey) != ERROR_SUCCESS) { - return NULL; + return; } for (i = 0; ; i++) @@ -473,25 +367,25 @@ LPTSTR GetConnectionDescription(LPTSTR lpClass) HeapFree(ProcessHeap, 0, lpPath); lpPath = NULL; - if (RegQueryValueEx(hClassKey, - _T("NetCfgInstanceId"), - NULL, - &dwType, - NULL, - &dwDataSize) == ERROR_SUCCESS) + if (RegQueryValueExA(hClassKey, + "NetCfgInstanceId", + NULL, + &dwType, + NULL, + &dwDataSize) == ERROR_SUCCESS) { - lpKeyClass = (LPTSTR)HeapAlloc(ProcessHeap, - 0, - dwDataSize); + lpKeyClass = (LPSTR)HeapAlloc(ProcessHeap, + 0, + dwDataSize); if (lpKeyClass == NULL) goto CLEANUP; - if (RegQueryValueEx(hClassKey, - _T("NetCfgInstanceId"), - NULL, - &dwType, - (PBYTE)lpKeyClass, - &dwDataSize) != ERROR_SUCCESS) + if (RegQueryValueExA(hClassKey, + "NetCfgInstanceId", + NULL, + &dwType, + (PBYTE)lpKeyClass, + &dwDataSize) != ERROR_SUCCESS) { HeapFree(ProcessHeap, 0, lpKeyClass); lpKeyClass = NULL; @@ -501,40 +395,37 @@ LPTSTR GetConnectionDescription(LPTSTR lpClass) else continue; - if (!lstrcmp(lpClass, lpKeyClass)) + if (!strcmp(lpClass, lpKeyClass)) { HeapFree(ProcessHeap, 0, lpKeyClass); lpKeyClass = NULL; - if (RegQueryValueEx(hClassKey, - _T("DriverDesc"), - NULL, - &dwType, - NULL, - &dwDataSize) == ERROR_SUCCESS) + if (RegQueryValueExA(hClassKey, + "DriverDesc", + NULL, + &dwType, + NULL, + &dwDataSize) == ERROR_SUCCESS) { - lpConDesc = (LPTSTR)HeapAlloc(ProcessHeap, - 0, - dwDataSize); - if (lpConDesc == NULL) - goto CLEANUP; - - if (RegQueryValueEx(hClassKey, - _T("DriverDesc"), - NULL, - &dwType, - (PBYTE)lpConDesc, - &dwDataSize) != ERROR_SUCCESS) + lpConDesc = (LPSTR)HeapAlloc(ProcessHeap, + 0, + dwDataSize); + if (lpConDesc != NULL) { + if (RegQueryValueExA(hClassKey, + "DriverDesc", + NULL, + &dwType, + (PBYTE)lpConDesc, + &dwDataSize) == ERROR_SUCCESS) + { + printf("%s", lpConDesc); + } + HeapFree(ProcessHeap, 0, lpConDesc); lpConDesc = NULL; - goto CLEANUP; } } - else - { - lpConDesc = NULL; - } break; } @@ -549,10 +440,89 @@ CLEANUP: HeapFree(ProcessHeap, 0, lpPath); if (lpKeyClass != NULL) HeapFree(ProcessHeap, 0, lpKeyClass); +} + +static +VOID +PrintNodeType(UINT NodeType) +{ + ConResPrintf(StdOut, IDS_NODETYPE); + + switch (NodeType) + { + case 1: + ConResPrintf(StdOut, IDS_BCAST); + break; + + case 2: + ConResPrintf(StdOut, IDS_P2P); + break; - return lpConDesc; + case 4: + ConResPrintf(StdOut, IDS_MIXED); + break; + + case 8: + ConResPrintf(StdOut, IDS_HYBRID); + break; + + default : + ConResPrintf(StdOut, IDS_UNKNOWN); + break; + } + printf("\n"); } +static +VOID +PrintAdapterTypeAndName( + PIP_ADAPTER_INFO pAdapterInfo) +{ + printf("\n"); + + switch (pAdapterInfo->Type) + { + case MIB_IF_TYPE_OTHER: + ConResPrintf(StdOut, IDS_OTHER); + break; + + case MIB_IF_TYPE_ETHERNET: + ConResPrintf(StdOut, IDS_ETH); + break; + + case MIB_IF_TYPE_TOKENRING: + ConResPrintf(StdOut, IDS_TOKEN); + break; + + case MIB_IF_TYPE_FDDI: + ConResPrintf(StdOut, IDS_FDDI); + break; + + case MIB_IF_TYPE_PPP: + ConResPrintf(StdOut, IDS_PPP); + break; + + case MIB_IF_TYPE_LOOPBACK: + ConResPrintf(StdOut, IDS_LOOP); + break; + + case MIB_IF_TYPE_SLIP: + ConResPrintf(StdOut, IDS_SLIP); + break; + + case IF_TYPE_IEEE80211: + ConResPrintf(StdOut, IDS_WIFI); + break; + + default: + ConResPrintf(StdOut, IDS_UNKNOWNADAPTER); + break; + } + + printf(": "); + PrintAdapterFriendlyName(pAdapterInfo->AdapterName); + printf("\n"); +} VOID ShowInfo(BOOL bAll) { @@ -628,45 +598,44 @@ VOID ShowInfo(BOOL bAll) pAdapter = pAdapterInfo; - _tprintf(_T("\nReactOS IP Configuration\n\n")); + ConResPrintf(StdOut, IDS_HEADER); + if (bAll) { - _tprintf(_T("\tHost Name . . . . . . . . . . . . : %s\n"), pFixedInfo->HostName); - _tprintf(_T("\tPrimary DNS Suffix. . . . . . . . : %s\n"), (pszDomainName != NULL) ? pszDomainName : ""); - _tprintf(_T("\tNode Type . . . . . . . . . . . . : %s\n"), GetNodeTypeName(pFixedInfo->NodeType)); + ConResPrintf(StdOut, IDS_HOSTNAME, pFixedInfo->HostName); + ConResPrintf(StdOut, IDS_PRIMARYDNSSUFFIX, (pszDomainName != NULL) ? pszDomainName : ""); + + PrintNodeType(pFixedInfo->NodeType); + if (pFixedInfo->EnableRouting) - _tprintf(_T("\tIP Routing Enabled. . . . . . . . : Yes\n")); + ConResPrintf(StdOut, IDS_IPROUTINGYES); else - _tprintf(_T("\tIP Routing Enabled. . . . . . . . : No\n")); + ConResPrintf(StdOut, IDS_IPROUTINGNO); + if (pAdapter && pAdapter->HaveWins) - _tprintf(_T("\tWINS Proxy enabled. . . . . . . . : Yes\n")); + ConResPrintf(StdOut, IDS_WINSPROXYYES); else - _tprintf(_T("\tWINS Proxy enabled. . . . . . . . : No\n")); + ConResPrintf(StdOut, IDS_WINSPROXYNO); + if (pszDomainName != NULL && pszDomainName[0] != 0) { - _tprintf(_T("\tDNS Suffix Search List. . . . . . : %s\n"), pszDomainName); - _tprintf(_T("\t %s\n"), pFixedInfo->DomainName); + ConResPrintf(StdOut, IDS_DNSSUFFIXLIST, pszDomainName); + ConResPrintf(StdOut, IDS_EMPTYLINE, pFixedInfo->DomainName); } else { - _tprintf(_T("\tDNS Suffix Search List. . . . . . : %s\n"), pFixedInfo->DomainName); + ConResPrintf(StdOut, IDS_DNSSUFFIXLIST, pFixedInfo->DomainName); } } while (pAdapter) { - LPTSTR IntType, myConType; BOOLEAN bConnected = TRUE; mibEntry.dwIndex = pAdapter->Index; GetIfEntry(&mibEntry); - IntType = GetInterfaceTypeName(pAdapter->Type); - myConType = GetConnectionType(pAdapter->AdapterName); - - _tprintf(_T("\n%s %s: \n\n"), IntType , myConType); - - if (myConType != NULL) HeapFree(ProcessHeap, 0, myConType); + PrintAdapterTypeAndName(pAdapter); if (GetPerAdapterInfo(pAdapter->Index, pPerAdapterInfo, &ulPerAdapterInfoLength) == ERROR_BUFFER_OVERFLOW) { @@ -681,35 +650,38 @@ VOID ShowInfo(BOOL bAll) if (mibEntry.dwOperStatus != MIB_IF_OPER_STATUS_CONNECTED && mibEntry.dwOperStatus != MIB_IF_OPER_STATUS_OPERATIONAL) { bConnected = FALSE; - _tprintf(_T("\tMedia State . . . . . . . . . . . : Media disconnected\n")); + ConResPrintf(StdOut, IDS_MEDIADISCONNECTED); } else { - _tprintf(_T("\tConnection-specific DNS Suffix. . : %s\n"), pFixedInfo->DomainName); + ConResPrintf(StdOut, IDS_CONNECTIONDNSSUFFIX, pFixedInfo->DomainName); } if (bAll) { - LPTSTR lpDesc = GetConnectionDescription(pAdapter->AdapterName); - _tprintf(_T("\tDescription . . . . . . . . . . . : %s\n"), lpDesc); - HeapFree(ProcessHeap, 0, lpDesc); - _tprintf(_T("\tPhysical Address. . . . . . . . . : %s\n"), PrintMacAddr(pAdapter->Address)); + ConResPrintf(StdOut, IDS_DESCRIPTION); + PrintAdapterDescription(pAdapter->AdapterName); + printf("\n"); + + ConResPrintf(StdOut, IDS_PHYSICALADDRESS, PrintMacAddr(pAdapter->Address)); + if (bConnected) { if (pAdapter->DhcpEnabled) { - _tprintf(_T("\tDHCP Enabled. . . . . . . . . . . : Yes\n")); + ConResPrintf(StdOut, IDS_DHCPYES); + if (pPerAdapterInfo != NULL) { if (pPerAdapterInfo->AutoconfigEnabled) - _tprintf(_T("\tAutoconfiguration Enabled . . . . : Yes\n")); + ConResPrintf(StdOut, IDS_AUTOCONFIGYES); else - _tprintf(_T("\tAutoconfiguration Enabled . . . . : No\n")); + ConResPrintf(StdOut, IDS_AUTOCONFIGNO); } } else { - _tprintf(_T("\tDHCP Enabled. . . . . . . . . . . : No\n")); + ConResPrintf(StdOut, IDS_DHCPNO); } } } @@ -720,53 +692,52 @@ VOID ShowInfo(BOOL bAll) continue; } - _tprintf(_T("\tIP Address. . . . . . . . . . . . : %s\n"), pAdapter->IpAddressList.IpAddress.String); - _tprintf(_T("\tSubnet Mask . . . . . . . . . . . : %s\n"), pAdapter->IpAddressList.IpMask.String); - if (pAdapter->GatewayList.IpAddress.String[0] != '0') - _tprintf(_T("\tDefault Gateway . . . . . . . . . : %s\n"), pAdapter->GatewayList.IpAddress.String); + ConResPrintf(StdOut, IDS_IPADDRESS, pAdapter->IpAddressList.IpAddress.String); + ConResPrintf(StdOut, IDS_SUBNETMASK, pAdapter->IpAddressList.IpMask.String); + + if (strcmp(pAdapter->GatewayList.IpAddress.String, "0.0.0.0")) + ConResPrintf(StdOut, IDS_DEFAULTGATEWAY, pAdapter->GatewayList.IpAddress.String); else - _tprintf(_T("\tDefault Gateway . . . . . . . . . :\n")); + ConResPrintf(StdOut, IDS_DEFAULTGATEWAY, ""); if (bAll) { PIP_ADDR_STRING pIPAddr; if (pAdapter->DhcpEnabled) - _tprintf(_T("\tDHCP Server . . . . . . . . . . . : %s\n"), pAdapter->DhcpServer.IpAddress.String); + ConResPrintf(StdOut, IDS_DHCPSERVER, pAdapter->DhcpServer.IpAddress.String); - _tprintf(_T("\tDNS Servers . . . . . . . . . . . : ")); - _tprintf(_T("%s\n"), pFixedInfo->DnsServerList.IpAddress.String); + ConResPrintf(StdOut, IDS_DNSSERVERS, pFixedInfo->DnsServerList.IpAddress.String); pIPAddr = pFixedInfo->DnsServerList.Next; while (pIPAddr) { - _tprintf(_T("\t\t\t\t\t %s\n"), pIPAddr ->IpAddress.String ); + ConResPrintf(StdOut, IDS_EMPTYLINE, pIPAddr ->IpAddress.String); pIPAddr = pIPAddr->Next; } if (pAdapter->HaveWins) { - _tprintf(_T("\tPrimary WINS Server . . . . . . . : %s\n"), pAdapter->PrimaryWinsServer.IpAddress.String); - _tprintf(_T("\tSecondary WINS Server . . . . . . : %s\n"), pAdapter->SecondaryWinsServer.IpAddress.String); + ConResPrintf(StdOut, IDS_PRIMARYWINSSERVER, pAdapter->PrimaryWinsServer.IpAddress.String); + ConResPrintf(StdOut, IDS_SECONDARYWINSSERVER, pAdapter->SecondaryWinsServer.IpAddress.String); } - if (pAdapter->DhcpEnabled && _tcscmp(pAdapter->DhcpServer.IpAddress.String, _T("255.255.255.255"))) + if (pAdapter->DhcpEnabled && strcmp(pAdapter->DhcpServer.IpAddress.String, "255.255.255.255")) { PTSTR DateTimeString; DateTimeString = timeToStr(pAdapter->LeaseObtained); - _tprintf(_T("\tLease Obtained. . . . . . . . . . : %s\n"), DateTimeString ? DateTimeString : _T("N/A")); + ConResPrintf(StdOut, IDS_LEASEOBTAINED, DateTimeString ? DateTimeString : _T("N/A")); if (DateTimeString) { HeapFree(ProcessHeap, 0, DateTimeString); } DateTimeString = timeToStr(pAdapter->LeaseExpires); - _tprintf(_T("\tLease Expires . . . . . . . . . . : %s\n"), DateTimeString ? DateTimeString : _T("N/A")); + ConResPrintf(StdOut, IDS_LEASEEXPIRES, DateTimeString ? DateTimeString : _T("N/A")); if (DateTimeString) { HeapFree(ProcessHeap, 0, DateTimeString); } } } - _tprintf(_T("\n")); HeapFree(ProcessHeap, 0, pPerAdapterInfo); pPerAdapterInfo = NULL; @@ -842,9 +813,6 @@ VOID Release(LPTSTR Index) } } - - - VOID Renew(LPTSTR Index) { IP_ADAPTER_INDEX_MAP AdapterInfo; @@ -914,7 +882,7 @@ VOID Renew(LPTSTR Index) VOID FlushDns(VOID) { - _tprintf(_T("\nReactOS IP Configuration\n\n")); + ConResPrintf(StdOut, IDS_HEADER); if (DnsFlushResolverCache()) _tprintf(_T("The DNS Resolver Cache has been deleted.\n")); @@ -952,20 +920,20 @@ DisplayDnsRecord( { if (Status == DNS_ERROR_RCODE_NAME_ERROR) { - _tprintf(_T("\t%S\n"), pszName); + _tprintf(_T("\t%ls\n"), pszName); _tprintf(_T("\t----------------------------------------\n")); _tprintf(_T("\tName does not exist\n\n")); } else if (Status == DNS_INFO_NO_RECORDS) { - _tprintf(_T("\t%S\n"), pszName); + _tprintf(_T("\t%ls\n"), pszName); _tprintf(_T("\t----------------------------------------\n")); _tprintf(_T("\tNo records of type %s\n\n"), GetRecordTypeName(wType)); } return; } - _tprintf(_T("\t%S\n"), pszName); + _tprintf(_T("\t%ls\n"), pszName); _tprintf(_T("\t----------------------------------------\n")); pThisRecord = pQueryResults; @@ -973,7 +941,7 @@ DisplayDnsRecord( { pNextRecord = pThisRecord->pNext; - _tprintf(_T("\tRecord Name . . . . . : %S\n"), pThisRecord->pName); + _tprintf(_T("\tRecord Name . . . . . : %ls\n"), pThisRecord->pName); _tprintf(_T("\tRecord Type . . . . . : %hu\n"), pThisRecord->wType); _tprintf(_T("\tTime To Live. . . . . : %lu\n"), pThisRecord->dwTtl); _tprintf(_T("\tData Length . . . . . : %hu\n"), pThisRecord->wDataLength); @@ -1002,15 +970,15 @@ DisplayDnsRecord( case DNS_TYPE_A: Addr4.S_un.S_addr = pThisRecord->Data.A.IpAddress; RtlIpv4AddressToStringW(&Addr4, szBuffer); - _tprintf(_T("\tA (Host) Record . . . : %S\n"), szBuffer); + _tprintf(_T("\tA (Host) Record . . . : %ls\n"), szBuffer); break; case DNS_TYPE_NS: - _tprintf(_T("\tNS Record . . . . . . : %S\n"), pThisRecord->Data.NS.pNameHost); + _tprintf(_T("\tNS Record . . . . . . : %ls\n"), pThisRecord->Data.NS.pNameHost); break; case DNS_TYPE_CNAME: - _tprintf(_T("\tCNAME Record. . . . . : %S\n"), pThisRecord->Data.CNAME.pNameHost); + _tprintf(_T("\tCNAME Record. . . . . : %ls\n"), pThisRecord->Data.CNAME.pNameHost); break; case DNS_TYPE_SOA: @@ -1018,7 +986,7 @@ DisplayDnsRecord( break; case DNS_TYPE_PTR: - _tprintf(_T("\tPTR Record. . . . . . : %S\n"), pThisRecord->Data.PTR.pNameHost); + _tprintf(_T("\tPTR Record. . . . . . : %ls\n"), pThisRecord->Data.PTR.pNameHost); break; case DNS_TYPE_MX: @@ -1028,7 +996,7 @@ DisplayDnsRecord( case DNS_TYPE_AAAA: RtlCopyMemory(&Addr6, &pThisRecord->Data.AAAA.Ip6Address, sizeof(IN6_ADDR)); RtlIpv6AddressToStringW(&Addr6, szBuffer); - _tprintf(_T("\tAAAA Record . . . . . : %S\n"), szBuffer); + _tprintf(_T("\tAAAA Record . . . . . : %ls\n"), szBuffer); break; case DNS_TYPE_ATMA: @@ -1047,13 +1015,12 @@ DisplayDnsRecord( DnsRecordListFree((PDNS_RECORD)pQueryResults, DnsFreeRecordList); } - VOID DisplayDns(VOID) { PDNS_CACHE_ENTRY DnsEntry = NULL, pThisEntry, pNextEntry; - _tprintf(_T("\nReactOS IP Configuration\n\n")); + ConResPrintf(StdOut, IDS_HEADER); if (!DnsGetCacheDataTable(&DnsEntry)) { @@ -1085,40 +1052,10 @@ DisplayDns(VOID) VOID Usage(VOID) { - HRSRC hRes; - LPTSTR lpUsage; - DWORD Size; - - LPTSTR lpName = (LPTSTR)MAKEINTRESOURCE((IDS_USAGE >> 4) + 1); - - hRes = FindResource(hInstance, - lpName, - RT_STRING); - if (hRes != NULL) - { - if ((Size = SizeofResource(hInstance, - hRes))) - { - lpUsage = (LPTSTR)HeapAlloc(ProcessHeap, - 0, - Size); - if (lpUsage == NULL) - return; - - if (LoadStringAndOem(hInstance, - IDS_USAGE, - lpUsage, - Size)) - { - _tprintf(_T("%s"), lpUsage); - } - - HeapFree(ProcessHeap, 0, lpUsage); - } - } + ConResPrintf(StdOut, IDS_USAGE); } -int main(int argc, char *argv[]) +int wmain(int argc, wchar_t *argv[]) { BOOL DoUsage=FALSE; BOOL DoAll=FALSE; @@ -1130,6 +1067,9 @@ int main(int argc, char *argv[]) BOOL DoShowclassid=FALSE; BOOL DoSetclassid=FALSE; + /* Initialize the Console Standard Streams */ + ConInitStdStreams(); + hInstance = GetModuleHandle(NULL); ProcessHeap = GetProcessHeap(); diff --git a/base/applications/network/ipconfig/lang/bg-BG.rc b/base/applications/network/ipconfig/lang/bg-BG.rc index 4a581558a37..55f6b37d01d 100644 --- a/base/applications/network/ipconfig/lang/bg-BG.rc +++ b/base/applications/network/ipconfig/lang/bg-BG.rc @@ -1,5 +1,42 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Разпръскване" @@ -11,6 +48,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Друг вид карта" IDS_ETH "Карта Ethernet" IDS_TOKEN "Карта Token Ring" @@ -18,6 +56,7 @@ BEGIN IDS_PPP "Карта PPP" IDS_LOOP "Карта Loopback" IDS_SLIP "Карта SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/de-DE.rc b/base/applications/network/ipconfig/lang/de-DE.rc index fda0ab3be46..efe249db721 100644 --- a/base/applications/network/ipconfig/lang/de-DE.rc +++ b/base/applications/network/ipconfig/lang/de-DE.rc @@ -1,5 +1,42 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS-IP-Konfiguration\n\n" + IDS_HOSTNAME "\tHostname. . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimäres DNS-Suffix . . . . . . . : %hs\n" + IDS_NODETYPE "\tKnotentyp . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP-Routing aktiviert. . . . . . . : Nein\n" + IDS_IPROUTINGYES "\tIP-Routing aktiviert. . . . . . . : Ja\n" + IDS_WINSPROXYNO "\tWINS-Proxy aktiviert. . . . . . . : Nein\n" + IDS_WINSPROXYYES "\tWINS-Proxy aktiviert. . . . . . . : Ja\n" + IDS_DNSSUFFIXLIST "\tDNS-Suffixliste . . . . . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedienstatus. . . . . . . . . . . : Es besteht keine Verbindung\n" + IDS_CONNECTIONDNSSUFFIX "\tVerbindungsspezifisches DNS-Suffix: %hs\n" + IDS_DESCRIPTION "\tBeschreibung. . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysikalische Adresse . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP aktiviert. . . . . . . . . . : Nein\n" + IDS_DHCPYES "\tDHCP aktiviert. . . . . . . . . . : Ja\n" + IDS_AUTOCONFIGNO "\tAutokonfiguration aktiviert . . . : Nein\n" + IDS_AUTOCONFIGYES "\tAutokonfiguration aktiviert . . . : Ja\n" + IDS_IPADDRESS "\tIP-Adresse. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnetzmaske. . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tStandardgateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP-Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS-Server. . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimärer WINS-Server. . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSekundärer WINS-Server. . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease erhalten. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease läuft ab. . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Broadcast" @@ -11,6 +48,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Anderer Adapter" IDS_ETH "Ethernet-Adapter" IDS_TOKEN "Token-Ring-Adapter" @@ -18,6 +56,7 @@ BEGIN IDS_PPP "PPP-Adapter" IDS_LOOP "Loopback-Adapter" IDS_SLIP "SLIP-Adapter" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/el-GR.rc b/base/applications/network/ipconfig/lang/el-GR.rc index 78594f682c3..8754fbac37c 100644 --- a/base/applications/network/ipconfig/lang/el-GR.rc +++ b/base/applications/network/ipconfig/lang/el-GR.rc @@ -1,5 +1,42 @@ LANGUAGE LANG_GREEK, SUBLANG_DEFAULT +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Broadcast" @@ -11,6 +48,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Άλλος τύπος προσαρμογέα" IDS_ETH "Προσαρμογέας Ethernet" IDS_TOKEN "Προσαρμογέας Token Ring" @@ -18,6 +56,7 @@ BEGIN IDS_PPP "Προσαρμογέας PPP" IDS_LOOP "Προσαρμογέας Loopback" IDS_SLIP "Προσαρμογέας SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/en-US.rc b/base/applications/network/ipconfig/lang/en-US.rc index bad49ed7423..78543bd0792 100644 --- a/base/applications/network/ipconfig/lang/en-US.rc +++ b/base/applications/network/ipconfig/lang/en-US.rc @@ -1,16 +1,54 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Broadcast" IDS_P2P "Peer To Peer" IDS_MIXED "Mixed" IDS_HYBRID "Hybrid" - IDS_UNKNOWN "unknown" + IDS_UNKNOWN "Unknown" END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Other Type Of Adapter" IDS_ETH "Ethernet Adapter" IDS_TOKEN "Token Ring Adapter" @@ -18,6 +56,7 @@ BEGIN IDS_PPP "PPP Adapter" IDS_LOOP "Loopback Adapter" IDS_SLIP "SLIP Adapter" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/es-ES.rc b/base/applications/network/ipconfig/lang/es-ES.rc index 363433f91dd..5beceaaa09c 100644 --- a/base/applications/network/ipconfig/lang/es-ES.rc +++ b/base/applications/network/ipconfig/lang/es-ES.rc @@ -3,6 +3,42 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Difusión" @@ -14,6 +50,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Otro tipo de adaptador" IDS_ETH "Adaptador Ethernet" IDS_TOKEN "Adaptador de red en anillo" @@ -21,6 +58,7 @@ BEGIN IDS_PPP "Adaptador PPP" IDS_LOOP "Adaptador de bucle invertido" IDS_SLIP "Adaptador SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/fr-FR.rc b/base/applications/network/ipconfig/lang/fr-FR.rc index dfd6d53317a..618589c78e0 100644 --- a/base/applications/network/ipconfig/lang/fr-FR.rc +++ b/base/applications/network/ipconfig/lang/fr-FR.rc @@ -1,5 +1,42 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Broadcast" @@ -11,6 +48,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Autre Type d'adapteur" IDS_ETH "Adapteur Ethernet" IDS_TOKEN "Adapteur Token Ring" @@ -18,6 +56,7 @@ BEGIN IDS_PPP "Adapteur PPP" IDS_LOOP "Adapteur Loopback" IDS_SLIP "Adapteur SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/id-ID.rc b/base/applications/network/ipconfig/lang/id-ID.rc index a6d2bf042b7..d3f67e51368 100644 --- a/base/applications/network/ipconfig/lang/id-ID.rc +++ b/base/applications/network/ipconfig/lang/id-ID.rc @@ -1,5 +1,42 @@ LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Siarkan" @@ -11,6 +48,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Adapter Tipe Lainnya" IDS_ETH "Adapter Ethernet" IDS_TOKEN "Adapter Token Ring" @@ -18,6 +56,7 @@ BEGIN IDS_PPP "Adapter PPP" IDS_LOOP "Adapter Loopback" IDS_SLIP "Adapter SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/it-IT.rc b/base/applications/network/ipconfig/lang/it-IT.rc index d49ccdfa2fd..f2c00981247 100644 --- a/base/applications/network/ipconfig/lang/it-IT.rc +++ b/base/applications/network/ipconfig/lang/it-IT.rc @@ -2,6 +2,43 @@ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Broadcast" @@ -13,6 +50,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Altro tipo di adattatore" IDS_ETH "Adattatore Ethernet" IDS_TOKEN "Adattatore Token Ring" @@ -20,6 +58,7 @@ BEGIN IDS_PPP "Adattatore PPP" IDS_LOOP "Adattatore Loopback" IDS_SLIP "Adattatore SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/no-NO.rc b/base/applications/network/ipconfig/lang/no-NO.rc index 7ada296fdda..d3b7938d8ea 100644 --- a/base/applications/network/ipconfig/lang/no-NO.rc +++ b/base/applications/network/ipconfig/lang/no-NO.rc @@ -1,5 +1,42 @@ LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Broadcast" @@ -11,6 +48,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Other Type Of Adapter" IDS_ETH "Ethernet Adapter" IDS_TOKEN "Token Ring Adapter" @@ -18,6 +56,7 @@ BEGIN IDS_PPP "PPP Adapter" IDS_LOOP "Loopback Adapter" IDS_SLIP "SLIP Adapter" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/pl-PL.rc b/base/applications/network/ipconfig/lang/pl-PL.rc index eb0ef4e53a0..bcedb0468d0 100644 --- a/base/applications/network/ipconfig/lang/pl-PL.rc +++ b/base/applications/network/ipconfig/lang/pl-PL.rc @@ -7,6 +7,43 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Transmisja" @@ -18,6 +55,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "inny rodzaj karty" IDS_ETH "karta Ethernet" IDS_TOKEN "karta Token Ring" @@ -25,6 +63,7 @@ BEGIN IDS_PPP "karta PPP" IDS_LOOP "karta Loopback" IDS_SLIP "karta SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/ro-RO.rc b/base/applications/network/ipconfig/lang/ro-RO.rc index a7a1a8c70e9..3c6a4678f67 100644 --- a/base/applications/network/ipconfig/lang/ro-RO.rc +++ b/base/applications/network/ipconfig/lang/ro-RO.rc @@ -6,6 +6,43 @@ LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Difuzare" @@ -17,6 +54,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "alt tip de adaptor" IDS_ETH "adaptor Ethernet" IDS_TOKEN "adaptor Token Ring" @@ -24,6 +62,7 @@ BEGIN IDS_PPP "adaptor PPP" IDS_LOOP "adaptor Loopback" IDS_SLIP "adaptor SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/ru-RU.rc b/base/applications/network/ipconfig/lang/ru-RU.rc index 366df722d5a..794f3c84776 100644 --- a/base/applications/network/ipconfig/lang/ru-RU.rc +++ b/base/applications/network/ipconfig/lang/ru-RU.rc @@ -2,6 +2,43 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Широковещательный" @@ -13,6 +50,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Другой тип адаптера" IDS_ETH "Ethernet адаптер" IDS_TOKEN "Адаптер Token Ring" @@ -20,6 +58,7 @@ BEGIN IDS_PPP "Адаптер PPP" IDS_LOOP "Адаптер замыкания на себя" IDS_SLIP "Адаптер SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/sk-SK.rc b/base/applications/network/ipconfig/lang/sk-SK.rc index b276841ad51..aba51b31816 100644 --- a/base/applications/network/ipconfig/lang/sk-SK.rc +++ b/base/applications/network/ipconfig/lang/sk-SK.rc @@ -4,6 +4,43 @@ LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Vysielací" @@ -15,6 +52,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Iný adaptér" IDS_ETH "Adaptér siete Ethernet" IDS_TOKEN "Adaptér siete Token Ring" @@ -22,6 +60,7 @@ BEGIN IDS_PPP "Adaptér PPP" IDS_LOOP "Adaptér pre spätnú slučku" IDS_SLIP "Adaptér SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/sq-AL.rc b/base/applications/network/ipconfig/lang/sq-AL.rc index 733ca05d937..bce64b609a5 100644 --- a/base/applications/network/ipconfig/lang/sq-AL.rc +++ b/base/applications/network/ipconfig/lang/sq-AL.rc @@ -4,6 +4,43 @@ LANGUAGE LANG_ALBANIAN, SUBLANG_NEUTRAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Transmeto" @@ -15,6 +52,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Tipe te tjera adaptuesi" IDS_ETH "Adapter Ethernet" IDS_TOKEN "Adapter Token Ring" @@ -22,6 +60,7 @@ BEGIN IDS_PPP "Adapter PPP" IDS_LOOP "Adapter Loopback" IDS_SLIP "Adapter SLIP" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/sv-SE.rc b/base/applications/network/ipconfig/lang/sv-SE.rc index 47678dccb09..36deb5fb754 100644 --- a/base/applications/network/ipconfig/lang/sv-SE.rc +++ b/base/applications/network/ipconfig/lang/sv-SE.rc @@ -7,6 +7,43 @@ LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Broadcast" @@ -18,6 +55,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Annan typ av adapter" IDS_ETH "Ethernet-adapter" IDS_TOKEN "Tokenring-adapter" @@ -25,6 +63,7 @@ BEGIN IDS_PPP "PPP-adapter" IDS_LOOP "Loopback-adapter" IDS_SLIP "SLIP-adapter" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/tr-TR.rc b/base/applications/network/ipconfig/lang/tr-TR.rc index 8ce770d073c..f9b4376e6ae 100644 --- a/base/applications/network/ipconfig/lang/tr-TR.rc +++ b/base/applications/network/ipconfig/lang/tr-TR.rc @@ -2,6 +2,43 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Yayın" @@ -13,6 +50,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Diğer Bağdaştırıcı" IDS_ETH "Ethernet Bağdaştırıcısı" IDS_TOKEN "Simgeli Halka Bağdaştırıcısı" @@ -20,6 +58,7 @@ BEGIN IDS_PPP "PPP Bağdaştırıcısı" IDS_LOOP "Geri Döngü Bağdaştırıcısı" IDS_SLIP "SLIP Bağdaştırıcısı" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/uk-UA.rc b/base/applications/network/ipconfig/lang/uk-UA.rc index 608d52f029d..3200f6ca9c9 100644 --- a/base/applications/network/ipconfig/lang/uk-UA.rc +++ b/base/applications/network/ipconfig/lang/uk-UA.rc @@ -8,6 +8,43 @@ LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "Broadcast" @@ -19,6 +56,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "Інший тип адаптера" IDS_ETH "Ethernet адаптер" IDS_TOKEN "Token Ring адаптер" @@ -26,6 +64,7 @@ BEGIN IDS_PPP "PPP адаптер" IDS_LOOP "Loopback адаптер" IDS_SLIP "SLIP адаптер" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/zh-CN.rc b/base/applications/network/ipconfig/lang/zh-CN.rc index 31ae167c8c4..e24fcb60741 100644 --- a/base/applications/network/ipconfig/lang/zh-CN.rc +++ b/base/applications/network/ipconfig/lang/zh-CN.rc @@ -2,6 +2,43 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "广播" @@ -13,6 +50,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "其他类型的适配器" IDS_ETH "以太网适配器" IDS_TOKEN "令牌环适配器" @@ -20,6 +58,7 @@ BEGIN IDS_PPP "PPP 适配器" IDS_LOOP "本地环回适配器" IDS_SLIP "SLIP 适配器" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/lang/zh-TW.rc b/base/applications/network/ipconfig/lang/zh-TW.rc index fad49d5c240..5ba939ea4b6 100644 --- a/base/applications/network/ipconfig/lang/zh-TW.rc +++ b/base/applications/network/ipconfig/lang/zh-TW.rc @@ -2,6 +2,43 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL +STRINGTABLE +BEGIN + IDS_HEADER "\nReactOS IP Configuration\n\n" + IDS_HOSTNAME "\tHost Name . . . . . . . . . . . . : %hs\n" + IDS_PRIMARYDNSSUFFIX "\tPrimary DNS Suffix. . . . . . . . : %hs\n" + IDS_NODETYPE "\tNode Type . . . . . . . . . . . . : " + IDS_IPROUTINGNO "\tIP Routing Enabled. . . . . . . . : No\n" + IDS_IPROUTINGYES "\tIP Routing Enabled. . . . . . . . : Yes\n" + IDS_WINSPROXYNO "\tWINS Proxy enabled. . . . . . . . : No\n" + IDS_WINSPROXYYES "\tWINS Proxy enabled. . . . . . . . : Yes\n" + IDS_DNSSUFFIXLIST "\tDNS Suffix Search List. . . . . . : %hs\n" + IDS_EMPTYLINE "\t %hs\n" + IDS_MEDIADISCONNECTED "\tMedia State . . . . . . . . . . . : Media disconnected\n" + IDS_CONNECTIONDNSSUFFIX "\tConnection-specific DNS Suffix. . : %hs\n" + IDS_DESCRIPTION "\tDescription . . . . . . . . . . . : " + IDS_PHYSICALADDRESS "\tPhysical Address. . . . . . . . . : %hs\n" + IDS_DHCPNO "\tDHCP Enabled. . . . . . . . . . . : No\n" + IDS_DHCPYES "\tDHCP Enabled. . . . . . . . . . . : Yes\n" + IDS_AUTOCONFIGNO "\tAutoconfiguration Enabled . . . . : No\n" + IDS_AUTOCONFIGYES "\tAutoconfiguration Enabled . . . . : Yes\n" + IDS_IPADDRESS "\tIP Address. . . . . . . . . . . . : %hs\n" + IDS_SUBNETMASK "\tSubnet Mask . . . . . . . . . . . : %hs\n" + IDS_DEFAULTGATEWAY "\tDefault Gateway . . . . . . . . . : %hs\n" + IDS_DHCPSERVER "\tDHCP Server . . . . . . . . . . . : %hs\n" + IDS_DNSSERVERS "\tDNS Servers . . . . . . . . . . . : %hs\n" + IDS_PRIMARYWINSSERVER "\tPrimary WINS Server . . . . . . . : %hs\n" + IDS_SECONDARYWINSSERVER "\tSecondary WINS Server . . . . . . : %hs\n" + IDS_LEASEOBTAINED "\tLease Obtained. . . . . . . . . . : %s\n" + IDS_LEASEEXPIRES "\tLease Expires . . . . . . . . . . : %s\n" +END + +STRINGTABLE +BEGIN + IDS_YES "Yes" + IDS_NO "No" +END + STRINGTABLE BEGIN IDS_BCAST "廣播" @@ -13,6 +50,7 @@ END STRINGTABLE BEGIN + IDS_UNKNOWNADAPTER "Unknown Adapter" IDS_OTHER "其他類型的配接器" IDS_ETH "乙太網配接器" IDS_TOKEN "權杖環配接器" @@ -20,6 +58,7 @@ BEGIN IDS_PPP "PPP 配接器" IDS_LOOP "本地環回配接器" IDS_SLIP "SLIP 配接器" + IDS_WIFI "Wireless Network Adapter" END STRINGTABLE diff --git a/base/applications/network/ipconfig/resource.h b/base/applications/network/ipconfig/resource.h index 5f1d4d11207..73750c0caa5 100644 --- a/base/applications/network/ipconfig/resource.h +++ b/base/applications/network/ipconfig/resource.h @@ -1,19 +1,51 @@ #pragma once -#define IDS_USAGE 100 +#define IDS_HEADER 100 +#define IDS_HOSTNAME 101 +#define IDS_PRIMARYDNSSUFFIX 102 +#define IDS_NODETYPE 103 +#define IDS_IPROUTINGNO 104 +#define IDS_IPROUTINGYES 105 +#define IDS_WINSPROXYNO 106 +#define IDS_WINSPROXYYES 107 +#define IDS_DNSSUFFIXLIST 108 +#define IDS_EMPTYLINE 109 +#define IDS_UNKNOWNADAPTER 110 +#define IDS_MEDIADISCONNECTED 111 +#define IDS_CONNECTIONDNSSUFFIX 112 +#define IDS_DESCRIPTION 113 +#define IDS_PHYSICALADDRESS 114 +#define IDS_DHCPNO 115 +#define IDS_DHCPYES 116 +#define IDS_AUTOCONFIGNO 117 +#define IDS_AUTOCONFIGYES 118 +#define IDS_IPADDRESS 119 +#define IDS_SUBNETMASK 120 +#define IDS_DEFAULTGATEWAY 121 +#define IDS_DHCPSERVER 122 +#define IDS_DNSSERVERS 123 +#define IDS_PRIMARYWINSSERVER 124 +#define IDS_SECONDARYWINSSERVER 125 +#define IDS_LEASEOBTAINED 126 +#define IDS_LEASEEXPIRES 127 -#define IDS_UNKNOWN 101 +#define IDS_YES 138 +#define IDS_NO 139 -#define IDS_BCAST 102 -#define IDS_P2P 103 -#define IDS_MIXED 104 -#define IDS_HYBRID 105 +#define IDS_UNKNOWN 141 +#define IDS_BCAST 142 +#define IDS_P2P 143 +#define IDS_MIXED 144 +#define IDS_HYBRID 145 /* adapter types */ -#define IDS_OTHER 106 -#define IDS_ETH 107 -#define IDS_TOKEN 108 -#define IDS_FDDI 109 -#define IDS_PPP 110 -#define IDS_LOOP 111 -#define IDS_SLIP 112 +#define IDS_OTHER 146 +#define IDS_ETH 147 +#define IDS_TOKEN 148 +#define IDS_FDDI 149 +#define IDS_PPP 150 +#define IDS_LOOP 151 +#define IDS_SLIP 152 +#define IDS_WIFI 153 + +#define IDS_USAGE 160
1 year, 6 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Establish Undo/Redo management (#5347)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e8c7e300300e9bbc76b37…
commit e8c7e300300e9bbc76b37b30dff392df12ef5222 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Jun 17 21:15:35 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jun 17 21:15:35 2023 +0900 [MSPAINT] Establish Undo/Redo management (#5347) - Painting the canvas is done by overlaying the multiple layers. - Drawing each overlay is implemented as polymorphism of OOP. - Refine the Undo/Redo mechanism. - Some adjustments. CORE-17969 --- base/applications/mspaint/canvas.cpp | 134 ++++---- base/applications/mspaint/canvas.h | 4 +- base/applications/mspaint/common.h | 1 - base/applications/mspaint/dialogs.cpp | 20 +- base/applications/mspaint/dib.cpp | 38 +-- base/applications/mspaint/drawing.cpp | 2 +- base/applications/mspaint/fullscreen.cpp | 4 +- base/applications/mspaint/globalvar.h | 22 +- base/applications/mspaint/history.cpp | 135 ++++---- base/applications/mspaint/history.h | 17 +- base/applications/mspaint/main.cpp | 28 +- base/applications/mspaint/miniature.cpp | 2 +- base/applications/mspaint/mouse.cpp | 468 ++++++++++++++++++--------- base/applications/mspaint/palette.cpp | 8 +- base/applications/mspaint/palette.h | 2 - base/applications/mspaint/palettemodel.cpp | 2 +- base/applications/mspaint/selectionmodel.cpp | 119 ++++--- base/applications/mspaint/selectionmodel.h | 12 +- base/applications/mspaint/textedit.cpp | 4 +- base/applications/mspaint/toolbox.cpp | 29 +- base/applications/mspaint/toolbox.h | 5 + base/applications/mspaint/toolsettings.cpp | 11 +- base/applications/mspaint/toolsmodel.cpp | 15 +- base/applications/mspaint/toolsmodel.h | 31 +- base/applications/mspaint/winproc.cpp | 108 ++++--- 25 files changed, 719 insertions(+), 502 deletions(-) diff --git a/base/applications/mspaint/canvas.cpp b/base/applications/mspaint/canvas.cpp index c36bd76faed..68a91b5d250 100644 --- a/base/applications/mspaint/canvas.cpp +++ b/base/applications/mspaint/canvas.cpp @@ -17,15 +17,17 @@ CCanvasWindow::CCanvasWindow() , m_hitSelection(HIT_NONE) , m_whereHit(HIT_NONE) , m_ptOrig { -1, -1 } - , m_hbmCached(NULL) { + m_ahbmCached[0] = m_ahbmCached[1] = NULL; ::SetRectEmpty(&m_rcNew); } CCanvasWindow::~CCanvasWindow() { - if (m_hbmCached) - ::DeleteObject(m_hbmCached); + if (m_ahbmCached[0]) + ::DeleteObject(m_ahbmCached[0]); + if (m_ahbmCached[1]) + ::DeleteObject(m_ahbmCached[1]); } VOID CCanvasWindow::drawZoomFrame(INT mouseX, INT mouseY) @@ -101,78 +103,80 @@ CANVAS_HITTEST CCanvasWindow::CanvasHitTest(POINT pt) VOID CCanvasWindow::DoDraw(HDC hDC, RECT& rcClient, RECT& rcPaint) { // We use a memory bitmap to reduce flickering - HDC hdcMem = ::CreateCompatibleDC(hDC); - m_hbmCached = CachedBufferDIB(m_hbmCached, rcClient.right, rcClient.bottom); - HGDIOBJ hbmOld = ::SelectObject(hdcMem, m_hbmCached); + HDC hdcMem0 = ::CreateCompatibleDC(hDC); + m_ahbmCached[0] = CachedBufferDIB(m_ahbmCached[0], rcClient.right, rcClient.bottom); + HGDIOBJ hbm0Old = ::SelectObject(hdcMem0, m_ahbmCached[0]); - // Fill the background - ::FillRect(hdcMem, &rcPaint, (HBRUSH)(COLOR_APPWORKSPACE + 1)); + // Fill the background on hdcMem0 + ::FillRect(hdcMem0, &rcPaint, (HBRUSH)(COLOR_APPWORKSPACE + 1)); // Draw the sizeboxes if necessary RECT rcBase = GetBaseRect(); if (!selectionModel.m_bShow) - drawSizeBoxes(hdcMem, &rcBase, FALSE, &rcPaint); + drawSizeBoxes(hdcMem0, &rcBase, FALSE, &rcPaint); - // Draw the image + // Calculate image size CRect rcImage; GetImageRect(rcImage); - ImageToCanvas(rcImage); SIZE sizeImage = { imageModel.GetWidth(), imageModel.GetHeight() }; - StretchBlt(hdcMem, rcImage.left, rcImage.top, rcImage.Width(), rcImage.Height(), - imageModel.GetDC(), 0, 0, sizeImage.cx, sizeImage.cy, SRCCOPY); - // Draw the grid - if (showGrid && toolsModel.GetZoom() >= 4000) + // hdcMem1 <-- imageModel + HDC hdcMem1 = ::CreateCompatibleDC(hDC); + m_ahbmCached[1] = CachedBufferDIB(m_ahbmCached[1], sizeImage.cx, sizeImage.cy); + HGDIOBJ hbm1Old = ::SelectObject(hdcMem1, m_ahbmCached[1]); + BitBlt(hdcMem1, 0, 0, sizeImage.cx, sizeImage.cy, imageModel.GetDC(), 0, 0, SRCCOPY); + + // Draw overlay #1 on hdcMem1 + toolsModel.OnDrawOverlayOnImage(hdcMem1); + + // Transfer the bits with stretch (hdcMem0 <-- hdcMem1) + ImageToCanvas(rcImage); + ::StretchBlt(hdcMem0, rcImage.left, rcImage.top, rcImage.Width(), rcImage.Height(), + hdcMem1, 0, 0, sizeImage.cx, sizeImage.cy, SRCCOPY); + + // Clean up hdcMem1 + ::SelectObject(hdcMem1, hbm1Old); + ::DeleteDC(hdcMem1); + + // Draw the grid on hdcMem0 + if (g_showGrid && toolsModel.GetZoom() >= 4000) { - HPEN oldPen = (HPEN) SelectObject(hdcMem, CreatePen(PS_SOLID, 1, RGB(160, 160, 160))); + HPEN oldPen = (HPEN) ::SelectObject(hdcMem0, ::CreatePen(PS_SOLID, 1, RGB(160, 160, 160))); for (INT counter = 0; counter < sizeImage.cy; counter++) { POINT pt0 = { 0, counter }, pt1 = { sizeImage.cx, counter }; ImageToCanvas(pt0); ImageToCanvas(pt1); - ::MoveToEx(hdcMem, pt0.x, pt0.y, NULL); - ::LineTo(hdcMem, pt1.x, pt1.y); + ::MoveToEx(hdcMem0, pt0.x, pt0.y, NULL); + ::LineTo(hdcMem0, pt1.x, pt1.y); } for (INT counter = 0; counter < sizeImage.cx; counter++) { POINT pt0 = { counter, 0 }, pt1 = { counter, sizeImage.cy }; ImageToCanvas(pt0); ImageToCanvas(pt1); - ::MoveToEx(hdcMem, pt0.x, pt0.y, NULL); - ::LineTo(hdcMem, pt1.x, pt1.y); + ::MoveToEx(hdcMem0, pt0.x, pt0.y, NULL); + ::LineTo(hdcMem0, pt1.x, pt1.y); } - ::DeleteObject(::SelectObject(hdcMem, oldPen)); + ::DeleteObject(::SelectObject(hdcMem0, oldPen)); } - // Draw selection - if (selectionModel.m_bShow) - { - RECT rcSelection = selectionModel.m_rc; - ImageToCanvas(rcSelection); - - ::InflateRect(&rcSelection, GRIP_SIZE, GRIP_SIZE); - drawSizeBoxes(hdcMem, &rcSelection, TRUE, &rcPaint); - ::InflateRect(&rcSelection, -GRIP_SIZE, -GRIP_SIZE); - - INT iSaveDC = ::SaveDC(hdcMem); - ::IntersectClipRect(hdcMem, rcImage.left, rcImage.top, rcImage.right, rcImage.bottom); - selectionModel.DrawSelection(hdcMem, &rcSelection, paletteModel.GetBgColor(), - toolsModel.IsBackgroundTransparent()); - ::RestoreDC(hdcMem, iSaveDC); - } + // Draw overlay #2 on hdcMem0 + toolsModel.OnDrawOverlayOnCanvas(hdcMem0); - // Draw new frame if any + // Draw new frame on hdcMem0 if any if (m_whereHit != HIT_NONE && !::IsRectEmpty(&m_rcNew)) - DrawXorRect(hdcMem, &m_rcNew); + DrawXorRect(hdcMem0, &m_rcNew); - // Transfer the bits + // Transfer the bits (hDC <-- hdcMem0) ::BitBlt(hDC, rcPaint.left, rcPaint.top, rcPaint.right - rcPaint.left, rcPaint.bottom - rcPaint.top, - hdcMem, rcPaint.left, rcPaint.top, SRCCOPY); + hdcMem0, rcPaint.left, rcPaint.top, SRCCOPY); - ::SelectObject(hdcMem, hbmOld); - ::DeleteDC(hdcMem); + // Clean up hdcMem0 + ::SelectObject(hdcMem0, hbm0Old); + ::DeleteDC(hdcMem0); } VOID CCanvasWindow::Update(HWND hwndFrom) @@ -383,15 +387,15 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL { CString strCoord; strCoord.Format(_T("%ld, %ld"), pt.x, pt.y); - SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) (LPCTSTR) strCoord); + ::SendMessage(g_hStatusBar, SB_SETTEXT, 1, (LPARAM) (LPCTSTR) strCoord); } } if (m_drawing) { // values displayed in statusbar - LONG xRel = pt.x - start.x; - LONG yRel = pt.y - start.y; + LONG xRel = pt.x - g_ptStart.x; + LONG yRel = pt.y - g_ptStart.y; switch (toolsModel.GetActiveTool()) { @@ -400,13 +404,13 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL case TOOL_RECTSEL: case TOOL_TEXT: if (xRel < 0) - xRel = (pt.x < 0) ? -start.x : xRel; + xRel = (pt.x < 0) ? -g_ptStart.x : xRel; else if (pt.x > imageModel.GetWidth()) - xRel = imageModel.GetWidth() - start.x; + xRel = imageModel.GetWidth() - g_ptStart.x; if (yRel < 0) - yRel = (pt.y < 0) ? -start.y : yRel; + yRel = (pt.y < 0) ? -g_ptStart.y : yRel; else if (pt.y > imageModel.GetHeight()) - yRel = imageModel.GetHeight() - start.y; + yRel = imageModel.GetHeight() - g_ptStart.y; break; // while drawing, update cursor coordinates only for tools 3, 7, 8, 9, 14 @@ -418,7 +422,7 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL { CString strCoord; strCoord.Format(_T("%ld, %ld"), pt.x, pt.y); - SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM) (LPCTSTR) strCoord); + ::SendMessage(g_hStatusBar, SB_SETTEXT, 1, (LPARAM) (LPCTSTR) strCoord); break; } default: @@ -444,7 +448,7 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL if ((toolsModel.GetActiveTool() >= TOOL_LINE) && (GetAsyncKeyState(VK_SHIFT) < 0)) yRel = xRel; strSize.Format(_T("%ld x %ld"), xRel, yRel); - SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) (LPCTSTR) strSize); + ::SendMessage(g_hStatusBar, SB_SETTEXT, 2, (LPARAM) (LPCTSTR) strSize); } } @@ -458,7 +462,7 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL if ((toolsModel.GetActiveTool() >= TOOL_LINE) && (GetAsyncKeyState(VK_SHIFT) < 0)) yRel = xRel; strSize.Format(_T("%ld x %ld"), xRel, yRel); - SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) (LPCTSTR) strSize); + ::SendMessage(g_hStatusBar, SB_SETTEXT, 2, (LPARAM) (LPCTSTR) strSize); } } return 0; @@ -514,7 +518,7 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL // Display new size CString strSize; strSize.Format(_T("%d x %d"), cxImage, cyImage); - SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) (LPCTSTR) strSize); + ::SendMessage(g_hStatusBar, SB_SETTEXT, 2, (LPARAM) (LPCTSTR) strSize); CRect rc = { 0, 0, cxImage, cyImage }; switch (m_whereHit) @@ -556,7 +560,7 @@ LRESULT CCanvasWindow::OnLRButtonUp(BOOL bLeftButton, UINT nMsg, WPARAM wParam, m_drawing = FALSE; toolsModel.OnButtonUp(bLeftButton, pt.x, pt.y); Invalidate(FALSE); - SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) ""); + ::SendMessage(g_hStatusBar, SB_SETTEXT, 2, (LPARAM)_T("")); return 0; } else if (m_hitSelection != HIT_NONE && bLeftButton) @@ -603,7 +607,7 @@ LRESULT CCanvasWindow::OnLRButtonUp(BOOL bLeftButton, UINT nMsg, WPARAM wParam, } ::SetRectEmpty(&m_rcNew); - imageSaved = FALSE; + g_imageSaved = FALSE; m_whereHit = HIT_NONE; toolsModel.resetTool(); // resets the point-buffer of the polygon and bezier functions @@ -654,19 +658,19 @@ LRESULT CCanvasWindow::OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL switch (toolsModel.GetActiveTool()) { case TOOL_FILL: - ::SetCursor(::LoadIcon(hProgInstance, MAKEINTRESOURCE(IDC_FILL))); + ::SetCursor(::LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDC_FILL))); break; case TOOL_COLOR: - ::SetCursor(::LoadIcon(hProgInstance, MAKEINTRESOURCE(IDC_COLOR))); + ::SetCursor(::LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDC_COLOR))); break; case TOOL_ZOOM: - ::SetCursor(::LoadIcon(hProgInstance, MAKEINTRESOURCE(IDC_ZOOM))); + ::SetCursor(::LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDC_ZOOM))); break; case TOOL_PEN: - ::SetCursor(::LoadIcon(hProgInstance, MAKEINTRESOURCE(IDC_PEN))); + ::SetCursor(::LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDC_PEN))); break; case TOOL_AIRBRUSH: - ::SetCursor(::LoadIcon(hProgInstance, MAKEINTRESOURCE(IDC_AIRBRUSH))); + ::SetCursor(::LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDC_AIRBRUSH))); break; default: ::SetCursor(::LoadCursor(NULL, IDC_CROSS)); @@ -710,7 +714,7 @@ LRESULT CCanvasWindow::OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOO LRESULT CCanvasWindow::OnCaptureChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)_T("")); + ::SendMessage(g_hStatusBar, SB_SETTEXT, 2, (LPARAM)_T("")); return 0; } @@ -800,3 +804,9 @@ LRESULT CCanvasWindow::OnCtlColorEdit(UINT nMsg, WPARAM wParam, LPARAM lParam, B SetBkMode((HDC)wParam, TRANSPARENT); return (LRESULT)GetStockObject(NULL_BRUSH); } + +LRESULT CCanvasWindow::OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + imageModel.NotifyImageChanged(); + return 0; +} diff --git a/base/applications/mspaint/canvas.h b/base/applications/mspaint/canvas.h index d76b3761b9c..40c07689acd 100644 --- a/base/applications/mspaint/canvas.h +++ b/base/applications/mspaint/canvas.h @@ -33,6 +33,7 @@ public: MESSAGE_HANDLER(WM_CANCELMODE, OnCancelMode) MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged) MESSAGE_HANDLER(WM_CTLCOLOREDIT, OnCtlColorEdit) + MESSAGE_HANDLER(WM_PALETTEMODELCOLORCHANGED, OnPaletteModelColorChanged) END_MSG_MAP() CCanvasWindow(); @@ -55,7 +56,7 @@ protected: CANVAS_HITTEST m_hitSelection; CANVAS_HITTEST m_whereHit; POINT m_ptOrig; // The origin of drag start - HBITMAP m_hbmCached; // The cached buffer bitmap + HBITMAP m_ahbmCached[2]; // The cached buffer bitmaps CRect m_rcNew; CANVAS_HITTEST CanvasHitTest(POINT pt); @@ -87,6 +88,7 @@ protected: LRESULT OnCancelMode(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnCaptureChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnCtlColorEdit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLRButtonDown(BOOL bLeftButton, UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLRButtonDblClk(BOOL bLeftButton, UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); diff --git a/base/applications/mspaint/common.h b/base/applications/mspaint/common.h index 4aefbb2dcff..0c99517c599 100644 --- a/base/applications/mspaint/common.h +++ b/base/applications/mspaint/common.h @@ -20,7 +20,6 @@ #define WM_TOOLSMODELSETTINGSCHANGED (WM_APP + 1) #define WM_TOOLSMODELZOOMCHANGED (WM_APP + 2) #define WM_PALETTEMODELCOLORCHANGED (WM_APP + 3) -#define WM_PALETTEMODELPALETTECHANGED (WM_APP + 4) /* this simplifies checking and unchecking menu items */ #define CHECKED_IF(a) ((a) ? (MF_CHECKED | MF_BYCOMMAND) : (MF_UNCHECKED | MF_BYCOMMAND)) diff --git a/base/applications/mspaint/dialogs.cpp b/base/applications/mspaint/dialogs.cpp index 7b85b59365e..b08e33974c7 100644 --- a/base/applications/mspaint/dialogs.cpp +++ b/base/applications/mspaint/dialogs.cpp @@ -83,16 +83,16 @@ LRESULT CAttributesDialog::OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, SetDlgItemInt(IDD_ATTRIBUTESEDIT1, newWidth, FALSE); SetDlgItemInt(IDD_ATTRIBUTESEDIT2, newHeight, FALSE); - if (isAFile) + if (g_isAFile) { TCHAR date[100]; TCHAR temp[100]; - GetDateFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, date, _countof(date)); - GetTimeFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, temp, _countof(temp)); + GetDateFormat(LOCALE_USER_DEFAULT, 0, &g_fileTime, NULL, date, _countof(date)); + GetTimeFormat(LOCALE_USER_DEFAULT, 0, &g_fileTime, NULL, temp, _countof(temp)); _tcscat(date, _T(" ")); _tcscat(date, temp); CString strSize; - strSize.Format(IDS_FILESIZE, fileSize); + strSize.Format(IDS_FILESIZE, g_fileSize); SetDlgItemText(IDD_ATTRIBUTESTEXT6, date); SetDlgItemText(IDD_ATTRIBUTESTEXT7, strSize); } @@ -240,9 +240,9 @@ LRESULT CStretchSkewDialog::OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& CString strrcAngle; BOOL tr1, tr2, tr3, tr4; - strrcIntNumbers.LoadString(hProgInstance, IDS_INTNUMBERS); - strrcPercentage.LoadString(hProgInstance, IDS_PERCENTAGE); - strrcAngle.LoadString(hProgInstance, IDS_ANGLE); + strrcIntNumbers.LoadString(g_hinstExe, IDS_INTNUMBERS); + strrcPercentage.LoadString(g_hinstExe, IDS_PERCENTAGE); + strrcAngle.LoadString(g_hinstExe, IDS_ANGLE); percentage.x = GetDlgItemInt(IDD_STRETCHSKEWEDITHSTRETCH, &tr1, FALSE); percentage.y = GetDlgItemInt(IDD_STRETCHSKEWEDITVSTRETCH, &tr2, FALSE); @@ -347,11 +347,11 @@ void CFontsDialog::InitToolbar() SendMessage(hwndToolbar, TB_SETBUTTONWIDTH, 0, MAKELPARAM(20, 20)); TBADDBITMAP AddBitmap; - AddBitmap.hInst = hProgInstance; + AddBitmap.hInst = g_hinstExe; AddBitmap.nID = IDB_FONTSTOOLBAR; SendMessage(hwndToolbar, TB_ADDBITMAP, 4, (LPARAM)&AddBitmap); - HIMAGELIST himl = ImageList_LoadImage(hProgInstance, MAKEINTRESOURCE(IDB_FONTSTOOLBAR), + HIMAGELIST himl = ImageList_LoadImage(g_hinstExe, MAKEINTRESOURCE(IDB_FONTSTOOLBAR), 16, 8, RGB(255, 0, 255), IMAGE_BITMAP, LR_CREATEDIBSECTION); SendMessage(hwndToolbar, TB_SETIMAGELIST, 0, (LPARAM)himl); @@ -511,7 +511,7 @@ LRESULT CFontsDialog::OnNotify(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH if (pnmhdr->code == TTN_NEEDTEXT) { LPTOOLTIPTEXT pToolTip = reinterpret_cast<LPTOOLTIPTEXT>(lParam); - pToolTip->hinst = hProgInstance; + pToolTip->hinst = g_hinstExe; switch (pnmhdr->idFrom) { case IDM_BOLD: pToolTip->lpszText = MAKEINTRESOURCE(IDS_BOLD); break; diff --git a/base/applications/mspaint/dib.cpp b/base/applications/mspaint/dib.cpp index 1e7477c661e..85472994639 100644 --- a/base/applications/mspaint/dib.cpp +++ b/base/applications/mspaint/dib.cpp @@ -9,10 +9,10 @@ #include "precomp.h" #include <math.h> -INT fileSize = 0; +INT g_fileSize = 0; float g_xDpi = 96; float g_yDpi = 96; -SYSTEMTIME fileTime; +SYSTEMTIME g_fileTime; /* FUNCTIONS ********************************************************/ @@ -114,15 +114,15 @@ BOOL SaveDIBToFile(HBITMAP hBitmap, LPCTSTR FileName, HDC hDC) // update time and size FILETIME ft; FileTimeToLocalFileTime(&find.ftLastWriteTime, &ft); - FileTimeToSystemTime(&ft, &fileTime); - fileSize = find.nFileSizeLow; + FileTimeToSystemTime(&ft, &g_fileTime); + g_fileSize = find.nFileSizeLow; // TODO: update hRes and vRes registrySettings.SetMostRecentFile(FileName); - isAFile = TRUE; - imageSaved = TRUE; + g_isAFile = TRUE; + g_imageSaved = TRUE; return TRUE; } @@ -150,33 +150,33 @@ HBITMAP SetBitmapAndInfo(HBITMAP hBitmap, LPCTSTR name, DWORD dwFileSize, BOOL i g_yDpi = GetDeviceCaps(hScreenDC, LOGPIXELSY); ReleaseDC(NULL, hScreenDC); - ZeroMemory(&fileTime, sizeof(fileTime)); + ZeroMemory(&g_fileTime, sizeof(g_fileTime)); } // update image imageModel.PushImageForUndo(hBitmap); imageModel.ClearHistory(); - // update fileSize - fileSize = dwFileSize; + // update g_fileSize + g_fileSize = dwFileSize; - // update filepathname + // update g_szFileName if (name && name[0]) - GetFullPathName(name, _countof(filepathname), filepathname, NULL); + GetFullPathName(name, _countof(g_szFileName), g_szFileName, NULL); else - LoadString(hProgInstance, IDS_DEFAULTFILENAME, filepathname, _countof(filepathname)); + LoadString(g_hinstExe, IDS_DEFAULTFILENAME, g_szFileName, _countof(g_szFileName)); // set title CString strTitle; - strTitle.Format(IDS_WINDOWTITLE, PathFindFileName(filepathname)); + strTitle.Format(IDS_WINDOWTITLE, PathFindFileName(g_szFileName)); mainWindow.SetWindowText(strTitle); // update file info and recent - isAFile = isFile; - if (isAFile) - registrySettings.SetMostRecentFile(filepathname); + g_isAFile = isFile; + if (g_isAFile) + registrySettings.SetMostRecentFile(g_szFileName); - imageSaved = TRUE; + g_imageSaved = TRUE; return hBitmap; } @@ -204,7 +204,7 @@ HBITMAP DoLoadImageFile(HWND hwnd, LPCTSTR name, BOOL fIsMainFile) { FILETIME ft; FileTimeToLocalFileTime(&find.ftLastWriteTime, &ft); - FileTimeToSystemTime(&ft, &fileTime); + FileTimeToSystemTime(&ft, &g_fileTime); return SetBitmapAndInfo(NULL, name, dwFileSize, TRUE); } } @@ -233,7 +233,7 @@ HBITMAP DoLoadImageFile(HWND hwnd, LPCTSTR name, BOOL fIsMainFile) { FILETIME ft; FileTimeToLocalFileTime(&find.ftLastWriteTime, &ft); - FileTimeToSystemTime(&ft, &fileTime); + FileTimeToSystemTime(&ft, &g_fileTime); SetBitmapAndInfo(hBitmap, name, dwFileSize, TRUE); } diff --git a/base/applications/mspaint/drawing.cpp b/base/applications/mspaint/drawing.cpp index 7bb0d57da60..5b3d1a24f62 100644 --- a/base/applications/mspaint/drawing.cpp +++ b/base/applications/mspaint/drawing.cpp @@ -158,7 +158,7 @@ Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r) { for (LONG dx = -r; dx <= r; dx++) { - if ((dx * dx + dy * dy <= r * r) && (rand() % 4 == 0)) + if ((dx * dx + dy * dy <= r * r) && (rand() % r == 0)) ::SetPixelV(hdc, x + dx, y + dy, color); } } diff --git a/base/applications/mspaint/fullscreen.cpp b/base/applications/mspaint/fullscreen.cpp index 63dd070da6d..5baadac6f02 100644 --- a/base/applications/mspaint/fullscreen.cpp +++ b/base/applications/mspaint/fullscreen.cpp @@ -23,8 +23,8 @@ HWND CFullscreenWindow::DoCreate() LRESULT CFullscreenWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - SendMessage(WM_SETICON, ICON_BIG, (LPARAM) LoadIcon(hProgInstance, MAKEINTRESOURCE(IDI_APPICON))); - SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) LoadIcon(hProgInstance, MAKEINTRESOURCE(IDI_APPICON))); + SendMessage(WM_SETICON, ICON_BIG, (LPARAM) LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDI_APPICON))); + SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDI_APPICON))); return 0; } diff --git a/base/applications/mspaint/globalvar.h b/base/applications/mspaint/globalvar.h index 4ed2cfc6a12..b38c82e665a 100644 --- a/base/applications/mspaint/globalvar.h +++ b/base/applications/mspaint/globalvar.h @@ -10,18 +10,16 @@ /* VARIABLES declared in main.cpp ***********************************/ -extern BOOL askBeforeEnlarging; +extern BOOL g_askBeforeEnlarging; -extern POINT start; -extern POINT last; +extern POINT g_ptStart, g_ptEnd; -extern HINSTANCE hProgInstance; +extern HINSTANCE g_hinstExe; -extern TCHAR filepathname[MAX_LONG_PATH]; -extern BOOL isAFile; -extern BOOL imageSaved; - -extern BOOL showGrid; +extern TCHAR g_szFileName[MAX_LONG_PATH]; +extern BOOL g_isAFile; +extern BOOL g_imageSaved; +extern BOOL g_showGrid; extern CMainWindow mainWindow; @@ -40,11 +38,11 @@ extern ToolsModel toolsModel; extern SelectionModel selectionModel; extern PaletteModel paletteModel; -extern HWND hStatusBar; +extern HWND g_hStatusBar; extern float g_xDpi; extern float g_yDpi; -extern INT fileSize; -extern SYSTEMTIME fileTime; +extern INT g_fileSize; +extern SYSTEMTIME g_fileTime; extern CFullscreenWindow fullscreenWindow; extern CMiniatureWindow miniature; diff --git a/base/applications/mspaint/history.cpp b/base/applications/mspaint/history.cpp index 92ef896afd0..46a7341ff1c 100644 --- a/base/applications/mspaint/history.cpp +++ b/base/applications/mspaint/history.cpp @@ -22,103 +22,103 @@ void ImageModel::NotifyImageChanged() } ImageModel::ImageModel() - : hDrawingDC(::CreateCompatibleDC(NULL)) - , currInd(0) - , undoSteps(0) - , redoSteps(0) + : m_hDrawingDC(::CreateCompatibleDC(NULL)) + , m_currInd(0) + , m_undoSteps(0) + , m_redoSteps(0) { - ZeroMemory(hBms, sizeof(hBms)); + ZeroMemory(m_hBms, sizeof(m_hBms)); - hBms[0] = CreateDIBWithProperties(1, 1); - ::SelectObject(hDrawingDC, hBms[0]); + m_hBms[0] = CreateColorDIB(1, 1, RGB(255, 255, 255)); + m_hbmOld = ::SelectObject(m_hDrawingDC, m_hBms[0]); - imageSaved = TRUE; + g_imageSaved = TRUE; } ImageModel::~ImageModel() { - ::DeleteDC(hDrawingDC); + ::DeleteDC(m_hDrawingDC); for (size_t i = 0; i < HISTORYSIZE; ++i) { - if (hBms[i]) - ::DeleteObject(hBms[i]); + if (m_hBms[i]) + ::DeleteObject(m_hBms[i]); } } void ImageModel::Undo(BOOL bClearRedo) { - ATLTRACE("%s: %d\n", __FUNCTION__, undoSteps); + ATLTRACE("%s: %d\n", __FUNCTION__, m_undoSteps); if (!CanUndo()) return; - selectionModel.m_bShow = FALSE; + selectionModel.HideSelection(); // Select previous item - currInd = (currInd + HISTORYSIZE - 1) % HISTORYSIZE; - ::SelectObject(hDrawingDC, hBms[currInd]); + m_currInd = (m_currInd + HISTORYSIZE - 1) % HISTORYSIZE; + ::SelectObject(m_hDrawingDC, m_hBms[m_currInd]); - undoSteps--; + m_undoSteps--; if (bClearRedo) - redoSteps = 0; - else if (redoSteps < HISTORYSIZE - 1) - redoSteps++; + m_redoSteps = 0; + else if (m_redoSteps < HISTORYSIZE - 1) + m_redoSteps++; NotifyImageChanged(); } void ImageModel::Redo() { - ATLTRACE("%s: %d\n", __FUNCTION__, redoSteps); + ATLTRACE("%s: %d\n", __FUNCTION__, m_redoSteps); if (!CanRedo()) return; - selectionModel.m_bShow = FALSE; + selectionModel.HideSelection(); // Select next item - currInd = (currInd + 1) % HISTORYSIZE; - ::SelectObject(hDrawingDC, hBms[currInd]); + m_currInd = (m_currInd + 1) % HISTORYSIZE; + ::SelectObject(m_hDrawingDC, m_hBms[m_currInd]); - redoSteps--; - if (undoSteps < HISTORYSIZE - 1) - undoSteps++; + m_redoSteps--; + if (m_undoSteps < HISTORYSIZE - 1) + m_undoSteps++; NotifyImageChanged(); } void ImageModel::ResetToPrevious() { - ATLTRACE("%s: %d\n", __FUNCTION__, currInd); + ATLTRACE("%s: %d\n", __FUNCTION__, m_currInd); // Revert current item with previous item - ::DeleteObject(hBms[currInd]); - hBms[currInd] = CopyDIBImage(hBms[(currInd + HISTORYSIZE - 1) % HISTORYSIZE]); - ::SelectObject(hDrawingDC, hBms[currInd]); + ::DeleteObject(m_hBms[m_currInd]); + m_hBms[m_currInd] = CopyDIBImage(m_hBms[(m_currInd + HISTORYSIZE - 1) % HISTORYSIZE]); + ::SelectObject(m_hDrawingDC, m_hBms[m_currInd]); NotifyImageChanged(); } void ImageModel::ClearHistory() { - undoSteps = 0; - redoSteps = 0; + m_undoSteps = 0; + m_redoSteps = 0; } void ImageModel::PushImageForUndo(HBITMAP hbm) { - ATLTRACE("%s: %d\n", __FUNCTION__, currInd); + ATLTRACE("%s: %d\n", __FUNCTION__, m_currInd); // Go to the next item with an HBITMAP or current item - ::DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]); - hBms[(currInd + 1) % HISTORYSIZE] = (hbm ? hbm : CopyDIBImage(hBms[currInd])); - currInd = (currInd + 1) % HISTORYSIZE; - ::SelectObject(hDrawingDC, hBms[currInd]); + ::DeleteObject(m_hBms[(m_currInd + 1) % HISTORYSIZE]); + m_hBms[(m_currInd + 1) % HISTORYSIZE] = (hbm ? hbm : CopyDIBImage(m_hBms[m_currInd])); + m_currInd = (m_currInd + 1) % HISTORYSIZE; + ::SelectObject(m_hDrawingDC, m_hBms[m_currInd]); - if (undoSteps < HISTORYSIZE - 1) - undoSteps++; - redoSteps = 0; + if (m_undoSteps < HISTORYSIZE - 1) + m_undoSteps++; + m_redoSteps = 0; - imageSaved = FALSE; + g_imageSaved = FALSE; NotifyImageChanged(); } @@ -136,7 +136,7 @@ void ImageModel::Crop(int nWidth, int nHeight, int nOffsetX, int nOffsetY) return; // Select the HBITMAP by memory DC - HDC hdcMem = ::CreateCompatibleDC(hDrawingDC); + HDC hdcMem = ::CreateCompatibleDC(m_hDrawingDC); HGDIOBJ hbmOld = ::SelectObject(hdcMem, hbmCropped); // Fill background of the HBITMAP @@ -146,7 +146,7 @@ void ImageModel::Crop(int nWidth, int nHeight, int nOffsetX, int nOffsetY) ::DeleteObject(hbrBack); // Copy the old content - ::BitBlt(hdcMem, -nOffsetX, -nOffsetY, GetWidth(), GetHeight(), hDrawingDC, 0, 0, SRCCOPY); + ::BitBlt(hdcMem, -nOffsetX, -nOffsetY, GetWidth(), GetHeight(), m_hDrawingDC, 0, 0, SRCCOPY); // Clean up ::SelectObject(hdcMem, hbmOld); @@ -160,12 +160,12 @@ void ImageModel::Crop(int nWidth, int nHeight, int nOffsetX, int nOffsetY) void ImageModel::SaveImage(LPCTSTR lpFileName) { - SaveDIBToFile(hBms[currInd], lpFileName, hDrawingDC); + SaveDIBToFile(m_hBms[m_currInd], lpFileName, m_hDrawingDC); } BOOL ImageModel::IsImageSaved() const { - return imageSaved; + return g_imageSaved; } void ImageModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX, int nSkewDegY) @@ -176,17 +176,17 @@ void ImageModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSk INT newHeight = oldHeight * nStretchPercentY / 100; if (oldWidth != newWidth || oldHeight != newHeight) { - HBITMAP hbm0 = CopyDIBImage(hBms[currInd], newWidth, newHeight); + HBITMAP hbm0 = CopyDIBImage(m_hBms[m_currInd], newWidth, newHeight); PushImageForUndo(hbm0); } if (nSkewDegX) { - HBITMAP hbm1 = SkewDIB(hDrawingDC, hBms[currInd], nSkewDegX, FALSE); + HBITMAP hbm1 = SkewDIB(m_hDrawingDC, m_hBms[m_currInd], nSkewDegX, FALSE); PushImageForUndo(hbm1); } if (nSkewDegY) { - HBITMAP hbm2 = SkewDIB(hDrawingDC, hBms[currInd], nSkewDegY, TRUE); + HBITMAP hbm2 = SkewDIB(m_hDrawingDC, m_hBms[m_currInd], nSkewDegY, TRUE); PushImageForUndo(hbm2); } NotifyImageChanged(); @@ -194,31 +194,31 @@ void ImageModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSk int ImageModel::GetWidth() const { - return GetDIBWidth(hBms[currInd]); + return GetDIBWidth(m_hBms[m_currInd]); } int ImageModel::GetHeight() const { - return GetDIBHeight(hBms[currInd]); + return GetDIBHeight(m_hBms[m_currInd]); } void ImageModel::InvertColors() { RECT rect = {0, 0, GetWidth(), GetHeight()}; PushImageForUndo(); - InvertRect(hDrawingDC, &rect); + InvertRect(m_hDrawingDC, &rect); NotifyImageChanged(); } HDC ImageModel::GetDC() { - return hDrawingDC; + return m_hDrawingDC; } void ImageModel::FlipHorizontally() { PushImageForUndo(); - StretchBlt(hDrawingDC, GetWidth() - 1, 0, -GetWidth(), GetHeight(), GetDC(), 0, 0, + StretchBlt(m_hDrawingDC, GetWidth() - 1, 0, -GetWidth(), GetHeight(), GetDC(), 0, 0, GetWidth(), GetHeight(), SRCCOPY); NotifyImageChanged(); } @@ -226,7 +226,7 @@ void ImageModel::FlipHorizontally() void ImageModel::FlipVertically() { PushImageForUndo(); - StretchBlt(hDrawingDC, 0, GetHeight() - 1, GetWidth(), -GetHeight(), GetDC(), 0, 0, + StretchBlt(m_hDrawingDC, 0, GetHeight() - 1, GetWidth(), -GetHeight(), GetDC(), 0, 0, GetWidth(), GetHeight(), SRCCOPY); NotifyImageChanged(); } @@ -238,7 +238,7 @@ void ImageModel::RotateNTimes90Degrees(int iN) case 1: case 3: { - HBITMAP hbm = Rotate90DegreeBlt(hDrawingDC, GetWidth(), GetHeight(), iN == 1, FALSE); + HBITMAP hbm = Rotate90DegreeBlt(m_hDrawingDC, GetWidth(), GetHeight(), iN == 1, FALSE); if (hbm) PushImageForUndo(hbm); break; @@ -246,28 +246,25 @@ void ImageModel::RotateNTimes90Degrees(int iN) case 2: { PushImageForUndo(); - StretchBlt(hDrawingDC, GetWidth() - 1, GetHeight() - 1, -GetWidth(), -GetHeight(), - hDrawingDC, 0, 0, GetWidth(), GetHeight(), SRCCOPY); + StretchBlt(m_hDrawingDC, GetWidth() - 1, GetHeight() - 1, -GetWidth(), -GetHeight(), + m_hDrawingDC, 0, 0, GetWidth(), GetHeight(), SRCCOPY); break; } } NotifyImageChanged(); } -void ImageModel::DeleteSelection() -{ - if (!selectionModel.m_bShow) - return; - - selectionModel.TakeOff(); - selectionModel.m_bShow = FALSE; - selectionModel.ClearColor(); - selectionModel.ClearMask(); - NotifyImageChanged(); -} - void ImageModel::Bound(POINT& pt) const { pt.x = max(0, min(pt.x, GetWidth())); pt.y = max(0, min(pt.y, GetHeight())); } + +HBITMAP ImageModel::CopyBitmap() +{ + // NOTE: An app cannot select a bitmap into more than one device context at a time. + ::SelectObject(m_hDrawingDC, m_hbmOld); // De-select + HBITMAP ret = CopyDIBImage(m_hBms[m_currInd]); + m_hbmOld = ::SelectObject(m_hDrawingDC, m_hBms[m_currInd]); // Re-select + return ret; +} diff --git a/base/applications/mspaint/history.h b/base/applications/mspaint/history.h index 00e66950425..2b74f306248 100644 --- a/base/applications/mspaint/history.h +++ b/base/applications/mspaint/history.h @@ -18,8 +18,8 @@ public: virtual ~ImageModel(); HDC GetDC(); - BOOL CanUndo() const { return undoSteps > 0; } - BOOL CanRedo() const { return redoSteps > 0; } + BOOL CanUndo() const { return m_undoSteps > 0; } + BOOL CanRedo() const { return m_redoSteps > 0; } void PushImageForUndo(HBITMAP hbm = NULL); void ResetToPrevious(void); void Undo(BOOL bClearRedo = FALSE); @@ -31,18 +31,19 @@ public: void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX = 0, int nSkewDegY = 0); int GetWidth() const; int GetHeight() const; + HBITMAP CopyBitmap(); void InvertColors(); void FlipHorizontally(); void FlipVertically(); void RotateNTimes90Degrees(int iN); - void DeleteSelection(); void Bound(POINT& pt) const; void NotifyImageChanged(); protected: - HDC hDrawingDC; // The device context for this class - int currInd; // The current index - int undoSteps; // The undo-able count - int redoSteps; // The redo-able count - HBITMAP hBms[HISTORYSIZE]; // A rotation buffer of HBITMAPs + HDC m_hDrawingDC; // The device context for this class + int m_currInd; // The current index in m_hBms + int m_undoSteps; // The undo-able count + int m_redoSteps; // The redo-able count + HBITMAP m_hBms[HISTORYSIZE]; // A rotation buffer of HBITMAPs + HGDIOBJ m_hbmOld; }; diff --git a/base/applications/mspaint/main.cpp b/base/applications/mspaint/main.cpp index 8d328de1e84..b3b6728fd94 100644 --- a/base/applications/mspaint/main.cpp +++ b/base/applications/mspaint/main.cpp @@ -8,15 +8,13 @@ #include "precomp.h" -POINT start; -POINT last; - -BOOL askBeforeEnlarging = FALSE; // TODO: initialize from registry -HINSTANCE hProgInstance = NULL; -TCHAR filepathname[MAX_LONG_PATH] = { 0 }; -BOOL isAFile = FALSE; -BOOL imageSaved = FALSE; -BOOL showGrid = FALSE; +POINT g_ptStart, g_ptEnd; +BOOL g_askBeforeEnlarging = FALSE; // TODO: initialize from registry +HINSTANCE g_hinstExe = NULL; +TCHAR g_szFileName[MAX_LONG_PATH] = { 0 }; +BOOL g_isAFile = FALSE; +BOOL g_imageSaved = FALSE; +BOOL g_showGrid = FALSE; CMainWindow mainWindow; @@ -81,7 +79,7 @@ BOOL CMainWindow::GetOpenFileName(IN OUT LPTSTR pszFile, INT cchMaxFile) { // The "All Files" item text CString strAllPictureFiles; - strAllPictureFiles.LoadString(hProgInstance, IDS_ALLPICTUREFILES); + strAllPictureFiles.LoadString(g_hinstExe, IDS_ALLPICTUREFILES); // Get the import filter CSimpleArray<GUID> aguidFileTypesI; @@ -92,7 +90,7 @@ BOOL CMainWindow::GetOpenFileName(IN OUT LPTSTR pszFile, INT cchMaxFile) ZeroMemory(&ofn, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = m_hWnd; - ofn.hInstance = hProgInstance; + ofn.hInstance = g_hinstExe; ofn.lpstrFilter = strFilter; ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY; ofn.lpstrDefExt = L"png"; @@ -119,7 +117,7 @@ BOOL CMainWindow::GetSaveFileName(IN OUT LPTSTR pszFile, INT cchMaxFile) ZeroMemory(&sfn, sizeof(sfn)); sfn.lStructSize = sizeof(sfn); sfn.hwndOwner = m_hWnd; - sfn.hInstance = hProgInstance; + sfn.hInstance = g_hinstExe; sfn.lpstrFilter = strFilter; sfn.Flags = OFN_EXPLORER | OFN_OVERWRITEPROMPT | OFN_ENABLEHOOK; sfn.lpfnHook = OFNHookProc; @@ -170,10 +168,10 @@ BOOL CMainWindow::ChooseColor(IN OUT COLORREF *prgbColor) HWND CMainWindow::DoCreate() { - ::LoadString(hProgInstance, IDS_DEFAULTFILENAME, filepathname, _countof(filepathname)); + ::LoadString(g_hinstExe, IDS_DEFAULTFILENAME, g_szFileName, _countof(g_szFileName)); CString strTitle; - strTitle.Format(IDS_WINDOWTITLE, PathFindFileName(filepathname)); + strTitle.Format(IDS_WINDOWTITLE, PathFindFileName(g_szFileName)); RECT& rc = registrySettings.WindowPlacement.rcNormalPosition; return Create(HWND_DESKTOP, rc, strTitle, WS_OVERLAPPEDWINDOW, WS_EX_ACCEPTFILES); @@ -188,7 +186,7 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, INT nC _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - hProgInstance = hInstance; + g_hinstExe = hInstance; // Initialize common controls library INITCOMMONCONTROLSEX iccx; diff --git a/base/applications/mspaint/miniature.cpp b/base/applications/mspaint/miniature.cpp index b354de983b1..ab10814e5bf 100644 --- a/base/applications/mspaint/miniature.cpp +++ b/base/applications/mspaint/miniature.cpp @@ -38,7 +38,7 @@ HWND CMiniatureWindow::DoCreate(HWND hwndParent) }; TCHAR strTitle[100]; - ::LoadString(hProgInstance, IDS_MINIATURETITLE, strTitle, _countof(strTitle)); + ::LoadString(g_hinstExe, IDS_MINIATURETITLE, strTitle, _countof(strTitle)); DWORD style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME; return Create(hwndParent, rc, strTitle, style, WS_EX_PALETTEWINDOW); diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index 3c0923bec58..97359f0ce68 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -53,25 +53,25 @@ BOOL nearlyEqualPoints(INT x0, INT y0, INT x1, INT y1) void updateStartAndLast(LONG x, LONG y) { - start.x = last.x = x; - start.y = last.y = y; + g_ptStart.x = g_ptEnd.x = x; + g_ptStart.y = g_ptEnd.y = y; } void updateLast(LONG x, LONG y) { - last.x = x; - last.y = y; + g_ptEnd.x = x; + g_ptEnd.y = y; } void ToolBase::reset() { pointSP = 0; - start.x = start.y = last.x = last.y = -1; + g_ptStart.x = g_ptStart.y = g_ptEnd.x = g_ptEnd.y = -1; selectionModel.ResetPtStack(); if (selectionModel.m_bShow) { selectionModel.Landing(); - selectionModel.m_bShow = FALSE; + selectionModel.HideSelection(); } } @@ -99,15 +99,46 @@ void ToolBase::endEvent() m_hdc = NULL; } +void ToolBase::OnDrawSelectionOnCanvas(HDC hdc) +{ + if (!selectionModel.m_bShow) + return; + + RECT rcSelection = selectionModel.m_rc; + canvasWindow.ImageToCanvas(rcSelection); + + ::InflateRect(&rcSelection, GRIP_SIZE, GRIP_SIZE); + drawSizeBoxes(hdc, &rcSelection, TRUE); +} + /* TOOLS ********************************************************/ // TOOL_FREESEL struct FreeSelTool : ToolBase { - BOOL m_bLeftButton; + BOOL m_bLeftButton = FALSE; + + FreeSelTool() : ToolBase(TOOL_FREESEL) + { + } + + void OnDrawOverlayOnImage(HDC hdc) override + { + if (!selectionModel.IsLanded()) + { + selectionModel.DrawBackgroundPoly(hdc, selectionModel.m_rgbBack); + selectionModel.DrawSelection(hdc, paletteModel.GetBgColor(), toolsModel.IsBackgroundTransparent()); + } + + if (canvasWindow.m_drawing) + { + selectionModel.DrawFramePoly(hdc); + } + } - FreeSelTool() : ToolBase(TOOL_FREESEL), m_bLeftButton(FALSE) + void OnDrawOverlayOnCanvas(HDC hdc) override { + OnDrawSelectionOnCanvas(hdc); } void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override @@ -115,8 +146,7 @@ struct FreeSelTool : ToolBase selectionModel.Landing(); if (bLeftButton) { - imageModel.PushImageForUndo(); - selectionModel.m_bShow = FALSE; + selectionModel.HideSelection(); selectionModel.ResetPtStack(); POINT pt = { x, y }; selectionModel.PushToPtStack(pt); @@ -131,8 +161,7 @@ struct FreeSelTool : ToolBase POINT pt = { x, y }; imageModel.Bound(pt); selectionModel.PushToPtStack(pt); - imageModel.ResetToPrevious(); - selectionModel.DrawFramePoly(m_hdc); + imageModel.NotifyImageChanged(); } } @@ -140,16 +169,13 @@ struct FreeSelTool : ToolBase { if (bLeftButton) { - imageModel.ResetToPrevious(); if (selectionModel.PtStackSize() > 2) { selectionModel.BuildMaskFromPtStack(); - selectionModel.TakeOff(); selectionModel.m_bShow = TRUE; } else { - imageModel.Undo(TRUE); selectionModel.ResetPtStack(); selectionModel.m_bShow = FALSE; } @@ -159,15 +185,13 @@ struct FreeSelTool : ToolBase void OnFinishDraw() override { - m_bLeftButton = FALSE; + selectionModel.Landing(); ToolBase::OnFinishDraw(); } void OnCancelDraw() override { - if (m_bLeftButton) - imageModel.Undo(TRUE); - m_bLeftButton = FALSE; + selectionModel.HideSelection(); ToolBase::OnCancelDraw(); } }; @@ -175,10 +199,31 @@ struct FreeSelTool : ToolBase // TOOL_RECTSEL struct RectSelTool : ToolBase { - BOOL m_bLeftButton; + BOOL m_bLeftButton = FALSE; + + RectSelTool() : ToolBase(TOOL_RECTSEL) + { + } - RectSelTool() : ToolBase(TOOL_RECTSEL), m_bLeftButton(FALSE) + void OnDrawOverlayOnImage(HDC hdc) override { + if (!selectionModel.IsLanded()) + { + selectionModel.DrawBackgroundRect(hdc, selectionModel.m_rgbBack); + selectionModel.DrawSelection(hdc, paletteModel.GetBgColor(), toolsModel.IsBackgroundTransparent()); + } + + if (canvasWindow.m_drawing) + { + RECT rc = selectionModel.m_rc; + if (!::IsRectEmpty(&rc)) + RectSel(hdc, rc.left, rc.top, rc.right, rc.bottom); + } + } + + void OnDrawOverlayOnCanvas(HDC hdc) override + { + OnDrawSelectionOnCanvas(hdc); } void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override @@ -186,9 +231,7 @@ struct RectSelTool : ToolBase selectionModel.Landing(); if (bLeftButton) { - imageModel.PushImageForUndo(); - selectionModel.m_bShow = FALSE; - ::SetRectEmpty(&selectionModel.m_rc); + selectionModel.HideSelection(); } m_bLeftButton = bLeftButton; } @@ -197,11 +240,10 @@ struct RectSelTool : ToolBase { if (bLeftButton) { - imageModel.ResetToPrevious(); POINT pt = { x, y }; imageModel.Bound(pt); - selectionModel.SetRectFromPoints(start, pt); - RectSel(m_hdc, start.x, start.y, pt.x, pt.y); + selectionModel.SetRectFromPoints(g_ptStart, pt); + imageModel.NotifyImageChanged(); } } @@ -209,9 +251,9 @@ struct RectSelTool : ToolBase { if (bLeftButton) { - imageModel.ResetToPrevious(); - if (start.x == x && start.y == y) - imageModel.Undo(TRUE); + POINT pt = { x, y }; + imageModel.Bound(pt); + selectionModel.SetRectFromPoints(g_ptStart, pt); selectionModel.m_bShow = !selectionModel.m_rc.IsRectEmpty(); imageModel.NotifyImageChanged(); } @@ -219,22 +261,68 @@ struct RectSelTool : ToolBase void OnFinishDraw() override { - m_bLeftButton = FALSE; + selectionModel.Landing(); ToolBase::OnFinishDraw(); } void OnCancelDraw() override { - if (m_bLeftButton) - imageModel.Undo(TRUE); - m_bLeftButton = FALSE; + selectionModel.HideSelection(); ToolBase::OnCancelDraw(); } }; -struct GenericDrawTool : ToolBase +struct TwoPointDrawTool : ToolBase { - GenericDrawTool(TOOLTYPE type) : ToolBase(type) + BOOL m_bLeftButton = FALSE; + BOOL m_bDrawing = FALSE; + + TwoPointDrawTool(TOOLTYPE type) : ToolBase(type) + { + } + + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override + { + m_bLeftButton = bLeftButton; + m_bDrawing = TRUE; + g_ptStart.x = g_ptEnd.x = x; + g_ptStart.y = g_ptEnd.y = y; + imageModel.NotifyImageChanged(); + } + + void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override + { + g_ptEnd.x = x; + g_ptEnd.y = y; + imageModel.NotifyImageChanged(); + } + + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override + { + g_ptEnd.x = x; + g_ptEnd.y = y; + imageModel.PushImageForUndo(); + OnDrawOverlayOnImage(m_hdc); + m_bDrawing = FALSE; + imageModel.NotifyImageChanged(); + } + + void OnFinishDraw() override + { + m_bDrawing = FALSE; + ToolBase::OnFinishDraw(); + } + + void OnCancelDraw() override + { + m_bDrawing = FALSE; + ToolBase::OnCancelDraw(); + } +}; + +struct SmoothDrawTool : ToolBase +{ + SmoothDrawTool(TOOLTYPE type) : ToolBase(type) { } @@ -243,7 +331,9 @@ struct GenericDrawTool : ToolBase void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { imageModel.PushImageForUndo(); - draw(bLeftButton, x, y); + g_ptStart.x = g_ptEnd.x = x; + g_ptStart.y = g_ptEnd.y = y; + imageModel.NotifyImageChanged(); } void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override @@ -255,7 +345,12 @@ struct GenericDrawTool : ToolBase void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { draw(bLeftButton, x, y); - imageModel.NotifyImageChanged(); + OnFinishDraw(); + } + + void OnFinishDraw() override + { + ToolBase::OnFinishDraw(); } void OnCancelDraw() override @@ -267,18 +362,20 @@ struct GenericDrawTool : ToolBase }; // TOOL_RUBBER -struct RubberTool : GenericDrawTool +struct RubberTool : SmoothDrawTool { - RubberTool() : GenericDrawTool(TOOL_RUBBER) + RubberTool() : SmoothDrawTool(TOOL_RUBBER) { } void draw(BOOL bLeftButton, LONG x, LONG y) override { if (bLeftButton) - Erase(m_hdc, last.x, last.y, x, y, m_bg, toolsModel.GetRubberRadius()); + Erase(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, m_bg, toolsModel.GetRubberRadius()); else - Replace(m_hdc, last.x, last.y, x, y, m_fg, m_bg, toolsModel.GetRubberRadius()); + Replace(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, m_fg, m_bg, toolsModel.GetRubberRadius()); + g_ptEnd.x = x; + g_ptEnd.y = y; } }; @@ -354,38 +451,42 @@ struct ZoomTool : ToolBase }; // TOOL_PEN -struct PenTool : GenericDrawTool +struct PenTool : SmoothDrawTool { - PenTool() : GenericDrawTool(TOOL_PEN) + PenTool() : SmoothDrawTool(TOOL_PEN) { } void draw(BOOL bLeftButton, LONG x, LONG y) override { COLORREF rgb = bLeftButton ? m_fg : m_bg; - Line(m_hdc, last.x, last.y, x, y, rgb, 1); + Line(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, 1); ::SetPixelV(m_hdc, x, y, rgb); + g_ptEnd.x = x; + g_ptEnd.y = y; } }; // TOOL_BRUSH -struct BrushTool : GenericDrawTool +struct BrushTool : SmoothDrawTool { - BrushTool() : GenericDrawTool(TOOL_BRUSH) + BrushTool() : SmoothDrawTool(TOOL_BRUSH) { } void draw(BOOL bLeftButton, LONG x, LONG y) override { COLORREF rgb = bLeftButton ? m_fg : m_bg; - Brush(m_hdc, last.x, last.y, x, y, rgb, toolsModel.GetBrushStyle()); + Brush(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, toolsModel.GetBrushStyle()); + g_ptEnd.x = x; + g_ptEnd.y = y; } }; // TOOL_AIRBRUSH -struct AirBrushTool : GenericDrawTool +struct AirBrushTool : SmoothDrawTool { - AirBrushTool() : GenericDrawTool(TOOL_AIRBRUSH) + AirBrushTool() : SmoothDrawTool(TOOL_AIRBRUSH) { } @@ -403,13 +504,22 @@ struct TextTool : ToolBase { } + void OnDrawOverlayOnImage(HDC hdc) override + { + if (canvasWindow.m_drawing) + { + RECT rc = selectionModel.m_rc; + if (!::IsRectEmpty(&rc)) + RectSel(hdc, rc.left, rc.top, rc.right, rc.bottom); + } + } + void UpdatePoint(LONG x, LONG y) { - imageModel.ResetToPrevious(); POINT pt = { x, y }; imageModel.Bound(pt); - selectionModel.SetRectFromPoints(start, pt); - RectSel(m_hdc, start.x, start.y, pt.x, pt.y); + selectionModel.SetRectFromPoints(g_ptStart, pt); + imageModel.NotifyImageChanged(); } void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override @@ -417,7 +527,6 @@ struct TextTool : ToolBase if (!textEditWindow.IsWindow()) textEditWindow.Create(canvasWindow); - imageModel.PushImageForUndo(); UpdatePoint(x, y); } @@ -426,30 +535,40 @@ struct TextTool : ToolBase UpdatePoint(x, y); } - void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override + void draw(HDC hdc) { - imageModel.Undo(TRUE); + CString szText; + textEditWindow.GetWindowText(szText); + RECT rc; + textEditWindow.InvalidateEditRect(); + textEditWindow.GetEditRect(&rc); + ::InflateRect(&rc, -GRIP_SIZE / 2, -GRIP_SIZE / 2); + + // Draw the text + INT style = (toolsModel.IsBackgroundTransparent() ? 0 : 1); + imageModel.PushImageForUndo(); + Text(hdc, rc.left, rc.top, rc.right, rc.bottom, m_fg, m_bg, szText, + textEditWindow.GetFont(), style); + } + + void quit() + { + if (textEditWindow.IsWindow()) + textEditWindow.ShowWindow(SW_HIDE); + selectionModel.HideSelection(); + } + + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override + { POINT pt = { x, y }; imageModel.Bound(pt); - selectionModel.SetRectFromPoints(start, pt); + selectionModel.SetRectFromPoints(g_ptStart, pt); BOOL bTextBoxShown = ::IsWindowVisible(textEditWindow); if (bTextBoxShown && textEditWindow.GetWindowTextLength() > 0) { - CString szText; - textEditWindow.GetWindowText(szText); - - RECT rc; - textEditWindow.InvalidateEditRect(); - textEditWindow.GetEditRect(&rc); - ::InflateRect(&rc, -GRIP_SIZE / 2, -GRIP_SIZE / 2); - - // Draw the text - INT style = (toolsModel.IsBackgroundTransparent() ? 0 : 1); - imageModel.PushImageForUndo(); - Text(m_hdc, rc.left, rc.top, rc.right, rc.bottom, m_fg, m_bg, szText, - textEditWindow.GetFont(), style); + draw(m_hdc); if (selectionModel.m_rc.IsRectEmpty()) { @@ -494,201 +613,224 @@ struct TextTool : ToolBase void OnFinishDraw() override { - toolsModel.OnButtonDown(TRUE, -1, -1, TRUE); - toolsModel.OnButtonUp(TRUE, -1, -1); + draw(m_hdc); + quit(); ToolBase::OnFinishDraw(); } + + void OnCancelDraw() override + { + quit(); + ToolBase::OnCancelDraw(); + } }; // TOOL_LINE -struct LineTool : GenericDrawTool +struct LineTool : TwoPointDrawTool { - LineTool() : GenericDrawTool(TOOL_LINE) + LineTool() : TwoPointDrawTool(TOOL_LINE) { } - void draw(BOOL bLeftButton, LONG x, LONG y) override + void OnDrawOverlayOnImage(HDC hdc) override { - imageModel.ResetToPrevious(); + if (!m_bDrawing) + return; if (GetAsyncKeyState(VK_SHIFT) < 0) - roundTo8Directions(start.x, start.y, x, y); - COLORREF rgb = bLeftButton ? m_fg : m_bg; - Line(m_hdc, start.x, start.y, x, y, rgb, toolsModel.GetLineWidth()); + roundTo8Directions(g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y); + COLORREF rgb = m_bLeftButton ? m_fg : m_bg; + Line(hdc, g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y, rgb, toolsModel.GetLineWidth()); } }; // TOOL_BEZIER struct BezierTool : ToolBase { - BOOL m_bLeftButton; + BOOL m_bLeftButton = FALSE; + BOOL m_bDrawing = FALSE; - BezierTool() : ToolBase(TOOL_BEZIER), m_bLeftButton(FALSE) + BezierTool() : ToolBase(TOOL_BEZIER) { } - void draw(BOOL bLeftButton) + void OnDrawOverlayOnImage(HDC hdc) { - COLORREF rgb = (bLeftButton ? m_fg : m_bg); + if (!m_bDrawing) + return; + + COLORREF rgb = (m_bLeftButton ? m_fg : m_bg); switch (pointSP) { case 1: - Line(m_hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, rgb, + Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, rgb, toolsModel.GetLineWidth()); break; case 2: - Bezier(m_hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], rgb, toolsModel.GetLineWidth()); + Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], rgb, toolsModel.GetLineWidth()); break; case 3: - Bezier(m_hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], rgb, toolsModel.GetLineWidth()); + Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], rgb, toolsModel.GetLineWidth()); break; } - m_bLeftButton = bLeftButton; } void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { - pointStack[pointSP].x = x; - pointStack[pointSP].y = y; + m_bLeftButton = bLeftButton; - if (pointSP == 0) + if (!m_bDrawing) { - imageModel.PushImageForUndo(); - pointSP++; + m_bDrawing = TRUE; + pointStack[pointSP].x = pointStack[pointSP + 1].x = x; + pointStack[pointSP].y = pointStack[pointSP + 1].y = y; + ++pointSP; } + else + { + ++pointSP; + pointStack[pointSP].x = x; + pointStack[pointSP].y = y; + } + + imageModel.NotifyImageChanged(); } void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { - imageModel.ResetToPrevious(); pointStack[pointSP].x = x; pointStack[pointSP].y = y; - draw(bLeftButton); + imageModel.NotifyImageChanged(); } void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { - imageModel.ResetToPrevious(); - draw(bLeftButton); - pointSP++; - if (pointSP == 4) - pointSP = 0; + pointStack[pointSP].x = x; + pointStack[pointSP].y = y; + if (pointSP >= 3) + { + OnFinishDraw(); + return; + } imageModel.NotifyImageChanged(); } void OnCancelDraw() override { - OnButtonUp(FALSE, 0, 0); - imageModel.Undo(TRUE); + m_bDrawing = FALSE; ToolBase::OnCancelDraw(); } void OnFinishDraw() override { - if (pointSP) - { - imageModel.ResetToPrevious(); - --pointSP; - draw(m_bLeftButton); - } + imageModel.PushImageForUndo(); + OnDrawOverlayOnImage(m_hdc); + m_bDrawing = FALSE; ToolBase::OnFinishDraw(); } }; // TOOL_RECT -struct RectTool : GenericDrawTool +struct RectTool : TwoPointDrawTool { - RectTool() : GenericDrawTool(TOOL_RECT) + RectTool() : TwoPointDrawTool(TOOL_RECT) { } - void draw(BOOL bLeftButton, LONG x, LONG y) override + void OnDrawOverlayOnImage(HDC hdc) override { - imageModel.ResetToPrevious(); + if (!m_bDrawing) + return; if (GetAsyncKeyState(VK_SHIFT) < 0) - regularize(start.x, start.y, x, y); - if (bLeftButton) - Rect(m_hdc, start.x, start.y, x, y, m_fg, m_bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); + regularize(g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y); + if (m_bLeftButton) + Rect(hdc, g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y, m_fg, m_bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); else - Rect(m_hdc, start.x, start.y, x, y, m_bg, m_fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); + Rect(hdc, g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y, m_bg, m_fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); } }; // TOOL_SHAPE struct ShapeTool : ToolBase { - BOOL m_bLeftButton; + BOOL m_bLeftButton = FALSE; + BOOL m_bClosed = FALSE; - ShapeTool() : ToolBase(TOOL_SHAPE), m_bLeftButton(FALSE) + ShapeTool() : ToolBase(TOOL_SHAPE) { } - void draw(BOOL bLeftButton, LONG x, LONG y, BOOL bClosed = FALSE) + void OnDrawOverlayOnImage(HDC hdc) { - if (pointSP + 1 >= 2) - { - if (bLeftButton) - Poly(m_hdc, pointStack, pointSP + 1, m_fg, m_bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle(), bClosed, FALSE); - else - Poly(m_hdc, pointStack, pointSP + 1, m_bg, m_fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle(), bClosed, FALSE); - } - m_bLeftButton = bLeftButton; + if (pointSP <= 0) + return; + + if (m_bLeftButton) + Poly(hdc, pointStack, pointSP + 1, m_fg, m_bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle(), m_bClosed, FALSE); + else + Poly(hdc, pointStack, pointSP + 1, m_bg, m_fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle(), m_bClosed, FALSE); } void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { + m_bLeftButton = bLeftButton; + m_bClosed = FALSE; + pointStack[pointSP].x = x; pointStack[pointSP].y = y; - if (pointSP == 0 && !bDoubleClick) + if (pointSP && bDoubleClick) { - imageModel.PushImageForUndo(); - draw(bLeftButton, x, y); - pointSP++; + OnFinishDraw(); + return; } - else + + if (pointSP == 0) { - draw(bLeftButton, x, y, bDoubleClick); - imageModel.NotifyImageChanged(); + pointSP++; + pointStack[pointSP].x = x; + pointStack[pointSP].y = y; } + + imageModel.NotifyImageChanged(); } void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { - imageModel.ResetToPrevious(); pointStack[pointSP].x = x; pointStack[pointSP].y = y; + if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, x, y); - draw(bLeftButton, x, y, FALSE); + + imageModel.NotifyImageChanged(); } void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { - imageModel.ResetToPrevious(); if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, x, y); + m_bClosed = FALSE; if (nearlyEqualPoints(x, y, pointStack[0].x, pointStack[0].y)) { - pointSP--; - draw(bLeftButton, x, y, TRUE); - pointSP = 0; + OnFinishDraw(); + return; } else { pointSP++; pointStack[pointSP].x = x; pointStack[pointSP].y = y; - draw(bLeftButton, x, y, FALSE); } if (pointSP == _countof(pointStack)) pointSP--; + + imageModel.NotifyImageChanged(); } void OnCancelDraw() override { - imageModel.Undo(TRUE); ToolBase::OnCancelDraw(); } @@ -696,49 +838,57 @@ struct ShapeTool : ToolBase { if (pointSP) { - imageModel.ResetToPrevious(); --pointSP; - draw(m_bLeftButton, -1, -1, TRUE); + m_bClosed = TRUE; + + imageModel.PushImageForUndo(); + OnDrawOverlayOnImage(m_hdc); } + + m_bClosed = FALSE; + pointSP = 0; + ToolBase::OnFinishDraw(); } }; // TOOL_ELLIPSE -struct EllipseTool : GenericDrawTool +struct EllipseTool : TwoPointDrawTool { - EllipseTool() : GenericDrawTool(TOOL_ELLIPSE) + EllipseTool() : TwoPointDrawTool(TOOL_ELLIPSE) { } - void draw(BOOL bLeftButton, LONG x, LONG y) override + void OnDrawOverlayOnImage(HDC hdc) override { - imageModel.ResetToPrevious(); + if (!m_bDrawing) + return; if (GetAsyncKeyState(VK_SHIFT) < 0) - regularize(start.x, start.y, x, y); - if (bLeftButton) - Ellp(m_hdc, start.x, start.y, x, y, m_fg, m_bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); + regularize(g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y); + if (m_bLeftButton) + Ellp(hdc, g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y, m_fg, m_bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); else - Ellp(m_hdc, start.x, start.y, x, y, m_bg, m_fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); + Ellp(hdc, g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y, m_bg, m_fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); } }; // TOOL_RRECT -struct RRectTool : GenericDrawTool +struct RRectTool : TwoPointDrawTool { - RRectTool() : GenericDrawTool(TOOL_RRECT) + RRectTool() : TwoPointDrawTool(TOOL_RRECT) { } - void draw(BOOL bLeftButton, LONG x, LONG y) override + void OnDrawOverlayOnImage(HDC hdc) override { - imageModel.ResetToPrevious(); + if (!m_bDrawing) + return; if (GetAsyncKeyState(VK_SHIFT) < 0) - regularize(start.x, start.y, x, y); - if (bLeftButton) - RRect(m_hdc, start.x, start.y, x, y, m_fg, m_bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); + regularize(g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y); + if (m_bLeftButton) + RRect(hdc, g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y, m_fg, m_bg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); else - RRect(m_hdc, start.x, start.y, x, y, m_bg, m_fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); + RRect(hdc, g_ptStart.x, g_ptStart.y, g_ptEnd.x, g_ptEnd.y, m_bg, m_fg, toolsModel.GetLineWidth(), toolsModel.GetShapeStyle()); } }; diff --git a/base/applications/mspaint/palette.cpp b/base/applications/mspaint/palette.cpp index f268a982f49..39346fd5e8a 100644 --- a/base/applications/mspaint/palette.cpp +++ b/base/applications/mspaint/palette.cpp @@ -181,13 +181,7 @@ LRESULT CPaletteWindow::OnRButtonDblClk(UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT CPaletteWindow::OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - InvalidateRect(NULL, FALSE); - return 0; -} - -LRESULT CPaletteWindow::OnPaletteModelPaletteChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - InvalidateRect(NULL, FALSE); + Invalidate(FALSE); return 0; } diff --git a/base/applications/mspaint/palette.h b/base/applications/mspaint/palette.h index fe23edda53f..63f3c4caf2b 100644 --- a/base/applications/mspaint/palette.h +++ b/base/applications/mspaint/palette.h @@ -27,7 +27,6 @@ public: MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp) MESSAGE_HANDLER(WM_PALETTEMODELCOLORCHANGED, OnPaletteModelColorChanged) - MESSAGE_HANDLER(WM_PALETTEMODELPALETTECHANGED, OnPaletteModelPaletteChanged) END_MSG_MAP() CPaletteWindow(); @@ -45,7 +44,6 @@ protected: LRESULT OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnPaletteModelPaletteChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); protected: INT DoHitTest(INT xPos, INT yPos) const; diff --git a/base/applications/mspaint/palettemodel.cpp b/base/applications/mspaint/palettemodel.cpp index 8d18449fbee..a07825e4762 100644 --- a/base/applications/mspaint/palettemodel.cpp +++ b/base/applications/mspaint/palettemodel.cpp @@ -106,5 +106,5 @@ void PaletteModel::NotifyColorChanged() void PaletteModel::NotifyPaletteChanged() { if (paletteWindow.IsWindow()) - paletteWindow.SendMessage(WM_PALETTEMODELPALETTECHANGED); + paletteWindow.Invalidate(FALSE); } diff --git a/base/applications/mspaint/selectionmodel.cpp b/base/applications/mspaint/selectionmodel.cpp index d70f324d805..9497cef153f 100644 --- a/base/applications/mspaint/selectionmodel.cpp +++ b/base/applications/mspaint/selectionmodel.cpp @@ -21,6 +21,7 @@ SelectionModel::SelectionModel() , m_bShow(FALSE) { ::SetRectEmpty(&m_rc); + ::SetRectEmpty(&m_rcOld); m_ptHit.x = m_ptHit.y = -1; } @@ -57,25 +58,13 @@ void SelectionModel::PushToPtStack(POINT pt) #undef GROW_COUNT } -void SelectionModel::ShiftPtStack(BOOL bPlus) +void SelectionModel::ShiftPtStack(INT dx, INT dy) { - if (bPlus) - { - for (INT i = 0; i < m_iPtSP; ++i) - { - POINT& pt = m_ptStack[i]; - pt.x += m_rc.left; - pt.y += m_rc.top; - } - } - else + for (INT i = 0; i < m_iPtSP; ++i) { - for (INT i = 0; i < m_iPtSP; ++i) - { - POINT& pt = m_ptStack[i]; - pt.x -= m_rc.left; - pt.y -= m_rc.top; - } + POINT& pt = m_ptStack[i]; + pt.x += dx; + pt.y += dy; } } @@ -93,16 +82,16 @@ void SelectionModel::BuildMaskFromPtStack() rc.right += 1; rc.bottom += 1; - m_rc = rc; - - ShiftPtStack(FALSE); + m_rc = m_rcOld = rc; ClearMask(); + ShiftPtStack(-m_rcOld.left, -m_rcOld.top); + HDC hdcMem = ::CreateCompatibleDC(NULL); m_hbmMask = ::CreateBitmap(rc.Width(), rc.Height(), 1, 1, NULL); HGDIOBJ hbmOld = ::SelectObject(hdcMem, m_hbmMask); - FillRect(hdcMem, &rc, (HBRUSH)::GetStockObject(BLACK_BRUSH)); + ::FillRect(hdcMem, &rc, (HBRUSH)::GetStockObject(BLACK_BRUSH)); HGDIOBJ hPenOld = ::SelectObject(hdcMem, GetStockObject(NULL_PEN)); HGDIOBJ hbrOld = ::SelectObject(hdcMem, GetStockObject(WHITE_BRUSH)); ::Polygon(hdcMem, m_ptStack, m_iPtSP); @@ -110,34 +99,39 @@ void SelectionModel::BuildMaskFromPtStack() ::SelectObject(hdcMem, hPenOld); ::SelectObject(hdcMem, hbmOld); ::DeleteDC(hdcMem); + + ShiftPtStack(+m_rcOld.left, +m_rcOld.top); } void SelectionModel::DrawBackgroundPoly(HDC hDCImage, COLORREF crBg) { - ShiftPtStack(TRUE); + if (::IsRectEmpty(&m_rcOld)) + return; HGDIOBJ hPenOld = ::SelectObject(hDCImage, ::GetStockObject(NULL_PEN)); HGDIOBJ hbrOld = ::SelectObject(hDCImage, ::CreateSolidBrush(crBg)); ::Polygon(hDCImage, m_ptStack, m_iPtSP); ::DeleteObject(::SelectObject(hDCImage, hbrOld)); ::SelectObject(hDCImage, hPenOld); - - ShiftPtStack(FALSE); } void SelectionModel::DrawBackgroundRect(HDC hDCImage, COLORREF crBg) { - Rect(hDCImage, m_rc.left, m_rc.top, m_rc.right, m_rc.bottom, crBg, crBg, 0, 1); + if (::IsRectEmpty(&m_rcOld)) + return; + + Rect(hDCImage, m_rcOld.left, m_rcOld.top, m_rcOld.right, m_rcOld.bottom, crBg, crBg, 0, 1); } -void SelectionModel::DrawSelection(HDC hDCImage, LPCRECT prc, COLORREF crBg, BOOL bBgTransparent) +void SelectionModel::DrawSelection(HDC hDCImage, COLORREF crBg, BOOL bBgTransparent) { - CRect rc = *prc; + CRect rc = m_rc; if (::IsRectEmpty(&rc)) return; BITMAP bm; - GetObject(m_hbmColor, sizeof(BITMAP), &bm); + if (!GetObject(m_hbmColor, sizeof(BITMAP), &bm)) + return; COLORREF keyColor = (bBgTransparent ? crBg : CLR_INVALID); @@ -161,23 +155,23 @@ void SelectionModel::GetSelectionContents(HDC hDCImage) ::DeleteDC(hMemDC); } +BOOL SelectionModel::IsLanded() const +{ + return !m_hbmColor; +} + BOOL SelectionModel::TakeOff() { - if (m_hbmColor || ::IsRectEmpty(&m_rc)) + if (!IsLanded() || ::IsRectEmpty(&m_rc)) return FALSE; - HDC hDCImage = imageModel.GetDC(); - GetSelectionContents(hDCImage); + m_rgbBack = paletteModel.GetBgColor(); + GetSelectionContents(imageModel.GetDC()); - if (toolsModel.GetActiveTool() == TOOL_FREESEL) - { - DrawBackgroundPoly(hDCImage, paletteModel.GetBgColor()); - } - else - { + if (toolsModel.GetActiveTool() == TOOL_RECTSEL) ClearMask(); - DrawBackgroundRect(hDCImage, paletteModel.GetBgColor()); - } + + m_rcOld = m_rc; imageModel.NotifyImageChanged(); return TRUE; @@ -185,16 +179,23 @@ BOOL SelectionModel::TakeOff() void SelectionModel::Landing() { - if (!m_hbmColor) + if (IsLanded() && !m_bShow) + { + imageModel.NotifyImageChanged(); return; + } - DrawSelection(imageModel.GetDC(), &m_rc, paletteModel.GetBgColor(), toolsModel.IsBackgroundTransparent()); + m_bShow = FALSE; - ::SetRectEmpty(&m_rc); - ClearMask(); - ClearColor(); + if (!::EqualRect(m_rc, m_rcOld) && !::IsRectEmpty(m_rc) && !::IsRectEmpty(m_rcOld)) + { + imageModel.PushImageForUndo(); - imageModel.PushImageForUndo(); + canvasWindow.m_drawing = FALSE; + toolsModel.OnDrawOverlayOnImage(imageModel.GetDC()); + } + + HideSelection(); } void SelectionModel::InsertFromHBITMAP(HBITMAP hBm, INT x, INT y) @@ -349,11 +350,11 @@ void SelectionModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int imageModel.NotifyImageChanged(); } -HBITMAP SelectionModel::GetBitmap() +HBITMAP SelectionModel::CopyBitmap() { if (m_hbmColor == NULL) GetSelectionContents(imageModel.GetDC()); - return m_hbmColor; + return CopyDIBImage(m_hbmColor); } int SelectionModel::PtStackSize() const @@ -435,15 +436,29 @@ void SelectionModel::ClearColor() } } -void SelectionModel::CancelSelection() +void SelectionModel::HideSelection() +{ + m_bShow = FALSE; + ClearColor(); + ClearMask(); + ::SetRectEmpty(&m_rc); + ::SetRectEmpty(&m_rcOld); + + imageModel.NotifyImageChanged(); +} + +void SelectionModel::DeleteSelection() { if (!m_bShow) return; + TakeOff(); + imageModel.PushImageForUndo(); - if (m_bShow) - imageModel.Undo(TRUE); + if (toolsModel.GetActiveTool() == TOOL_FREESEL) + DrawBackgroundPoly(imageModel.GetDC(), paletteModel.GetBgColor()); + else + DrawBackgroundRect(imageModel.GetDC(), paletteModel.GetBgColor()); - m_bShow = FALSE; - imageModel.NotifyImageChanged(); + HideSelection(); } diff --git a/base/applications/mspaint/selectionmodel.h b/base/applications/mspaint/selectionmodel.h index 01a21c7bc62..f68a740d18f 100644 --- a/base/applications/mspaint/selectionmodel.h +++ b/base/applications/mspaint/selectionmodel.h @@ -18,9 +18,11 @@ private: int m_iPtSP; public: + COLORREF m_rgbBack = RGB(255, 255, 255); BOOL m_bShow; CRect m_rc; // in image pixel coordinates POINT m_ptHit; // in image pixel coordinates + CRect m_rcOld; // in image pixel coordinates SelectionModel(); ~SelectionModel(); @@ -33,13 +35,16 @@ public: BOOL TakeOff(); void Landing(); + BOOL IsLanded() const; + void HideSelection(); + void DeleteSelection(); - HBITMAP GetBitmap(); + HBITMAP CopyBitmap(); void GetSelectionContents(HDC hDCImage); void DrawFramePoly(HDC hDCImage); void DrawBackgroundPoly(HDC hDCImage, COLORREF crBg); void DrawBackgroundRect(HDC hDCImage, COLORREF crBg); - void DrawSelection(HDC hDCImage, LPCRECT prc, COLORREF crBg = 0, BOOL bBgTransparent = FALSE); + void DrawSelection(HDC hDCImage, COLORREF crBg = 0, BOOL bBgTransparent = FALSE); void InsertFromHBITMAP(HBITMAP hBm, INT x = 0, INT y = 0); // operation @@ -48,7 +53,6 @@ public: void RotateNTimes90Degrees(int iN); void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX, int nSkewDegY); - void CancelSelection(); void Dragging(CANVAS_HITTEST hit, POINT pt); void ClearMask(); void ClearColor(); @@ -57,5 +61,5 @@ private: SelectionModel(const SelectionModel&); SelectionModel& operator=(const SelectionModel&); - void ShiftPtStack(BOOL bPlus); + void ShiftPtStack(INT dx, INT dy); }; diff --git a/base/applications/mspaint/textedit.cpp b/base/applications/mspaint/textedit.cpp index 3b679c61272..bf0ab2ce4fb 100644 --- a/base/applications/mspaint/textedit.cpp +++ b/base/applications/mspaint/textedit.cpp @@ -61,7 +61,7 @@ void CTextEditWindow::FixEditPos(LPCTSTR pszOldText) SelectObject(hDC, m_hFontZoomed); TEXTMETRIC tm; GetTextMetrics(hDC, &tm); - szText += TEXT("x"); // This is a trick to enable the last newlines + szText += TEXT("x"); // This is a trick to enable the g_ptEnd newlines const UINT uFormat = DT_LEFT | DT_TOP | DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_EXPANDTABS | DT_WORDBREAK; DrawText(hDC, szText, -1, &rcText, uFormat | DT_CALCRECT); @@ -235,7 +235,7 @@ HWND CTextEditWindow::Create(HWND hwndParent) const DWORD style = ES_LEFT | ES_MULTILINE | ES_WANTRETURN | ES_AUTOVSCROLL | WS_CHILD | WS_THICKFRAME; HWND hwnd = ::CreateWindowEx(0, WC_EDIT, NULL, style, 0, 0, 0, 0, - hwndParent, NULL, hProgInstance, NULL); + hwndParent, NULL, g_hinstExe, NULL); if (hwnd) { #undef SubclassWindow // Don't use this macro diff --git a/base/applications/mspaint/toolbox.cpp b/base/applications/mspaint/toolbox.cpp index 7e772a5bb6c..236ab9a4ba5 100644 --- a/base/applications/mspaint/toolbox.cpp +++ b/base/applications/mspaint/toolbox.cpp @@ -13,6 +13,20 @@ CToolBox toolBoxContainer; /* FUNCTIONS ********************************************************/ +LRESULT CALLBACK +CPaintToolBar::ToolBarWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + WNDPROC oldWndProc = (WNDPROC)::GetWindowLongPtr(hwnd, GWLP_USERDATA); + if (uMsg == WM_LBUTTONUP) + { + // We have to detect clicking on toolbar even if no change of pressed button + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + INT id = (INT)SendMessage(hwnd, TB_HITTEST, 0, (LPARAM)&pt); + ::PostMessage(::GetParent(hwnd), WM_TOOLBARHIT, id, 0); + } + return ::CallWindowProc(oldWndProc, hwnd, uMsg, wParam, lParam); +} + BOOL CPaintToolBar::DoCreate(HWND hwndParent) { // NOTE: The horizontal line above the toolbar is hidden by CCS_NODIVIDER style. @@ -25,7 +39,7 @@ BOOL CPaintToolBar::DoCreate(HWND hwndParent) HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0); SendMessage(TB_SETIMAGELIST, 0, (LPARAM)hImageList); - HBITMAP hbmIcons = (HBITMAP)::LoadImage(hProgInstance, MAKEINTRESOURCE(IDB_TOOLBARICONS), + HBITMAP hbmIcons = (HBITMAP)::LoadImage(g_hinstExe, MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0); ImageList_AddMasked(hImageList, hbmIcons, RGB(255, 0, 255)); ::DeleteObject(hbmIcons); @@ -38,7 +52,7 @@ BOOL CPaintToolBar::DoCreate(HWND hwndParent) tbbutton.fsStyle = TBSTYLE_CHECKGROUP; for (INT i = 0; i < NUM_TOOLS; i++) { - ::LoadString(hProgInstance, IDS_TOOLTIP1 + i, szToolTip, _countof(szToolTip)); + ::LoadString(g_hinstExe, IDS_TOOLTIP1 + i, szToolTip, _countof(szToolTip)); tbbutton.iString = (INT_PTR)szToolTip; tbbutton.fsState = TBSTATE_ENABLED | ((i % 2 == 1) ? TBSTATE_WRAP : 0); tbbutton.idCommand = ID_FREESEL + i; @@ -49,6 +63,8 @@ BOOL CPaintToolBar::DoCreate(HWND hwndParent) SendMessage(TB_CHECKBUTTON, ID_PEN, MAKELPARAM(TRUE, 0)); SendMessage(TB_SETMAXTEXTROWS, 0, 0); SendMessage(TB_SETBUTTONSIZE, 0, MAKELPARAM(CXY_TB_BUTTON, CXY_TB_BUTTON)); + + SetWindowLongPtr(GWLP_USERDATA, SetWindowLongPtr(GWLP_WNDPROC, (LONG_PTR)ToolBarWndProc)); return TRUE; } @@ -114,7 +130,7 @@ LRESULT CToolBox::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHand LRESULT CToolBox::OnToolsModelToolChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - selectionModel.m_bShow = FALSE; + selectionModel.HideSelection(); toolsModel.resetTool(); // resets the point-buffer of the polygon and bezier functions // Check the toolbar button @@ -168,3 +184,10 @@ LRESULT CToolBox::OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHa ::ReleaseCapture(); return 0; } + +LRESULT CToolBox::OnToolBarHit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + // See also: CPaintToolBar::ToolBarWndProc + selectionModel.Landing(); + return 0; +} diff --git a/base/applications/mspaint/toolbox.h b/base/applications/mspaint/toolbox.h index bd0a635636a..33cfe5eb702 100644 --- a/base/applications/mspaint/toolbox.h +++ b/base/applications/mspaint/toolbox.h @@ -15,10 +15,13 @@ #define CX_TOOLBAR (TOOLBAR_COLUMNS * CXY_TB_BUTTON) #define CY_TOOLBAR (TOOLBAR_ROWS * CXY_TB_BUTTON) +#define WM_TOOLBARHIT (WM_APP + 1) + class CPaintToolBar : public CWindow { public: BOOL DoCreate(HWND hwndParent); + static LRESULT CALLBACK ToolBarWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); }; class CToolBox : public CWindowImpl<CToolBox> @@ -34,6 +37,7 @@ public: MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp) MESSAGE_HANDLER(WM_TOOLSMODELTOOLCHANGED, OnToolsModelToolChanged) + MESSAGE_HANDLER(WM_TOOLBARHIT, OnToolBarHit) END_MSG_MAP() BOOL DoCreate(HWND hwndParent); @@ -48,4 +52,5 @@ private: LRESULT OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnToolsModelToolChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnToolBarHit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); }; diff --git a/base/applications/mspaint/toolsettings.cpp b/base/applications/mspaint/toolsettings.cpp index 323956ba7ca..97008c07563 100644 --- a/base/applications/mspaint/toolsettings.cpp +++ b/base/applications/mspaint/toolsettings.cpp @@ -200,11 +200,14 @@ VOID CToolSettingsWindow::drawAirBrush(HDC hdc, LPCRECT prc) if (bHigh) { ::FillRect(hdc, &rc, ::GetSysColorBrush(COLOR_HIGHLIGHT)); - Airbrush(hdc, x, y, ::GetSysColor(COLOR_HIGHLIGHTTEXT), s_AirRadius[i]); + + for (int k = 0; k < 3; ++k) + Airbrush(hdc, x, y, ::GetSysColor(COLOR_HIGHLIGHTTEXT), s_AirRadius[i]); } else { - Airbrush(hdc, x, y, ::GetSysColor(COLOR_WINDOWTEXT), s_AirRadius[i]); + for (int k = 0; k < 3; ++k) + Airbrush(hdc, x, y, ::GetSysColor(COLOR_WINDOWTEXT), s_AirRadius[i]); } } } @@ -258,9 +261,9 @@ VOID CToolSettingsWindow::drawBox(HDC hdc, LPCRECT prc) LRESULT CToolSettingsWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, WINBOOL& bHandled) { /* preloading the draw transparent/nontransparent icons for later use */ - m_hNontranspIcon = (HICON)LoadImage(hProgInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), + m_hNontranspIcon = (HICON)LoadImage(g_hinstExe, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, CX_TRANS_ICON, CY_TRANS_ICON, LR_DEFAULTCOLOR); - m_hTranspIcon = (HICON)LoadImage(hProgInstance, MAKEINTRESOURCE(IDI_TRANSPARENT), + m_hTranspIcon = (HICON)LoadImage(g_hinstExe, MAKEINTRESOURCE(IDI_TRANSPARENT), IMAGE_ICON, CX_TRANS_ICON, CY_TRANS_ICON, LR_DEFAULTCOLOR); RECT trackbarZoomPos = {1, 1, 1 + 40, 1 + 64}; diff --git a/base/applications/mspaint/toolsmodel.cpp b/base/applications/mspaint/toolsmodel.cpp index 822547048f7..76a123513b5 100644 --- a/base/applications/mspaint/toolsmodel.cpp +++ b/base/applications/mspaint/toolsmodel.cpp @@ -28,7 +28,7 @@ ToolsModel::ToolsModel() ToolsModel::~ToolsModel() { - for (size_t i = 0; i < TOOL_MAX + 1; ++i) + for (size_t i = 0; i < _countof(m_tools); ++i) delete m_tools[i]; } @@ -87,9 +87,6 @@ void ToolsModel::SetActiveTool(TOOLTYPE nActiveTool) { OnFinishDraw(); - if (m_activeTool == nActiveTool) - return; - switch (m_activeTool) { case TOOL_FREESEL: @@ -225,6 +222,16 @@ void ToolsModel::OnFinishDraw() m_pToolObject->endEvent(); } +void ToolsModel::OnDrawOverlayOnImage(HDC hdc) +{ + m_pToolObject->OnDrawOverlayOnImage(hdc); +} + +void ToolsModel::OnDrawOverlayOnCanvas(HDC hdc) +{ + m_pToolObject->OnDrawOverlayOnCanvas(hdc); +} + void ToolsModel::resetTool() { m_pToolObject->reset(); diff --git a/base/applications/mspaint/toolsmodel.h b/base/applications/mspaint/toolsmodel.h index da0e06cfa2f..b8c819590a7 100644 --- a/base/applications/mspaint/toolsmodel.h +++ b/base/applications/mspaint/toolsmodel.h @@ -39,34 +39,27 @@ struct ToolBase static INT pointSP; static POINT pointStack[256]; - ToolBase(TOOLTYPE tool) : m_tool(tool), m_hdc(NULL) - { - } + ToolBase(TOOLTYPE tool) : m_tool(tool), m_hdc(NULL) { } + virtual ~ToolBase() { } - virtual ~ToolBase() - { - } - - virtual void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) - { - } - - virtual void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) - { - } - - virtual void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) - { - } + virtual void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) { } + virtual void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) { } + virtual void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) { } virtual void OnCancelDraw(); virtual void OnFinishDraw(); + virtual void OnDrawOverlayOnImage(HDC hdc) { } + virtual void OnDrawOverlayOnCanvas(HDC hdc) { } + void beginEvent(); void endEvent(); void reset(); static ToolBase* createToolObject(TOOLTYPE type); + +protected: + void OnDrawSelectionOnCanvas(HDC hdc); }; class ToolsModel @@ -112,6 +105,8 @@ public: void OnButtonUp(BOOL bLeftButton, LONG x, LONG y); void OnCancelDraw(); void OnFinishDraw(); + void OnDrawOverlayOnImage(HDC hdc); + void OnDrawOverlayOnCanvas(HDC hdc); void resetTool(); void selectAll(); diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index c3cc041ebe8..29bc32b9327 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -17,7 +17,7 @@ typedef HWND (WINAPI *FN_HtmlHelpW)(HWND, LPCWSTR, UINT, DWORD_PTR); static HINSTANCE s_hHHCTRL_OCX = NULL; // HtmlHelpW needs "hhctrl.ocx" static FN_HtmlHelpW s_pHtmlHelpW = NULL; -HWND hStatusBar = NULL; +HWND g_hStatusBar = NULL; /* FUNCTIONS ********************************************************/ @@ -79,9 +79,9 @@ void CMainWindow::alignChildrenToMainWindow() GetClientRect(&clientRect); RECT rcSpace = clientRect; - if (::IsWindowVisible(hStatusBar)) + if (::IsWindowVisible(g_hStatusBar)) { - ::GetWindowRect(hStatusBar, &rc); + ::GetWindowRect(g_hStatusBar, &rc); rcSpace.bottom -= rc.bottom - rc.top; } @@ -142,18 +142,18 @@ void CMainWindow::saveImage(BOOL overwrite) { canvasWindow.finishDrawing(); - if (isAFile && overwrite) + if (g_isAFile && overwrite) { - imageModel.SaveImage(filepathname); + imageModel.SaveImage(g_szFileName); } - else if (GetSaveFileName(filepathname, _countof(filepathname))) + else if (GetSaveFileName(g_szFileName, _countof(g_szFileName))) { - imageModel.SaveImage(filepathname); + imageModel.SaveImage(g_szFileName); CString strTitle; - strTitle.Format(IDS_WINDOWTITLE, PathFindFileName(filepathname)); + strTitle.Format(IDS_WINDOWTITLE, PathFindFileName(g_szFileName)); SetWindowText(strTitle); - isAFile = TRUE; + g_isAFile = TRUE; } } @@ -168,13 +168,13 @@ void CMainWindow::InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window) { BOOL shouldEnlarge = TRUE; - if (askBeforeEnlarging) + if (g_askBeforeEnlarging) { TCHAR programname[20]; TCHAR shouldEnlargePromptText[100]; - LoadString(hProgInstance, IDS_PROGRAMNAME, programname, _countof(programname)); - LoadString(hProgInstance, IDS_ENLARGEPROMPTTEXT, shouldEnlargePromptText, _countof(shouldEnlargePromptText)); + LoadString(g_hinstExe, IDS_PROGRAMNAME, programname, _countof(programname)); + LoadString(g_hinstExe, IDS_ENLARGEPROMPTTEXT, shouldEnlargePromptText, _countof(shouldEnlargePromptText)); switch (MessageBox(shouldEnlargePromptText, programname, MB_YESNOCANCEL | MB_ICONQUESTION)) { @@ -276,14 +276,14 @@ LRESULT CMainWindow::OnDropFiles(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& LRESULT CMainWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { // Loading and setting the window menu from resource - m_hMenu = ::LoadMenu(hProgInstance, MAKEINTRESOURCE(ID_MENU)); + m_hMenu = ::LoadMenu(g_hinstExe, MAKEINTRESOURCE(ID_MENU)); SetMenu(m_hMenu); // Create the status bar DWORD style = SBARS_SIZEGRIP | WS_CHILD | (registrySettings.ShowStatusBar ? WS_VISIBLE : 0); - hStatusBar = ::CreateWindowEx(0, STATUSCLASSNAME, NULL, style, 0, 0, 0, 0, m_hWnd, - NULL, hProgInstance, NULL); - ::SendMessage(hStatusBar, SB_SETMINHEIGHT, 21, 0); + g_hStatusBar = ::CreateWindowEx(0, STATUSCLASSNAME, NULL, style, 0, 0, 0, 0, m_hWnd, + NULL, g_hinstExe, NULL); + ::SendMessage(g_hStatusBar, SB_SETMINHEIGHT, 21, 0); // Create the tool box toolBoxContainer.DoCreate(m_hWnd); @@ -305,8 +305,8 @@ LRESULT CMainWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHa } // Set icon - SendMessage(WM_SETICON, ICON_BIG, (LPARAM) LoadIcon(hProgInstance, MAKEINTRESOURCE(IDI_APPICON))); - SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) LoadIcon(hProgInstance, MAKEINTRESOURCE(IDI_APPICON))); + SendMessage(WM_SETICON, ICON_BIG, (LPARAM) LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDI_APPICON))); + SendMessage(WM_SETICON, ICON_SMALL, (LPARAM) LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDI_APPICON))); return 0; } @@ -347,7 +347,7 @@ BOOL CMainWindow::ConfirmSave() strProgramName.LoadString(IDS_PROGRAMNAME); CString strSavePromptText; - strSavePromptText.Format(IDS_SAVEPROMPTTEXT, PathFindFileName(filepathname)); + strSavePromptText.Format(IDS_SAVEPROMPTTEXT, PathFindFileName(g_szFileName)); switch (MessageBox(strSavePromptText, strProgramName, MB_YESNOCANCEL | MB_ICONQUESTION)) { @@ -374,7 +374,7 @@ LRESULT CMainWindow::OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHan void CMainWindow::ProcessFileMenu(HMENU hPopupMenu) { - LPCTSTR dotext = PathFindExtensionW(filepathname); + LPCTSTR dotext = PathFindExtensionW(g_szFileName); BOOL isBMP = FALSE; if (_tcsicmp(dotext, _T(".bmp")) == 0 || _tcsicmp(dotext, _T(".dib")) == 0 || @@ -383,9 +383,9 @@ void CMainWindow::ProcessFileMenu(HMENU hPopupMenu) isBMP = TRUE; } - EnableMenuItem(hPopupMenu, IDM_FILEASWALLPAPERPLANE, ENABLED_IF(isAFile && isBMP)); - EnableMenuItem(hPopupMenu, IDM_FILEASWALLPAPERCENTERED, ENABLED_IF(isAFile && isBMP)); - EnableMenuItem(hPopupMenu, IDM_FILEASWALLPAPERSTRETCHED, ENABLED_IF(isAFile && isBMP)); + EnableMenuItem(hPopupMenu, IDM_FILEASWALLPAPERPLANE, ENABLED_IF(g_isAFile && isBMP)); + EnableMenuItem(hPopupMenu, IDM_FILEASWALLPAPERCENTERED, ENABLED_IF(g_isAFile && isBMP)); + EnableMenuItem(hPopupMenu, IDM_FILEASWALLPAPERSTRETCHED, ENABLED_IF(g_isAFile && isBMP)); for (INT iItem = 0; iItem < MAX_RECENT_FILES; ++iItem) RemoveMenu(hPopupMenu, IDM_FILE1 + iItem, MF_BYCOMMAND); @@ -445,11 +445,11 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO case 2: /* View menu */ CheckMenuItem(menu, IDM_VIEWTOOLBOX, CHECKED_IF(::IsWindowVisible(toolBoxContainer))); CheckMenuItem(menu, IDM_VIEWCOLORPALETTE, CHECKED_IF(::IsWindowVisible(paletteWindow))); - CheckMenuItem(menu, IDM_VIEWSTATUSBAR, CHECKED_IF(::IsWindowVisible(hStatusBar))); + CheckMenuItem(menu, IDM_VIEWSTATUSBAR, CHECKED_IF(::IsWindowVisible(g_hStatusBar))); CheckMenuItem(menu, IDM_FORMATICONBAR, CHECKED_IF(::IsWindowVisible(fontsDialog))); EnableMenuItem(menu, IDM_FORMATICONBAR, ENABLED_IF(toolsModel.GetActiveTool() == TOOL_TEXT)); - CheckMenuItem(menu, IDM_VIEWSHOWGRID, CHECKED_IF(showGrid)); + CheckMenuItem(menu, IDM_VIEWSHOWGRID, CHECKED_IF(g_showGrid)); CheckMenuItem(menu, IDM_VIEWSHOWMINIATURE, CHECKED_IF(registrySettings.ShowThumbnail)); break; case 3: /* Image menu */ @@ -474,10 +474,10 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO LRESULT CMainWindow::OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { int test[] = { LOWORD(lParam) - 260, LOWORD(lParam) - 140, LOWORD(lParam) - 20 }; - if (::IsWindow(hStatusBar)) + if (::IsWindow(g_hStatusBar)) { - ::SendMessage(hStatusBar, WM_SIZE, 0, 0); - ::SendMessage(hStatusBar, SB_SETPARTS, 3, (LPARAM)&test); + ::SendMessage(g_hStatusBar, WM_SIZE, 0, 0); + ::SendMessage(g_hStatusBar, SB_SETPARTS, 3, (LPARAM)&test); } alignChildrenToMainWindow(); return 0; @@ -508,9 +508,11 @@ LRESULT CMainWindow::OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH } else if (selectionModel.m_bShow) { - selectionModel.Landing(); - selectionModel.m_bShow = FALSE; - imageModel.NotifyImageChanged(); + selectionModel.HideSelection(); + } + else + { + canvasWindow.cancelDrawing(); } break; @@ -551,11 +553,11 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH { case IDM_HELPINFO: { - HICON paintIcon = LoadIcon(hProgInstance, MAKEINTRESOURCE(IDI_APPICON)); + HICON paintIcon = LoadIcon(g_hinstExe, MAKEINTRESOURCE(IDI_APPICON)); TCHAR infotitle[100]; TCHAR infotext[200]; - LoadString(hProgInstance, IDS_INFOTITLE, infotitle, _countof(infotitle)); - LoadString(hProgInstance, IDS_INFOTEXT, infotext, _countof(infotext)); + LoadString(g_hinstExe, IDS_INFOTITLE, infotitle, _countof(infotitle)); + LoadString(g_hinstExe, IDS_INFOTEXT, infotext, _countof(infotext)); ShellAbout(m_hWnd, infotitle, infotext, paintIcon); DeleteObject(paintIcon); break; @@ -620,13 +622,13 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH GlobalFree(pd.hDevNames); break; case IDM_FILEASWALLPAPERPLANE: - RegistrySettings::SetWallpaper(filepathname, RegistrySettings::TILED); + RegistrySettings::SetWallpaper(g_szFileName, RegistrySettings::TILED); break; case IDM_FILEASWALLPAPERCENTERED: - RegistrySettings::SetWallpaper(filepathname, RegistrySettings::CENTERED); + RegistrySettings::SetWallpaper(g_szFileName, RegistrySettings::CENTERED); break; case IDM_FILEASWALLPAPERSTRETCHED: - RegistrySettings::SetWallpaper(filepathname, RegistrySettings::STRETCHED); + RegistrySettings::SetWallpaper(g_szFileName, RegistrySettings::STRETCHED); break; case IDM_FILE1: case IDM_FILE2: @@ -640,7 +642,10 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH } case IDM_EDITUNDO: if (toolsModel.GetActiveTool() == TOOL_TEXT && ::IsWindowVisible(textEditWindow)) + { + textEditWindow.PostMessage(WM_UNDO, 0, 0); break; + } if (selectionModel.m_bShow) { if (toolsModel.GetActiveTool() == TOOL_RECTSEL || @@ -668,10 +673,19 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH imageModel.Redo(); break; case IDM_EDITCOPY: + // FIXME: We should use CF_DIB in the future if (OpenClipboard()) { EmptyClipboard(); - SetClipboardData(CF_BITMAP, CopyDIBImage(selectionModel.GetBitmap())); + if (selectionModel.m_bShow) + { + selectionModel.TakeOff(); + SetClipboardData(CF_BITMAP, selectionModel.CopyBitmap()); + } + else + { + SetClipboardData(CF_BITMAP, imageModel.CopyBitmap()); + } CloseClipboard(); } break; @@ -695,7 +709,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH { case TOOL_FREESEL: case TOOL_RECTSEL: - imageModel.DeleteSelection(); + selectionModel.DeleteSelection(); break; case TOOL_TEXT: @@ -723,7 +737,11 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH { TCHAR szFileName[MAX_LONG_PATH] = _T(""); if (GetSaveFileName(szFileName, _countof(szFileName))) - SaveDIBToFile(selectionModel.GetBitmap(), szFileName, imageModel.GetDC()); + { + HBITMAP hbm = selectionModel.CopyBitmap(); + SaveDIBToFile(hbm, szFileName, imageModel.GetDC()); + ::DeleteObject(hbm); + } break; } case IDM_EDITPASTEFROM: @@ -827,8 +845,8 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH toolsModel.SetBackgroundTransparent(!toolsModel.IsBackgroundTransparent()); break; case IDM_IMAGECROP: - imageModel.PushImageForUndo(CopyDIBImage(selectionModel.GetBitmap())); - imageModel.DeleteSelection(); + imageModel.PushImageForUndo(selectionModel.CopyBitmap()); + selectionModel.HideSelection(); break; case IDM_VIEWTOOLBOX: @@ -842,8 +860,8 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH alignChildrenToMainWindow(); break; case IDM_VIEWSTATUSBAR: - registrySettings.ShowStatusBar = !::IsWindowVisible(hStatusBar); - ::ShowWindow(hStatusBar, (registrySettings.ShowStatusBar ? SW_SHOWNOACTIVATE : SW_HIDE)); + registrySettings.ShowStatusBar = !::IsWindowVisible(g_hStatusBar); + ::ShowWindow(g_hStatusBar, (registrySettings.ShowStatusBar ? SW_SHOWNOACTIVATE : SW_HIDE)); alignChildrenToMainWindow(); break; case IDM_FORMATICONBAR: @@ -859,7 +877,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH } break; case IDM_VIEWSHOWGRID: - showGrid = !showGrid; + g_showGrid = !g_showGrid; canvasWindow.Invalidate(FALSE); break; case IDM_VIEWSHOWMINIATURE:
1 year, 6 months
1
0
0
0
[reactos] 01/01: [TASKMGR] Remove CRTDBG (#5348)
by Thamatip Chitpong
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b7071f67a8f56ef5c7ca6…
commit b7071f67a8f56ef5c7ca69dcb485806c3d008b76 Author: Thamatip Chitpong <tangaming123456(a)outlook.com> AuthorDate: Sat Jun 17 01:33:29 2023 +0700 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jun 17 03:33:29 2023 +0900 [TASKMGR] Remove CRTDBG (#5348) taskmgr doesn't use any CRT allocation. I don't see the point of using it. This reverts commit 2441e86 . CORE-18991 --- base/applications/taskmgr/precomp.h | 5 ----- base/applications/taskmgr/taskmgr.c | 5 ----- 2 files changed, 10 deletions(-) diff --git a/base/applications/taskmgr/precomp.h b/base/applications/taskmgr/precomp.h index 5a4f77a55d9..6b5aa223ed7 100644 --- a/base/applications/taskmgr/precomp.h +++ b/base/applications/taskmgr/precomp.h @@ -16,11 +16,6 @@ #include <stdlib.h> #include <stdarg.h> -#ifdef _DEBUG - #define _CRTDBG_MAP_ALLOC - #include <crtdbg.h> -#endif - #define WIN32_NO_STATUS #include <windef.h> diff --git a/base/applications/taskmgr/taskmgr.c b/base/applications/taskmgr/taskmgr.c index 51e6d4a8fcf..44bc24b2f96 100644 --- a/base/applications/taskmgr/taskmgr.c +++ b/base/applications/taskmgr/taskmgr.c @@ -101,11 +101,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, TOKEN_PRIVILEGES tkp; HANDLE hMutex; -#ifdef _DEBUG - // Report any memory leaks on exit - _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); -#endif - /* check wether we're already running or not */ hMutex = CreateMutexW(NULL, TRUE, L"taskmgrros"); if (hMutex && GetLastError() == ERROR_ALREADY_EXISTS)
1 year, 6 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Add CachedBufferDIB function and use it
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2f856f6f0d1a2053deec6…
commit 2f856f6f0d1a2053deec61fb8fa282a80b56210d Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Jun 16 08:05:23 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Fri Jun 16 08:05:23 2023 +0900 [MSPAINT] Add CachedBufferDIB function and use it We do caching on buffering paint. This will improve performance a little. CORE-18867 --- base/applications/mspaint/canvas.cpp | 13 ++++++++++--- base/applications/mspaint/canvas.h | 2 ++ base/applications/mspaint/dib.cpp | 20 ++++++++++++++++++++ base/applications/mspaint/dib.h | 1 + base/applications/mspaint/miniature.cpp | 16 ++++++++++++++-- base/applications/mspaint/miniature.h | 7 ++++++- base/applications/mspaint/palette.cpp | 17 ++++++++++++++--- base/applications/mspaint/palette.h | 6 ++++++ 8 files changed, 73 insertions(+), 9 deletions(-) diff --git a/base/applications/mspaint/canvas.cpp b/base/applications/mspaint/canvas.cpp index b83a692ab7c..c36bd76faed 100644 --- a/base/applications/mspaint/canvas.cpp +++ b/base/applications/mspaint/canvas.cpp @@ -17,10 +17,17 @@ CCanvasWindow::CCanvasWindow() , m_hitSelection(HIT_NONE) , m_whereHit(HIT_NONE) , m_ptOrig { -1, -1 } + , m_hbmCached(NULL) { ::SetRectEmpty(&m_rcNew); } +CCanvasWindow::~CCanvasWindow() +{ + if (m_hbmCached) + ::DeleteObject(m_hbmCached); +} + VOID CCanvasWindow::drawZoomFrame(INT mouseX, INT mouseY) { // FIXME: Draw the border of the area that is to be zoomed in @@ -95,8 +102,8 @@ VOID CCanvasWindow::DoDraw(HDC hDC, RECT& rcClient, RECT& rcPaint) { // We use a memory bitmap to reduce flickering HDC hdcMem = ::CreateCompatibleDC(hDC); - HBITMAP hbm = ::CreateCompatibleBitmap(hDC, rcClient.right, rcClient.bottom); - HGDIOBJ hbmOld = ::SelectObject(hdcMem, hbm); + m_hbmCached = CachedBufferDIB(m_hbmCached, rcClient.right, rcClient.bottom); + HGDIOBJ hbmOld = ::SelectObject(hdcMem, m_hbmCached); // Fill the background ::FillRect(hdcMem, &rcPaint, (HBRUSH)(COLOR_APPWORKSPACE + 1)); @@ -164,7 +171,7 @@ VOID CCanvasWindow::DoDraw(HDC hDC, RECT& rcClient, RECT& rcPaint) rcPaint.right - rcPaint.left, rcPaint.bottom - rcPaint.top, hdcMem, rcPaint.left, rcPaint.top, SRCCOPY); - ::DeleteObject(::SelectObject(hdcMem, hbmOld)); + ::SelectObject(hdcMem, hbmOld); ::DeleteDC(hdcMem); } diff --git a/base/applications/mspaint/canvas.h b/base/applications/mspaint/canvas.h index 53d5fa1acc1..d76b3761b9c 100644 --- a/base/applications/mspaint/canvas.h +++ b/base/applications/mspaint/canvas.h @@ -36,6 +36,7 @@ public: END_MSG_MAP() CCanvasWindow(); + virtual ~CCanvasWindow(); BOOL m_drawing; @@ -54,6 +55,7 @@ protected: CANVAS_HITTEST m_hitSelection; CANVAS_HITTEST m_whereHit; POINT m_ptOrig; // The origin of drag start + HBITMAP m_hbmCached; // The cached buffer bitmap CRect m_rcNew; CANVAS_HITTEST CanvasHitTest(POINT pt); diff --git a/base/applications/mspaint/dib.cpp b/base/applications/mspaint/dib.cpp index 3d74403cdda..1e7477c661e 100644 --- a/base/applications/mspaint/dib.cpp +++ b/base/applications/mspaint/dib.cpp @@ -59,6 +59,26 @@ CreateColorDIB(int width, int height, COLORREF rgb) return ret; } +HBITMAP CachedBufferDIB(HBITMAP hbm, int minimalWidth, int minimalHeight) +{ + if (minimalWidth <= 0) + minimalWidth = 1; + if (minimalHeight <= 0) + minimalHeight = 1; + + BITMAP bm; + if (!GetObject(hbm, sizeof(bm), &bm)) + hbm = NULL; + + if (hbm && minimalWidth <= bm.bmWidth && minimalHeight <= bm.bmHeight) + return hbm; + + if (hbm) + DeleteObject(hbm); + + return CreateDIBWithProperties((minimalWidth * 3) / 2, (minimalHeight * 3) / 2); +} + int GetDIBWidth(HBITMAP hBitmap) { diff --git a/base/applications/mspaint/dib.h b/base/applications/mspaint/dib.h index cc873913114..f4043d83ca3 100644 --- a/base/applications/mspaint/dib.h +++ b/base/applications/mspaint/dib.h @@ -10,6 +10,7 @@ HBITMAP CreateDIBWithProperties(int width, int height); HBITMAP CreateColorDIB(int width, int height, COLORREF rgb); +HBITMAP CachedBufferDIB(HBITMAP hbm, int minimalWidth, int minimalHeight); static inline HBITMAP CopyDIBImage(HBITMAP hbm, INT cx = 0, INT cy = 0) { diff --git a/base/applications/mspaint/miniature.cpp b/base/applications/mspaint/miniature.cpp index 223b38e176a..b354de983b1 100644 --- a/base/applications/mspaint/miniature.cpp +++ b/base/applications/mspaint/miniature.cpp @@ -14,6 +14,17 @@ CMiniatureWindow miniature; /* FUNCTIONS ********************************************************/ +CMiniatureWindow::CMiniatureWindow() + : m_hbmCached(NULL) +{ +} + +CMiniatureWindow::~CMiniatureWindow() +{ + if (m_hbmCached) + ::DeleteObject(m_hbmCached); +} + HWND CMiniatureWindow::DoCreate(HWND hwndParent) { if (m_hWnd) @@ -82,7 +93,8 @@ LRESULT CMiniatureWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& // Use a memory bitmap to reduce flickering HDC hdcMem = ::CreateCompatibleDC(hDC); - HGDIOBJ hbmOld = ::SelectObject(hdcMem, ::CreateCompatibleBitmap(hDC, rc.right, rc.bottom)); + m_hbmCached = CachedBufferDIB(m_hbmCached, rc.right, rc.bottom); + HGDIOBJ hbmOld = ::SelectObject(hdcMem, m_hbmCached); // FIXME: Consider aspect ratio @@ -100,7 +112,7 @@ LRESULT CMiniatureWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& ::BitBlt(hDC, 0, 0, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY); // Clean up - ::DeleteObject(::SelectObject(hdcMem, hbmOld)); + ::SelectObject(hdcMem, hbmOld); ::DeleteDC(hdcMem); EndPaint(&ps); diff --git a/base/applications/mspaint/miniature.h b/base/applications/mspaint/miniature.h index e1ec6657f88..9c01f1b9091 100644 --- a/base/applications/mspaint/miniature.h +++ b/base/applications/mspaint/miniature.h @@ -24,9 +24,14 @@ public: MESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo) END_MSG_MAP() + CMiniatureWindow(); + virtual ~CMiniatureWindow(); + HWND DoCreate(HWND hwndParent); -private: +protected: + HBITMAP m_hbmCached; // Cached buffer bitmap + LRESULT OnMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); diff --git a/base/applications/mspaint/palette.cpp b/base/applications/mspaint/palette.cpp index acd5552defc..f268a982f49 100644 --- a/base/applications/mspaint/palette.cpp +++ b/base/applications/mspaint/palette.cpp @@ -21,6 +21,17 @@ CPaletteWindow paletteWindow; /* FUNCTIONS ********************************************************/ +CPaletteWindow::CPaletteWindow() + : m_hbmCached(NULL) +{ +} + +CPaletteWindow::~CPaletteWindow() +{ + if (m_hbmCached) + ::DeleteObject(m_hbmCached); +} + static VOID drawColorBox(HDC hDC, LPCRECT prc, COLORREF rgbColor, UINT nBorder) { RECT rc = *prc; @@ -76,8 +87,8 @@ LRESULT CPaletteWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b /* To avoid flickering, we use a memory bitmap. The left and top values are zeros in client rectangle */ HDC hMemDC = ::CreateCompatibleDC(hDC); - HBITMAP hbm = ::CreateCompatibleBitmap(hDC, rcClient.right, rcClient.bottom); - HGDIOBJ hbmOld = ::SelectObject(hMemDC, hbm); + m_hbmCached = CachedBufferDIB(m_hbmCached, rcClient.right, rcClient.bottom); + HGDIOBJ hbmOld = ::SelectObject(hMemDC, m_hbmCached); /* Fill the background (since WM_ERASEBKGND handling is disabled) */ ::FillRect(hMemDC, &rcClient, (HBRUSH)(COLOR_3DFACE + 1)); @@ -121,7 +132,7 @@ LRESULT CPaletteWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b /* Transfer bits (hDC <-- hMemDC) */ ::BitBlt(hDC, 0, 0, rcClient.right, rcClient.bottom, hMemDC, 0, 0, SRCCOPY); - ::DeleteObject(::SelectObject(hMemDC, hbmOld)); + ::SelectObject(hMemDC, hbmOld); ::DeleteDC(hMemDC); EndPaint(&ps); return 0; diff --git a/base/applications/mspaint/palette.h b/base/applications/mspaint/palette.h index c9e09e92708..fe23edda53f 100644 --- a/base/applications/mspaint/palette.h +++ b/base/applications/mspaint/palette.h @@ -30,6 +30,12 @@ public: MESSAGE_HANDLER(WM_PALETTEMODELPALETTECHANGED, OnPaletteModelPaletteChanged) END_MSG_MAP() + CPaletteWindow(); + virtual ~CPaletteWindow(); + +protected: + HBITMAP m_hbmCached; // Cached buffer bitmap + LRESULT OnEraseBkgnd(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
1 year, 6 months
1
0
0
0
[reactos] 01/01: [TASKMGR] Fix the license. Turns out it's LGPL-2.1-or-later from the texts.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c706222f3f1b2a63e8cc9…
commit c706222f3f1b2a63e8cc969ee756c8be92527853 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Jun 15 19:45:15 2023 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Jun 15 19:45:23 2023 +0200 [TASKMGR] Fix the license. Turns out it's LGPL-2.1-or-later from the texts. Caught by Stanislav. Sorry for the oversight! --- base/applications/taskmgr/about.c | 2 +- base/applications/taskmgr/about.h | 2 +- base/applications/taskmgr/affinity.c | 2 +- base/applications/taskmgr/affinity.h | 2 +- base/applications/taskmgr/applpage.c | 2 +- base/applications/taskmgr/applpage.h | 2 +- base/applications/taskmgr/column.c | 2 +- base/applications/taskmgr/column.h | 2 +- base/applications/taskmgr/debug.c | 2 +- base/applications/taskmgr/debug.h | 2 +- base/applications/taskmgr/endproc.c | 2 +- base/applications/taskmgr/endproc.h | 2 +- base/applications/taskmgr/graph.c | 2 +- base/applications/taskmgr/graph.h | 2 +- base/applications/taskmgr/graphctl.c | 2 +- base/applications/taskmgr/graphctl.h | 2 +- base/applications/taskmgr/optnmenu.c | 2 +- base/applications/taskmgr/optnmenu.h | 2 +- base/applications/taskmgr/perfdata.c | 2 +- base/applications/taskmgr/perfdata.h | 2 +- base/applications/taskmgr/perfpage.c | 2 +- base/applications/taskmgr/perfpage.h | 2 +- base/applications/taskmgr/precomp.h | 2 +- base/applications/taskmgr/priority.c | 2 +- base/applications/taskmgr/priority.h | 2 +- base/applications/taskmgr/proclist.c | 2 +- base/applications/taskmgr/proclist.h | 2 +- base/applications/taskmgr/procpage.c | 2 +- base/applications/taskmgr/procpage.h | 2 +- base/applications/taskmgr/resource.h | 2 +- base/applications/taskmgr/run.c | 2 +- base/applications/taskmgr/run.h | 2 +- base/applications/taskmgr/shutdown.c | 2 +- base/applications/taskmgr/shutdown.h | 2 +- base/applications/taskmgr/taskmgr.c | 2 +- base/applications/taskmgr/taskmgr.h | 2 +- base/applications/taskmgr/taskmgr.rc | 2 +- base/applications/taskmgr/trayicon.c | 2 +- base/applications/taskmgr/trayicon.h | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-) diff --git a/base/applications/taskmgr/about.c b/base/applications/taskmgr/about.c index e3ebc1c0b7c..e0decc1ddaa 100644 --- a/base/applications/taskmgr/about.c +++ b/base/applications/taskmgr/about.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: About Box. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/about.h b/base/applications/taskmgr/about.h index cfe31132e2c..5af62ca8a80 100644 --- a/base/applications/taskmgr/about.h +++ b/base/applications/taskmgr/about.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: About Box. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/affinity.c b/base/applications/taskmgr/affinity.c index 5bb596a63a0..6470caa9526 100644 --- a/base/applications/taskmgr/affinity.c +++ b/base/applications/taskmgr/affinity.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Processor Affinity. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/affinity.h b/base/applications/taskmgr/affinity.h index 6aafd95cb8f..1d7e05e3dd2 100644 --- a/base/applications/taskmgr/affinity.h +++ b/base/applications/taskmgr/affinity.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Processor Affinity. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/applpage.c b/base/applications/taskmgr/applpage.c index 488ae8fd6af..7db38c09c90 100644 --- a/base/applications/taskmgr/applpage.c +++ b/base/applications/taskmgr/applpage.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Applications Page. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/applpage.h b/base/applications/taskmgr/applpage.h index 2f59e175c68..e6bf69c21a1 100644 --- a/base/applications/taskmgr/applpage.h +++ b/base/applications/taskmgr/applpage.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Applications Page. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/column.c b/base/applications/taskmgr/column.c index bc98b06705d..089e4044854 100644 --- a/base/applications/taskmgr/column.c +++ b/base/applications/taskmgr/column.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Processes List Columns. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/column.h b/base/applications/taskmgr/column.h index cf68106c6e0..615067104ad 100644 --- a/base/applications/taskmgr/column.h +++ b/base/applications/taskmgr/column.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Processes List Columns. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/debug.c b/base/applications/taskmgr/debug.c index 8e5701fceab..7e3e11f283e 100644 --- a/base/applications/taskmgr/debug.c +++ b/base/applications/taskmgr/debug.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Process Debugging. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/debug.h b/base/applications/taskmgr/debug.h index cecb974df67..5ab2473bbce 100644 --- a/base/applications/taskmgr/debug.h +++ b/base/applications/taskmgr/debug.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Process Debugging. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/endproc.c b/base/applications/taskmgr/endproc.c index 822790033d2..9f4a2ee647e 100644 --- a/base/applications/taskmgr/endproc.c +++ b/base/applications/taskmgr/endproc.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Process Termination. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/endproc.h b/base/applications/taskmgr/endproc.h index 04744d7c1f1..1cf2704acab 100644 --- a/base/applications/taskmgr/endproc.h +++ b/base/applications/taskmgr/endproc.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Process Termination. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/graph.c b/base/applications/taskmgr/graph.c index 0b30e1ffbbc..aea347c47b6 100644 --- a/base/applications/taskmgr/graph.c +++ b/base/applications/taskmgr/graph.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Performance Graph Meters. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/graph.h b/base/applications/taskmgr/graph.h index d79524b43b1..27682b41c05 100644 --- a/base/applications/taskmgr/graph.h +++ b/base/applications/taskmgr/graph.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Performance Graph Meters. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/graphctl.c b/base/applications/taskmgr/graphctl.c index ef6bbf6b632..3f34ddf016e 100644 --- a/base/applications/taskmgr/graphctl.c +++ b/base/applications/taskmgr/graphctl.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Graph Plotting controls. * COPYRIGHT: Copyright 2002 Robert Dickenson <robd(a)reactos.org> * Copyright 2021 Wu Haotian <rigoligo03(a)gmail.com> diff --git a/base/applications/taskmgr/graphctl.h b/base/applications/taskmgr/graphctl.h index 959ffab4122..7fb84d291db 100644 --- a/base/applications/taskmgr/graphctl.h +++ b/base/applications/taskmgr/graphctl.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Graph Plotting controls. * COPYRIGHT: Copyright 2002 Robert Dickenson <robd(a)reactos.org> * Copyright 2021 Wu Haotian <rigoligo03(a)gmail.com> diff --git a/base/applications/taskmgr/optnmenu.c b/base/applications/taskmgr/optnmenu.c index f6be7e209f6..93cd96c3f85 100644 --- a/base/applications/taskmgr/optnmenu.c +++ b/base/applications/taskmgr/optnmenu.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Menu item handlers for the options menu. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/optnmenu.h b/base/applications/taskmgr/optnmenu.h index 6f259c396bd..46bfc60ba0b 100644 --- a/base/applications/taskmgr/optnmenu.h +++ b/base/applications/taskmgr/optnmenu.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Menu item handlers for the options menu. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/perfdata.c b/base/applications/taskmgr/perfdata.c index c4e80d5832a..0126285c98b 100644 --- a/base/applications/taskmgr/perfdata.c +++ b/base/applications/taskmgr/perfdata.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Performance Counters. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2014 Ismael Ferreras Morezuelas <swyterzone+ros(a)gmail.com> diff --git a/base/applications/taskmgr/perfdata.h b/base/applications/taskmgr/perfdata.h index 5bfc3bb31fb..3da4a0fef2b 100644 --- a/base/applications/taskmgr/perfdata.h +++ b/base/applications/taskmgr/perfdata.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Performance Counters. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2014 Ismael Ferreras Morezuelas <swyterzone+ros(a)gmail.com> diff --git a/base/applications/taskmgr/perfpage.c b/base/applications/taskmgr/perfpage.c index 62668e059c0..9e601041bd4 100644 --- a/base/applications/taskmgr/perfpage.c +++ b/base/applications/taskmgr/perfpage.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Performance Page. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/perfpage.h b/base/applications/taskmgr/perfpage.h index 6eed9c34e61..e581bd39c3e 100644 --- a/base/applications/taskmgr/perfpage.h +++ b/base/applications/taskmgr/perfpage.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Performance Page. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/precomp.h b/base/applications/taskmgr/precomp.h index 682b35d07e7..5a4f77a55d9 100644 --- a/base/applications/taskmgr/precomp.h +++ b/base/applications/taskmgr/precomp.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Precompiled Header. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/priority.c b/base/applications/taskmgr/priority.c index 714bc76da72..028c297f8e0 100644 --- a/base/applications/taskmgr/priority.c +++ b/base/applications/taskmgr/priority.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Process Priority. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/priority.h b/base/applications/taskmgr/priority.h index d7088b17211..891db0fd0b5 100644 --- a/base/applications/taskmgr/priority.h +++ b/base/applications/taskmgr/priority.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Process Priority. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/proclist.c b/base/applications/taskmgr/proclist.c index 7396be368ec..02e7df0b314 100644 --- a/base/applications/taskmgr/proclist.c +++ b/base/applications/taskmgr/proclist.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Processes List. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/proclist.h b/base/applications/taskmgr/proclist.h index 8822d1010f2..96f07472bd9 100644 --- a/base/applications/taskmgr/proclist.h +++ b/base/applications/taskmgr/proclist.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Processes List. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/procpage.c b/base/applications/taskmgr/procpage.c index 40d941add28..1740e0a2753 100644 --- a/base/applications/taskmgr/procpage.c +++ b/base/applications/taskmgr/procpage.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Processes Page. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2009 Maxime Vernier <maxime.vernier(a)gmail.com> diff --git a/base/applications/taskmgr/procpage.h b/base/applications/taskmgr/procpage.h index fdee980ae79..d9705b1ec16 100644 --- a/base/applications/taskmgr/procpage.h +++ b/base/applications/taskmgr/procpage.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Processes Page. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2009 Maxime Vernier <maxime.vernier(a)gmail.com> diff --git a/base/applications/taskmgr/resource.h b/base/applications/taskmgr/resource.h index 7f5ef276afe..bda48393a30 100644 --- a/base/applications/taskmgr/resource.h +++ b/base/applications/taskmgr/resource.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Resources header. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/run.c b/base/applications/taskmgr/run.c index 09ed71e74d2..3e210f04415 100644 --- a/base/applications/taskmgr/run.c +++ b/base/applications/taskmgr/run.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Run Task. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/run.h b/base/applications/taskmgr/run.h index ef1ffe53cb0..d3ea0a1e0ba 100644 --- a/base/applications/taskmgr/run.h +++ b/base/applications/taskmgr/run.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Run Task. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/shutdown.c b/base/applications/taskmgr/shutdown.c index 9a64b0a3ed6..41604e35409 100644 --- a/base/applications/taskmgr/shutdown.c +++ b/base/applications/taskmgr/shutdown.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: System Shutdown. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2011 Mário Kacmár /Mario Kacmar/ aka Kario <kario(a)szm.sk> diff --git a/base/applications/taskmgr/shutdown.h b/base/applications/taskmgr/shutdown.h index 7c13c445e3a..272471768a4 100644 --- a/base/applications/taskmgr/shutdown.h +++ b/base/applications/taskmgr/shutdown.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: System Shutdown. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2011 Mário Kacmár /Mario Kacmar/ aka Kario <kario(a)szm.sk> diff --git a/base/applications/taskmgr/taskmgr.c b/base/applications/taskmgr/taskmgr.c index 844e85acefc..51e6d4a8fcf 100644 --- a/base/applications/taskmgr/taskmgr.c +++ b/base/applications/taskmgr/taskmgr.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Application Entry-point. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/taskmgr.h b/base/applications/taskmgr/taskmgr.h index 7a719a77a20..28136f8271c 100644 --- a/base/applications/taskmgr/taskmgr.h +++ b/base/applications/taskmgr/taskmgr.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Main Header. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/taskmgr.rc b/base/applications/taskmgr/taskmgr.rc index 521f83fbe78..a60e8f33e27 100644 --- a/base/applications/taskmgr/taskmgr.rc +++ b/base/applications/taskmgr/taskmgr.rc @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Resources file. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> */ diff --git a/base/applications/taskmgr/trayicon.c b/base/applications/taskmgr/trayicon.c index 9a7c1efcee1..88578800557 100644 --- a/base/applications/taskmgr/trayicon.c +++ b/base/applications/taskmgr/trayicon.c @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Tray Icon. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at> diff --git a/base/applications/taskmgr/trayicon.h b/base/applications/taskmgr/trayicon.h index 6d6c1dbc21c..5eae5cf0156 100644 --- a/base/applications/taskmgr/trayicon.h +++ b/base/applications/taskmgr/trayicon.h @@ -1,6 +1,6 @@ /* * PROJECT: ReactOS Task Manager - * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) * PURPOSE: Tray Icon. * COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp(a)reactos.org> * Copyright 2005 Klemens Friedl <frik85(a)reactos.at>
1 year, 6 months
1
0
0
0
[reactos] 02/02: [TASKMGR] Re-include StringSafe usage in trayicon.c (see e.g. 99fb812be)
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f4735ccc9b83eae23cf67…
commit f4735ccc9b83eae23cf6771fa1e7737a39436369 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jun 5 20:33:13 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Jun 15 13:28:16 2023 +0200 [TASKMGR] Re-include StringSafe usage in trayicon.c (see e.g. 99fb812be) --- base/applications/taskmgr/trayicon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/applications/taskmgr/trayicon.c b/base/applications/taskmgr/trayicon.c index 5da5d7d778a..9a7c1efcee1 100644 --- a/base/applications/taskmgr/trayicon.c +++ b/base/applications/taskmgr/trayicon.c @@ -111,7 +111,7 @@ TrayIcon_Update( BOOL bRetVal; if (!*szMsg) - LoadStringW(hInst, IDS_MSG_TRAYICONCPUUSAGE, szMsg, ARRAYSIZE(szMsg)); + LoadStringW(hInst, IDS_MSG_TRAYICONCPUUSAGE, szMsg, _countof(szMsg)); ZeroMemory(&nid, sizeof(nid)); @@ -125,7 +125,7 @@ TrayIcon_Update( nid.uCallbackMessage = WM_ONTRAYICON; nid.hIcon = hIcon; - wsprintfW(nid.szTip, szMsg, CpuUsage); + StringCchPrintfW(nid.szTip, _countof(nid.szTip), szMsg, CpuUsage); bRetVal = Shell_NotifyIconW(dwMessage, &nid);
1 year, 6 months
1
0
0
0
[reactos] 01/02: [TASKMGR] Move strsafe.h into precompiled header.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=434798e312cf5141dffc0…
commit 434798e312cf5141dffc032afdca71475a5b72d7 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jun 5 20:34:16 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Jun 15 13:26:32 2023 +0200 [TASKMGR] Move strsafe.h into precompiled header. --- base/applications/taskmgr/precomp.h | 2 ++ base/applications/taskmgr/procpage.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/applications/taskmgr/precomp.h b/base/applications/taskmgr/precomp.h index 4fbcf760c3d..682b35d07e7 100644 --- a/base/applications/taskmgr/precomp.h +++ b/base/applications/taskmgr/precomp.h @@ -33,6 +33,8 @@ #include <shellapi.h> #include <tlhelp32.h> +#include <strsafe.h> + #include "column.h" #include "taskmgr.h" #include "perfdata.h" diff --git a/base/applications/taskmgr/procpage.c b/base/applications/taskmgr/procpage.c index 7119e675239..40d941add28 100644 --- a/base/applications/taskmgr/procpage.c +++ b/base/applications/taskmgr/procpage.c @@ -11,8 +11,6 @@ #include "proclist.h" -#include <strsafe.h> - #include <ndk/psfuncs.h> #define CMP(x1, x2)\
1 year, 6 months
1
0
0
0
[reactos] 01/01: [MSPAINT] mouse.cpp: Use override keywords
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6d9b7f77adbc9c79ec256…
commit 6d9b7f77adbc9c79ec256f65e725068424c3ea03 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jun 14 16:01:10 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Jun 14 16:01:10 2023 +0900 [MSPAINT] mouse.cpp: Use override keywords CORE-18867 --- base/applications/mspaint/mouse.cpp | 80 ++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index 23bfa69043c..bd7d23c139c 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -108,7 +108,7 @@ struct FreeSelTool : ToolBase { } - void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { selectionModel.Landing(); if (bLeftButton) @@ -122,7 +122,7 @@ struct FreeSelTool : ToolBase m_bLeftButton = bLeftButton; } - void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) + void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { if (bLeftButton) { @@ -134,7 +134,7 @@ struct FreeSelTool : ToolBase } } - void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { if (bLeftButton) { @@ -155,7 +155,7 @@ struct FreeSelTool : ToolBase } } - void OnFinishDraw() + void OnFinishDraw() override { if (m_bLeftButton) canvasWindow.Invalidate(FALSE); @@ -164,7 +164,7 @@ struct FreeSelTool : ToolBase ToolBase::OnFinishDraw(); } - void OnCancelDraw() + void OnCancelDraw() override { if (m_bLeftButton) imageModel.Undo(TRUE); @@ -182,7 +182,7 @@ struct RectSelTool : ToolBase { } - void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { selectionModel.Landing(); if (bLeftButton) @@ -194,7 +194,7 @@ struct RectSelTool : ToolBase m_bLeftButton = bLeftButton; } - void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) + void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { if (bLeftButton) { @@ -206,7 +206,7 @@ struct RectSelTool : ToolBase } } - void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { if (bLeftButton) { @@ -218,7 +218,7 @@ struct RectSelTool : ToolBase } } - void OnFinishDraw() + void OnFinishDraw() override { if (m_bLeftButton) canvasWindow.Invalidate(FALSE); @@ -227,7 +227,7 @@ struct RectSelTool : ToolBase ToolBase::OnFinishDraw(); } - void OnCancelDraw() + void OnCancelDraw() override { if (m_bLeftButton) imageModel.Undo(TRUE); @@ -244,23 +244,23 @@ struct GenericDrawTool : ToolBase virtual void draw(BOOL bLeftButton, LONG x, LONG y) = 0; - void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { imageModel.PushImageForUndo(); draw(bLeftButton, x, y); } - void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) + void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { draw(bLeftButton, x, y); } - void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { draw(bLeftButton, x, y); } - void OnCancelDraw() + void OnCancelDraw() override { OnButtonUp(FALSE, 0, 0); imageModel.Undo(TRUE); @@ -275,7 +275,7 @@ struct RubberTool : GenericDrawTool { } - virtual void draw(BOOL bLeftButton, LONG x, LONG y) + void draw(BOOL bLeftButton, LONG x, LONG y) override { if (bLeftButton) Erase(m_hdc, last.x, last.y, x, y, m_bg, toolsModel.GetRubberRadius()); @@ -291,7 +291,7 @@ struct FillTool : ToolBase { } - void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { imageModel.PushImageForUndo(); Fill(m_hdc, x, y, bLeftButton ? m_fg : m_bg); @@ -320,12 +320,12 @@ struct ColorTool : ToolBase paletteModel.SetBgColor(rgbColor); } - void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) + void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { fetchColor(bLeftButton, x, y); } - void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { fetchColor(bLeftButton, x, y); toolsModel.SetActiveTool(toolsModel.GetOldActiveTool()); @@ -339,7 +339,7 @@ struct ZoomTool : ToolBase { } - void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { imageModel.PushImageForUndo(); if (bLeftButton) @@ -362,7 +362,7 @@ struct PenTool : GenericDrawTool { } - virtual void draw(BOOL bLeftButton, LONG x, LONG y) + void draw(BOOL bLeftButton, LONG x, LONG y) override { COLORREF rgb = bLeftButton ? m_fg : m_bg; Line(m_hdc, last.x, last.y, x, y, rgb, 1); @@ -377,7 +377,7 @@ struct BrushTool : GenericDrawTool { } - virtual void draw(BOOL bLeftButton, LONG x, LONG y) + void draw(BOOL bLeftButton, LONG x, LONG y) override { COLORREF rgb = bLeftButton ? m_fg : m_bg; Brush(m_hdc, last.x, last.y, x, y, rgb, toolsModel.GetBrushStyle()); @@ -391,7 +391,7 @@ struct AirBrushTool : GenericDrawTool { } - virtual void draw(BOOL bLeftButton, LONG x, LONG y) + void draw(BOOL bLeftButton, LONG x, LONG y) override { COLORREF rgb = bLeftButton ? m_fg : m_bg; Airbrush(m_hdc, x, y, rgb, toolsModel.GetAirBrushWidth()); @@ -414,7 +414,7 @@ struct TextTool : ToolBase RectSel(m_hdc, start.x, start.y, pt.x, pt.y); } - void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { if (!textEditWindow.IsWindow()) textEditWindow.Create(canvasWindow); @@ -423,12 +423,12 @@ struct TextTool : ToolBase UpdatePoint(x, y); } - void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) + void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { UpdatePoint(x, y); } - void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { imageModel.Undo(TRUE); @@ -494,7 +494,7 @@ struct TextTool : ToolBase textEditWindow.SetFocus(); } - void OnFinishDraw() + void OnFinishDraw() override { toolsModel.OnButtonDown(TRUE, -1, -1, TRUE); toolsModel.OnButtonUp(TRUE, -1, -1); @@ -509,7 +509,7 @@ struct LineTool : GenericDrawTool { } - virtual void draw(BOOL bLeftButton, LONG x, LONG y) + void draw(BOOL bLeftButton, LONG x, LONG y) override { imageModel.ResetToPrevious(); if (GetAsyncKeyState(VK_SHIFT) < 0) @@ -547,7 +547,7 @@ struct BezierTool : ToolBase m_bLeftButton = bLeftButton; } - void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { pointStack[pointSP].x = x; pointStack[pointSP].y = y; @@ -559,7 +559,7 @@ struct BezierTool : ToolBase } } - void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) + void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { imageModel.ResetToPrevious(); pointStack[pointSP].x = x; @@ -567,7 +567,7 @@ struct BezierTool : ToolBase draw(bLeftButton); } - void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { imageModel.ResetToPrevious(); draw(bLeftButton); @@ -576,14 +576,14 @@ struct BezierTool : ToolBase pointSP = 0; } - void OnCancelDraw() + void OnCancelDraw() override { OnButtonUp(FALSE, 0, 0); imageModel.Undo(TRUE); ToolBase::OnCancelDraw(); } - void OnFinishDraw() + void OnFinishDraw() override { if (pointSP) { @@ -602,7 +602,7 @@ struct RectTool : GenericDrawTool { } - virtual void draw(BOOL bLeftButton, LONG x, LONG y) + void draw(BOOL bLeftButton, LONG x, LONG y) override { imageModel.ResetToPrevious(); if (GetAsyncKeyState(VK_SHIFT) < 0) @@ -635,7 +635,7 @@ struct ShapeTool : ToolBase m_bLeftButton = bLeftButton; } - void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) + void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override { pointStack[pointSP].x = x; pointStack[pointSP].y = y; @@ -652,7 +652,7 @@ struct ShapeTool : ToolBase } } - void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) + void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { imageModel.ResetToPrevious(); pointStack[pointSP].x = x; @@ -662,7 +662,7 @@ struct ShapeTool : ToolBase draw(bLeftButton, x, y, FALSE); } - void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) + void OnButtonUp(BOOL bLeftButton, LONG x, LONG y) override { imageModel.ResetToPrevious(); if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) @@ -686,13 +686,13 @@ struct ShapeTool : ToolBase pointSP--; } - void OnCancelDraw() + void OnCancelDraw() override { imageModel.Undo(TRUE); ToolBase::OnCancelDraw(); } - void OnFinishDraw() + void OnFinishDraw() override { if (pointSP) { @@ -711,7 +711,7 @@ struct EllipseTool : GenericDrawTool { } - virtual void draw(BOOL bLeftButton, LONG x, LONG y) + void draw(BOOL bLeftButton, LONG x, LONG y) override { imageModel.ResetToPrevious(); if (GetAsyncKeyState(VK_SHIFT) < 0) @@ -730,7 +730,7 @@ struct RRectTool : GenericDrawTool { } - virtual void draw(BOOL bLeftButton, LONG x, LONG y) + void draw(BOOL bLeftButton, LONG x, LONG y) override { imageModel.ResetToPrevious(); if (GetAsyncKeyState(VK_SHIFT) < 0)
1 year, 6 months
1
0
0
0
[reactos] 01/01: [MSPAINT] drawing.cpp: Refactor Erase, Replace and Airbrush
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=78c8df8393c7164f9dc1b…
commit 78c8df8393c7164f9dc1b83ad9a81c8c7ed334f6 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jun 14 16:44:54 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Jun 14 16:44:54 2023 +0900 [MSPAINT] drawing.cpp: Refactor Erase, Replace and Airbrush CORE-18867 --- base/applications/mspaint/drawing.cpp | 51 ++++++++++++++++------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/base/applications/mspaint/drawing.cpp b/base/applications/mspaint/drawing.cpp index 05599d2d2cc..40ff30bcb32 100644 --- a/base/applications/mspaint/drawing.cpp +++ b/base/applications/mspaint/drawing.cpp @@ -116,46 +116,41 @@ Fill(HDC hdc, LONG x, LONG y, COLORREF color) void Erase(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG radius) { - LONG a, b; - HPEN oldPen; - HBRUSH oldBrush = (HBRUSH) SelectObject(hdc, CreateSolidBrush(color)); + LONG cx = (x1 + x2) / 2, cy = (y1 + y2) / 2; + RECT rc = { cx - radius, cy - radius, cx + radius, cy + radius }; - b = max(1, max(abs(x2 - x1), abs(y2 - y1))); - oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); - for(a = 0; a <= b; a++) - Rectangle(hdc, - (x1 * (b - a) + x2 * a) / b - radius, - (y1 * (b - a) + y2 * a) / b - radius, - (x1 * (b - a) + x2 * a) / b + radius, - (y1 * (b - a) + y2 * a) / b + radius); - DeleteObject(SelectObject(hdc, oldBrush)); - DeleteObject(SelectObject(hdc, oldPen)); + HBRUSH hbr = ::CreateSolidBrush(color); + ::FillRect(hdc, &rc, hbr); + ::DeleteObject(hbr); } void Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LONG radius) { - LONG a, b, x, y; - b = max(1, max(abs(x2 - x1), abs(y2 - y1))); + LONG cx = (x1 + x2) / 2, cy = (y1 + y2) / 2; + RECT rc = { cx - radius, cy - radius, cx + radius, cy + radius }; - for(a = 0; a <= b; a++) - for(y = (y1 * (b - a) + y2 * a) / b - radius + 1; - y < (y1 * (b - a) + y2 * a) / b + radius + 1; y++) - for(x = (x1 * (b - a) + x2 * a) / b - radius + 1; - x < (x1 * (b - a) + x2 * a) / b + radius + 1; x++) - if (GetPixel(hdc, x, y) == fg) - SetPixel(hdc, x, y, bg); + for (LONG y = rc.top; y < rc.bottom; ++y) + { + for (LONG x = rc.left; x < rc.right; ++x) + { + if (::GetPixel(hdc, x, y) == fg) + ::SetPixelV(hdc, x, y, bg); + } + } } void Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r) { - LONG a, b; - - for(b = -r; b <= r; b++) - for(a = -r; a <= r; a++) - if ((a * a + b * b <= r * r) && (rand() % 4 == 0)) - SetPixel(hdc, x + a, y + b, color); + for (LONG dy = -r; dy <= r; dy++) + { + for (LONG dx = -r; dx <= r; dx++) + { + if ((dx * dx + dy * dy <= r * r) && (rand() % 4 == 0)) + ::SetPixelV(hdc, x + dx, y + dy, color); + } + } } void
1 year, 6 months
1
0
0
0
[reactos] 01/01: [MSPAINT] drawing.cpp: Refactor Erase, Replace and Airbrush 2
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03344980688a47267debd…
commit 03344980688a47267debdf875b458e50bac70786 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jun 14 17:03:22 2023 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Jun 14 17:03:22 2023 +0900 [MSPAINT] drawing.cpp: Refactor Erase, Replace and Airbrush 2 CORE-18867 --- base/applications/mspaint/drawing.cpp | 36 +++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/base/applications/mspaint/drawing.cpp b/base/applications/mspaint/drawing.cpp index 40ff30bcb32..de9c925f396 100644 --- a/base/applications/mspaint/drawing.cpp +++ b/base/applications/mspaint/drawing.cpp @@ -116,26 +116,42 @@ Fill(HDC hdc, LONG x, LONG y, COLORREF color) void Erase(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG radius) { - LONG cx = (x1 + x2) / 2, cy = (y1 + y2) / 2; - RECT rc = { cx - radius, cy - radius, cx + radius, cy + radius }; - + LONG b = max(1, max(abs(x2 - x1), abs(y2 - y1))); + RECT rc; HBRUSH hbr = ::CreateSolidBrush(color); - ::FillRect(hdc, &rc, hbr); + + for (LONG a = 0; a <= b; a++) + { + ::SetRect(&rc, (x1 * (b - a) + x2 * a) / b - radius, + (y1 * (b - a) + y2 * a) / b - radius, + (x1 * (b - a) + x2 * a) / b + radius, + (y1 * (b - a) + y2 * a) / b + radius); + + ::FillRect(hdc, &rc, hbr); + } + ::DeleteObject(hbr); } void Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LONG radius) { - LONG cx = (x1 + x2) / 2, cy = (y1 + y2) / 2; - RECT rc = { cx - radius, cy - radius, cx + radius, cy + radius }; + LONG b = max(1, max(abs(x2 - x1), abs(y2 - y1))); + RECT rc; - for (LONG y = rc.top; y < rc.bottom; ++y) + for (LONG a = 0; a <= b; a++) { - for (LONG x = rc.left; x < rc.right; ++x) + ::SetRect(&rc, (x1 * (b - a) + x2 * a) / b - radius, + (y1 * (b - a) + y2 * a) / b - radius, + (x1 * (b - a) + x2 * a) / b + radius, + (y1 * (b - a) + y2 * a) / b + radius); + for (LONG y = rc.top; y < rc.bottom; ++y) { - if (::GetPixel(hdc, x, y) == fg) - ::SetPixelV(hdc, x, y, bg); + for (LONG x = rc.left; x < rc.right; ++x) + { + if (::GetPixel(hdc, x, y) == fg) + ::SetPixelV(hdc, x, y, bg); + } } } }
1 year, 6 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200