https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0efd7b97643c0a6a60d322...
commit 0efd7b97643c0a6a60d322e902de29e6d851f2a2 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Thu Feb 25 09:12:47 2021 +0900 Commit: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com CommitDate: Thu Feb 25 09:12:47 2021 +0900
[SDK][INCLUDE] Strengthen and improve layout.h
- Refreshing STATIC controls. - In LayoutInit function, if cLayouts parameter was negative, then don't use size grip. --- sdk/include/host/cmake_install.cmake | 34 +++++++++++++++++++++++++++++++ sdk/include/reactos/buildno.h | 25 +++++++++++++++++++++++ sdk/include/reactos/layout.h | 39 +++++++++++++++++++++++++++++++----- sdk/include/reactos/version.h | 27 +++++++++++++++++++++++++ 4 files changed, 120 insertions(+), 5 deletions(-)
diff --git a/sdk/include/host/cmake_install.cmake b/sdk/include/host/cmake_install.cmake new file mode 100644 index 00000000000..c63853082e7 --- /dev/null +++ b/sdk/include/host/cmake_install.cmake @@ -0,0 +1,34 @@ +# Install script for directory: C:/Users/katahiromz/reactos-1/sdk/include/host + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/REACTOS") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: "${CMAKE_INSTALL_CONFIG_NAME}"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: "${COMPONENT}"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + diff --git a/sdk/include/reactos/buildno.h b/sdk/include/reactos/buildno.h new file mode 100644 index 00000000000..d8f923d88be --- /dev/null +++ b/sdk/include/reactos/buildno.h @@ -0,0 +1,25 @@ +/* Do not edit - Machine generated */ +#ifndef _INC_REACTOS_BUILDNO +#define _INC_REACTOS_BUILDNO + +#define KERNEL_VERSION_BUILD 20210222 +#define KERNEL_VERSION_BUILD_STR "20210222-0.4.15-dev-2073-ga6e3e8a" +#define KERNEL_VERSION_BUILD_RC "20210222-0.4.15-dev-2073-ga6e3e8a\0" + +#define KERNEL_VERSION_RC "0.4.15-x86-dev\0" +#define KERNEL_VERSION_STR "0.4.15-x86-dev" + +#define KERNEL_VERSION_REVISION_RC "0.4.15-dev-2073-ga6e3e8a\0" +#define KERNEL_VERSION_REVISION_STR "0.4.15-dev-2073-ga6e3e8a" + +#define KERNEL_VERSION_COMMIT_HASH "a6e3e8adf0ff581390dafc0bcf8f615c93d8c8b1" + +#define REACTOS_DLL_VERSION_MAJOR 42 +#define REACTOS_DLL_VERSION_RC "42.4.15-dev\0" +#define REACTOS_DLL_VERSION_STR "42.4.15-dev" + +#define REACTOS_COMPILER_NAME "GNU" +#define REACTOS_COMPILER_VERSION "8.4.0" + +#endif +/* EOF */ diff --git a/sdk/include/reactos/layout.h b/sdk/include/reactos/layout.h index 5b310716168..7cddf11cd11 100644 --- a/sdk/include/reactos/layout.h +++ b/sdk/include/reactos/layout.h @@ -2,7 +2,7 @@ * PROJECT: ReactOS headers * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later) * PURPOSE: The layout engine of resizable dialog boxes / windows - * COPYRIGHT: Copyright 2020 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com) + * COPYRIGHT: Copyright 2020-2021 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com) */ #pragma once #include <assert.h> @@ -41,6 +41,9 @@ _layout_ModifySystemMenu(LAYOUT_DATA *pData, BOOL bEnableResize) static __inline HDWP _layout_MoveGrip(LAYOUT_DATA *pData, HDWP hDwp OPTIONAL) { + if (!IsWindowVisible(pData->m_hwndGrip)) + return hDwp; + SIZE size = { GetSystemMetrics(SM_CXVSCROLL), GetSystemMetrics(SM_CYHSCROLL) }; const UINT uFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER; RECT rcClient; @@ -62,7 +65,7 @@ _layout_MoveGrip(LAYOUT_DATA *pData, HDWP hDwp OPTIONAL) }
static __inline void -_layout_ShowGrip(LAYOUT_DATA *pData, BOOL bShow) +LayoutShowGrip(LAYOUT_DATA *pData, BOOL bShow) { if (!bShow) { @@ -135,6 +138,18 @@ _layout_ArrangeLayout(LAYOUT_DATA *pData)
hDwp = _layout_MoveGrip(pData, hDwp); EndDeferWindowPos(hDwp); + + /* STATIC controls need refreshing. */ + for (iItem = 0; iItem < pData->m_cLayouts; ++iItem) + { + HWND hwndCtrl = pData->m_pLayouts[iItem].m_hwndCtrl; + WCHAR szClass[8]; + GetClassNameW(hwndCtrl, szClass, _countof(szClass)); + if (lstrcmpiW(szClass, L"STATIC") == 0) + { + InvalidateRect(hwndCtrl, NULL, TRUE); + } + } }
static __inline void @@ -185,13 +200,14 @@ LayoutUpdate(HWND ignored1, LAYOUT_DATA *pData, LPCVOID ignored2, UINT ignored3) static __inline void LayoutEnableResize(LAYOUT_DATA *pData, BOOL bEnable) { - _layout_ShowGrip(pData, bEnable); + LayoutShowGrip(pData, bEnable); _layout_ModifySystemMenu(pData, bEnable); }
static __inline LAYOUT_DATA * -LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, UINT cLayouts) +LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, INT cLayouts) { + BOOL bShowGrip; SIZE_T cb; LAYOUT_DATA *pData = (LAYOUT_DATA *)HeapAlloc(GetProcessHeap(), 0, sizeof(LAYOUT_DATA)); if (pData == NULL) @@ -200,6 +216,16 @@ LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, UINT cLayouts) return NULL; }
+ if (cLayouts < 0) /* NOTE: If cLayouts was negative, then don't show size grip */ + { + cLayouts = -cLayouts; + bShowGrip = FALSE; + } + else + { + bShowGrip = TRUE; + } + cb = cLayouts * sizeof(LAYOUT_INFO); pData->m_cLayouts = cLayouts; pData->m_pLayouts = (LAYOUT_INFO *)HeapAlloc(GetProcessHeap(), 0, cb); @@ -216,8 +242,11 @@ LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, UINT cLayouts) assert(GetWindowLongPtrW(hwndParent, GWL_STYLE) & WS_SIZEBOX);
pData->m_hwndParent = hwndParent; + pData->m_hwndGrip = NULL; - LayoutEnableResize(pData, TRUE); + if (bShowGrip) + LayoutShowGrip(pData, bShowGrip); + _layout_InitLayouts(pData); return pData; } diff --git a/sdk/include/reactos/version.h b/sdk/include/reactos/version.h new file mode 100644 index 00000000000..8d8015a86e0 --- /dev/null +++ b/sdk/include/reactos/version.h @@ -0,0 +1,27 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/reactos/version.h.cmake + * PURPOSE: Defines the current version + * PROGRAMMER: David Welch (welch@mcmail.com) + * REVISIONS: + * 1999-11-06 (ea) + * Moved from include/internal in include/reactos + * to be used by buildno. + * 2002-01-17 (ea) + * KERNEL_VERSION removed. Use + * reactos/buildno.h:KERNEL_VERSION_STR instead. + */ + +#ifndef __VERSION_H +#define __VERSION_H + +#define KERNEL_VERSION_MAJOR 0 +#define KERNEL_VERSION_MINOR 4 +#define KERNEL_VERSION_PATCH_LEVEL 15 + +#define COPYRIGHT_YEAR "2021" + +#endif + +/* EOF */