Author: ashaposhnikov
Date: Wed Aug 2 12:50:53 2017
New Revision: 75469
URL:
http://svn.reactos.org/svn/reactos?rev=75469&view=rev
Log:
[RAPPS]
- Split the rapps.h into multiple headers for easier managing
- Moved headers to include/
- Corrected some typos and moved functions around
Added:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h (with
props)
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/crichedit.h
- copied, changed from r75468,
branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h (with
props)
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/dialogs.h (with
props)
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/gui.h (with props)
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h (with
props)
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/misc.h (with
props)
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/rapps.h
- copied, changed from r75468,
branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/resource.h
- copied unchanged from r75468,
branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/rosui.h
- copied, changed from r75468,
branches/GSoC_2017/rapps/reactos/base/applications/rapps/rosui.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/winmain.h (with
props)
Removed:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/rosui.h
Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt
branches/GSoC_2017/rapps/reactos/base/applications/rapps/aboutdlg.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/installdlg.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/integrity.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc
branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/settingsdlg.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -4,6 +4,7 @@
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cryptlib)
+include_directories(include)
list(APPEND SOURCE
aboutdlg.cpp
@@ -16,7 +17,8 @@
misc.cpp
settingsdlg.cpp
winmain.cpp
- rapps.h)
+ include/rapps.h
+)
add_definitions(-DUSE_CERT_PINNING)
file(GLOB_RECURSE rapps_rc_deps res/*.*)
@@ -25,7 +27,7 @@
set_module_type(rapps win32gui UNICODE)
target_link_libraries(rapps atlnew uuid wine)
add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 msvcrt
kernel32 ntdll)
-add_pch(rapps rapps.h SOURCE)
+add_pch(rapps include/rapps.h SOURCE)
add_dependencies(rapps rappsmsg)
add_message_headers(ANSI rappsmsg.mc)
add_cd_file(TARGET rapps DESTINATION reactos/system32 FOR all)
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/aboutdlg.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/aboutdlg.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/aboutdlg.cpp [iso-8859-1] Wed
Aug 2 12:50:53 2017
@@ -5,8 +5,7 @@
* PURPOSE: About Dialog
* PROGRAMMERS: Dmitry Chapyshev (dmitry(a)reactos.org)
*/
-
-#include "rapps.h"
+#include "defines.h"
static
INT_PTR CALLBACK
@@ -32,8 +31,8 @@
VOID
ShowAboutDialog(VOID)
{
- DialogBox(hInst,
- MAKEINTRESOURCE(IDD_ABOUT_DIALOG),
+ DialogBoxW(hInst,
+ MAKEINTRESOURCEW(IDD_ABOUT_DIALOG),
hMainWnd,
AboutDlgProc);
}
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -7,8 +7,15 @@
* Ismael Ferreras Morezuelas (swyterzone+ros(a)gmail.com)
* Alexander Shaposhnikov (chaez.san(a)gmail.com)
*/
-
-#include "rapps.h"
+#include "defines.h"
+
+#include "available.h"
+#include "misc.h"
+#include "dialogs.h"
+
+#include <atlcoll.h>
+#include <atlsimpcoll.h>
+#include <atlstr.h>
// CAvailableApplicationInfo
CAvailableApplicationInfo::CAvailableApplicationInfo(const ATL::CStringW&
sFileNameParam)
@@ -28,6 +35,7 @@
}
}
+// Lazily load general info from the file
VOID CAvailableApplicationInfo::RetrieveGeneralInfo()
{
Category = m_Parser.GetInt(L"Category");
@@ -481,4 +489,4 @@
return (UINT) (result <= 0) ? 0 : result;
}
-// CConfigParser
+// CConfigParser
Removed: branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h (removed)
@@ -1,119 +0,0 @@
-#pragma once
-
-class CRichEdit :
- public CWindow
-{
- HMODULE LoadedLibrary;
- inline VOID GenericInsertText(LPCWSTR lpszText, LONG InsertedTextLen, DWORD
dwEffects)
- {
- SETTEXTEX SetText;
- LONG Len = GetTextLen();
-
- if (InsertedTextLen)
- {
- /* Insert new text */
- SetText.flags = ST_SELECTION;
- SetText.codepage = 1200;
-
- SendMessageW(EM_SETTEXTEX, (WPARAM) &SetText, (LPARAM) lpszText);
-
- SetRangeFormatting(Len, Len + InsertedTextLen,
- (dwEffects == CFM_LINK) ? (PathIsURLW(lpszText) ? dwEffects : 0) :
dwEffects);
- }
- }
-
-public:
- VOID SetRangeFormatting(LONG Start, LONG End, DWORD dwEffects)
- {
- CHARFORMAT2W CharFormat;
-
- SendMessageW(EM_SETSEL, Start, End);
-
- ZeroMemory(&CharFormat, sizeof(CharFormat));
-
- CharFormat.cbSize = sizeof(CharFormat);
- CharFormat.dwMask = dwEffects;
- CharFormat.dwEffects = dwEffects;
-
- SendMessageW(EM_SETCHARFORMAT, SCF_WORD | SCF_SELECTION, (LPARAM)
&CharFormat);
-
- SendMessageW(EM_SETSEL, End, End + 1);
- }
-
- LONG GetTextLen(VOID)
- {
- GETTEXTLENGTHEX TxtLenStruct;
-
- TxtLenStruct.flags = GTL_NUMCHARS;
- TxtLenStruct.codepage = 1200;
-
- return (LONG) SendMessageW(EM_GETTEXTLENGTHEX, (WPARAM) &TxtLenStruct, 0);
- }
-
- /*
- * Insert text (without cleaning old text)
- * Supported effects:
- * - CFM_BOLD
- * - CFM_ITALIC
- * - CFM_UNDERLINE
- * - CFM_LINK
- */
- VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
- {
- GenericInsertText(lpszText, wcslen(lpszText), dwEffects);
- }
-
- VOID InsertText(const ATL::CStringW& szText, DWORD dwEffects)
- {
- GenericInsertText(szText.GetString(), szText.GetLength(), dwEffects);
- }
- /*
- * Clear old text and add new
- */
- VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
- {
- SetWindowTextW(L"");
- InsertText(lpszText, dwEffects);
- }
-
- VOID SetText(const ATL::CStringW& szText, DWORD dwEffects)
- {
- SetText(szText.GetString(), dwEffects);
- }
-
- HWND Create(HWND hwndParent)
- {
- LoadedLibrary = LoadLibraryW(L"riched20.dll");
-
- m_hWnd = CreateWindowExW(0,
- L"RichEdit20W",
- NULL,
- WS_CHILD | WS_VISIBLE | ES_MULTILINE |
- ES_LEFT | ES_READONLY,
- 205, 28, 465, 100,
- hwndParent,
- NULL,
- _AtlBaseModule.GetModuleInstance(),
- NULL);
-
- if (m_hWnd)
- {
- SendMessageW(EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_BTNFACE));
- SendMessageW(WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
- SendMessageW(EM_SETEVENTMASK, 0, ENM_LINK | ENM_MOUSEEVENTS);
- SendMessageW(EM_SHOWSCROLLBAR, SB_VERT, TRUE);
- }
-
- return m_hWnd;
- }
-
- virtual VOID OnLink(ENLINK *Link)
- {
- }
-
- ~CRichEdit()
- {
- FreeLibrary(LoadedLibrary);
- }
-
-};
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp [iso-8859-1] Wed Aug
2 12:50:53 2017
@@ -3,8 +3,11 @@
* AUTHORS: David Quintana <gigaherz(a)gmail.com>
* Alexander Shaposhnikov <chaez.san(a)gmail.com>
*/
+#include "defines.h"
#include "rapps.h"
+#include "rosui.h"
+#include "crichedit.h"
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
@@ -14,15 +17,41 @@
#include <atlwin.h>
#include <wininet.h>
#include <shellutils.h>
-
#include <rosctrls.h>
-#include "rosui.h"
-#include "crichedit.h"
-
#define SEARCH_TIMER_ID 'SR'
+#define LISTVIEW_ICON_SIZE 24
+#define TREEVIEW_ICON_SIZE 24
HWND hListView = NULL;
+
+INT
+GetSystemColorDepth(VOID)
+{
+ DEVMODEW pDevMode;
+ INT ColorDepth;
+
+ pDevMode.dmSize = sizeof(pDevMode);
+ pDevMode.dmDriverExtra = 0;
+
+ if (!EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &pDevMode))
+ {
+ /* TODO: Error message */
+ return ILC_COLOR;
+ }
+
+ switch (pDevMode.dmBitsPerPel)
+ {
+ case 32: ColorDepth = ILC_COLOR32; break;
+ case 24: ColorDepth = ILC_COLOR24; break;
+ case 16: ColorDepth = ILC_COLOR16; break;
+ case 8: ColorDepth = ILC_COLOR8; break;
+ case 4: ColorDepth = ILC_COLOR4; break;
+ default: ColorDepth = ILC_COLOR; break;
+ }
+
+ return ColorDepth;
+}
class CAvailableAppView
{
Added: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h (added)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -0,0 +1,148 @@
+#pragma once
+#include <windef.h>
+#include <atlstr.h>
+#include <atlsimpcoll.h>
+#include <atlcoll.h>
+
+/* EnumType flags for EnumAvailableApplications */
+#define ENUM_ALL_AVAILABLE 0
+#define ENUM_CAT_AUDIO 1
+#define ENUM_CAT_VIDEO 2
+#define ENUM_CAT_GRAPHICS 3
+#define ENUM_CAT_GAMES 4
+#define ENUM_CAT_INTERNET 5
+#define ENUM_CAT_OFFICE 6
+#define ENUM_CAT_DEVEL 7
+#define ENUM_CAT_EDU 8
+#define ENUM_CAT_ENGINEER 9
+#define ENUM_CAT_FINANCE 10
+#define ENUM_CAT_SCIENCE 11
+#define ENUM_CAT_TOOLS 12
+#define ENUM_CAT_DRIVERS 13
+#define ENUM_CAT_LIBS 14
+#define ENUM_CAT_OTHER 15
+
+#define ENUM_AVAILABLE_MIN ENUM_ALL_AVAILABLE
+#define ENUM_AVAILABLE_MAX ENUM_CAT_OTHER
+
+#define IS_AVAILABLE_ENUM(a) (a >= ENUM_AVAILABLE_MIN && a <=
ENUM_AVAILABLE_MAX)
+
+typedef enum
+{
+ None,
+ OpenSource,
+ Freeware,
+ Trial,
+ Max = Trial,
+ Min = None
+} LICENSE_TYPE, *PLICENSE_TYPE;
+
+class CConfigParser
+{
+ // Locale names cache
+ const static INT m_cchLocaleSize = 5;
+
+ static ATL::CStringW m_szLocaleID;
+ static ATL::CStringW m_szCachedINISectionLocale;
+ static ATL::CStringW m_szCachedINISectionLocaleNeutral;
+
+ const LPCWSTR STR_VERSION_CURRENT = L"CURRENT";
+ const ATL::CStringW szConfigPath;
+
+ static ATL::CStringW GetINIFullPath(const ATL::CStringW& FileName);
+ static VOID CacheINILocaleLazy();
+
+public:
+ static const ATL::CStringW& GetLocale();
+ static INT CConfigParser::GetLocaleSize();
+
+ CConfigParser(const ATL::CStringW& FileName);
+
+ UINT GetString(const ATL::CStringW& KeyName, ATL::CStringW& ResultString);
+ UINT GetInt(const ATL::CStringW& KeyName);
+};
+
+typedef struct
+{
+ INT Category;
+ LICENSE_TYPE LicenseType;
+ ATL::CStringW szName;
+ ATL::CStringW szRegName;
+ ATL::CStringW szVersion;
+ ATL::CStringW szLicense;
+ ATL::CStringW szDesc;
+ ATL::CStringW szSize;
+ ATL::CStringW szUrlSite;
+ ATL::CStringW szUrlDownload;
+ ATL::CStringW szCDPath;
+ ATL::CSimpleArray<LCID> Languages;
+
+ // Caching mechanism related entries
+ ATL::CStringW sFileName;
+ FILETIME ftCacheStamp;
+
+ // Optional integrity checks (SHA-1 digests are 160 bit = 40 characters in hex string
form)
+ ATL::CStringW szSHA1;
+
+} APPLICATION_INFO, *PAPPLICATION_INFO;
+
+extern ATL::CAtlList<PAPPLICATION_INFO> InfoList;
+
+typedef BOOL(CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info, LPCWSTR szFolderPath);
+
+struct CAvailableApplicationInfo : public APPLICATION_INFO
+{
+ ATL::CStringW szInstalledVersion;
+ CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam);
+
+ // Load all info from the file
+ VOID RefreshAppInfo();
+ BOOL HasLanguageInfo() const;
+ BOOL HasNativeLanguage() const;
+ BOOL HasEnglishLanguage() const;
+ BOOL IsInstalled() const;
+ BOOL HasInstalledVersion() const;
+ BOOL HasUpdate() const;
+
+ // Set a timestamp
+ VOID SetLastWriteTime(FILETIME* ftTime);
+
+private:
+ BOOL m_IsInstalled = FALSE;
+ BOOL m_HasLanguageInfo = FALSE;
+ BOOL m_HasInstalledVersion = FALSE;
+ CConfigParser m_Parser;
+
+ inline BOOL GetString(LPCWSTR lpKeyName,
+ ATL::CStringW& ReturnedString);
+
+ // Lazily load general info from the file
+ VOID RetrieveGeneralInfo();
+ VOID RetrieveInstalledStatus();
+ VOID RetrieveInstalledVersion();
+ VOID RetrieveLanguages();
+ VOID RetrieveLicenseType();
+ inline BOOL FindInLanguages(LCID what) const;
+};
+
+class CAvailableApps
+{
+ ATL::CAtlList<CAvailableApplicationInfo*> m_InfoList;
+ ATL::CStringW m_szPath;
+ ATL::CStringW m_szCabPath;
+ ATL::CStringW m_szAppsPath;
+ ATL::CStringW m_szSearchPath;
+
+public:
+ CAvailableApps();
+ VOID FreeCachedEntries();
+ BOOL DeleteCurrentAppsDB();
+ BOOL UpdateAppsDB();
+ BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
+ const ATL::CStringW& GetFolderPath();
+ const ATL::CStringW& GetAppPath();
+ const ATL::CStringW& GetCabPath();
+ const LPCWSTR GetFolderPathString();
+ const LPCWSTR GetAppPathString();
+ const LPCWSTR GetCabPathString();
+};
Propchange: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
------------------------------------------------------------------------------
svn:eol-style = native
Copied: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/crichedit.h (from
r75468, branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h)
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/crichedit.h [iso-8859-1]
(original)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/crichedit.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -1,4 +1,5 @@
#pragma once
+#include <rosctrls.h>
class CRichEdit :
public CWindow
Added: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h (added)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -0,0 +1,34 @@
+#pragma once
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+#define COBJMACROS
+#include <tchar.h>
+#include <stdarg.h>
+
+#include <windef.h>
+#include <winbase.h>
+#include <winreg.h>
+#include <wingdi.h>
+#include <winnls.h>
+#include <winuser.h>
+#include <wincon.h>
+#include <richedit.h>
+#include <shellapi.h>
+#include <shlobj.h>
+#include <shlwapi.h>
+#include <stdio.h>
+#include <strsafe.h>
+#include <ndk/rtlfuncs.h>
+#include <atlcoll.h>
+#include <atlsimpcoll.h>
+#include <atlstr.h>
+#include <rappsmsg.h>
+
+#include "resource.h"
+#include "winmain.h"
+
+#define APPLICATION_DATABASE_URL
L"https://svn.reactos.org/packages/rappmgr.cab"
+#define MAX_STR_LEN 256
+#define ENUM_ALL_COMPONENTS 30
Propchange: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/dialogs.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/dialogs.h (added)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/dialogs.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -0,0 +1,41 @@
+#pragma once
+
+#include "available.h"
+
+#include <windef.h>
+#include <atlsimpcoll.h>
+
+// Download dialog (loaddlg.cpp)
+class CDowloadingAppsListView;
+
+class CDownloadManager
+{
+ static PAPPLICATION_INFO AppInfo;
+ static ATL::CSimpleArray<PAPPLICATION_INFO> AppsToInstallList;
+ static CDowloadingAppsListView DownloadsListView;
+ static INT iCurrentApp;
+
+public:
+ static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM
lParam);
+ static LRESULT CALLBACK DownloadProgressProc(HWND hWnd,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam,
+ UINT_PTR uIdSubclass,
+ DWORD_PTR dwRefData);
+
+ static DWORD WINAPI ThreadFunc(LPVOID Context);
+ static BOOL DownloadListOfApplications(const
ATL::CSimpleArray<PAPPLICATION_INFO>& AppsList);
+ static BOOL DownloadApplication(PAPPLICATION_INFO pAppInfo);
+ static VOID DownloadApplicationsDB(LPCWSTR lpUrl);
+ static VOID LaunchDownloadDialog();
+};
+
+// Settings dialog (settingsdlg.cpp)
+VOID CreateSettingsDlg(HWND hwnd);
+
+// About dialog (aboutdlg.cpp)
+VOID ShowAboutDialog(VOID);
+
+// Installation dialog (installdlg.cpp)
+//BOOL InstallApplication(INT Index);
Propchange: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/dialogs.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/gui.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/gui.h (added)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/gui.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -0,0 +1,20 @@
+#pragma once
+#include <windef.h>
+#include <atlstr.h>
+
+class CAvailableApps;
+
+HWND CreateMainWindow();
+DWORD_PTR ListViewGetlParam(INT item);
+INT ListViewAddItem(INT ItemIndex, INT IconIndex, LPWSTR lpName, LPARAM lParam);
+VOID SetStatusBarText(LPCWSTR szText);
+VOID NewRichEditText(LPCWSTR szText, DWORD flags);
+VOID InsertRichEditText(LPCWSTR szText, DWORD flags);
+
+VOID SetStatusBarText(const ATL::CStringW& szText);
+INT ListViewAddItem(INT ItemIndex, INT IconIndex, ATL::CStringW & Name, LPARAM
lParam);
+VOID NewRichEditText(const ATL::CStringW& szText, DWORD flags);
+VOID InsertRichEditText(const ATL::CStringW& szText, DWORD flags);
+CAvailableApps * GetAvailableApps();
+extern HWND hListView;
+extern ATL::CStringW szSearchPattern;
Propchange: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/gui.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h (added)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <windef.h>
+#include <atlstr.h>
+
+#define ENUM_APPLICATIONS 31
+#define ENUM_UPDATES 32
+
+#define ENUM_INSTALLED_MIN ENUM_ALL_COMPONENTS
+#define ENUM_INSTALLED_MAX ENUM_UPDATES
+
+#define IS_INSTALLED_ENUM(a) (a >= ENUM_INSTALLED_MIN && a <=
ENUM_INSTALLED_MAX)
+
+struct INSTALLED_INFO
+{
+ HKEY hRootKey;
+ HKEY hSubKey;
+ ATL::CStringW szKeyName;
+};
+typedef INSTALLED_INFO *PINSTALLED_INFO;
+typedef BOOL(CALLBACK *APPENUMPROC)(INT ItemIndex, ATL::CStringW &Name,
PINSTALLED_INFO Info);
+
+BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc);
+BOOL GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR szString);
+BOOL GetApplicationString(HKEY hKey, LPCWSTR RegName, ATL::CStringW &String);
+
+BOOL ShowInstalledAppInfo(INT Index);
+BOOL UninstallApplication(INT Index, BOOL bModify);
+VOID RemoveAppFromRegistry(INT Index);
Propchange: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/misc.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/misc.h (added)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/misc.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <windef.h>
+#include <atlstr.h>
+
+int GetWindowWidth(HWND hwnd);
+int GetWindowHeight(HWND hwnd);
+int GetClientWindowWidth(HWND hwnd);
+int GetClientWindowHeight(HWND hwnd);
+
+VOID CopyTextToClipboard(LPCWSTR lpszText);
+VOID SetWelcomeText(VOID);
+VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem);
+BOOL StartProcess(ATL::CStringW &Path, BOOL Wait);
+BOOL StartProcess(LPWSTR lpPath, BOOL Wait);
+BOOL GetStorageDirectory(ATL::CStringW &lpDirectory);
+BOOL ExtractFilesFromCab(LPCWSTR lpCabName, LPCWSTR lpOutputPath);
+VOID InitLogs(VOID);
+VOID FreeLogs(VOID);
+BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg);
+BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName);
Propchange: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/misc.h
------------------------------------------------------------------------------
svn:eol-style = native
Copied: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/rapps.h (from
r75468, branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h)
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/rapps.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -3,317 +3,12 @@
#ifndef _RAPPS_H
#define _RAPPS_H
-#include <tchar.h>
-#include <stdarg.h>
+#include "defines.h"
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-#define COBJMACROS
-
-#include <windef.h>
-#include <winbase.h>
-#include <winreg.h>
-#include <wingdi.h>
-#include <winnls.h>
-#include <winuser.h>
-#include <wincon.h>
-#include <richedit.h>
-#include <shellapi.h>
-#include <shlobj.h>
-#include <shlwapi.h>
-#include <stdio.h>
-#include <strsafe.h>
-#include <ndk/rtlfuncs.h>
-#include <atlcoll.h>
-#include <atlsimpcoll.h>
-#include <atlstr.h>
-#include <rappsmsg.h>
-
-#include "resource.h"
-
-#ifdef USE_CERT_PINNING
- #define CERT_ISSUER_INFO "BE\r\nGlobalSign nv-sa\r\nGlobalSign Domain Validation
CA - SHA256 - G2"
- #define CERT_SUBJECT_INFO "Domain Control Validated\r\n*.reactos.org"
-#endif
-
-#define APPLICATION_DATABASE_URL
L"https://svn.reactos.org/packages/rappmgr.cab"
-
-#define SPLIT_WIDTH 4
-#define MAX_STR_LEN 256
-#define LISTVIEW_ICON_SIZE 24
-#define TREEVIEW_ICON_SIZE 24
-
-/* EnumType flags for EnumInstalledApplications */
-#define ENUM_ALL_COMPONENTS 30
-#define ENUM_APPLICATIONS 31
-#define ENUM_UPDATES 32
-/* EnumType flags for EnumAvailableApplications */
-#define ENUM_ALL_AVAILABLE 0
-#define ENUM_CAT_AUDIO 1
-#define ENUM_CAT_VIDEO 2
-#define ENUM_CAT_GRAPHICS 3
-#define ENUM_CAT_GAMES 4
-#define ENUM_CAT_INTERNET 5
-#define ENUM_CAT_OFFICE 6
-#define ENUM_CAT_DEVEL 7
-#define ENUM_CAT_EDU 8
-#define ENUM_CAT_ENGINEER 9
-#define ENUM_CAT_FINANCE 10
-#define ENUM_CAT_SCIENCE 11
-#define ENUM_CAT_TOOLS 12
-#define ENUM_CAT_DRIVERS 13
-#define ENUM_CAT_LIBS 14
-#define ENUM_CAT_OTHER 15
-
-#define ENUM_INSTALLED_MIN ENUM_ALL_COMPONENTS
-#define ENUM_INSTALLED_MAX ENUM_UPDATES
-#define ENUM_AVAILABLE_MIN ENUM_ALL_AVAILABLE
-#define ENUM_AVAILABLE_MAX ENUM_CAT_OTHER
-
-#define IS_INSTALLED_ENUM(a) (a >= ENUM_INSTALLED_MIN && a <=
ENUM_INSTALLED_MAX)
-#define IS_AVAILABLE_ENUM(a) (a >= ENUM_AVAILABLE_MIN && a <=
ENUM_AVAILABLE_MAX)
-
-typedef enum
-{
- None,
- OpenSource,
- Freeware,
- Trial,
- Max = Trial,
- Min = None
-} LICENSE_TYPE, *PLICENSE_TYPE;
-
-/* aboutdlg.cpp */
-VOID ShowAboutDialog(VOID);
-
-/* available.cpp */
-typedef struct
-{
- INT Category;
- LICENSE_TYPE LicenseType;
- ATL::CStringW szName;
- ATL::CStringW szRegName;
- ATL::CStringW szVersion;
- ATL::CStringW szLicense;
- ATL::CStringW szDesc;
- ATL::CStringW szSize;
- ATL::CStringW szUrlSite;
- ATL::CStringW szUrlDownload;
- ATL::CStringW szCDPath;
- ATL::CSimpleArray<LCID> Languages;
-
- /* caching mechanism related entries */
- ATL::CStringW sFileName;
- FILETIME ftCacheStamp;
-
- /* optional integrity checks (SHA-1 digests are 160 bit = 40 characters in hex string
form) */
- ATL::CStringW szSHA1;
-
-} APPLICATION_INFO, *PAPPLICATION_INFO;
-
-extern ATL::CAtlList<PAPPLICATION_INFO> InfoList;
-
-typedef struct
-{
- HKEY hRootKey;
- HKEY hSubKey;
- ATL::CStringW szKeyName;
-
-} INSTALLED_INFO, *PINSTALLED_INFO;
-
-typedef struct
-{
- BOOL bSaveWndPos;
- BOOL bUpdateAtStart;
- BOOL bLogEnabled;
- WCHAR szDownloadDir[MAX_PATH];
- BOOL bDelInstaller;
- /* Window Pos */
- BOOL Maximized;
- INT Left;
- INT Top;
- INT Width;
- INT Height;
- /* Proxy settings */
- INT Proxy;
- WCHAR szProxyServer[MAX_PATH];
- WCHAR szNoProxyFor[MAX_PATH];
-
-} SETTINGS_INFO, *PSETTINGS_INFO;
-
-/* available.cpp */
-class CConfigParser
-{
- // Loacale names cache
- static ATL::CStringW m_szLocaleID;
- const static INT m_cchLocaleSize = 5;
- static ATL::CStringW m_szCachedINISectionLocale;
- static ATL::CStringW m_szCachedINISectionLocaleNeutral;
-
- const LPCWSTR STR_VERSION_CURRENT = L"CURRENT";
- const ATL::CStringW szConfigPath;
-
- static ATL::CStringW GetINIFullPath(const ATL::CStringW& FileName);
- static VOID CacheINILocaleLazy();
-
-public:
- static const ATL::CStringW& GetLocale();
- static INT CConfigParser::GetLocaleSize();
-
- CConfigParser(const ATL::CStringW& FileName);
-
- UINT GetString(const ATL::CStringW& KeyName, ATL::CStringW& ResultString);
- UINT GetInt(const ATL::CStringW& KeyName);
-};
-
-typedef BOOL (CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info, LPCWSTR szFolderPath);
-struct CAvailableApplicationInfo : public APPLICATION_INFO
-{
- ATL::CStringW szInstalledVersion;
- CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam);
-
- // Load all info from the file
- VOID RefreshAppInfo();
- BOOL HasLanguageInfo() const;
- BOOL HasNativeLanguage() const;
- BOOL HasEnglishLanguage() const;
- BOOL IsInstalled() const;
- BOOL HasInstalledVersion() const;
- BOOL HasUpdate() const;
-
- // Set a timestamp
- VOID SetLastWriteTime(FILETIME* ftTime);
-
-private:
- BOOL m_IsInstalled = FALSE;
- BOOL m_HasLanguageInfo = FALSE;
- BOOL m_HasInstalledVersion = FALSE;
- CConfigParser m_Parser;
-
- inline BOOL GetString(LPCWSTR lpKeyName,
- ATL::CStringW& ReturnedString);
-
- // Lazily load general info from the file
- VOID RetrieveGeneralInfo();
- VOID RetrieveInstalledStatus();
- VOID RetrieveInstalledVersion();
- VOID RetrieveLanguages();
- VOID RetrieveLicenseType();
- inline BOOL FindInLanguages(LCID what) const;
-};
-
-class CAvailableApps
-{
- ATL::CAtlList<CAvailableApplicationInfo*> m_InfoList;
- ATL::CStringW m_szPath;
- ATL::CStringW m_szCabPath;
- ATL::CStringW m_szAppsPath;
- ATL::CStringW m_szSearchPath;
-
-public:
- CAvailableApps();
- VOID FreeCachedEntries();
- BOOL DeleteCurrentAppsDB();
- BOOL UpdateAppsDB();
- BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
- const ATL::CStringW& GetFolderPath();
- const ATL::CStringW& GetAppPath();
- const ATL::CStringW& GetCabPath();
- const LPCWSTR GetFolderPathString();
- const LPCWSTR GetAppPathString();
- const LPCWSTR GetCabPathString();
-};
-
-/* installdlg.cpp */
-//BOOL InstallApplication(INT Index);
-
-/* installed.cpp */
-typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, ATL::CStringW &lpName,
PINSTALLED_INFO Info);
-BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc);
-BOOL GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR szString);
-BOOL GetApplicationString(HKEY hKey, LPCWSTR RegName, ATL::CStringW& String);
-
-BOOL ShowInstalledAppInfo(INT Index);
-BOOL UninstallApplication(INT Index, BOOL bModify);
-VOID RemoveAppFromRegistry(INT Index);
-
-BOOL GetInstalledVersion(ATL::CStringW* pszVersion, const ATL::CStringW& szRegName);
-
-/* winmain.cpp */
-extern HWND hMainWnd;
-extern HINSTANCE hInst;
-extern INT SelectedEnumType;
-extern SETTINGS_INFO SettingsInfo;
-VOID SaveSettings(HWND hwnd);
-VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo);
-
-/* loaddlg.cpp */
-class CDowloadingAppsListView;
-
-class CDownloadManager
-{
- static PAPPLICATION_INFO AppInfo;
- static ATL::CSimpleArray<PAPPLICATION_INFO> AppsToInstallList;
- static CDowloadingAppsListView DownloadsListView;
- static INT iCurrentApp;
-public:
- static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM
lParam);
- static LRESULT CALLBACK DownloadProgressProc(HWND hWnd,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam,
- UINT_PTR uIdSubclass,
- DWORD_PTR dwRefData);
-
- static DWORD WINAPI ThreadFunc(LPVOID Context);
- static BOOL DownloadListOfApplications(const
ATL::CSimpleArray<PAPPLICATION_INFO>& AppsList);
- static BOOL DownloadApplication(PAPPLICATION_INFO pAppInfo);
- static VOID DownloadApplicationsDB(LPCWSTR lpUrl);
- static VOID LaunchDownloadDialog();
-};
-
-/* misc.cpp */
-INT GetSystemColorDepth(VOID);
-int GetWindowWidth(HWND hwnd);
-int GetWindowHeight(HWND hwnd);
-int GetClientWindowWidth(HWND hwnd);
-int GetClientWindowHeight(HWND hwnd);
-VOID CopyTextToClipboard(LPCWSTR lpszText);
-VOID SetWelcomeText(VOID);
-VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem);
-BOOL StartProcess(ATL::CStringW & Path, BOOL Wait);
-BOOL StartProcess(LPWSTR lpPath, BOOL Wait);
-BOOL GetStorageDirectory(ATL::CStringW &lpDirectory);
-BOOL ExtractFilesFromCab(LPCWSTR lpCabName, LPCWSTR lpOutputPath);
-VOID InitLogs(VOID);
-VOID FreeLogs(VOID);
-BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg);
-
-/* settingsdlg.cpp */
-VOID CreateSettingsDlg(HWND hwnd);
-
-/* gui.cpp */
-HWND CreateMainWindow();
-DWORD_PTR ListViewGetlParam(INT item);
-INT ListViewAddItem(INT ItemIndex, INT IconIndex, LPWSTR lpName, LPARAM lParam);
-VOID SetStatusBarText(LPCWSTR szText);
-VOID NewRichEditText(LPCWSTR szText, DWORD flags);
-VOID InsertRichEditText(LPCWSTR szText, DWORD flags);
-
-VOID SetStatusBarText(const ATL::CStringW& szText);
-INT ListViewAddItem(INT ItemIndex, INT IconIndex, ATL::CStringW & Name, LPARAM
lParam);
-VOID NewRichEditText(const ATL::CStringW& szText, DWORD flags);
-VOID InsertRichEditText(const ATL::CStringW& szText, DWORD flags);
-CAvailableApps * GetAvailableApps();
-extern HWND hListView;
-extern ATL::CStringW szSearchPattern;
-
-/* integrity.cpp */
-BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName);
-
-//extern HWND hTreeView;
-//BOOL CreateTreeView(HWND hwnd);
-//HTREEITEM TreeViewAddItem(HTREEITEM hParent, LPWSTR lpText, INT Image, INT
SelectedImage, LPARAM lParam);
+#include "dialogs.h"
+#include "installed.h"
+#include "available.h"
+#include "misc.h"
+#include "gui.h"
#endif /* _RAPPS_H */
Copied: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/rosui.h (from
r75468, branches/GSoC_2017/rapps/reactos/base/applications/rapps/rosui.h)
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/rosui.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/rosui.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -3,6 +3,8 @@
* AUTHORS: David Quintana <gigaherz(a)gmail.com>
*/
#pragma once
+
+#include <atlwin.h>
template<class T, int GrowthRate = 10>
class CPointerArray
Added: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/winmain.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/winmain.h (added)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/winmain.h [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -0,0 +1,35 @@
+#pragma once
+#include <windef.h>
+//TODO: Separate main and settings related definitions
+
+struct SETTINGS_INFO
+{
+ BOOL bSaveWndPos;
+ BOOL bUpdateAtStart;
+ BOOL bLogEnabled;
+ WCHAR szDownloadDir[MAX_PATH];
+ BOOL bDelInstaller;
+ /* Window Pos */
+ BOOL Maximized;
+ INT Left;
+ INT Top;
+ INT Width;
+ INT Height;
+ /* Proxy settings */
+ INT Proxy;
+ WCHAR szProxyServer[MAX_PATH];
+ WCHAR szNoProxyFor[MAX_PATH];
+};
+
+typedef SETTINGS_INFO *PSETTINGS_INFO;
+
+extern HWND hMainWnd;
+extern HINSTANCE hInst;
+extern INT SelectedEnumType;
+extern SETTINGS_INFO SettingsInfo;
+
+VOID SaveSettings(HWND hwnd);
+VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo);
+
+// integrity.cpp
+BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName);
Propchange: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/winmain.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/installdlg.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/installdlg.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/installdlg.cpp [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -5,8 +5,10 @@
* PURPOSE: "Download and Install" Dialog
* PROGRAMMERS: Dmitry Chapyshev (dmitry(a)reactos.org)
*/
+#include "defines.h"
-#include "rapps.h"
+#include "dialogs.h"
+#include "available.h"
static PAPPLICATION_INFO AppInfo;
@@ -18,7 +20,6 @@
{
case WM_INITDIALOG:
{
-
}
break;
@@ -47,8 +48,8 @@
AppInfo = (PAPPLICATION_INFO) ListViewGetlParam(Index);
if (!AppInfo) return FALSE;
- DialogBox(hInst,
- MAKEINTRESOURCE(IDD_INSTALL_DIALOG),
+ DialogBoxW(hInst,
+ MAKEINTRESOURCEW(IDD_INSTALL_DIALOG),
hMainWnd,
InstallDlgProc);
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -7,7 +7,12 @@
* Alexander Shaposhnikov (chaez.san(a)gmail.com)
*/
-#include "rapps.h"
+#include "defines.h"
+
+#include "installed.h"
+
+#include "gui.h"
+#include "misc.h"
BOOL
GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, ATL::CStringW& String)
@@ -34,62 +39,6 @@
StringCchCopyW(szString, MAX_PATH, L"---");
return FALSE;
-}
-
-BOOL
-GetInstalledVersion_WowUser(_Out_opt_ ATL::CStringW* szVersionResult,
- _In_z_ const ATL::CStringW& RegName,
- _In_ BOOL IsUserKey,
- _In_ REGSAM keyWow)
-{
- HKEY hKey;
- BOOL bHasSucceded = FALSE;
- ATL::CStringW szVersion;
- ATL::CStringW szPath =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + RegName;
-
- if (RegOpenKeyExW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
- szPath.GetString(), 0, keyWow | KEY_READ,
- &hKey) == ERROR_SUCCESS)
- {
- if (szVersionResult != NULL)
- {
- DWORD dwSize = MAX_PATH * sizeof(WCHAR);
- DWORD dwType = REG_SZ;
- if (RegQueryValueExW(hKey,
- L"DisplayVersion",
- NULL,
- &dwType,
- (LPBYTE) szVersion.GetBuffer(MAX_PATH),
- &dwSize) == ERROR_SUCCESS)
- {
- szVersion.ReleaseBuffer();
- *szVersionResult = szVersion;
- bHasSucceded = TRUE;
- }
- else
- {
- szVersion.ReleaseBuffer();
- }
- }
- else
- {
- bHasSucceded = TRUE;
- szVersion.ReleaseBuffer();
- }
-
- }
-
- RegCloseKey(hKey);
- return bHasSucceded;
-}
-
-BOOL GetInstalledVersion(ATL::CStringW* pszVersion, const ATL::CStringW& szRegName)
-{
- return (!szRegName.IsEmpty()
- && (::GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE,
KEY_WOW64_32KEY)
- || ::GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE,
KEY_WOW64_32KEY)
- || ::GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE,
KEY_WOW64_64KEY)
- || ::GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE,
KEY_WOW64_64KEY)));
}
BOOL
@@ -146,7 +95,6 @@
return StartProcess(szPath, TRUE);
}
-
BOOL
ShowInstalledAppInfo(INT Index)
@@ -190,7 +138,6 @@
return TRUE;
}
-
VOID
RemoveAppFromRegistry(INT Index)
{
@@ -228,7 +175,6 @@
MessageBoxW(hMainWnd, szMsgText.GetString(), NULL, MB_OK | MB_ICONERROR);
}
}
-
BOOL
EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/integrity.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/integrity.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/integrity.cpp [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -6,8 +6,8 @@
* PROGRAMMERS: Ismael Ferreras Morezuelas (swyterzone+ros(a)gmail.com)
* Mark Jansen
*/
+#include "defines.h"
-#include "rapps.h"
#include <sha1.h>
BOOL VerifyInteg(const ATL::CStringW &SHA1Hash, const ATL::CStringW &FileName)
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/lang/en-US.rc [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -208,7 +208,7 @@
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have
been corrupted or tampered with during downloading. Running the software is not
recommended."
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to
Internet."
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity."
- IDS_SELECT_ALL "Select/Desellect All"
+ IDS_SELECT_ALL "Select/Deselect All"
IDS_INSTALL_SELECTED "Install Selected"
END
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp [iso-8859-1] Wed
Aug 2 12:50:53 2017
@@ -27,8 +27,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-#include "rapps.h"
+#include "defines.h"
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
@@ -43,6 +42,12 @@
#include <windowsx.h>
#include "rosui.h"
+#include "dialogs.h"
+
+#ifdef USE_CERT_PINNING
+ #define CERT_ISSUER_INFO "BE\r\nGlobalSign nv-sa\r\nGlobalSign Domain Validation
CA - SHA256 - G2"
+ #define CERT_SUBJECT_INFO "Domain Control Validated\r\n*.reactos.org"
+#endif
typedef enum
{
@@ -834,4 +839,4 @@
hMainWnd,
DownloadDlgProc);
}
-// CDownloadManager
+// CDownloadManager
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp [iso-8859-1] Wed Aug
2 12:50:53 2017
@@ -7,8 +7,10 @@
* Ismael Ferreras Morezuelas (swyterzone+ros(a)gmail.com)
* Alexander Shaposhnikov (chaez.san(a)gmail.com)
*/
-
-#include "rapps.h"
+#include "defines.h"
+
+#include "gui.h"
+#include "misc.h"
/* SESSION Operation */
#define EXTRACT_FILLFILELIST 0x00000001
@@ -26,53 +28,26 @@
struct FILELIST
{
LPSTR FileName;
- struct FILELIST *next;
+ FILELIST *next;
BOOL DoExtract;
};
-typedef struct
+struct SESSION
{
INT FileSize;
ERF Error;
- struct FILELIST *FileList;
+ FILELIST *FileList;
INT FileCount;
INT Operation;
CHAR Destination[MAX_PATH];
CHAR CurrentFile[MAX_PATH];
CHAR Reserved[MAX_PATH];
- struct FILELIST *FilterList;
-} SESSION;
+ FILELIST *FilterList;
+};
typedef HRESULT(WINAPI *fnExtract)(SESSION *dest, LPCSTR szCabName);
fnExtract pfnExtract;
-INT
-GetSystemColorDepth(VOID)
-{
- DEVMODE pDevMode;
- INT ColorDepth;
-
- pDevMode.dmSize = sizeof(pDevMode);
- pDevMode.dmDriverExtra = 0;
-
- if (!EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &pDevMode))
- {
- /* TODO: Error message */
- return ILC_COLOR;
- }
-
- switch (pDevMode.dmBitsPerPel)
- {
- case 32: ColorDepth = ILC_COLOR32; break;
- case 24: ColorDepth = ILC_COLOR24; break;
- case 16: ColorDepth = ILC_COLOR16; break;
- case 8: ColorDepth = ILC_COLOR8; break;
- case 4: ColorDepth = ILC_COLOR4; break;
- default: ColorDepth = ILC_COLOR; break;
- }
-
- return ColorDepth;
-}
int
GetWindowWidth(HWND hwnd)
@@ -396,5 +371,58 @@
return TRUE;
}
-
-
+BOOL
+GetInstalledVersion_WowUser(_Out_opt_ ATL::CStringW* szVersionResult,
+ _In_z_ const ATL::CStringW& RegName,
+ _In_ BOOL IsUserKey,
+ _In_ REGSAM keyWow)
+{
+ HKEY hKey;
+ BOOL bHasSucceded = FALSE;
+ ATL::CStringW szVersion;
+ ATL::CStringW szPath =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + RegName;
+
+ if (RegOpenKeyExW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
+ szPath.GetString(), 0, keyWow | KEY_READ,
+ &hKey) == ERROR_SUCCESS)
+ {
+ if (szVersionResult != NULL)
+ {
+ DWORD dwSize = MAX_PATH * sizeof(WCHAR);
+ DWORD dwType = REG_SZ;
+ if (RegQueryValueExW(hKey,
+ L"DisplayVersion",
+ NULL,
+ &dwType,
+ (LPBYTE) szVersion.GetBuffer(MAX_PATH),
+ &dwSize) == ERROR_SUCCESS)
+ {
+ szVersion.ReleaseBuffer();
+ *szVersionResult = szVersion;
+ bHasSucceded = TRUE;
+ }
+ else
+ {
+ szVersion.ReleaseBuffer();
+ }
+ }
+ else
+ {
+ bHasSucceded = TRUE;
+ szVersion.ReleaseBuffer();
+ }
+
+ }
+
+ RegCloseKey(hKey);
+ return bHasSucceded;
+}
+
+BOOL GetInstalledVersion(ATL::CStringW * pszVersion, const ATL::CStringW &
szRegName)
+{
+ return (!szRegName.IsEmpty()
+ && (GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE,
KEY_WOW64_32KEY)
+ || GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE,
KEY_WOW64_32KEY)
+ || GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE,
KEY_WOW64_64KEY)
+ || GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE,
KEY_WOW64_64KEY)));
+}
Removed: branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.h (removed)
@@ -1,319 +0,0 @@
-#pragma once
-
-#ifndef _RAPPS_H
-#define _RAPPS_H
-
-#include <tchar.h>
-#include <stdarg.h>
-
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-#define COBJMACROS
-
-#include <windef.h>
-#include <winbase.h>
-#include <winreg.h>
-#include <wingdi.h>
-#include <winnls.h>
-#include <winuser.h>
-#include <wincon.h>
-#include <richedit.h>
-#include <shellapi.h>
-#include <shlobj.h>
-#include <shlwapi.h>
-#include <stdio.h>
-#include <strsafe.h>
-#include <ndk/rtlfuncs.h>
-#include <atlcoll.h>
-#include <atlsimpcoll.h>
-#include <atlstr.h>
-#include <rappsmsg.h>
-
-#include "resource.h"
-
-#ifdef USE_CERT_PINNING
- #define CERT_ISSUER_INFO "BE\r\nGlobalSign nv-sa\r\nGlobalSign Domain Validation
CA - SHA256 - G2"
- #define CERT_SUBJECT_INFO "Domain Control Validated\r\n*.reactos.org"
-#endif
-
-#define APPLICATION_DATABASE_URL
L"https://svn.reactos.org/packages/rappmgr.cab"
-
-#define SPLIT_WIDTH 4
-#define MAX_STR_LEN 256
-#define LISTVIEW_ICON_SIZE 24
-#define TREEVIEW_ICON_SIZE 24
-
-/* EnumType flags for EnumInstalledApplications */
-#define ENUM_ALL_COMPONENTS 30
-#define ENUM_APPLICATIONS 31
-#define ENUM_UPDATES 32
-/* EnumType flags for EnumAvailableApplications */
-#define ENUM_ALL_AVAILABLE 0
-#define ENUM_CAT_AUDIO 1
-#define ENUM_CAT_VIDEO 2
-#define ENUM_CAT_GRAPHICS 3
-#define ENUM_CAT_GAMES 4
-#define ENUM_CAT_INTERNET 5
-#define ENUM_CAT_OFFICE 6
-#define ENUM_CAT_DEVEL 7
-#define ENUM_CAT_EDU 8
-#define ENUM_CAT_ENGINEER 9
-#define ENUM_CAT_FINANCE 10
-#define ENUM_CAT_SCIENCE 11
-#define ENUM_CAT_TOOLS 12
-#define ENUM_CAT_DRIVERS 13
-#define ENUM_CAT_LIBS 14
-#define ENUM_CAT_OTHER 15
-
-#define ENUM_INSTALLED_MIN ENUM_ALL_COMPONENTS
-#define ENUM_INSTALLED_MAX ENUM_UPDATES
-#define ENUM_AVAILABLE_MIN ENUM_ALL_AVAILABLE
-#define ENUM_AVAILABLE_MAX ENUM_CAT_OTHER
-
-#define IS_INSTALLED_ENUM(a) (a >= ENUM_INSTALLED_MIN && a <=
ENUM_INSTALLED_MAX)
-#define IS_AVAILABLE_ENUM(a) (a >= ENUM_AVAILABLE_MIN && a <=
ENUM_AVAILABLE_MAX)
-
-typedef enum
-{
- None,
- OpenSource,
- Freeware,
- Trial,
- Max = Trial,
- Min = None
-} LICENSE_TYPE, *PLICENSE_TYPE;
-
-/* aboutdlg.cpp */
-VOID ShowAboutDialog(VOID);
-
-/* available.cpp */
-typedef struct
-{
- INT Category;
- LICENSE_TYPE LicenseType;
- ATL::CStringW szName;
- ATL::CStringW szRegName;
- ATL::CStringW szVersion;
- ATL::CStringW szLicense;
- ATL::CStringW szDesc;
- ATL::CStringW szSize;
- ATL::CStringW szUrlSite;
- ATL::CStringW szUrlDownload;
- ATL::CStringW szCDPath;
- ATL::CSimpleArray<LCID> Languages;
-
- /* caching mechanism related entries */
- ATL::CStringW sFileName;
- FILETIME ftCacheStamp;
-
- /* optional integrity checks (SHA-1 digests are 160 bit = 40 characters in hex string
form) */
- ATL::CStringW szSHA1;
-
-} APPLICATION_INFO, *PAPPLICATION_INFO;
-
-extern ATL::CAtlList<PAPPLICATION_INFO> InfoList;
-
-typedef struct
-{
- HKEY hRootKey;
- HKEY hSubKey;
- ATL::CStringW szKeyName;
-
-} INSTALLED_INFO, *PINSTALLED_INFO;
-
-typedef struct
-{
- BOOL bSaveWndPos;
- BOOL bUpdateAtStart;
- BOOL bLogEnabled;
- WCHAR szDownloadDir[MAX_PATH];
- BOOL bDelInstaller;
- /* Window Pos */
- BOOL Maximized;
- INT Left;
- INT Top;
- INT Width;
- INT Height;
- /* Proxy settings */
- INT Proxy;
- WCHAR szProxyServer[MAX_PATH];
- WCHAR szNoProxyFor[MAX_PATH];
-
-} SETTINGS_INFO, *PSETTINGS_INFO;
-
-/* available.cpp */
-class CConfigParser
-{
- // Loacale names cache
- static ATL::CStringW m_szLocaleID;
- const static INT m_cchLocaleSize = 5;
- static ATL::CStringW m_szCachedINISectionLocale;
- static ATL::CStringW m_szCachedINISectionLocaleNeutral;
-
- const LPCWSTR STR_VERSION_CURRENT = L"CURRENT";
- const ATL::CStringW szConfigPath;
-
- static ATL::CStringW GetINIFullPath(const ATL::CStringW& FileName);
- static VOID CacheINILocaleLazy();
-
-public:
- static const ATL::CStringW& GetLocale();
- static INT CConfigParser::GetLocaleSize();
-
- CConfigParser(const ATL::CStringW& FileName);
-
- UINT GetString(const ATL::CStringW& KeyName, ATL::CStringW& ResultString);
- UINT GetInt(const ATL::CStringW& KeyName);
-};
-
-typedef BOOL (CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info, LPCWSTR szFolderPath);
-struct CAvailableApplicationInfo : public APPLICATION_INFO
-{
- ATL::CStringW szInstalledVersion;
- CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam);
-
- // Load all info from the file
- VOID RefreshAppInfo();
- BOOL HasLanguageInfo() const;
- BOOL HasNativeLanguage() const;
- BOOL HasEnglishLanguage() const;
- BOOL IsInstalled() const;
- BOOL HasInstalledVersion() const;
- BOOL HasUpdate() const;
-
- // Set a timestamp
- VOID SetLastWriteTime(FILETIME* ftTime);
-
-private:
- BOOL m_IsInstalled = FALSE;
- BOOL m_HasLanguageInfo = FALSE;
- BOOL m_HasInstalledVersion = FALSE;
- CConfigParser m_Parser;
-
- inline BOOL GetString(LPCWSTR lpKeyName,
- ATL::CStringW& ReturnedString);
-
- // Lazily load general info from the file
- VOID RetrieveGeneralInfo();
- VOID RetrieveInstalledStatus();
- VOID RetrieveInstalledVersion();
- VOID RetrieveLanguages();
- VOID RetrieveLicenseType();
- inline BOOL FindInLanguages(LCID what) const;
-};
-
-class CAvailableApps
-{
- ATL::CAtlList<CAvailableApplicationInfo*> m_InfoList;
- ATL::CStringW m_szPath;
- ATL::CStringW m_szCabPath;
- ATL::CStringW m_szAppsPath;
- ATL::CStringW m_szSearchPath;
-
-public:
- CAvailableApps();
- VOID FreeCachedEntries();
- BOOL DeleteCurrentAppsDB();
- BOOL UpdateAppsDB();
- BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
- const ATL::CStringW& GetFolderPath();
- const ATL::CStringW& GetAppPath();
- const ATL::CStringW& GetCabPath();
- const LPCWSTR GetFolderPathString();
- const LPCWSTR GetAppPathString();
- const LPCWSTR GetCabPathString();
-};
-
-/* installdlg.cpp */
-//BOOL InstallApplication(INT Index);
-
-/* installed.cpp */
-typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, ATL::CStringW &lpName,
PINSTALLED_INFO Info);
-BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc);
-BOOL GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR szString);
-BOOL GetApplicationString(HKEY hKey, LPCWSTR RegName, ATL::CStringW& String);
-
-BOOL ShowInstalledAppInfo(INT Index);
-BOOL UninstallApplication(INT Index, BOOL bModify);
-VOID RemoveAppFromRegistry(INT Index);
-
-BOOL GetInstalledVersion(ATL::CStringW* pszVersion, const ATL::CStringW& szRegName);
-
-/* winmain.cpp */
-extern HWND hMainWnd;
-extern HINSTANCE hInst;
-extern INT SelectedEnumType;
-extern SETTINGS_INFO SettingsInfo;
-VOID SaveSettings(HWND hwnd);
-VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo);
-
-/* loaddlg.cpp */
-class CDowloadingAppsListView;
-
-class CDownloadManager
-{
- static PAPPLICATION_INFO AppInfo;
- static ATL::CSimpleArray<PAPPLICATION_INFO> AppsToInstallList;
- static CDowloadingAppsListView DownloadsListView;
- static INT iCurrentApp;
-public:
- static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM
lParam);
- static LRESULT CALLBACK DownloadProgressProc(HWND hWnd,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam,
- UINT_PTR uIdSubclass,
- DWORD_PTR dwRefData);
-
- static DWORD WINAPI ThreadFunc(LPVOID Context);
- static BOOL DownloadListOfApplications(const
ATL::CSimpleArray<PAPPLICATION_INFO>& AppsList);
- static BOOL DownloadApplication(PAPPLICATION_INFO pAppInfo);
- static VOID DownloadApplicationsDB(LPCWSTR lpUrl);
- static VOID LaunchDownloadDialog();
-};
-
-/* misc.cpp */
-INT GetSystemColorDepth(VOID);
-int GetWindowWidth(HWND hwnd);
-int GetWindowHeight(HWND hwnd);
-int GetClientWindowWidth(HWND hwnd);
-int GetClientWindowHeight(HWND hwnd);
-VOID CopyTextToClipboard(LPCWSTR lpszText);
-VOID SetWelcomeText(VOID);
-VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem);
-BOOL StartProcess(ATL::CStringW & Path, BOOL Wait);
-BOOL StartProcess(LPWSTR lpPath, BOOL Wait);
-BOOL GetStorageDirectory(ATL::CStringW &lpDirectory);
-BOOL ExtractFilesFromCab(LPCWSTR lpCabName, LPCWSTR lpOutputPath);
-VOID InitLogs(VOID);
-VOID FreeLogs(VOID);
-BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg);
-
-/* settingsdlg.cpp */
-VOID CreateSettingsDlg(HWND hwnd);
-
-/* gui.cpp */
-HWND CreateMainWindow();
-DWORD_PTR ListViewGetlParam(INT item);
-INT ListViewAddItem(INT ItemIndex, INT IconIndex, LPWSTR lpName, LPARAM lParam);
-VOID SetStatusBarText(LPCWSTR szText);
-VOID NewRichEditText(LPCWSTR szText, DWORD flags);
-VOID InsertRichEditText(LPCWSTR szText, DWORD flags);
-
-VOID SetStatusBarText(const ATL::CStringW& szText);
-INT ListViewAddItem(INT ItemIndex, INT IconIndex, ATL::CStringW & Name, LPARAM
lParam);
-VOID NewRichEditText(const ATL::CStringW& szText, DWORD flags);
-VOID InsertRichEditText(const ATL::CStringW& szText, DWORD flags);
-CAvailableApps * GetAvailableApps();
-extern HWND hListView;
-extern ATL::CStringW szSearchPattern;
-
-/* integrity.cpp */
-BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName);
-
-//extern HWND hTreeView;
-//BOOL CreateTreeView(HWND hwnd);
-//HTREEITEM TreeViewAddItem(HTREEITEM hParent, LPWSTR lpText, INT Image, INT
SelectedImage, LPARAM lParam);
-
-#endif /* _RAPPS_H */
Removed: branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/resource.h (removed)
@@ -1,200 +0,0 @@
-#pragma once
-
-/* Icons */
-#define IDI_MAIN 10
-#define IDI_EXIT 11
-#define IDI_INSTALL 12
-#define IDI_UNINSTALL 13
-#define IDI_SETTINGS 14
-#define IDI_MODIFY 15
-#define IDI_REFRESH 16
-#define IDI_APPS 17
-#define IDI_APPUPD 18
-#define IDI_CATEGORY 19
-#define IDI_UPDATE_DB 20
-#define IDI_CHECK_ALL 21
-
-/* Icons for categories */
-#define IDI_CAT_AUDIO 50
-#define IDI_CAT_DEVEL 51
-#define IDI_CAT_DRIVERS 52
-#define IDI_CAT_EDU 53
-#define IDI_CAT_ENGINEER 54
-#define IDI_CAT_FINANCE 55
-#define IDI_CAT_GAMES 56
-#define IDI_CAT_GRAPHICS 57
-#define IDI_CAT_INTERNET 58
-#define IDI_CAT_LIBS 59
-#define IDI_CAT_OFFICE 60
-#define IDI_CAT_OTHER 61
-#define IDI_CAT_SCIENCE 62
-#define IDI_CAT_TOOLS 63
-#define IDI_CAT_VIDEO 64
-
-/* Bitmaps */
-
-/* Controls */
-#define IDC_STATUSBAR 1000
-#define IDC_DOWNLOAD_PROGRESS 1001
-#define IDC_DOWNLOAD_STATUS 1002
-#define IDC_SAVE_WINDOW_POS 1003
-#define IDC_UPDATE_AVLIST 1004
-#define IDC_DOWNLOAD_DIR_EDIT 1005
-#define IDC_DEL_AFTER_INSTALL 1006
-#define IDC_LOG_ENABLED 1007
-#define IDC_CHOOSE 1008
-#define IDC_DEFAULT_SETTINGS 1009
-#define IDC_INSTALL_TEXT 1010
-#define IDC_CD_INSTALL 1011
-#define IDC_DOWNLOAD_INSTALL 1012
-#define IDC_PROXY_DEFAULT 1013
-#define IDC_NO_PROXY 1014
-#define IDC_USE_PROXY 1015
-#define IDC_PROXY_SERVER 1016
-#define IDC_NO_PROXY_FOR 1017
-
-/* Dialogs */
-#define IDD_SETTINGS_DIALOG 300
-#define IDD_INSTALL_DIALOG 301
-#define IDD_DOWNLOAD_DIALOG 302
-#define IDD_ABOUT_DIALOG 303
-
-/* Menus */
-#define IDR_MAINMENU 500
-#define IDR_LINKMENU 501
-#define IDR_APPLICATIONMENU 502
-
-/* Menu items */
-#define ID_EXIT 550
-#define ID_INSTALL 551
-#define ID_UNINSTALL 552
-#define ID_HELP 553
-#define ID_ABOUT 554
-#define ID_MODIFY 555
-#define ID_OPEN_LINK 556
-#define ID_COPY_LINK 557
-#define ID_SETTINGS 558
-#define ID_REFRESH 559
-#define ID_REGREMOVE 560
-#define ID_RESETDB 561
-#define ID_CHECK_ALL 562
-
-/* Strings */
-#define IDS_APPTITLE 100
-#define IDS_SEARCH_TEXT 101
-#define IDS_INSTALL 102
-#define IDS_UNINSTALL 103
-#define IDS_MODIFY 104
-#define IDS_APPS_COUNT 105
-#define IDS_WELCOME_TITLE 106
-#define IDS_WELCOME_TEXT 107
-#define IDS_WELCOME_URL 108
-#define IDS_INSTALLED 109
-#define IDS_AVAILABLEFORINST 110
-#define IDS_UPDATES 111
-#define IDS_APPLICATIONS 112
-#define IDS_CHOOSE_FOLDER_TEXT 113
-#define IDS_CHOOSE_FOLDER_ERROR 114
-#define IDS_APP_REG_REMOVE 116
-#define IDS_INFORMATION 117
-#define IDS_UNABLE_TO_REMOVE 118
-#define IDS_UNABLE_TO_DOWNLOAD 119
-#define IDS_UNABLE_TO_DOWNLOAD2 120
-#define IDS_CERT_DOES_NOT_MATCH 121
-#define IDS_INTEG_CHECK_TITLE 122
-#define IDS_INTEG_CHECK_FAIL 123
-#define IDS_INTERRUPTED_DOWNLOAD 124
-#define IDS_UNABLE_TO_WRITE 125
-#define IDS_SELECT_ALL 126
-#define IDS_INSTALL_SELECTED 127
-#define IDS_UNABLE_TO_INSTALL 128
-
-/* Tooltips */
-#define IDS_TOOLTIP_INSTALL 200
-#define IDS_TOOLTIP_UNINSTALL 201
-#define IDS_TOOLTIP_MODIFY 202
-#define IDS_TOOLTIP_SETTINGS 203
-#define IDS_TOOLTIP_REFRESH 204
-#define IDS_TOOLTIP_EXIT 205
-#define IDS_TOOLTIP_UPDATE_DB 206
-
-/* Columns info */
-#define IDS_APP_NAME 250
-#define IDS_APP_INST_VERSION 251
-#define IDS_APP_DESCRIPTION 252
-
-/* Apps info */
-#define IDS_INFO_VERSION 280
-#define IDS_INFO_DESCRIPTION 281
-#define IDS_INFO_PUBLISHER 282
-#define IDS_INFO_HELPLINK 283
-#define IDS_INFO_HELPPHONE 284
-#define IDS_INFO_README 285
-#define IDS_INFO_REGOWNER 286
-#define IDS_INFO_PRODUCTID 287
-#define IDS_INFO_CONTACT 288
-#define IDS_INFO_UPDATEINFO 289
-#define IDS_INFO_INFOABOUT 290
-#define IDS_INFO_COMMENTS 291
-#define IDS_INFO_INSTLOCATION 292
-#define IDS_INFO_INSTALLSRC 293
-#define IDS_INFO_UNINSTALLSTR 294
-#define IDS_INFO_MODIFYPATH 295
-#define IDS_INFO_INSTALLDATE 296
-
-/* Info for available apps */
-#define IDS_AINFO_VERSION 350
-#define IDS_AINFO_DESCRIPTION 351
-#define IDS_AINFO_SIZE 352
-#define IDS_AINFO_URLSITE 353
-#define IDS_AINFO_LICENSE 354
-#define IDS_AINFO_URLDOWNLOAD 355
-#define IDS_AINFO_AVAILABLEVERSION 356
-#define IDS_AINFO_LANGUAGES 357
-
-
-/* Names of categories */
-#define IDS_CAT_AUDIO 700
-#define IDS_CAT_DEVEL 701
-#define IDS_CAT_DRIVERS 702
-#define IDS_CAT_EDU 703
-#define IDS_CAT_ENGINEER 704
-#define IDS_CAT_FINANCE 705
-#define IDS_CAT_GAMES 706
-#define IDS_CAT_GRAPHICS 707
-#define IDS_CAT_INTERNET 708
-#define IDS_CAT_LIBS 709
-#define IDS_CAT_OFFICE 710
-#define IDS_CAT_OTHER 711
-#define IDS_CAT_SCIENCE 712
-#define IDS_CAT_TOOLS 713
-#define IDS_CAT_VIDEO 714
-
-/* App installation status */
-#define IDS_STATUS_INSTALLED 800
-#define IDS_STATUS_NOTINSTALLED 801
-#define IDS_STATUS_DOWNLOADED 802
-#define IDS_STATUS_UPDATE_AVAILABLE 803
-#define IDS_STATUS_DOWNLOADING 804
-#define IDS_STATUS_INSTALLING 805
-#define IDS_STATUS_WAITING 806
-#define IDS_STATUS_FINISHED 807
-
-/* App license names */
-#define IDS_LICENSE_OPENSOURCE 900
-#define IDS_LICENSE_FREEWARE 901
-#define IDS_LICENSE_TRIAL 902
-
-/* Language related strings */
-#define IDS_LANGUAGE_AVAILABLE_TRANSLATION 910
-#define IDS_LANGUAGE_NO_TRANSLATION 911
-#define IDS_LANGUAGE_ENGLISH_TRANSLATION 912
-#define IDS_LANGUAGE_SINGLE 913
-
-/* Accelerators */
-#define HOTKEYS 715
-
-/* Other */
-#ifndef IDC_STATIC
-#define IDC_STATIC -1
-#endif
Removed: branches/GSoC_2017/rapps/reactos/base/applications/rapps/rosui.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/rosui.h [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/rosui.h (removed)
@@ -1,801 +0,0 @@
-/* PROJECT: ReactOS UI Layout Engine
- * LICENSE: GPL - See COPYING in the top level directory
- * AUTHORS: David Quintana <gigaherz(a)gmail.com>
- */
-#pragma once
-
-template<class T, int GrowthRate = 10>
-class CPointerArray
-{
-protected:
- HDPA m_hDpa;
-
-public:
- CPointerArray()
- {
- m_hDpa = DPA_Create(GrowthRate);
- }
-
- ~CPointerArray()
- {
- DPA_DestroyCallback(m_hDpa, s_OnRemoveItem, this);
- }
-
-private:
- static int CALLBACK s_OnRemoveItem(void * ptr, void * context)
- {
- CPointerArray * self = (CPointerArray*) context;
- return (int) self->OnRemoveItem(reinterpret_cast<T*>(ptr));
- }
-
- static int CALLBACK s_OnCompareItems(void *p1, void *p2, LPARAM lParam)
- {
- CPointerArray * self = (CPointerArray*) lParam;
- return self->OnCompareItems(reinterpret_cast<T*>(p1),
reinterpret_cast<T*>(p2));
- }
-
-public:
- virtual BOOL OnRemoveItem(T * ptr)
- {
- return TRUE;
- }
-
- virtual int OnCompareItems(T * p1, T * p2)
- {
- int t = (reinterpret_cast<int>(p2) -reinterpret_cast<int>(p1));
- if (t > 0)
- return 1;
- if (t < 0)
- return -1;
- return 0;
- }
-
-public:
- int GetCount() const
- {
- return DPA_GetPtrCount(m_hDpa);
- }
-
- T* Get(int i) const
- {
- return (T*) DPA_GetPtr(m_hDpa, i);
- }
-
- BOOL Set(int i, T* ptr)
- {
- return DPA_SetPtr(m_hDpa, i, ptr);
- }
-
- int Insert(int at, T* ptr)
- {
- return DPA_InsertPtr(m_hDpa, at, ptr);
- }
-
- int Append(T* ptr)
- {
- return DPA_InsertPtr(m_hDpa, DA_LAST, ptr);
- }
-
- int IndexOf(T* ptr) const
- {
- return DPA_GetPtrIndex(m_hDpa, ptr);
- }
-
- BOOL Remove(T* ptr)
- {
- int i = IndexOf(ptr);
- if (i < 0)
- return FALSE;
- return RemoveAt(i);
- }
-
- BOOL RemoveAt(int i)
- {
- T* ptr = (T*) DPA_GetPtr(m_hDpa, i);
- OnRemoveItem(ptr);
- return DPA_DeletePtr(m_hDpa, i);
- }
-
- BOOL Clear()
- {
- DPA_EnumCallback(s_OnRemoveItem, this);
- return DPA_DeleteAllPtrs(m_hDpa);
- }
-
- BOOL Sort()
- {
- return DPA_Sort(m_hDpa, s_OnCompareItems, (LPARAM)this);
- }
-
- int Search(T* item, int iStart, UINT uFlags)
- {
- return DPA_Search(m_hDpa, s_OnCompareItems, (LPARAM)this);
- }
-};
-
-class CUiRect
- : public RECT
-{
-public:
- CUiRect()
- {
- left = right = top = bottom = 0;
- }
-
- CUiRect(int l, int t, int r, int b)
- {
- left = l;
- right = r;
- top = t;
- bottom = b;
- }
-};
-
-class CUiMargin
- : public CUiRect
-{
-public:
- CUiMargin()
- {
- }
-
- CUiMargin(int all)
- : CUiRect(all, all, all, all)
- {
- }
-
- CUiMargin(int horz, int vert)
- : CUiRect(horz, vert, horz, vert)
- {
- }
-};
-
-class CUiMeasure
-{
-public:
- enum MeasureType
- {
- Type_FitContent = 0,
- Type_Fixed = 1,
- Type_Percent = 2,
- Type_FitParent = 3
- };
-
-private:
- MeasureType m_Type;
- int m_Value;
-
-public:
- CUiMeasure()
- {
- m_Type = Type_FitContent;
- m_Value = 0;
- }
-
- CUiMeasure(MeasureType type, int value)
- {
- m_Type = type;
- m_Value = value;
- }
-
- int ComputeMeasure(int parent, int content)
- {
- switch (m_Type)
- {
- case Type_FitContent:
- return content;
- case Type_Fixed:
- return m_Value;
- case Type_Percent:
- return max(content, parent * m_Value / 100);
- case Type_FitParent:
- return parent;
- }
-
- return 0;
- }
-
-public:
- static CUiMeasure FitContent()
- {
- return CUiMeasure(Type_FitContent, 0);
- }
-
- static CUiMeasure FitParent()
- {
- return CUiMeasure(Type_FitParent, 0);
- }
-
- static CUiMeasure Fixed(int pixels)
- {
- return CUiMeasure(Type_Fixed, pixels);
- }
-
- static CUiMeasure Percent(int percent)
- {
- return CUiMeasure(Type_Percent, percent);
- }
-};
-
-enum CUiAlignment
-{
- UiAlign_LeftTop,
- UiAlign_Middle,
- UiAlign_RightBtm,
- UiAlign_Stretch
-};
-
-class CUiBox
-{
-public:
- CUiMargin m_Margin;
-
- CUiAlignment m_HorizontalAlignment;
- CUiAlignment m_VerticalAlignment;
-
-protected:
- CUiBox()
- {
- m_HorizontalAlignment = UiAlign_LeftTop;
- m_VerticalAlignment = UiAlign_LeftTop;
- }
-
- virtual void ComputeRect(RECT parentRect, RECT currentRect, RECT* newRect)
- {
- parentRect.left += m_Margin.left;
- parentRect.right -= m_Margin.right;
- parentRect.top += m_Margin.top;
- parentRect.bottom -= m_Margin.bottom;
-
- if (parentRect.right < parentRect.left)
- parentRect.right = parentRect.left;
-
- if (parentRect.bottom < parentRect.top)
- parentRect.bottom = parentRect.top;
-
- SIZE szParent = { parentRect.right - parentRect.left, parentRect.bottom -
parentRect.top };
- SIZE szCurrent = { currentRect.right - currentRect.left, currentRect.bottom -
currentRect.top };
-
- currentRect = parentRect;
-
- switch (m_HorizontalAlignment)
- {
- case UiAlign_LeftTop:
- currentRect.right = currentRect.left + szCurrent.cx;
- break;
- case UiAlign_Middle:
- currentRect.left = parentRect.left + (szParent.cx - szCurrent.cx) / 2;
- currentRect.right = currentRect.left + szCurrent.cx;
- break;
- case UiAlign_RightBtm:
- currentRect.left = currentRect.right - szCurrent.cx;
- break;
- default:
- break;
- }
-
- switch (m_VerticalAlignment)
- {
- case UiAlign_LeftTop:
- currentRect.bottom = currentRect.top + szCurrent.cy;
- break;
- case UiAlign_Middle:
- currentRect.top = parentRect.top + (szParent.cy - szCurrent.cy) / 2;
- currentRect.bottom = currentRect.top + szCurrent.cy;
- break;
- case UiAlign_RightBtm:
- currentRect.top = currentRect.bottom - szCurrent.cy;
- break;
- default:
- break;
- }
-
- *newRect = currentRect;
- }
-
-
-public:
- virtual void ComputeMinimalSize(SIZE* size)
- {
- // Override in subclass
- size->cx = max(size->cx, 0);
- size->cy = min(size->cy, 0);
- };
-
- virtual void ComputeContentBounds(RECT* rect)
- {
- // Override in subclass
- };
-
- virtual DWORD_PTR CountSizableChildren()
- {
- // Override in subclass
- return 0;
- };
-
- virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
- {
- // Override in subclass
- return NULL;
- };
-};
-
-class CUiPrimitive
-{
-protected:
- CUiPrimitive * m_Parent;
-
-public:
- virtual ~CUiPrimitive() {}
-
- virtual CUiBox * AsBox() { return NULL; }
-};
-
-class CUiCollection :
- public CPointerArray < CUiPrimitive >
-{
- virtual BOOL OnRemoveItem(CUiPrimitive * ptr)
- {
- delete ptr;
- return TRUE;
- }
-};
-
-class CUiContainer
-{
-protected:
- CUiCollection m_Children;
-
-public:
- CUiCollection& Children() { return m_Children; }
-};
-
-class CUiPanel :
- public CUiPrimitive,
- public CUiBox,
- public CUiContainer
-{
-public:
- CUiMeasure m_Width;
- CUiMeasure m_Height;
-
- CUiPanel()
- {
- m_Width = CUiMeasure::FitParent();
- m_Height = CUiMeasure::FitParent();
- }
-
- virtual ~CUiPanel()
- {
- }
-
- virtual CUiBox * AsBox() { return this; }
-
- virtual void ComputeMinimalSize(SIZE* size)
- {
- for (int i = 0; i < m_Children.GetCount(); i++)
- {
- CUiBox * box = m_Children.Get(i)->AsBox();
- if (box)
- {
- box->ComputeMinimalSize(size);
- }
- }
- };
-
- virtual void ComputeContentBounds(RECT* rect)
- {
- for (int i = 0; i < m_Children.GetCount(); i++)
- {
- CUiBox * box = m_Children.Get(i)->AsBox();
- if (box)
- {
- box->ComputeContentBounds(rect);
- }
- }
- };
-
- virtual DWORD_PTR CountSizableChildren()
- {
- int count = 0;
- for (int i = 0; i < m_Children.GetCount(); i++)
- {
- CUiBox * box = m_Children.Get(i)->AsBox();
- if (box)
- {
- count += box->CountSizableChildren();
- }
- }
- return count;
- }
-
- virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
- {
- RECT rect = { 0 };
-
- SIZE content = { 0 };
- ComputeMinimalSize(&content);
-
- int preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left,
content.cx);
- int preferredHeight = m_Height.ComputeMeasure(parentRect.bottom - parentRect.top,
content.cy);
-
- rect.right = preferredWidth;
- rect.bottom = preferredHeight;
-
- ComputeRect(parentRect, rect, &rect);
-
- for (int i = 0; i < m_Children.GetCount(); i++)
- {
- CUiBox * box = m_Children.Get(i)->AsBox();
- if (box)
- {
- hDwp = box->OnParentSize(rect, hDwp);
- }
- }
-
- return hDwp;
- }
-};
-
-template<class T = CWindow>
-class CUiWindow :
- public CUiPrimitive,
- public CUiBox,
- public T
-{
-public:
- virtual CUiBox * AsBox() { return this; }
-
- HWND GetWindow() { return T::m_hWnd; }
-
- virtual void ComputeMinimalSize(SIZE* size)
- {
- // TODO: Maybe use WM_GETMINMAXINFO?
- return CUiBox::ComputeMinimalSize(size);
- };
-
- virtual void ComputeContentBounds(RECT* rect)
- {
- RECT r;
- ::GetWindowRect(T::m_hWnd, &r);
- rect->left = min(rect->left, r.left);
- rect->top = min(rect->top, r.top);
- rect->right = max(rect->right, r.right);
- rect->bottom = max(rect->bottom, r.bottom);
- };
-
- virtual DWORD_PTR CountSizableChildren()
- {
- return 1;
- };
-
- virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
- {
- RECT rect;
-
- ::GetWindowRect(T::m_hWnd, &rect);
-
- ComputeRect(parentRect, rect, &rect);
-
- if (hDwp)
- {
- return ::DeferWindowPos(hDwp, T::m_hWnd, NULL, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER);
- }
- else
- {
- T::SetWindowPos(NULL, rect.left, rect.top, rect.right - rect.left,
rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER | SWP_DEFERERASE);
- return NULL;
- }
- };
-
- virtual ~CUiWindow()
- {
- T::DestroyWindow();
- }
-
- void GetWindowTextW(ATL::CStringW& szText)
- {
- INT length = CWindow::GetWindowTextLengthW() + 1;
- CWindow::GetWindowTextW(szText.GetBuffer(length), length);
- szText.ReleaseBuffer();
- }
-};
-
-class CUiSplitPanel :
- public CUiPrimitive,
- public CUiBox,
- public CWindowImpl<CUiSplitPanel>
-{
- static const int THICKNESS = 4;
-
-protected:
-
- HCURSOR m_hCursor;
-
- CUiPanel m_First;
- CUiPanel m_Second;
-
- RECT m_LastRect;
-
- BOOL m_HasOldRect;
-
-public:
- int m_Pos;
- BOOL m_Horizontal;
- BOOL m_DynamicFirst;
- int m_MinFirst;
- int m_MinSecond;
-
- CUiMeasure m_Width;
- CUiMeasure m_Height;
-
- CUiSplitPanel()
- {
- m_Width = CUiMeasure::FitParent();
- m_Height = CUiMeasure::FitParent();
- m_Pos = 100;
- m_MinFirst = 100;
- m_MinSecond = 100;
- m_DynamicFirst = FALSE;
- m_HasOldRect = FALSE;
- }
-
- virtual ~CUiSplitPanel()
- {
- }
-
- virtual CUiBox * AsBox() { return this; }
-
- CUiCollection& First() { return m_First.Children(); }
- CUiCollection& Second() { return m_Second.Children(); }
-
- virtual void ComputeMinimalSize(SIZE* size)
- {
- if (m_Horizontal)
- size->cx = max(size->cx, THICKNESS);
- else
- size->cy = max(size->cy, THICKNESS);
- m_First.ComputeMinimalSize(size);
- m_Second.ComputeMinimalSize(size);
- };
-
- virtual void ComputeContentBounds(RECT* rect)
- {
- RECT r;
-
- m_First.ComputeContentBounds(rect);
- m_Second.ComputeContentBounds(rect);
-
- ::GetWindowRect(m_hWnd, &r);
-
- rect->left = min(rect->left, r.left);
- rect->top = min(rect->top, r.top);
- rect->right = max(rect->right, r.right);
- rect->bottom = max(rect->bottom, r.bottom);
- };
-
- virtual DWORD_PTR CountSizableChildren()
- {
- int count = 1;
- count += m_First.CountSizableChildren();
- count += m_Second.CountSizableChildren();
- return count;
- };
-
- virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
- {
- RECT rect = { 0 };
-
- SIZE content = { 0 };
- ComputeMinimalSize(&content);
-
- int preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left,
content.cx);
- int preferredHeight = m_Width.ComputeMeasure(parentRect.bottom - parentRect.top,
content.cy);
-
- rect.right = preferredWidth;
- rect.bottom = preferredHeight;
-
- ComputeRect(parentRect, rect, &rect);
-
- SIZE growth = { 0 };
- if (m_HasOldRect)
- {
- RECT oldRect = m_LastRect;
-
- growth.cx = (parentRect.right - parentRect.left) - (oldRect.right -
oldRect.left);
- growth.cy = (parentRect.bottom - parentRect.top) - (oldRect.bottom -
oldRect.top);
- }
-
- RECT splitter = rect;
- RECT first = rect;
- RECT second = rect;
-
- if (m_Horizontal)
- {
- rect.top += m_MinFirst;
- rect.bottom -= THICKNESS + m_MinSecond;
- if (m_DynamicFirst)
- {
- if (growth.cy > 0)
- {
- m_Pos += min(growth.cy, rect.bottom - (m_Pos+THICKNESS));
- }
- else if (growth.cy < 0)
- {
- m_Pos += max(growth.cy, rect.top - m_Pos);
- }
- }
-
- if (m_Pos > rect.bottom)
- m_Pos = rect.bottom;
-
- if (m_Pos < rect.top)
- m_Pos = rect.top;
-
- splitter.top = m_Pos;
- splitter.bottom = m_Pos + THICKNESS;
- first.bottom = splitter.top;
- second.top = splitter.bottom;
- }
- else
- {
- rect.left += m_MinFirst;
- rect.right -= THICKNESS + m_MinSecond;
- if (m_DynamicFirst)
- {
- if (growth.cx > 0)
- {
- m_Pos += min(growth.cx, rect.right - (m_Pos + THICKNESS));
- }
- else if (growth.cx < 0)
- {
- m_Pos += max(growth.cy, rect.left - m_Pos);
- }
- }
-
- if (m_Pos > rect.right)
- m_Pos = rect.right;
-
- if (m_Pos < rect.left)
- m_Pos = rect.left;
-
- splitter.left = m_Pos;
- splitter.right = m_Pos + THICKNESS;
- first.right = splitter.left;
- second.left = splitter.right;
- }
-
- m_LastRect = parentRect;
- m_HasOldRect = TRUE;
-
- hDwp = m_First.OnParentSize(first, hDwp);
- hDwp = m_Second.OnParentSize(second, hDwp);
-
- if (hDwp)
- {
- return DeferWindowPos(hDwp, NULL,
- splitter.left, splitter.top,
- splitter.right - splitter.left,
- splitter.bottom - splitter.top,
- SWP_NOACTIVATE | SWP_NOZORDER);
- }
- else
- {
- SetWindowPos(NULL,
- splitter.left, splitter.top,
- splitter.right - splitter.left,
- splitter.bottom - splitter.top,
- SWP_NOACTIVATE | SWP_NOZORDER);
- return NULL;
- }
- };
-
-private:
- BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam,
LRESULT& theResult, DWORD dwMapId)
- {
- theResult = 0;
- switch (Msg)
- {
- case WM_SETCURSOR:
- SetCursor(m_hCursor);
- theResult = TRUE;
- break;
-
- case WM_LBUTTONDOWN:
- SetCapture();
- break;
-
- case WM_LBUTTONUP:
- case WM_RBUTTONDOWN:
- if (GetCapture() == m_hWnd)
- {
- ReleaseCapture();
- }
- break;
-
- case WM_MOUSEMOVE:
- if (GetCapture() == m_hWnd)
- {
- POINT Point;
- GetCursorPos(&Point);
- ::ScreenToClient(GetParent(), &Point);
- if (m_Horizontal)
- SetPos(Point.y);
- else
- SetPos(Point.x);
- }
- break;
-
- default:
- return FALSE;
- }
-
- return TRUE;
- }
-
-public:
- int GetPos(VOID)
- {
- return m_Pos;
- }
-
- void SetPos(int NewPos)
- {
- RECT rcParent;
-
- rcParent = m_LastRect;
-
- if (m_Horizontal)
- {
- rcParent.bottom -= THICKNESS;
-
- m_Pos = NewPos;
-
- if (m_Pos < rcParent.top)
- m_Pos = rcParent.top;
-
- if (m_Pos > rcParent.bottom)
- m_Pos = rcParent.bottom;
- }
- else
- {
- rcParent.right -= THICKNESS;
-
- m_Pos = NewPos;
-
- if (m_Pos < rcParent.left)
- m_Pos = rcParent.left;
-
- if (m_Pos > rcParent.right)
- m_Pos = rcParent.right;
- }
-
- int count = CountSizableChildren();
-
- HDWP hdwp = NULL;
- hdwp = BeginDeferWindowPos(count);
- if (hdwp) hdwp = OnParentSize(m_LastRect, hdwp);
- if (hdwp) EndDeferWindowPos(hdwp);
- }
-
-public:
- DECLARE_WND_CLASS_EX(_T("SplitterWindowClass"), CS_HREDRAW | CS_VREDRAW,
COLOR_BTNFACE)
-
- /* Create splitter bar */
- HWND Create(HWND hwndParent)
- {
- if (m_Horizontal)
- m_hCursor = LoadCursor(0, IDC_SIZENS);
- else
- m_hCursor = LoadCursor(0, IDC_SIZEWE);
-
- DWORD style = WS_CHILD | WS_VISIBLE;
- DWORD exStyle = WS_EX_TRANSPARENT;
-
- RECT size = { 205, 180, 465, THICKNESS };
- size.right += size.left;
- size.bottom += size.top;
-
- return CWindowImpl::Create(hwndParent, size, NULL, style, exStyle);
- }
-};
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/settingsdlg.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/settingsdlg.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/settingsdlg.cpp [iso-8859-1]
Wed Aug 2 12:50:53 2017
@@ -6,8 +6,9 @@
* PROGRAMMERS: Dmitry Chapyshev (dmitry(a)reactos.org)
* Alexander Shaposhnikov (chaez.san(a)gmail.com)
*/
-
-#include "rapps.h"
+#include "defines.h"
+
+#include "dialogs.h"
SETTINGS_INFO NewSettingsInfo;
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp [iso-8859-1] Wed
Aug 2 12:50:53 2017
@@ -7,6 +7,7 @@
* Ismael Ferreras Morezuelas (swyterzone+ros(a)gmail.com)
* Alexander Shaposhnikov (chaez.san(a)gmail.com)
*/
+#include "defines.h"
#include "rapps.h"
@@ -188,10 +189,10 @@
GetAvailableApps()->UpdateAppsDB();
/* Load the menu hotkeys */
- KeyBrd = LoadAcceleratorsW(NULL, MAKEINTRESOURCE(HOTKEYS));
+ KeyBrd = LoadAcceleratorsW(NULL, MAKEINTRESOURCEW(HOTKEYS));
/* Message Loop */
- while (GetMessage(&Msg, NULL, 0, 0))
+ while (GetMessageW(&Msg, NULL, 0, 0))
{
if (!TranslateAcceleratorW(hMainWnd, KeyBrd, &Msg))
{