Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 62 lines (52 sloc) 1.645 kb
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
//
// DTCompatibility.h
// DTCoreText
//
// Created by Oliver Letterer on 09.04.12.
// Copyright (c) 2012 Drobnik.com. All rights reserved.
//

// DTColor is UIColor on iOS, NSColor on Mac
#if TARGET_OS_IPHONE
@compatibility_alias DTColor UIColor;
#else
@compatibility_alias DTColor NSColor;
#endif

// DTImage is UIImage on iOS, NSImage on Mac
#if TARGET_OS_IPHONE
@compatibility_alias DTImage UIImage;
#else
@compatibility_alias DTImage NSImage;
#endif

// DTFont is UIFont on iOS, NSFont on Mac
#if TARGET_OS_IPHONE
@compatibility_alias DTFont UIFont;
#else
@compatibility_alias DTFont NSFont;
#endif

// DTEdgeInsets is UIEdgeInsets on iOS, NSEdgeInsets on Mac
#if TARGET_OS_IPHONE
#define DTEdgeInsets UIEdgeInsets
#define DTEdgeInsetsMake(a, b, c, d) UIEdgeInsetsMake(a, b, c, d)
#else
#define DTEdgeInsets NSEdgeInsets
#define DTEdgeInsetsMake(a, b, c, d) NSEdgeInsetsMake(a, b, c, d)

// These may be out of place here. Feel free to move them!
// Sourced from https://github.com/andrep/RMModelObject
static inline NSString* NSStringFromCGRect(const CGRect rect)
{
return NSStringFromRect(NSRectFromCGRect(rect));
}

static inline NSString* NSStringFromCGSize(const CGSize size)
{
return NSStringFromSize(NSSizeFromCGSize(size));
}

static inline NSString* NSStringFromCGPoint(const CGPoint point)
{
return NSStringFromPoint(NSPointFromCGPoint(point));
}

#define NSTextAlignmentLeft NSLeftTextAlignment
#define NSTextAlignmentRight NSRightTextAlignment
#define NSTextAlignmentCenter NSCenterTextAlignment
#define NSTextAlignmentJustified NSJustifiedTextAlignment
#define NSTextAlignmentNatural NSNaturalTextAlignment

#endif
Something went wrong with that request. Please try again.