From b430026b7656173f78f62dfdab13fa705b2cc718 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 13 Mar 2025 06:44:04 +0100 Subject: TQ-23: Patch source code and leaving it for now. Signed-off-by: Amlal El Mahrouss --- dev/Usr/LibCF/Foundation.h | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 dev/Usr/LibCF/Foundation.h (limited to 'dev/Usr/LibCF/Foundation.h') diff --git a/dev/Usr/LibCF/Foundation.h b/dev/Usr/LibCF/Foundation.h new file mode 100644 index 00000000..c0f8fe6c --- /dev/null +++ b/dev/Usr/LibCF/Foundation.h @@ -0,0 +1,78 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + FILE: Foundation.h + PURPOSE: Foundation header of the CF framework. + +------------------------------------------- */ + +#pragma once + +#include + +namespace LibCF +{ + class CFString; + class CFGUID; + class CFProperty; + class CFObject; + template + class CFRef; + class CFFont; + struct CFPoint; + struct CFRect; + struct CFColor; + +#ifndef __LP64__ + typedef SInt32 CFInteger; + typedef float CFReal; +#else + typedef SInt64 CFInteger; + typedef double CFReal; +#endif + + typedef SInt32 CFInteger32; + typedef SInt64 CFInteger64; + + typedef char CFChar8; + typedef char16_t CFChar16; + + struct CFPoint + { + CFInteger64 x_1{0UL}; + CFInteger64 y_1{0UL}; + + CFInteger64 x_2{0UL}; + CFInteger64 y_2{0UL}; + CFReal ang{0UL}; + + operator bool(); + + /// @brief Check if point is within the current CFPoint. + /// @param point the current point to check. + /// @retval true if point is within this point. + /// @retval validations failed. + bool IsWithin(CFPoint& point); + }; + + struct CFColor final + { + CFInteger64 r, g, b, a{0}; + }; + + struct CFRect final + { + CFInteger64 x{0UL}; + CFInteger64 y{0UL}; + + CFInteger64 width{0UL}; + CFInteger64 height{0UL}; + + operator bool(); + + BOOL SizeMatches(CFRect& rect) noexcept; + BOOL PositionMatches(CFRect& rect) noexcept; + }; +} // namespace LibCF \ No newline at end of file -- cgit v1.2.3