summaryrefslogtreecommitdiffhomepage
path: root/public/frameworks/CoreFoundation.fwrk/src/Foundation.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:13:48 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:15:17 +0100
commita13e1c0911c0627184bc38f18c7fdda64447b3ad (patch)
tree073a62c09bf216e85a3f310376640fa1805147f9 /public/frameworks/CoreFoundation.fwrk/src/Foundation.cc
parent149fa096eb306d03686b3b67e813cf1a78e08cd0 (diff)
meta(kernel): Reworked repository's filesystem structure.
Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'public/frameworks/CoreFoundation.fwrk/src/Foundation.cc')
-rw-r--r--public/frameworks/CoreFoundation.fwrk/src/Foundation.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/public/frameworks/CoreFoundation.fwrk/src/Foundation.cc b/public/frameworks/CoreFoundation.fwrk/src/Foundation.cc
new file mode 100644
index 00000000..219c3bfb
--- /dev/null
+++ b/public/frameworks/CoreFoundation.fwrk/src/Foundation.cc
@@ -0,0 +1,48 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024 Amlal El Mahrouss, all rights reserved
+
+------------------------------------------- */
+
+#include <CoreFoundation.fwrk/headers/Foundation.h>
+
+LibCF::CFRect::operator bool()
+{
+ return width > 0 && height > 0;
+}
+
+/***********************************************************************************/
+/// @brief returns true if size matches.
+/***********************************************************************************/
+BOOL LibCF::CFRect::SizeMatches(LibCF::CFRect& rect) noexcept
+{
+ return rect.height == height && rect.width == width;
+}
+
+/***********************************************************************************/
+/// @brief returns true if position matches.
+/***********************************************************************************/
+BOOL LibCF::CFRect::PositionMatches(LibCF::CFRect& rect) noexcept
+{
+ return rect.y == y && rect.x == x;
+}
+
+/***********************************************************************************/
+/// @brief Check if point is within the current MLPoint.
+/// @param point the current point to check.
+/// @retval true if point is within this point.
+/// @retval the validations have failed, false otherwise true.
+/***********************************************************************************/
+BOOL LibCF::CFPoint::IsWithin(LibCF::CFPoint& withinOf)
+{
+ return x_1 >= withinOf.x_1 && x_2 <= (withinOf.x_2) &&
+ y_1 >= withinOf.y_1 && y_2 <= (withinOf.y_2);
+}
+
+/***********************************************************************************/
+/// @brief if Point object is correctly set up.
+/***********************************************************************************/
+LibCF::CFPoint::operator bool()
+{
+ return x_1 > x_2 && y_1 > y_2;
+} \ No newline at end of file