FoundationExtension
FoundationExtension is common Foundation/UIKit/Cocoa shortcuts and snippets collection.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
NSGeometry.h
Go to the documentation of this file.
1 //
2 // NSGeometry.h
3 // FoundationExtension
4 //
5 // Created by Jeong YunWon on 13. 4. 5..
6 // Copyright (c) 2013 youknowone.org. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 
22 #define NSPointZero NSZeroPoint
23 
29 #define NSSizeZero NSZeroSize
30 
36 #define NSRectZero NSZeroRect
37 
38 
48 NS_INLINE NSPoint NSPointMake(CGFloat x, CGFloat y) {
49  return NSMakePoint(x, y);
50 }
51 
57 NS_INLINE NSSize NSSizeMake(CGFloat w, CGFloat h) {
58  return NSMakeSize(w, h);
59 }
60 
66 NS_INLINE NSRect NSRectMake(CGFloat x, CGFloat y, CGFloat w, CGFloat h) {
67  return NSMakeRect(x, y, w, h);
68 }
69 
79 NS_INLINE BOOL NSPointEqualToPoint(NSPoint aPoint, NSPoint bPoint) {
80  return NSEqualPoints(aPoint, bPoint);
81 }
82 
88 NS_INLINE BOOL NSSizeEqualToSize(NSSize aSize, NSSize bSize) {
89  return NSEqualSizes(aSize, bSize);
90 }
91 
97 NS_INLINE BOOL NSRectEqualToRect(NSRect aRect, NSRect bRect) {
98  return NSEqualRects(aRect, bRect);
99 }
100 
106 NS_INLINE BOOL NSRectIsEmpty(NSRect aRect) {
107  return NSIsEmptyRect(aRect);
108 }
NS_INLINE BOOL NSRectIsEmpty(NSRect aRect)
Returns a Boolean value that indicates whether a given rectangle is empty.
Definition: NSGeometry.h:106
NS_INLINE BOOL NSSizeEqualToSize(NSSize aSize, NSSize bSize)
Returns a Boolean value that indicates whether two size values are equal.
Definition: NSGeometry.h:88
NS_INLINE NSPoint NSPointMake(CGFloat x, CGFloat y)
Creates a new NSPoint from the specified values.
Definition: NSGeometry.h:48
NS_INLINE NSRect NSRectMake(CGFloat x, CGFloat y, CGFloat w, CGFloat h)
Creates a new NSRect from the specified values.
Definition: NSGeometry.h:66
NS_INLINE BOOL NSPointEqualToPoint(NSPoint aPoint, NSPoint bPoint)
Returns a Boolean value that indicates whether two points are equal.
Definition: NSGeometry.h:79
NS_INLINE NSSize NSSizeMake(CGFloat w, CGFloat h)
Creates a new NSSize from the specified values.
Definition: NSGeometry.h:57
NS_INLINE BOOL NSRectEqualToRect(NSRect aRect, NSRect bRect)
Returns a Boolean value that indicates whether the two rectangles are equal.
Definition: NSGeometry.h:97