blob: 192c72f5d39821482cb90d07fb1d9bb1097579c4 (
plain)
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
40
41
42
43
44
45
46
|
// SPDX-License-Identifier: Apache-2.0
// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
#include <CoreFoundation.fwrk/headers/Foundation.h>
/***********************************************************************************/
/// @brief returns true if the proportions are valid.
/***********************************************************************************/
CF::CFRect::operator bool() {
return width > 0 && height > 0;
}
/***********************************************************************************/
/// @brief returns true if size matches.
/***********************************************************************************/
BOOL CF::CFRect::SizeMatches(CF::CFRect& rect) {
return rect.height == height && rect.width == width;
}
/***********************************************************************************/
/// @brief returns true if position matches.
/***********************************************************************************/
BOOL CF::CFRect::PositionMatches(CF::CFRect& rect) {
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 CF::CFPoint::IsWithin(CF::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.
/***********************************************************************************/
CF::CFPoint::operator bool() {
return x_1 > x_2 && y_1 > y_2;
}
|