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
September 2020
----- 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
25 participants
382 discussions
Start a n
N
ew thread
[reactos] 04/19: [RAPPS] update broken-img icon
by 赫杨
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cfb0963c1f2bb5db2c5ec…
commit cfb0963c1f2bb5db2c5ec6f37c82a65ccf4cbd93 Author: 赫杨 <1160386205(a)qq.com> AuthorDate: Sat Jun 20 13:00:02 2020 +0800 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Sep 6 17:09:20 2020 +0200 [RAPPS] update broken-img icon --- base/applications/rapps/res/brokenimg.ico | Bin 152126 -> 152126 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/base/applications/rapps/res/brokenimg.ico b/base/applications/rapps/res/brokenimg.ico index 58454f74041..0a455301a0f 100644 Binary files a/base/applications/rapps/res/brokenimg.ico and b/base/applications/rapps/res/brokenimg.ico differ
4 years, 3 months
1
0
0
0
[reactos] 02/19: [RAPPS] Screenshot preview and other trivial fixes (#2894)
by He Yang
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fbf119fde1fe00f0e5920…
commit fbf119fde1fe00f0e5920070d37b73983c7cfb5a Author: He Yang <1160386205(a)qq.com> AuthorDate: Sun Jun 14 21:22:58 2020 +0800 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Sep 6 17:09:19 2020 +0200 [RAPPS] Screenshot preview and other trivial fixes (#2894) * add one more layer of window * using Path* API to operate path * always use rappmgr.cab as file name when downloading db. ignore the URL * add snapshot preview window * show a broken-image icon when failed to load image * add a padding between image and content, and make sure always some space is reserved for richedit * hide the padding if snapshot window does not have a width * some work to avoid blinking when window resizing * add WM_PRINTCLIENT handling --- base/applications/rapps/CMakeLists.txt | 2 +- base/applications/rapps/available.cpp | 67 +++- base/applications/rapps/gui.cpp | 491 ++++++++++++++++++++++++++-- base/applications/rapps/include/available.h | 38 ++- base/applications/rapps/include/misc.h | 1 - base/applications/rapps/include/resource.h | 1 + base/applications/rapps/loaddlg.cpp | 15 +- base/applications/rapps/misc.cpp | 5 +- base/applications/rapps/rapps.rc | 3 +- base/applications/rapps/res/brokenimg.ico | Bin 0 -> 152126 bytes base/applications/rapps/winmain.cpp | 20 ++ 11 files changed, 574 insertions(+), 69 deletions(-) diff --git a/base/applications/rapps/CMakeLists.txt b/base/applications/rapps/CMakeLists.txt index 33225ae5c04..226a8badcbd 100644 --- a/base/applications/rapps/CMakeLists.txt +++ b/base/applications/rapps/CMakeLists.txt @@ -39,7 +39,7 @@ add_rc_deps(rapps.rc ${rapps_rc_deps}) add_executable(rapps ${SOURCE} rapps.rc) set_module_type(rapps win32gui UNICODE) target_link_libraries(rapps uuid wine) -add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 setupapi msvcrt kernel32 ntdll) +add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 setupapi gdiplus msvcrt kernel32 ntdll) add_pch(rapps include/rapps.h SOURCE) add_dependencies(rapps rappsmsg) add_message_headers(ANSI rappsmsg.mc) diff --git a/base/applications/rapps/available.cpp b/base/applications/rapps/available.cpp index c7c78e180a9..be376c1c05b 100644 --- a/base/applications/rapps/available.cpp +++ b/base/applications/rapps/available.cpp @@ -18,23 +18,23 @@ #include <atlstr.h> // CAvailableApplicationInfo -CAvailableApplicationInfo::CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam) +CAvailableApplicationInfo::CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam, AvailableStrings& AvlbStrings) : m_IsSelected(FALSE), m_LicenseType(LICENSE_NONE), m_SizeBytes(0), m_sFileName(sFileNameParam), m_IsInstalled(FALSE), m_HasLanguageInfo(FALSE), m_HasInstalledVersion(FALSE) { - RetrieveGeneralInfo(); + RetrieveGeneralInfo(AvlbStrings); } -VOID CAvailableApplicationInfo::RefreshAppInfo() +VOID CAvailableApplicationInfo::RefreshAppInfo(AvailableStrings& AvlbStrings) { if (m_szUrlDownload.IsEmpty()) { - RetrieveGeneralInfo(); + RetrieveGeneralInfo(AvlbStrings); } } // Lazily load general info from the file -VOID CAvailableApplicationInfo::RetrieveGeneralInfo() +VOID CAvailableApplicationInfo::RetrieveGeneralInfo(AvailableStrings& AvlbStrings) { m_Parser = new CConfigParser(m_sFileName); @@ -52,10 +52,31 @@ VOID CAvailableApplicationInfo::RetrieveGeneralInfo() GetString(L"License", m_szLicense); GetString(L"Description", m_szDesc); GetString(L"URLSite", m_szUrlSite); - GetString(L"CDPath", m_szCDPath); - GetString(L"Language", m_szRegName); GetString(L"SHA1", m_szSHA1); + static_assert(MAX_SNAPSHOT_NUM < 10000, "MAX_SNAPSHOT_NUM is too big"); + for (int i = 0; i < MAX_SNAPSHOT_NUM; i++) + { + WCHAR SnapshotField[sizeof("Snapshot") + 4]; + wsprintfW(SnapshotField, L"Snapshot%d", i + 1); + ATL::CStringW SnapshotFileName; + if (!GetString(SnapshotField, SnapshotFileName)) + { + continue; + } + + // TODO: Add URL Support + + // TODO: Does the filename contain anything stuff like "\\" ".." ":" "<" ">" ? + // these stuff may lead to security issues + + ATL::CStringW SnapshotName = AvlbStrings.szAppsPath; + PathAppendW(SnapshotName.GetBuffer(MAX_PATH), L"snapshots"); + PathAppendW(SnapshotName.GetBuffer(), SnapshotFileName.GetString()); + SnapshotName.ReleaseBuffer(); + m_szSnapshotFilename.Add(SnapshotName); + } + RetrieveSize(); RetrieveLicenseType(); RetrieveLanguages(); @@ -209,6 +230,16 @@ BOOL CAvailableApplicationInfo::HasUpdate() const return (m_szInstalledVersion.Compare(m_szVersion) < 0) ? TRUE : FALSE; } +BOOL CAvailableApplicationInfo::RetrieveSnapshot(UINT Index,ATL::CStringW& SnapshotFileName) const +{ + if (Index >= (UINT)m_szSnapshotFilename.GetSize()) + { + return FALSE; + } + SnapshotFileName = m_szSnapshotFilename[Index]; + return TRUE; +} + VOID CAvailableApplicationInfo::SetLastWriteTime(FILETIME* ftTime) { RtlCopyMemory(&m_ftCacheStamp, ftTime, sizeof(FILETIME)); @@ -231,11 +262,19 @@ AvailableStrings::AvailableStrings() //FIXME: maybe provide a fallback? if (GetStorageDirectory(szPath)) { - szAppsPath = szPath + L"\\rapps\\"; + szAppsPath = szPath; + PathAppendW(szAppsPath.GetBuffer(MAX_PATH), L"rapps"); + szAppsPath.ReleaseBuffer(); + szCabName = L"rappmgr.cab"; szCabDir = szPath; - szCabPath = (szCabDir + L"\\") + szCabName; - szSearchPath = szAppsPath + L"*.txt"; + szCabPath = szCabDir; + PathAppendW(szCabPath.GetBuffer(MAX_PATH), szCabName); + szCabPath.ReleaseBuffer(); + + szSearchPath = szAppsPath; + PathAppendW(szSearchPath.GetBuffer(MAX_PATH), L"*.txt"); + szSearchPath.ReleaseBuffer(); } } // AvailableStrings @@ -273,7 +312,9 @@ VOID CAvailableApps::DeleteCurrentAppsDB() ATL::CStringW szTmp; do { - szTmp = m_Strings.szAppsPath + FindFileData.cFileName; + szTmp = m_Strings.szAppsPath; + PathAppendW(szTmp.GetBuffer(MAX_PATH), FindFileData.cFileName); + szTmp.ReleaseBuffer(); DeleteFileW(szTmp.GetString()); } while (FindNextFileW(hFind, &FindFileData) != 0); FindClose(hFind); @@ -369,7 +410,7 @@ BOOL CAvailableApps::Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param) } // create a new entry - Info = new CAvailableApplicationInfo(FindFileData.cFileName); + Info = new CAvailableApplicationInfo(FindFileData.cFileName, m_Strings); // set a timestamp for the next time Info->SetLastWriteTime(&FindFileData.ftLastWriteTime); @@ -380,7 +421,7 @@ skip_if_cached: || EnumType == ENUM_ALL_AVAILABLE || (EnumType == ENUM_CAT_SELECTED && Info->m_IsSelected)) { - Info->RefreshAppInfo(); + Info->RefreshAppInfo(m_Strings); if (lpEnumProc) lpEnumProc(Info, m_Strings.szAppsPath.GetString(), param); diff --git a/base/applications/rapps/gui.cpp b/base/applications/rapps/gui.cpp index a1d1e0075c8..e8d2e4057de 100644 --- a/base/applications/rapps/gui.cpp +++ b/base/applications/rapps/gui.cpp @@ -17,15 +17,48 @@ #include <atlbase.h> #include <atlcom.h> +#include <atltypes.h> #include <atlwin.h> #include <wininet.h> #include <shellutils.h> #include <rosctrls.h> +#include <gdiplus.h> +#include <math.h> + +using namespace Gdiplus; #define SEARCH_TIMER_ID 'SR' #define LISTVIEW_ICON_SIZE 24 #define TREEVIEW_ICON_SIZE 24 +// default broken-image icon size +#define BROKENIMG_ICON_SIZE 96 + +// the boundary of w/h ratio of snapshot preview window +#define SNPSHT_MAX_ASPECT_RAT 2.5 + +// padding between snapshot preview and richedit (in pixel) +#define INFO_DISPLAY_PADDING 10 + +// minimum width of richedit +#define RICHEDIT_MIN_WIDTH 160 + +enum SNPSHT_STATUS +{ + SNPSHTPREV_EMPTY, // show nothing + SNPSHTPREV_LOADING, // image is loading (most likely downloading) + SNPSHTPREV_FILE, // display image from a file + SNPSHTPREV_FAILED // image can not be shown (download failure or wrong image) +}; + +#define TIMER_LOADING_ANIMATION 1 // Timer ID + +#define LOADING_ANIMATION_PERIOD 3 // Animation cycling period (in seconds) +#define LOADING_ANIMATION_FPS 18 // Animation Frame Per Second + + +#define PI 3.1415927 + INT GetSystemColorDepth() { DEVMODEW pDevMode; @@ -257,6 +290,322 @@ public: } }; +class CAppSnapshotPreview : + public CWindowImpl<CAppSnapshotPreview> +{ +private: + + SNPSHT_STATUS SnpshtPrevStauts = SNPSHTPREV_EMPTY; + Image* pImage = NULL; + HICON hBrokenImgIcon = NULL; + BOOL bLoadingTimerOn = FALSE; + int LoadingAnimationFrame = 0; + int BrokenImgSize = BROKENIMG_ICON_SIZE; + + BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT& theResult, DWORD dwMapId) + { + theResult = 0; + switch (Msg) + { + case WM_CREATE: + hBrokenImgIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_BROKEN_IMAGE), IMAGE_ICON, BrokenImgSize, BrokenImgSize, 0); + break; + case WM_SIZE: + { + if (BrokenImgSize != min(min(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), BROKENIMG_ICON_SIZE)) + { + BrokenImgSize = min(min(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)), BROKENIMG_ICON_SIZE); + + if (hBrokenImgIcon) + { + DeleteObject(hBrokenImgIcon); + hBrokenImgIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_BROKEN_IMAGE), IMAGE_ICON, BrokenImgSize, BrokenImgSize, 0); + } + } + break; + } + case WM_PAINT: + { + PAINTSTRUCT ps; + HDC hdc = BeginPaint(&ps); + CRect rect; + GetClientRect(&rect); + + PaintOnDC(hdc, + rect.Width(), + rect.Height(), + ps.fErase); + + EndPaint(&ps); + break; + } + case WM_PRINTCLIENT: + { + if (lParam & PRF_CHECKVISIBLE) + { + if (!IsWindowVisible()) break; + } + CRect rect; + GetClientRect(&rect); + + PaintOnDC((HDC)wParam, + rect.Width(), + rect.Height(), + lParam & PRF_ERASEBKGND); + break; + } + case WM_ERASEBKGND: + { + return TRUE; // do not erase to avoid blinking + } + case WM_TIMER: + { + switch (wParam) + { + case TIMER_LOADING_ANIMATION: + LoadingAnimationFrame++; + LoadingAnimationFrame %= (LOADING_ANIMATION_PERIOD * LOADING_ANIMATION_FPS); + HDC hdc = GetDC(); + CRect rect; + GetClientRect(&rect); + + PaintOnDC(hdc, + rect.Width(), + rect.Height(), + TRUE); + ReleaseDC(hdc); + } + break; + } + case WM_DESTROY: + { + PreviousDisplayCleanup(); + DeleteObject(hBrokenImgIcon); + hBrokenImgIcon = NULL; + break; + } + } + return FALSE; + } + + VOID SetStatus(SNPSHT_STATUS Status) + { + SnpshtPrevStauts = Status; + } + + VOID PaintOnDC(HDC hdc, int width, int height, BOOL bDrawBkgnd) + { + // use an off screen dc to avoid blinking + HDC hdcMem = CreateCompatibleDC(hdc); + HBITMAP hBitmap = CreateCompatibleBitmap(hdc, width, height); + SelectObject(hdcMem, hBitmap); + + if (bDrawBkgnd) + { + HBRUSH hOldBrush = (HBRUSH)SelectObject(hdcMem, (HGDIOBJ)GetSysColorBrush(COLOR_BTNFACE)); + PatBlt(hdcMem, 0, 0, width, height, PATCOPY); + SelectObject(hdcMem, hOldBrush); + } + + switch (SnpshtPrevStauts) + { + case SNPSHTPREV_EMPTY: + { + + } + break; + + case SNPSHTPREV_LOADING: + { + Graphics graphics(hdcMem); + Color color(255, 0, 0); + SolidBrush dotBrush(Color(255, 100, 100, 100)); + + graphics.SetSmoothingMode(SmoothingMode::SmoothingModeAntiAlias); + + // Paint three dot + float DotWidth = GetLoadingDotWidth(width, height); + graphics.FillEllipse((Brush*)(&dotBrush), + (REAL)width / 2.0 - min(width, height) * 2.0 / 16.0 - DotWidth / 2.0, + (REAL)height / 2.0 - GetFrameDotShift(LoadingAnimationFrame + LOADING_ANIMATION_FPS / 4, width, height) - DotWidth / 2.0, + DotWidth, + DotWidth); + + graphics.FillEllipse((Brush*)(&dotBrush), + (REAL)width / 2.0 - DotWidth / 2.0, + (REAL)height / 2.0 - GetFrameDotShift(LoadingAnimationFrame, width, height) - DotWidth / 2.0, + DotWidth, + DotWidth); + + graphics.FillEllipse((Brush*)(&dotBrush), + (REAL)width / 2.0 + min(width, height) * 2.0 / 16.0 - DotWidth / 2.0, + (REAL)height / 2.0 - GetFrameDotShift(LoadingAnimationFrame - LOADING_ANIMATION_FPS / 4, width, height) - DotWidth / 2.0, + DotWidth, + DotWidth); + } + break; + + case SNPSHTPREV_FILE: + { + if (pImage) + { + // always draw entire image inside the window. + Graphics graphics(hdcMem); + float ZoomRatio = min(((float)width / (float)pImage->GetWidth()), ((float)height / (float)pImage->GetHeight())); + float ZoomedImgWidth = ZoomRatio * (float)pImage->GetWidth(); + float ZoomedImgHeight = ZoomRatio * (float)pImage->GetHeight(); + + graphics.DrawImage(pImage, + ((float)width - ZoomedImgWidth) / 2.0, ((float)height - ZoomedImgHeight) / 2.0, + ZoomedImgWidth, ZoomedImgHeight); + } + } + break; + + case SNPSHTPREV_FAILED: + { + DrawIconEx(hdcMem, + (width - BrokenImgSize) / 2, + (height - BrokenImgSize) / 2, + hBrokenImgIcon, + BrokenImgSize, + BrokenImgSize, + NULL, + NULL, + DI_NORMAL | DI_COMPAT); + } + break; + } + + // copy the content form off-screen dc to hdc + BitBlt(hdc, 0, 0, width, height, hdcMem, 0, 0, SRCCOPY); + DeleteDC(hdcMem); + DeleteObject(hBitmap); + } + + float GetLoadingDotWidth(int width, int height) + { + return min(width, height) / 20.0; + } + + float GetFrameDotShift(int Frame, int width, int height) + { + return min(width, height) * + (1.0 / 16.0) * + (2.0 / (2.0 - sqrt(3.0))) * + (max(sin((float)Frame * 2 * PI / (LOADING_ANIMATION_PERIOD * LOADING_ANIMATION_FPS)), sqrt(3.0) / 2.0) - sqrt(3.0) / 2.0); + } + +public: + static ATL::CWndClassInfo& GetWndClassInfo() + { + DWORD csStyle = CS_VREDRAW | CS_HREDRAW; + static ATL::CWndClassInfo wc = + { + { + sizeof(WNDCLASSEX), + csStyle, + StartWindowProc, + 0, + 0, + NULL, + 0, + LoadCursorW(NULL, IDC_ARROW), + (HBRUSH)(COLOR_BTNFACE + 1), + 0, + L"RAppsSnapshotPreview", + NULL + }, + NULL, NULL, IDC_ARROW, TRUE, 0, _T("") + }; + return wc; + } + + HWND Create(HWND hParent) + { + RECT r = { 0,0,0,0 }; + + return CWindowImpl::Create(hParent, r, L"", WS_CHILD | WS_VISIBLE); + } + + VOID PreviousDisplayCleanup() + { + if (bLoadingTimerOn) + { + KillTimer(TIMER_LOADING_ANIMATION); + bLoadingTimerOn = FALSE; + } + LoadingAnimationFrame = 0; + if (pImage) + { + delete pImage; + pImage = NULL; + } + } + + VOID DisplayEmpty() + { + SetStatus(SNPSHTPREV_EMPTY); + PreviousDisplayCleanup(); + } + + VOID DisplayLoading() + { + SetStatus(SNPSHTPREV_LOADING); + PreviousDisplayCleanup(); + bLoadingTimerOn = TRUE; + SetTimer(TIMER_LOADING_ANIMATION, 1000 / LOADING_ANIMATION_FPS, 0); + } + + BOOL DisplayFile(LPCWSTR lpszFileName) + { + SetStatus(SNPSHTPREV_FILE); + PreviousDisplayCleanup(); + pImage = Bitmap::FromFile(lpszFileName, 0); + if (pImage->GetLastStatus() != Ok) + { + DisplayFailed(); + return FALSE; + } + return TRUE; + } + + VOID DisplayFailed() + { + SetStatus(SNPSHTPREV_FAILED); + PreviousDisplayCleanup(); + } + + int GetRequestedWidth(int Height) // calculate requested window width by given height + { + switch (SnpshtPrevStauts) + { + case SNPSHTPREV_EMPTY: + return 0; + case SNPSHTPREV_LOADING: + return 200; + case SNPSHTPREV_FILE: + if (pImage) + { + // return the width needed to display image inside the window. + // and always keep window w/h ratio inside [ 1/SNPSHT_MAX_ASPECT_RAT, SNPSHT_MAX_ASPECT_RAT ] + return (int)floor((float)Height * + max(min((float)pImage->GetWidth() / (float)pImage->GetHeight(), (float)SNPSHT_MAX_ASPECT_RAT), 1.0/ (float)SNPSHT_MAX_ASPECT_RAT)); + } + return 0; + case SNPSHTPREV_FAILED: + return 200; + default: + return 0; + } + } + + ~CAppSnapshotPreview() + { + PreviousDisplayCleanup(); + } +}; + class CAppInfoDisplay : public CUiWindow<CWindowImpl<CAppInfoDisplay>> { @@ -272,16 +621,18 @@ private: { RichEdit = new CAppRichEdit(); RichEdit->Create(hwnd); + + SnpshtPrev = new CAppSnapshotPreview(); + SnpshtPrev->Create(hwnd); break; } case WM_SIZE: { - ::MoveWindow(RichEdit->m_hWnd, 0, 0, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), TRUE); + ResizeChildren(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); break; } case WM_COMMAND: { - OnCommand(wParam, lParam); break; } @@ -304,9 +655,94 @@ private: return FALSE; } + VOID ResizeChildren() + { + CRect rect; + GetWindowRect(&rect); + ResizeChildren(rect.Width(), rect.Height()); + } + + VOID ResizeChildren(int Width, int Height) + { + int SnpshtWidth = SnpshtPrev->GetRequestedWidth(Height); + + // make sure richedit always have room to display + SnpshtWidth = min(SnpshtWidth, Width - INFO_DISPLAY_PADDING - RICHEDIT_MIN_WIDTH); + + DWORD dwError = ERROR_SUCCESS; + HDWP hDwp = BeginDeferWindowPos(2); + + if (hDwp) + { + hDwp = ::DeferWindowPos(hDwp, SnpshtPrev->m_hWnd, NULL, + 0, 0, SnpshtWidth, Height, 0); + + if (hDwp) + { + // hide the padding if snapshot window width == 0 + int RicheditPosX = SnpshtWidth ? (SnpshtWidth + INFO_DISPLAY_PADDING) : 0; + + hDwp = ::DeferWindowPos(hDwp, RichEdit->m_hWnd, NULL, + RicheditPosX, 0, Width - RicheditPosX, Height, 0); + + if (hDwp) + { + EndDeferWindowPos(hDwp); + } + else + { + dwError = GetLastError(); + } + } + else + { + dwError = GetLastError(); + } + } + else + { + dwError = GetLastError(); + } + + +#if DBG + ATLASSERT(dwError == ERROR_SUCCESS); +#endif + + UpdateWindow(); + } + + VOID OnLink(ENLINK* Link) + { + switch (Link->msg) + { + case WM_LBUTTONUP: + case WM_RBUTTONUP: + { + if (pLink) HeapFree(GetProcessHeap(), 0, pLink); + + pLink = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, + (max(Link->chrg.cpMin, Link->chrg.cpMax) - + min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR)); + if (!pLink) + { + /* TODO: Error message */ + return; + } + + RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax); + RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink); + + ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1); + } + break; + } + } + public: CAppRichEdit * RichEdit; + CAppSnapshotPreview * SnpshtPrev; static ATL::CWndClassInfo& GetWndClassInfo() { @@ -336,51 +772,38 @@ public: { RECT r = { 0,0,0,0 }; - return CWindowImpl::Create(hwndParent, r, L"", WS_CHILD | WS_VISIBLE); + return CWindowImpl::Create(hwndParent, r, L"", WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); } BOOL ShowAvailableAppInfo(CAvailableApplicationInfo* Info) { + ATL::CStringW SnapshotFilename; + if (Info->RetrieveSnapshot(0, SnapshotFilename)) + { + SnpshtPrev->DisplayFile(SnapshotFilename); + } + else + { + SnpshtPrev->DisplayEmpty(); + } + ResizeChildren(); return RichEdit->ShowAvailableAppInfo(Info); } BOOL ShowInstalledAppInfo(PINSTALLED_INFO Info) { + SnpshtPrev->DisplayEmpty(); + ResizeChildren(); return RichEdit->ShowInstalledAppInfo(Info); } VOID SetWelcomeText() { + SnpshtPrev->DisplayEmpty(); + ResizeChildren(); RichEdit->SetWelcomeText(); } - VOID OnLink(ENLINK* Link) - { - switch (Link->msg) - { - case WM_LBUTTONUP: - case WM_RBUTTONUP: - { - if (pLink) HeapFree(GetProcessHeap(), 0, pLink); - - pLink = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, - (max(Link->chrg.cpMin, Link->chrg.cpMax) - - min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR)); - if (!pLink) - { - /* TODO: Error message */ - return; - } - - RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax); - RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink); - - ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1); - } - break; - } - } - VOID OnCommand(WPARAM wParam, LPARAM lParam) { WORD wCommand = LOWORD(wParam); @@ -1804,8 +2227,12 @@ private: } /* Load icon from file */ - ATL::CStringW szIconPath; - szIconPath.Format(L"%lsicons\\%ls.ico", szFolderPath, Info->m_szName.GetString()); + ATL::CStringW szIconPath = szFolderPath; + PathAppendW(szIconPath.GetBuffer(MAX_PATH), L"icons"); + PathAppendW(szIconPath.GetBuffer(), Info->m_szName.GetString()); + PathAddExtensionW(szIconPath.GetBuffer(), L".ico"); + szIconPath.ReleaseBuffer(); + hIcon = (HICON) LoadImageW(NULL, szIconPath.GetString(), IMAGE_ICON, diff --git a/base/applications/rapps/include/available.h b/base/applications/rapps/include/available.h index 5e3a464fc03..e52c1970a30 100644 --- a/base/applications/rapps/include/available.h +++ b/base/applications/rapps/include/available.h @@ -7,6 +7,9 @@ #include "misc.h" + +#define MAX_SNAPSHOT_NUM 16 + enum LicenseType { LICENSE_NONE, @@ -22,6 +25,18 @@ inline BOOL IsLicenseType(INT x) return (x >= LICENSE_MIN && x <= LICENSE_MAX); } +struct AvailableStrings +{ + ATL::CStringW szPath; + ATL::CStringW szCabPath; + ATL::CStringW szAppsPath; + ATL::CStringW szSearchPath; + ATL::CStringW szCabName; + ATL::CStringW szCabDir; + + AvailableStrings(); +}; + struct CAvailableApplicationInfo { INT m_Category; @@ -35,8 +50,9 @@ struct CAvailableApplicationInfo ATL::CStringW m_szSize; ATL::CStringW m_szUrlSite; ATL::CStringW m_szUrlDownload; - ATL::CStringW m_szCDPath; ATL::CSimpleArray<LCID> m_LanguageLCIDs; + ATL::CSimpleArray<ATL::CStringW> m_szSnapshotFilename; + ULONG m_SizeBytes; // Caching mechanism related entries @@ -48,17 +64,17 @@ struct CAvailableApplicationInfo ATL::CStringW m_szInstalledVersion; // Create an object from file - CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam); + CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam, AvailableStrings& m_Strings); // Load all info from the file - VOID RefreshAppInfo(); + VOID RefreshAppInfo(AvailableStrings& m_Strings); BOOL HasLanguageInfo() const; BOOL HasNativeLanguage() const; BOOL HasEnglishLanguage() const; BOOL IsInstalled() const; BOOL HasInstalledVersion() const; BOOL HasUpdate() const; - + BOOL RetrieveSnapshot(UINT Index, ATL::CStringW& SnapshotFileName) const; // Set a timestamp VOID SetLastWriteTime(FILETIME* ftTime); @@ -71,7 +87,7 @@ private: inline BOOL GetString(LPCWSTR lpKeyName, ATL::CStringW& ReturnedString); // Lazily load general info from the file - VOID RetrieveGeneralInfo(); + VOID RetrieveGeneralInfo(AvailableStrings& m_Strings); VOID RetrieveInstalledStatus(); VOID RetrieveInstalledVersion(); VOID RetrieveLanguages(); @@ -82,18 +98,6 @@ private: typedef BOOL(CALLBACK *AVAILENUMPROC)(CAvailableApplicationInfo *Info, LPCWSTR szFolderPath, PVOID param); -struct AvailableStrings -{ - ATL::CStringW szPath; - ATL::CStringW szCabPath; - ATL::CStringW szAppsPath; - ATL::CStringW szSearchPath; - ATL::CStringW szCabName; - ATL::CStringW szCabDir; - - AvailableStrings(); -}; - class CAvailableApps { static AvailableStrings m_Strings; diff --git a/base/applications/rapps/include/misc.h b/base/applications/rapps/include/misc.h index fd914c4c468..50354c0f7ff 100644 --- a/base/applications/rapps/include/misc.h +++ b/base/applications/rapps/include/misc.h @@ -9,7 +9,6 @@ INT GetClientWindowWidth(HWND hwnd); INT GetClientWindowHeight(HWND hwnd); VOID CopyTextToClipboard(LPCWSTR lpszText); -VOID SetWelcomeText(); VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem); VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem); BOOL StartProcess(ATL::CStringW &Path, BOOL Wait); diff --git a/base/applications/rapps/include/resource.h b/base/applications/rapps/include/resource.h index 49dc2105b4f..26b6cf706db 100644 --- a/base/applications/rapps/include/resource.h +++ b/base/applications/rapps/include/resource.h @@ -14,6 +14,7 @@ #define IDI_UPDATE_DB 20 #define IDI_CHECK_ALL 21 #define IDI_SELECTEDFORINST 22 +#define IDI_BROKEN_IMAGE 23 /* Icons for categories */ #define IDI_CAT_AUDIO 50 diff --git a/base/applications/rapps/loaddlg.cpp b/base/applications/rapps/loaddlg.cpp index cc88af6cc16..60f999967cb 100644 --- a/base/applications/rapps/loaddlg.cpp +++ b/base/applications/rapps/loaddlg.cpp @@ -650,8 +650,19 @@ unsigned int WINAPI CDownloadManager::ThreadFunc(LPVOID param) } // append a \ to the provided file system path, and the filename portion from the URL after that - Path += L"\\"; - Path += (LPWSTR) (p + 1); + + PathAddBackslashW(Path.GetBuffer(MAX_PATH)); + switch (InfoArray[iAppId].DLType) + { + case DLTYPE_DBUPDATE: + case DLTYPE_DBUPDATE_UNOFFICIAL: + PathAppendW(Path.GetBuffer(), L"rappmgr.cab"); // whatever the URL is, use the file name L"rappmgr.cab" + break; + case DLTYPE_APPLICATION: + PathAppendW(Path.GetBuffer(), (LPWSTR)(p + 1)); // use the filename retrieved from URL + break; + } + Path.ReleaseBuffer(); if ((InfoArray[iAppId].DLType == DLTYPE_APPLICATION) && InfoArray[iAppId].szSHA1[0] && GetFileAttributesW(Path.GetString()) != INVALID_FILE_ATTRIBUTES) { diff --git a/base/applications/rapps/misc.cpp b/base/applications/rapps/misc.cpp index d0f13cac232..9ee6a391f63 100644 --- a/base/applications/rapps/misc.cpp +++ b/base/applications/rapps/misc.cpp @@ -177,14 +177,15 @@ BOOL StartProcess(LPWSTR lpPath, BOOL Wait) BOOL GetStorageDirectory(ATL::CStringW& Directory) { - if (!SHGetSpecialFolderPathW(NULL, Directory.GetBuffer(MAX_PATH), CSIDL_LOCAL_APPDATA, TRUE)) + LPWSTR DirectoryStr = Directory.GetBuffer(MAX_PATH); + if (!SHGetSpecialFolderPathW(NULL, DirectoryStr, CSIDL_LOCAL_APPDATA, TRUE)) { Directory.ReleaseBuffer(); return FALSE; } + PathAppendW(DirectoryStr, L"rapps"); Directory.ReleaseBuffer(); - Directory += L"\\rapps"; return (CreateDirectoryW(Directory.GetString(), NULL) || GetLastError() == ERROR_ALREADY_EXISTS); } diff --git a/base/applications/rapps/rapps.rc b/base/applications/rapps/rapps.rc index c67e1de5442..5debb642bdd 100644 --- a/base/applications/rapps/rapps.rc +++ b/base/applications/rapps/rapps.rc @@ -23,6 +23,8 @@ IDI_APPUPD ICON "res/appupd.ico" IDI_CATEGORY ICON "res/cat.ico" IDI_UPDATE_DB ICON "res/updatedb.ico" IDI_CHECK_ALL ICON "res/select.ico" +IDI_SELECTEDFORINST ICON "res/select.ico" +IDI_BROKEN_IMAGE ICON "res/brokenimg.ico" /* Categories */ IDI_CAT_AUDIO ICON "res/cats/audio.ico" @@ -41,7 +43,6 @@ IDI_CAT_SCIENCE ICON "res/cats/science.ico" IDI_CAT_TOOLS ICON "res/cats/tools.ico" IDI_CAT_VIDEO ICON "res/cats/video.ico" IDI_CAT_THEMES ICON "res/cats/themes.ico" -IDI_SELECTEDFORINST ICON "res/select.ico" /* Accelerators -- key bindings */ HOTKEYS ACCELERATORS diff --git a/base/applications/rapps/res/brokenimg.ico b/base/applications/rapps/res/brokenimg.ico new file mode 100644 index 00000000000..58454f74041 Binary files /dev/null and b/base/applications/rapps/res/brokenimg.ico differ diff --git a/base/applications/rapps/winmain.cpp b/base/applications/rapps/winmain.cpp index d55edca46fa..ad14c9fd80b 100644 --- a/base/applications/rapps/winmain.cpp +++ b/base/applications/rapps/winmain.cpp @@ -13,6 +13,8 @@ #include <atlcom.h> +#include <gdiplus.h> + HWND hMainWnd; HINSTANCE hInst; SETTINGS_INFO SettingsInfo; @@ -28,6 +30,10 @@ END_OBJECT_MAP() CRAppsModule gModule; CAtlWinModule gWinModule; +Gdiplus::GdiplusStartupInput gdiplusStartupInput; +ULONG_PTR gdiplusToken; + + static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize) { if (bInitialize) @@ -40,6 +46,18 @@ static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize) } } +VOID InitializeGDIPlus(BOOL bInitialize) +{ + if (bInitialize) + { + Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + } + else + { + Gdiplus::GdiplusShutdown(gdiplusToken); + } +} + VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo) { ATL::CStringW szDownloadDir; @@ -129,6 +147,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi BOOL bIsFirstLaunch; InitializeAtlModule(hInstance, TRUE); + InitializeGDIPlus(TRUE); if (GetUserDefaultUILanguage() == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT)) { @@ -169,6 +188,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi if (hMutex) CloseHandle(hMutex); + InitializeGDIPlus(FALSE); InitializeAtlModule(hInstance, FALSE); return 0;
4 years, 3 months
1
0
0
0
[reactos] 01/19: [RAPPS] add a layer of window above the richedit (#2871)
by He Yang
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eacaf65459b81610f17e9…
commit eacaf65459b81610f17e92865c429ab59866ae8e Author: He Yang <1160386205(a)qq.com> AuthorDate: Fri Jun 5 23:32:08 2020 +0800 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Sep 6 17:09:12 2020 +0200 [RAPPS] add a layer of window above the richedit (#2871) * add one more layer of window * use ATL to create window * set pLink to NULL to avoid wild pointer --- base/applications/rapps/gui.cpp | 216 ++++++++++++++++++++++++--------- base/applications/rapps/include/misc.h | 1 + base/applications/rapps/misc.cpp | 10 +- base/applications/rapps/winmain.cpp | 2 +- 4 files changed, 171 insertions(+), 58 deletions(-) diff --git a/base/applications/rapps/gui.cpp b/base/applications/rapps/gui.cpp index 65209073ce6..a1d1e0075c8 100644 --- a/base/applications/rapps/gui.cpp +++ b/base/applications/rapps/gui.cpp @@ -1,4 +1,4 @@ -/* +/* * PROJECT: ReactOS Applications Manager * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) * FILE: base/applications/rapps/gui.cpp @@ -53,7 +53,7 @@ INT GetSystemColorDepth() return ColorDepth; } -class CAppRichEdit: +class CAppRichEdit : public CUiWindow<CRichEdit> { private: @@ -257,6 +257,154 @@ public: } }; +class CAppInfoDisplay : + public CUiWindow<CWindowImpl<CAppInfoDisplay>> +{ + LPWSTR pLink = NULL; + +private: + BOOL ProcessWindowMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT& theResult, DWORD dwMapId) + { + theResult = 0; + switch (message) + { + case WM_CREATE: + { + RichEdit = new CAppRichEdit(); + RichEdit->Create(hwnd); + break; + } + case WM_SIZE: + { + ::MoveWindow(RichEdit->m_hWnd, 0, 0, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), TRUE); + break; + } + case WM_COMMAND: + { + + OnCommand(wParam, lParam); + break; + } + case WM_NOTIFY: + { + NMHDR* NotifyHeader = (NMHDR*)lParam; + if (NotifyHeader->hwndFrom == RichEdit->m_hWnd) + { + switch (NotifyHeader->code) + { + case EN_LINK: + OnLink((ENLINK*)lParam); + break; + } + } + break; + } + } + + return FALSE; + } + +public: + + CAppRichEdit * RichEdit; + + static ATL::CWndClassInfo& GetWndClassInfo() + { + DWORD csStyle = CS_VREDRAW | CS_HREDRAW; + static ATL::CWndClassInfo wc = + { + { + sizeof(WNDCLASSEX), + csStyle, + StartWindowProc, + 0, + 0, + NULL, + NULL, + NULL, + (HBRUSH)(COLOR_BTNFACE + 1), + NULL, + L"RAppsAppInfo", + NULL + }, + NULL, NULL, IDC_ARROW, TRUE, 0, _T("") + }; + return wc; + } + + HWND Create(HWND hwndParent) + { + RECT r = { 0,0,0,0 }; + + return CWindowImpl::Create(hwndParent, r, L"", WS_CHILD | WS_VISIBLE); + } + + BOOL ShowAvailableAppInfo(CAvailableApplicationInfo* Info) + { + return RichEdit->ShowAvailableAppInfo(Info); + } + + BOOL ShowInstalledAppInfo(PINSTALLED_INFO Info) + { + return RichEdit->ShowInstalledAppInfo(Info); + } + + VOID SetWelcomeText() + { + RichEdit->SetWelcomeText(); + } + + VOID OnLink(ENLINK* Link) + { + switch (Link->msg) + { + case WM_LBUTTONUP: + case WM_RBUTTONUP: + { + if (pLink) HeapFree(GetProcessHeap(), 0, pLink); + + pLink = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, + (max(Link->chrg.cpMin, Link->chrg.cpMax) - + min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR)); + if (!pLink) + { + /* TODO: Error message */ + return; + } + + RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax); + RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink); + + ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1); + } + break; + } + } + + VOID OnCommand(WPARAM wParam, LPARAM lParam) + { + WORD wCommand = LOWORD(wParam); + + switch (wCommand) + { + case ID_OPEN_LINK: + + ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE); + HeapFree(GetProcessHeap(), 0, pLink); + pLink = NULL; + break; + + case ID_COPY_LINK: + CopyTextToClipboard(pLink); + HeapFree(GetProcessHeap(), 0, pLink); + pLink = NULL; + break; + + } + } + +}; + class CMainToolbar : public CUiWindow< CToolbar<> > { @@ -759,13 +907,11 @@ class CMainWindow : CSideTreeView* m_TreeView; CUiWindow<CStatusBar>* m_StatusBar; - CAppRichEdit* m_RichEdit; + CAppInfoDisplay* m_AppInfo; CUiWindow<CSearchBar>* m_SearchBar; CAvailableApps m_AvailableApps; - LPWSTR pLink; - INT nSelectedApps; BOOL bSearchEnabled; @@ -777,7 +923,6 @@ class CMainWindow : public: CMainWindow() : m_ClientPanel(NULL), - pLink(NULL), bSearchEnabled(FALSE), SelectedEnumType(ENUM_ALL_INSTALLED) { @@ -878,12 +1023,12 @@ private: BOOL CreateRichEdit() { - m_RichEdit = new CAppRichEdit(); - m_RichEdit->m_VerticalAlignment = UiAlign_Stretch; - m_RichEdit->m_HorizontalAlignment = UiAlign_Stretch; - m_HSplitter->Second().Append(m_RichEdit); + m_AppInfo = new CAppInfoDisplay(); + m_AppInfo->m_VerticalAlignment = UiAlign_Stretch; + m_AppInfo->m_HorizontalAlignment = UiAlign_Stretch; + m_HSplitter->Second().Append(m_AppInfo); - return m_RichEdit->Create(m_hWnd) != NULL; + return m_AppInfo->Create(m_hWnd) != NULL; } BOOL CreateVSplitter() @@ -998,7 +1143,7 @@ private: PINSTALLED_INFO Info = (PINSTALLED_INFO) m_ListView->GetItemData(Index); - m_RichEdit->ShowInstalledAppInfo(Info); + m_AppInfo->ShowInstalledAppInfo(Info); } else if (IsAvailableEnum(SelectedEnumType)) { @@ -1007,7 +1152,7 @@ private: CAvailableApplicationInfo* Info = (CAvailableApplicationInfo*) m_ListView->GetItemData(Index); - m_RichEdit->ShowAvailableAppInfo(Info); + m_AppInfo->ShowAvailableAppInfo(Info); } } @@ -1372,9 +1517,7 @@ private: } break; - case EN_LINK: - OnLink((ENLINK*) lParam); - break; + case TTN_GETDISPINFO: m_Toolbar->OnGetDispInfo((LPTOOLTIPTEXT) lParam); @@ -1423,33 +1566,6 @@ private: return FALSE; } - virtual VOID OnLink(ENLINK *Link) - { - switch (Link->msg) - { - case WM_LBUTTONUP: - case WM_RBUTTONUP: - { - if (pLink) HeapFree(GetProcessHeap(), 0, pLink); - - pLink = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, - (max(Link->chrg.cpMin, Link->chrg.cpMax) - - min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR)); - if (!pLink) - { - /* TODO: Error message */ - return; - } - - m_RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax); - m_RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM) pLink); - - ShowPopupMenu(m_RichEdit->m_hWnd, IDR_LINKMENU, -1); - } - break; - } - } - BOOL IsSelectedNodeInstalled() { HTREEITEM hSelectedItem = m_TreeView->GetSelection(); @@ -1551,16 +1667,6 @@ private: switch (wCommand) { - case ID_OPEN_LINK: - ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE); - HeapFree(GetProcessHeap(), 0, pLink); - break; - - case ID_COPY_LINK: - CopyTextToClipboard(pLink); - HeapFree(GetProcessHeap(), 0, pLink); - break; - case ID_SETTINGS: CreateSettingsDlg(m_hWnd); break; @@ -1810,7 +1916,7 @@ private: SelectedEnumType = EnumType; UpdateStatusBarText(); - m_RichEdit->SetWelcomeText(); + m_AppInfo->SetWelcomeText(); // Set automatic column width for program names if the list is not empty if (m_ListView->GetItemCount() > 0) @@ -1866,7 +1972,7 @@ public: void HandleTabOrder(int direction) { - HWND Controls[] = { m_Toolbar->m_hWnd, m_SearchBar->m_hWnd, m_TreeView->m_hWnd, m_ListView->m_hWnd, m_RichEdit->m_hWnd }; + HWND Controls[] = { m_Toolbar->m_hWnd, m_SearchBar->m_hWnd, m_TreeView->m_hWnd, m_ListView->m_hWnd, m_AppInfo->m_hWnd }; // When there is no control found, go to the first or last (depending on tab vs shift-tab) int current = direction > 0 ? 0 : (_countof(Controls) - 1); HWND hActive = ::GetFocus(); diff --git a/base/applications/rapps/include/misc.h b/base/applications/rapps/include/misc.h index 143d9769b72..fd914c4c468 100644 --- a/base/applications/rapps/include/misc.h +++ b/base/applications/rapps/include/misc.h @@ -10,6 +10,7 @@ INT GetClientWindowHeight(HWND hwnd); VOID CopyTextToClipboard(LPCWSTR lpszText); VOID SetWelcomeText(); +VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem); VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem); BOOL StartProcess(ATL::CStringW &Path, BOOL Wait); BOOL StartProcess(LPWSTR lpPath, BOOL Wait); diff --git a/base/applications/rapps/misc.cpp b/base/applications/rapps/misc.cpp index f76c3849b50..d0f13cac232 100644 --- a/base/applications/rapps/misc.cpp +++ b/base/applications/rapps/misc.cpp @@ -71,7 +71,7 @@ VOID CopyTextToClipboard(LPCWSTR lpszText) CloseClipboard(); } -VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem) +VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem) { HMENU hMenu = NULL; HMENU hPopupMenu; @@ -102,7 +102,7 @@ VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem) GetCursorPos(&pt); SetForegroundWindow(hwnd); - TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hMainWnd, NULL); + TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hwndOwner, NULL); if (hMenu) { @@ -110,6 +110,12 @@ VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem) } } +VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem) +{ + ShowPopupMenuEx(hwnd, hMainWnd, MenuID, DefaultItem); +} + + BOOL StartProcess(ATL::CStringW &Path, BOOL Wait) { return StartProcess(const_cast<LPWSTR>(Path.GetString()), Wait);; diff --git a/base/applications/rapps/winmain.cpp b/base/applications/rapps/winmain.cpp index 1c351e864f8..d55edca46fa 100644 --- a/base/applications/rapps/winmain.cpp +++ b/base/applications/rapps/winmain.cpp @@ -65,7 +65,7 @@ VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo) PathAppendW(szDownloadDir.GetBuffer(MAX_PATH), L"\\RAPPS Downloads"); szDownloadDir.ReleaseBuffer(); - + ATL::CStringW::CopyChars(pSettingsInfo->szDownloadDir, _countof(pSettingsInfo->szDownloadDir), szDownloadDir.GetString(),
4 years, 3 months
1
0
0
0
[reactos] 01/01: [SHELL32] Make 'hwndServer == NULL' spams quiet
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=88cdb9696b96fcaacc802…
commit 88cdb9696b96fcaacc802462be6a4fa1c5f7de78 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Sep 6 22:48:29 2020 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sun Sep 6 22:48:29 2020 +0900 [SHELL32] Make 'hwndServer == NULL' spams quiet --- dll/win32/shell32/changenotify.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/dll/win32/shell32/changenotify.cpp b/dll/win32/shell32/changenotify.cpp index 08a7e632eba..c35201cce7c 100644 --- a/dll/win32/shell32/changenotify.cpp +++ b/dll/win32/shell32/changenotify.cpp @@ -300,10 +300,7 @@ CreateNotificationParamAndSend(LONG wEventId, UINT uFlags, LPCITEMIDLIST pidl1, // get server window HWND hwndServer = GetNotificationServer(FALSE); if (hwndServer == NULL) - { - ERR("hwndServer == NULL\n"); return; - } // the ticket owner is the process of the notification server DWORD pid;
4 years, 3 months
1
0
0
0
[reactos] 01/01: [BROWSEUI_APITEST] Follow-up of #3123 (94a413a)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e7430a86b23677f7b1c0c…
commit e7430a86b23677f7b1c0c5c9e811c74b3eaca58a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Sep 6 21:51:08 2020 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sun Sep 6 21:51:08 2020 +0900 [BROWSEUI_APITEST] Follow-up of #3123 (94a413a) --- modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c b/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c index be16dfa29b7..ea45c95d18f 100644 --- a/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c +++ b/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c @@ -422,6 +422,7 @@ START_TEST(SHExplorerParseCmdLine) { __LINE__, L"/inproc,\"c:\\\"", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 }, { __LINE__, L"/inproc,{20d04fe0-3aea-1069-a2d8-08002b30309d}", TRUE, PIDL_IS_UNTOUCHED, 0x00000400 }, { __LINE__, L"shell:::{450D8FBA-AD25-11D0-98A8-0800361B1103}", TRUE, CSIDL_MYDOCUMENTS, 0x00000200 }, + { __LINE__, L"::{450d8fba-ad25-11d0-98a8-0800361b1103}", TRUE, CSIDL_MYDOCUMENTS, 0x00000200 }, }; const int TestCount = sizeof(Tests) / sizeof(Tests[0]); PWSTR CommandLine;
4 years, 3 months
1
0
0
0
[reactos] 01/01: [BROWSEUI] Stop the address edit box trying to parse a null pidl
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=246e6a0de99e9d993fe9e…
commit 246e6a0de99e9d993fe9e4c0916d16af73b84ea1 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Sep 6 14:32:59 2020 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Sep 6 14:32:59 2020 +0200 [BROWSEUI] Stop the address edit box trying to parse a null pidl --- dll/win32/browseui/addresseditbox.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dll/win32/browseui/addresseditbox.cpp b/dll/win32/browseui/addresseditbox.cpp index f3d7bc20008..69e6f25d50c 100644 --- a/dll/win32/browseui/addresseditbox.cpp +++ b/dll/win32/browseui/addresseditbox.cpp @@ -390,6 +390,12 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::Invoke(DISPID dispIdMember, REFIID ri if (FAILED_UNEXPECTEDLY(hr)) return hr; + if (!absolutePIDL) + { + ERR("Got no PIDL, investigate me!\n"); + return S_OK; + } + /* Fill the combobox */ PopulateComboBox(absolutePIDL);
4 years, 3 months
1
0
0
0
[reactos] 01/01: [ZIPFLDR] Fix PathCompactPathW writing out of bounds CORE-17245
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=53badbd2f78630fc0cc72…
commit 53badbd2f78630fc0cc72e3cd3ff0e6a04a00eab Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Sep 6 14:28:56 2020 +0200 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Sep 6 14:28:56 2020 +0200 [ZIPFLDR] Fix PathCompactPathW writing out of bounds CORE-17245 --- dll/shellext/zipfldr/CZipExtract.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/shellext/zipfldr/CZipExtract.cpp b/dll/shellext/zipfldr/CZipExtract.cpp index f9dd21d9b0e..1ccba19b226 100644 --- a/dll/shellext/zipfldr/CZipExtract.cpp +++ b/dll/shellext/zipfldr/CZipExtract.cpp @@ -293,7 +293,7 @@ public: { SetWizardButtons(PSWIZB_FINISH); CStringW Path = m_pExtract->m_Directory; - PWSTR Ptr = Path.GetBuffer(); + PWSTR Ptr = Path.GetBuffer(MAX_PATH); RECT rc; ::GetWindowRect(GetDlgItem(IDC_DESTDIR), &rc); HDC dc = GetDC();
4 years, 3 months
1
0
0
0
[reactos] 01/01: [CMAKE] Fix regressions CORE-17243 & CORE-17246
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a4fee60e460966e7aa9b2…
commit a4fee60e460966e7aa9b21e696c854750a9171d4 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Sun Sep 6 04:35:33 2020 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Sun Sep 6 04:35:33 2020 +0200 [CMAKE] Fix regressions CORE-17243 & CORE-17246 By sledge-hammer-reverting of 0.4.15-dev-689-g 7ffb6a09c370ef51de554a1ce913f871d72b76ca and 0.4.15-dev-688-g 1234223f417c2ea9617af0f7a1d80934861eb7d1 Sorry, but the negative impact for other devs and the whole project are just unbearable. Stuff got committed meanwhile even so I had to act. The improvements may be reapplied later when the negative consequences are under control. --- CMakeLists.txt | 3 + boot/CMakeLists.txt | 138 +++++++++++------------- boot/bootdata/packages/CMakeLists.txt | 27 +---- sdk/cmake/CMakeMacros.cmake | 192 +++++++++++++++++++++++----------- 4 files changed, 201 insertions(+), 159 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7f851df962..4cbb6b3f190 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,6 +265,9 @@ else() # Create the registry hives create_registry_hives() + # Create {bootcd, livecd, bootcdregtest}.lst + create_iso_lists() + file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/sdk/include/reactos) add_dependency_footer() diff --git a/boot/CMakeLists.txt b/boot/CMakeLists.txt index 17bc2bdce61..727f75a7fff 100644 --- a/boot/CMakeLists.txt +++ b/boot/CMakeLists.txt @@ -15,12 +15,11 @@ else() message(FATAL_ERROR "Unknown ARCH '" ${ARCH} "', cannot generate a valid UEFI boot filename.") endif() -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin +add_custom_target(efisys COMMAND native-fatten ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin -format 2880 EFIBOOT -boot ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/fat.bin -mkdir EFI -mkdir EFI/BOOT -add $<TARGET_FILE:bootmgfw> EFI/BOOT/boot${EFI_PLATFORM_ID}.efi DEPENDS native-fatten fat bootmgfw VERBATIM) -add_custom_target(efisys DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin) + # Create an 'empty' directory (guaranteed to be empty) to be able to add # arbitrary empty directories to the ISO image using mkisofs. @@ -60,119 +59,108 @@ set(ISO_VOLNAME "ReactOS") # For both the Volume ID and the Vol # Create user profile directories in the LiveImage -function(add_allusers_profile_dirs _target _rootdir) - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/All Users/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/All Users/Documents/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/All Users/Documents/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/All Users/Documents/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/All Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/All Users/My Documents=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/All Users/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/All Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty") +function(add_allusers_profile_dirs _image_filelist _rootdir) + file(APPEND ${_image_filelist} "${_rootdir}/All Users/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/All Users/Documents/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/All Users/Documents/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/All Users/Documents/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/All Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/All Users/My Documents=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/All Users/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/All Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n") endfunction() -function(add_user_profile_dirs _target _rootdir _username) - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Application Data/Microsoft/Internet Explorer/Quick Launch=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Local Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Local Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Local Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Start Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Start Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty") - set_property(TARGET ${_target} APPEND PROPERTY FILE_LIST "${_rootdir}/${_username}/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty") +function(add_user_profile_dirs _image_filelist _rootdir _username) + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Application Data/Microsoft/Internet Explorer/Quick Launch=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Local Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Local Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Local Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Start Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Start Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n") + file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n") endfunction() ## BootCD -# create file list on generation phase -file(GENERATE - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bootcd.$<CONFIG>.lst - CONTENT $<GENEX_EVAL:$<JOIN:$<TARGET_PROPERTY:bootcd,FILE_LIST>,\n>>) -# create target -add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/bootcd.iso +# Create the file list +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.cmake.lst "") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.cmake.lst "${CMAKE_CURRENT_BINARY_DIR}/empty\n") + +add_custom_target(bootcd COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/bootcd.iso -iso-level 4 -publisher ${ISO_MANUFACTURER} -preparer ${ISO_MANUFACTURER} -volid ${ISO_VOLNAME} -volset ${ISO_VOLNAME} -eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 -eltorito-alt-boot -eltorito-platform efi -eltorito-boot loader/efisys.bin -no-emul-boot -hide boot.catalog -sort ${CMAKE_CURRENT_BINARY_DIR}/bootfiles.sort -no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/bootcd.$<CONFIG>.lst COMMAND native-isohybrid -b ${_isombr_file} -t 0x96 ${REACTOS_BINARY_DIR}/bootcd.iso - DEPENDS isombr native-isohybrid native-mkisofs $<TARGET_PROPERTY:bootcd,ISO_DEPENDENCIES> + DEPENDS isombr native-isohybrid native-mkisofs VERBATIM) -add_custom_target(bootcd DEPENDS ${REACTOS_BINARY_DIR}/bootcd.iso) ## BootCDRegTest -# create file list on generation phase -file(GENERATE - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.$<CONFIG>.lst - CONTENT $<GENEX_EVAL:$<JOIN:$<TARGET_PROPERTY:bootcdregtest,FILE_LIST>,\n>>) -# create target -add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/bootcdregtest.iso +# Create the file list +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.cmake.lst "") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.cmake.lst "${CMAKE_CURRENT_BINARY_DIR}/empty\n") + +add_custom_target(bootcdregtest COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/bootcdregtest.iso -iso-level 4 -publisher ${ISO_MANUFACTURER} -preparer ${ISO_MANUFACTURER} -volid ${ISO_VOLNAME} -volset ${ISO_VOLNAME} -eltorito-boot loader/isobtrt.bin -no-emul-boot -boot-load-size 4 -eltorito-alt-boot -eltorito-platform efi -eltorito-boot loader/efisys.bin -no-emul-boot -hide boot.catalog -sort ${CMAKE_CURRENT_BINARY_DIR}/bootfiles.sort -no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/bootcdregtest.$<CONFIG>.lst COMMAND native-isohybrid -b ${_isombr_file} -t 0x96 ${REACTOS_BINARY_DIR}/bootcdregtest.iso - DEPENDS isombr native-isohybrid native-mkisofs $<TARGET_PROPERTY:bootcdregtest,ISO_DEPENDENCIES> + DEPENDS isombr native-isohybrid native-mkisofs VERBATIM) -add_custom_target(bootcdregtest DEPENDS ${REACTOS_BINARY_DIR}/bootcdregtest.iso) ## LiveCD -# create file list on generation phase -file(GENERATE - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/livecd.$<CONFIG>.lst - CONTENT $<GENEX_EVAL:$<JOIN:$<TARGET_PROPERTY:livecd,FILE_LIST>,\n>>) -# create target -add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/livecd.iso +# Create the file list +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "${CMAKE_CURRENT_BINARY_DIR}/empty\n") + +# Create user profile directories +add_allusers_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles") +add_user_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles" "Default User") + +add_custom_target(livecd COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/livecd.iso -iso-level 4 -publisher ${ISO_MANUFACTURER} -preparer ${ISO_MANUFACTURER} -volid ${ISO_VOLNAME} -volset ${ISO_VOLNAME} -eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 -eltorito-alt-boot -eltorito-platform efi -eltorito-boot loader/efisys.bin -no-emul-boot -hide boot.catalog -sort ${CMAKE_CURRENT_BINARY_DIR}/bootfiles.sort -no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/livecd.$<CONFIG>.lst COMMAND native-isohybrid -b ${_isombr_file} -t 0x96 ${REACTOS_BINARY_DIR}/livecd.iso - DEPENDS isombr native-isohybrid native-mkisofs ${CMAKE_CURRENT_BINARY_DIR}/livecd.$<CONFIG>.lst $<TARGET_PROPERTY:livecd,ISO_DEPENDENCIES> + DEPENDS isombr native-isohybrid native-mkisofs VERBATIM) -add_custom_target(livecd DEPENDS ${REACTOS_BINARY_DIR}/livecd.iso) -# Create user profile directories -add_allusers_profile_dirs(livecd "Profiles") -add_user_profile_dirs(livecd "Profiles" "Default User") ## HybridCD -# create file list on generation phase -file(GENERATE - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.$<CONFIG>.lst - CONTENT $<GENEX_EVAL:$<JOIN:$<TARGET_PROPERTY:hybridcd,FILE_LIST>,\n>>) -# create target -add_custom_command( - OUTPUT ${REACTOS_BINARY_DIR}/hybridcd.iso +# Create the file list +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "${CMAKE_CURRENT_BINARY_DIR}/empty\n") + +# Create user profile directories +add_allusers_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles") +add_user_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles" "Default User") + +add_custom_target(hybridcd COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/hybridcd.iso -iso-level 4 -publisher ${ISO_MANUFACTURER} -preparer ${ISO_MANUFACTURER} -volid ${ISO_VOLNAME} -volset ${ISO_VOLNAME} -eltorito-boot loader/isoboot.bin -no-emul-boot -boot-load-size 4 -eltorito-alt-boot -eltorito-platform efi -eltorito-boot loader/efisys.bin -no-emul-boot -hide boot.catalog -sort ${CMAKE_CURRENT_BINARY_DIR}/bootfiles.sort -duplicates-once -no-cache-inodes -graft-points -path-list ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.$<CONFIG>.lst COMMAND native-isohybrid -b ${_isombr_file} -t 0x96 ${REACTOS_BINARY_DIR}/hybridcd.iso - DEPENDS isombr native-isohybrid native-mkisofs ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.$<CONFIG>.lst $<TARGET_PROPERTY:hybridcd,ISO_DEPENDENCIES> + DEPENDS bootcd livecd VERBATIM) -add_custom_target(hybridcd DEPENDS ${REACTOS_BINARY_DIR}/hybridcd.iso) -# Create user profile directories -add_allusers_profile_dirs(hybridcd "livecd/Profiles") -add_user_profile_dirs(livecd "livecd/Profiles" "Default User") add_cd_file(TARGET efisys FILE ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin DESTINATION loader NO_CAB NOT_IN_HYBRIDCD FOR bootcd regtest livecd hybridcd) -add_cd_file(TARGET livecd FILE ${REACTOS_BINARY_DIR}/livecd.iso DESTINATION livecd FOR hybridcd) add_subdirectory(freeldr) add_subdirectory(bootdata) diff --git a/boot/bootdata/packages/CMakeLists.txt b/boot/bootdata/packages/CMakeLists.txt index 5ef12d6f107..3f1cc6ff00c 100644 --- a/boot/bootdata/packages/CMakeLists.txt +++ b/boot/bootdata/packages/CMakeLists.txt @@ -31,37 +31,20 @@ add_custom_command( -D SRC2=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.$<CONFIG>.dyn -D DST=${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.maydiff -P ${CMAKE_CURRENT_BINARY_DIR}/concat.cmake - COMMAND ${CMAKE_COMMAND} -E copy_if_different + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.maydiff ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/reactos.dff.in DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff.$<CONFIG>.dyn) -# reactos.inf. We want this command to be always executed, in case someone added an optional file between two builds. -# So we pretend it generates another file although it will never do. -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos_real.inf ${CMAKE_CURRENT_BINARY_DIR}/__some_non_existent_file +add_custom_target( + reactos_cab_inf COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -L ${CMAKE_CURRENT_BINARY_DIR} -I -P ${REACTOS_SOURCE_DIR} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf ${CMAKE_CURRENT_BINARY_DIR}/reactos_real.inf DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff native-cabman BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf) -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab - COMMAND native-cabman -C ${CMAKE_CURRENT_BINARY_DIR}/reactos.dff -RC ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf -N -P ${REACTOS_SOURCE_DIR} - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos_real.inf native-cabman $<TARGET_PROPERTY:reactos_cab,CAB_DEPENDENCIES>) - -add_custom_target(reactos_cab DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab) - -add_cd_file( - TARGET reactos_cab - FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab - DESTINATION reactos - NO_CAB FOR bootcd regtest) - add_cd_file( - TARGET reactos_cab - FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos_real.inf - NAME_ON_CD reactos.inf + TARGET reactos_cab_inf + FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf DESTINATION reactos NO_CAB FOR bootcd regtest) diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index a99c9ea3b03..5ac5dec5555 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -309,12 +309,7 @@ macro(dir_to_num dir var) endmacro() function(add_cd_file) - cmake_parse_arguments(_CD "NO_CAB;NOT_IN_HYBRIDCD" "DESTINATION;NAME_ON_CD;TARGET;FILE" "FOR" ${ARGN}) - - if (_CD_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unexpected arguments to add_cd_file : ${_CD_UNPARSED_ARGUMENTS}") - endif() - + cmake_parse_arguments(_CD "NO_CAB;NOT_IN_HYBRIDCD" "DESTINATION;NAME_ON_CD;TARGET" "FILE;FOR" ${ARGN}) if(NOT (_CD_TARGET OR _CD_FILE)) message(FATAL_ERROR "You must provide a target or a file to install!") endif() @@ -337,10 +332,6 @@ function(add_cd_file) endif() endif() - if (NOT _CD_NAME_ON_CD) - get_filename_component(_CD_NAME_ON_CD ${_CD_FILE} NAME) - endif() - # do we add it to all CDs? list(FIND _CD_FOR all __cd) if(NOT __cd EQUAL -1) @@ -348,38 +339,42 @@ function(add_cd_file) list(INSERT _CD_FOR __cd "bootcd;livecd;regtest") endif() - # do we add it to bootcd? list(FIND _CD_FOR bootcd __cd) if(NOT __cd EQUAL -1) # whether or not we should put it in reactos.cab or directly on cd if(_CD_NO_CAB) # directly on cd - set_property(TARGET bootcd APPEND PROPERTY FILE_LIST "${_CD_DESTINATION}/${_CD_NAME_ON_CD}=${_CD_FILE}") - # add it also into the hybridcd if not specified otherwise - if(NOT _CD_NOT_IN_HYBRIDCD) - set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "bootcd/${_CD_DESTINATION}/${_CD_NAME_ON_CD}=${_CD_FILE}") - endif() - # manage dependency - if(_CD_TARGET) - set_property(TARGET bootcd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_TARGET}) - if(NOT _CD_NOT_IN_HYBRIDCD) - set_property(TARGET hybridcd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_TARGET}) + foreach(item ${_CD_FILE}) + if(_CD_NAME_ON_CD) + # rename it in the cd tree + set(__file ${_CD_NAME_ON_CD}) + else() + get_filename_component(__file ${item} NAME) endif() - else() - set_property(TARGET bootcd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_FILE}) + set_property(GLOBAL APPEND PROPERTY BOOTCD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}") + # add it also into the hybridcd if not specified otherwise if(NOT _CD_NOT_IN_HYBRIDCD) - set_property(TARGET hybridcd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_FILE}) + set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "bootcd/${_CD_DESTINATION}/${__file}=${item}") endif() + endforeach() + # manage dependency + if(_CD_TARGET) + add_dependencies(bootcd ${_CD_TARGET} registry_inf) endif() else() dir_to_num(${_CD_DESTINATION} _num) - file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.cmake "\"${_CD_FILE}\" ${_num}\n") - # manage dependencies + foreach(item ${_CD_FILE}) + # add it in reactos.cab + file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.cmake "\"${item}\" ${_num}\n") + + # manage dependency - file level + set_property(GLOBAL APPEND PROPERTY REACTOS_CAB_DEPENDS ${item}) + endforeach() + + # manage dependency - target level if(_CD_TARGET) - set_property(TARGET reactos_cab APPEND PROPERTY CAB_DEPENDENCIES ${_CD_TARGET}) - else() - set_property(TARGET reactos_cab APPEND PROPERTY CAB_DEPENDENCIES ${_CD_FILE}) + add_dependencies(reactos_cab_inf ${_CD_TARGET}) endif() endif() endif() #end bootcd @@ -389,36 +384,39 @@ function(add_cd_file) if(NOT __cd EQUAL -1) # manage dependency if(_CD_TARGET) - set_property(TARGET livecd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_TARGET}) - if(NOT _CD_NOT_IN_HYBRIDCD) - set_property(TARGET hybridcd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_TARGET}) - endif() + add_dependencies(livecd ${_CD_TARGET} registry_inf) endif() - - set_property(TARGET livecd APPEND PROPERTY FILE_LIST "${_CD_DESTINATION}/${_CD_NAME_ON_CD}=${_CD_FILE}") - # manage dependency - if (NOT _CD_TARGET) - set_property(TARGET livecd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_FILE}) - endif() - # add it also into the hybridcd if not specified otherwise - if(NOT _CD_NOT_IN_HYBRIDCD) - set_property(TARGET hybridcd APPEND PROPERTY FILE_LIST "livecd/${_CD_DESTINATION}/${_CD_NAME_ON_CD}=${_CD_FILE}") - if (NOT _CD_TARGET) - set_property(TARGET hybridcd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_FILE}) + foreach(item ${_CD_FILE}) + if(_CD_NAME_ON_CD) + # rename it in the cd tree + set(__file ${_CD_NAME_ON_CD}) + else() + get_filename_component(__file ${item} NAME) endif() - endif() + set_property(GLOBAL APPEND PROPERTY LIVECD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}") + # add it also into the hybridcd if not specified otherwise + if(NOT _CD_NOT_IN_HYBRIDCD) + set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "livecd/${_CD_DESTINATION}/${__file}=${item}") + endif() + endforeach() endif() #end livecd # do we need also to add it to hybridcd? list(FIND _CD_FOR hybridcd __cd) if(NOT __cd EQUAL -1) - set_property(TARGET hybridcd APPEND PROPERTY FILE_LIST "${_CD_DESTINATION}/${_CD_NAME_ON_CD}=${_CD_FILE}") # manage dependency if(_CD_TARGET) - set_property(TARGET hybridcd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_TARGET}) - else() - set_property(TARGET hybridcd APPEND PROPERTY ISO_DEPENDENCIES ${_CD_FILE}) + add_dependencies(hybridcd ${_CD_TARGET}) endif() + foreach(item ${_CD_FILE}) + if(_CD_NAME_ON_CD) + # rename it in the cd tree + set(__file ${_CD_NAME_ON_CD}) + else() + get_filename_component(__file ${item} NAME) + endif() + set_property(GLOBAL APPEND PROPERTY HYBRIDCD_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}") + endforeach() endif() #end hybridcd # do we add it to regtest? @@ -426,12 +424,19 @@ function(add_cd_file) if(NOT __cd EQUAL -1) # whether or not we should put it in reactos.cab or directly on cd if(_CD_NO_CAB) - set_property(TARGET bootcdregtest APPEND PROPERTY FILE_LIST "${_CD_DESTINATION}/${_CD_NAME_ON_CD}=${_CD_FILE}") + # directly on cd + foreach(item ${_CD_FILE}) + if(_CD_NAME_ON_CD) + # rename it in the cd tree + set(__file ${_CD_NAME_ON_CD}) + else() + get_filename_component(__file ${item} NAME) + endif() + set_property(GLOBAL APPEND PROPERTY BOOTCDREGTEST_FILE_LIST "${_CD_DESTINATION}/${__file}=${item}") + endforeach() # manage dependency if(_CD_TARGET) - set_property(TARGET bootcdregtest APPEND PROPERTY ISO_DEPENDENCIES ${_CD_TARGET}) - else() - set_property(TARGET bootcdregtest APPEND PROPERTY ISO_DEPENDENCIES ${_CD_FILE}) + add_dependencies(bootcdregtest ${_CD_TARGET} registry_inf) endif() else() #add it in reactos.cab @@ -445,6 +450,68 @@ function(add_cd_file) endif() #end bootcd endfunction() +function(create_iso_lists) + # generate reactos.cab before anything else + get_property(_filelist GLOBAL PROPERTY REACTOS_CAB_DEPENDS) + + # begin with reactos.inf. We want this command to be always executed, so we pretend it generates another file although it will never do. + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf ${CMAKE_CURRENT_BINARY_DIR}/__some_non_existent_file + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.inf ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf + DEPENDS ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.inf reactos_cab_inf) + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab + COMMAND native-cabman -C ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff -RC ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf -N -P ${REACTOS_SOURCE_DIR} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.inf native-cabman ${_filelist}) + + add_custom_target(reactos_cab DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab) + add_dependencies(reactos_cab reactos_cab_inf) + + add_cd_file( + TARGET reactos_cab + FILE ${CMAKE_CURRENT_BINARY_DIR}/reactos.cab + DESTINATION reactos + NO_CAB FOR bootcd regtest) + + add_cd_file( + FILE ${CMAKE_CURRENT_BINARY_DIR}/livecd.iso + DESTINATION livecd + FOR hybridcd) + + get_property(_filelist GLOBAL PROPERTY BOOTCD_FILE_LIST) + string(REPLACE ";" "\n" _filelist "${_filelist}") + file(APPEND ${REACTOS_BINARY_DIR}/boot/bootcd.cmake.lst "${_filelist}") + unset(_filelist) + file(GENERATE + OUTPUT ${REACTOS_BINARY_DIR}/boot/bootcd.$<CONFIG>.lst + INPUT ${REACTOS_BINARY_DIR}/boot/bootcd.cmake.lst) + + get_property(_filelist GLOBAL PROPERTY LIVECD_FILE_LIST) + string(REPLACE ";" "\n" _filelist "${_filelist}") + file(APPEND ${REACTOS_BINARY_DIR}/boot/livecd.cmake.lst "${_filelist}") + unset(_filelist) + file(GENERATE + OUTPUT ${REACTOS_BINARY_DIR}/boot/livecd.$<CONFIG>.lst + INPUT ${REACTOS_BINARY_DIR}/boot/livecd.cmake.lst) + + get_property(_filelist GLOBAL PROPERTY HYBRIDCD_FILE_LIST) + string(REPLACE ";" "\n" _filelist "${_filelist}") + file(APPEND ${REACTOS_BINARY_DIR}/boot/hybridcd.cmake.lst "${_filelist}") + unset(_filelist) + file(GENERATE + OUTPUT ${REACTOS_BINARY_DIR}/boot/hybridcd.$<CONFIG>.lst + INPUT ${REACTOS_BINARY_DIR}/boot/hybridcd.cmake.lst) + + get_property(_filelist GLOBAL PROPERTY BOOTCDREGTEST_FILE_LIST) + string(REPLACE ";" "\n" _filelist "${_filelist}") + file(APPEND ${REACTOS_BINARY_DIR}/boot/bootcdregtest.cmake.lst "${_filelist}") + unset(_filelist) + file(GENERATE + OUTPUT ${REACTOS_BINARY_DIR}/boot/bootcdregtest.$<CONFIG>.lst + INPUT ${REACTOS_BINARY_DIR}/boot/bootcdregtest.cmake.lst) +endfunction() + # Create module_clean targets function(add_clean_target _target) set(_clean_working_directory ${CMAKE_CURRENT_BINARY_DIR}) @@ -820,11 +887,15 @@ function(create_registry_hives) ${CMAKE_BINARY_DIR}/boot/bootdata/sam ${CMAKE_BINARY_DIR}/boot/bootdata/security) - add_cd_file(FILE ${CMAKE_BINARY_DIR}/boot/bootdata/system TARGET livecd_hives DESTINATION reactos/system32/config FOR livecd) - add_cd_file(FILE ${CMAKE_BINARY_DIR}/boot/bootdata/software TARGET livecd_hives DESTINATION reactos/system32/config FOR livecd) - add_cd_file(FILE ${CMAKE_BINARY_DIR}/boot/bootdata/default TARGET livecd_hives DESTINATION reactos/system32/config FOR livecd) - add_cd_file(FILE ${CMAKE_BINARY_DIR}/boot/bootdata/sam TARGET livecd_hives DESTINATION reactos/system32/config FOR livecd) - add_cd_file(FILE ${CMAKE_BINARY_DIR}/boot/bootdata/security TARGET livecd_hives DESTINATION reactos/system32/config FOR livecd) + add_cd_file( + FILE ${CMAKE_BINARY_DIR}/boot/bootdata/system + ${CMAKE_BINARY_DIR}/boot/bootdata/software + ${CMAKE_BINARY_DIR}/boot/bootdata/default + ${CMAKE_BINARY_DIR}/boot/bootdata/sam + ${CMAKE_BINARY_DIR}/boot/bootdata/security + TARGET livecd_hives + DESTINATION reactos/system32/config + FOR livecd) # BCD Hive add_custom_command( @@ -853,13 +924,10 @@ function(add_driver_inf _module) COMMAND native-utf16le "${_source_item}" "${_converted_item}" DEPENDS native-utf16le "${_source_item}") list(APPEND _converted_inf_files ${_converted_item}) - endforeach() add_custom_target(${_module}_inf_files DEPENDS ${_converted_inf_files}) - foreach(item ${_converted_inf_files}) - add_cd_file(FILE ${item} TARGET ${_module}_inf_files DESTINATION reactos/inf FOR all) - endforeach() + add_cd_file(FILE ${_converted_inf_files} TARGET ${_module}_inf_files DESTINATION reactos/inf FOR all) endfunction() if(KDBG)
4 years, 3 months
1
0
0
0
[reactos] 01/01: [BROWSEUI_APITEST] Strengthen SHExplorerParseCmdLine testcase a bit (#3123)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=94a413ae3e410ff01a1c6…
commit 94a413ae3e410ff01a1c6e50d416fe8f9660829d Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Sep 6 08:03:09 2020 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Sep 6 08:03:09 2020 +0900 [BROWSEUI_APITEST] Strengthen SHExplorerParseCmdLine testcase a bit (#3123) CORE-14177 --- .../apitests/browseui/SHExplorerParseCmdLine.c | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c b/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c index 59b7c0452c8..be16dfa29b7 100644 --- a/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c +++ b/modules/rostests/apitests/browseui/SHExplorerParseCmdLine.c @@ -2,7 +2,8 @@ * PROJECT: ReactOS api tests * LICENSE: GPLv2+ - See COPYING in the top level directory * PURPOSE: Test for SHExplorerParseCmdLine - * PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org + * PROGRAMMERS: Thomas Faber <thomas.faber(a)reactos.org> + * Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ #include <apitest.h> @@ -30,7 +31,7 @@ typedef struct _EXPLORER_INFO DWORD dwFlags; ULONG Unknown1[5]; PIDLIST_ABSOLUTE pidlRoot; - ULONG Unknown3[4]; + CLSID clsid; GUID guidInproc; ULONG Padding[PADDING_SIZE]; } EXPLORER_INFO, *PEXPLORER_INFO; @@ -85,6 +86,7 @@ _In_ INT ExpectedCsidl, _In_ DWORD ExpectedFlags, _In_ PCWSTR ExpectedFileName, _In_ PCWSTR PidlPath, +_In_ PCWSTR pclsid, _Out_opt_ PUINT PWriteEnd) { EXPLORER_INFO Info; @@ -220,6 +222,23 @@ _Out_opt_ PUINT PWriteEnd) } } + { + LPOLESTR psz; + BYTE ab[sizeof(CLSID)]; + + StringFromCLSID(&Info.clsid, &psz); + if (pclsid == NULL) + { + FillMemory(ab, sizeof(ab), 0x55); + ok(memcmp(ab, &Info.clsid, sizeof(ab)) == 0, "Line %lu: CLSID was %ls.\n", TestLine, psz); + } + else + { + ok(lstrcmpiW(psz, pclsid) == 0, "Line %lu: CLSID was %ls.\n", TestLine, psz); + } + CoTaskMemFree(psz); + } + if (PWriteEnd) { PBYTE data = (PBYTE)&Info; @@ -248,6 +267,7 @@ START_TEST(SHExplorerParseCmdLine) DWORD ExpectedFlags; PCWSTR ExpectedFileName; PCWSTR PidlPath; + PCWSTR pclsid; } Tests [] = { { __LINE__, L"", -1, CSIDL_MYDOCUMENTS, 0x00000009 }, @@ -401,6 +421,7 @@ START_TEST(SHExplorerParseCmdLine) { __LINE__, L"/inproc,c:\\", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 }, { __LINE__, L"/inproc,\"c:\\\"", FALSE, PIDL_IS_UNTOUCHED, 0x00000000 }, { __LINE__, L"/inproc,{20d04fe0-3aea-1069-a2d8-08002b30309d}", TRUE, PIDL_IS_UNTOUCHED, 0x00000400 }, + { __LINE__, L"shell:::{450D8FBA-AD25-11D0-98A8-0800361B1103}", TRUE, CSIDL_MYDOCUMENTS, 0x00000200 }, }; const int TestCount = sizeof(Tests) / sizeof(Tests[0]); PWSTR CommandLine; @@ -440,6 +461,7 @@ START_TEST(SHExplorerParseCmdLine) Tests[i].ExpectedFlags, Tests[i].ExpectedFileName, Tests[i].PidlPath, + Tests[i].pclsid, &cWrite); if (cWrite > maxWrite)
4 years, 3 months
1
0
0
0
[reactos] 01/01: [NTUSER] Demote ERR to TRACE, also some minor corrections (#3132)
by Kyle Katarn
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f428f5522c9a6a4ec8cf…
commit 9f428f5522c9a6a4ec8cf19f7f0c543c944b9483 Author: Kyle Katarn <contact(a)kcsoftwares.com> AuthorDate: Sat Sep 5 16:59:10 2020 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Sep 5 17:59:10 2020 +0300 [NTUSER] Demote ERR to TRACE, also some minor corrections (#3132) --- win32ss/user/ntuser/message.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win32ss/user/ntuser/message.c b/win32ss/user/ntuser/message.c index ae0c0733ebe..2d6164e7c7c 100644 --- a/win32ss/user/ntuser/message.c +++ b/win32ss/user/ntuser/message.c @@ -800,7 +800,7 @@ static LRESULT handle_internal_message( PWND pWnd, UINT msg, WPARAM wparam, LPAR } case WM_ASYNC_DESTROYWINDOW: { - ERR("WM_ASYNC_DESTROYWINDOW\n"); + TRACE("WM_ASYNC_DESTROYWINDOW\n"); if (pWnd->style & WS_CHILD) return co_UserFreeWindow(pWnd, PsGetCurrentProcessWin32Process(), PsGetCurrentThreadWin32Thread(), TRUE); else @@ -1867,8 +1867,8 @@ co_IntSendMessageWithCallBack( HWND hWnd, if(!(Message = AllocateUserMessage(FALSE))) { - ERR("MsqSendMessage(): Not enough memory to allocate a message"); - RETURN( FALSE); + ERR("MsqSendMessage(): Not enough memory to allocate a message\n"); + RETURN(FALSE); } Message->Msg.hwnd = hWnd;
4 years, 3 months
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Results per page:
10
25
50
100
200