ArcGIS Runtime SDK for iOS: AGSEdgeInsets.h Source File
ArcGIS Runtime SDK for iOS  100.9
AGSEdgeInsets.h
Go to the documentation of this file.
1 /*
2  COPYRIGHT 1995-2020 ESRI
3 
4  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
5  Unpublished material - all rights reserved under the
6  Copyright Laws of the United States and applicable international
7  laws, treaties, and conventions.
8 
9  For additional information, contact:
10  Environmental Systems Research Institute, Inc.
11  Attn: Contracts and Legal Services Department
12  380 New York Street
13  Redlands, California, 92373
14  USA
15 
16  email: contracts@esri.com
17  */
18 
19 #import <ArcGIS/AGSDefines.h>
20 
21 #if __has_include(<UIKit/UIGeometry.h>)
22 
23 #import <UIKit/UIGeometry.h>
24 
35 typedef UIEdgeInsets AGSEdgeInsets;
36 
45 static inline CGRect AGSEdgeInsetsInsetRect(CGRect rect, AGSEdgeInsets insets) {
46  return UIEdgeInsetsInsetRect(rect, insets);
47 }
48 
49 #elif __has_include(<Foundation/NSGeometry.h>)
50 
51 #import <Foundation/NSGeometry.h>
52 
63 typedef NSEdgeInsets AGSEdgeInsets;
64 
73 static inline CGRect AGSEdgeInsetsInsetRect(CGRect rect, AGSEdgeInsets insets) {
74  return CGRectMake(rect.origin.x + insets.left,
75  rect.origin.y + insets.bottom,
76  rect.size.width - (insets.right + insets.left),
77  rect.size.height - (insets.top + insets.bottom));
78 }
79 
80 #endif
81 
95 static inline AGSEdgeInsets AGSEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right) {
96  AGSEdgeInsets insets = {top, left, bottom, right};
97  return insets;
98 }
99 
106 AGS_EXTERN const AGSEdgeInsets AGSEdgeInsetsZero;
AGS_EXTERN const AGSEdgeInsets AGSEdgeInsetsZero
Definition: AGSEdgeInsets.h:106
#define AGS_EXTERN
Definition: AGSDefines.h:22
static AGSEdgeInsets AGSEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right)
Definition: AGSEdgeInsets.h:95