forked from card-io/card.io-iOS-source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCardIODmzBridge.h
36 lines (32 loc) · 1.17 KB
/
CardIODmzBridge.h
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
//
// CardIODmzBridge.h
// See the file "LICENSE.md" for the full license governing this code.
//
#import "dmz.h"
#import <Foundation/Foundation.h>
static inline FrameOrientation frameOrientationWithInterfaceOrientation(UIInterfaceOrientation interfaceOrientation) {
FrameOrientation frameOrientation = FrameOrientationPortrait; // provide a default to keep static analyzer happy
switch(interfaceOrientation) {
case UIInterfaceOrientationPortrait:
frameOrientation = FrameOrientationPortrait;
break;
case UIInterfaceOrientationPortraitUpsideDown:
frameOrientation = FrameOrientationPortraitUpsideDown;
break;
case UIInterfaceOrientationLandscapeLeft:
frameOrientation = FrameOrientationLandscapeLeft;
break;
case UIInterfaceOrientationLandscapeRight:
frameOrientation = FrameOrientationLandscapeRight;
break;
case UIInterfaceOrientationUnknown:
break;
}
return frameOrientation;
}
static inline CGRect CGRectWithDmzRect(dmz_rect rect) {
return CGRectMake(rect.x, rect.y, rect.w, rect.h);
}
static inline CGRect CGRectWithRotatedDmzRect(dmz_rect rect) {
return CGRectMake(rect.y, rect.x, rect.h, rect.w);
}