#pragma mark ---- AppDelegate
088
089
#define APPDELEGATE [(AppDelegate*)[UIApplication sharedApplication] delegate]
090
091
#define APPD [UIApplication sharedApplication]
092
#define rootNavVC (UINavigationController*)[[[[UIApplication sharedApplication] delegate] window] rootViewController]
093
094
#define isPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
095
#define isiPhone5 ([[UIScreen mainScreen]bounds].size.height == 568)
096
097
098
108
#pragma mark ---- File functions
109
#define PATH_OF_APP_HOME NSHomeDirectory()
110
#define PATH_OF_TEMP NSTemporaryDirectory()
111
#define PATH_OF_DOCUMENT [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
112
113
114
#pragma mark ---- color functions
115
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
116
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
117
118
119
120
#define SCREEN_HEIGHT [[UIScreen mainScreen]bounds].size.height
121
#define SCREEN_WIDTH [[UIScreen mainScreen]bounds].size.width
122
#define HEIGHT_SCALE ([[UIScreen mainScreen]bounds].size.height/480.0)
123
124
125
#define APP_HEIGHT [[UIScreen mainScreen]applicationFrame].size.height
126
#define APP_WIDTH [[UIScreen mainScreen]applicationFrame].size.width
127
128
#define APP_SCALE_H ([[UIScreen mainScreen]applicationFrame].size.height/480.0)
129
#define APP_SCALE_W ([[UIScreen mainScreen]applicationFrame].size.width/320.0)
130
131
132
#define VIEW_TX(view) (view.frame.origin.x)
133
#define VIEW_TY(view) (view.frame.origin.y)
134
135
136
#define VIEW_W(view) (view.frame.size.width)
137
#define VIEW_H(view) (view.frame.size.height)
138
139
140
#define VIEW_BX(view) (view.frame.origin.x + view.frame.size.width)
141
#define VIEW_BY(view) (view.frame.origin.y + view.frame.size.height )
142
143
144
#define FRAME_TX(frame) (frame.origin.x)
145
#define FRAME_TY(frame) (frame.origin.y)
146
147
#define FRAME_W(frame) (frame.size.width)
148
#define FRAME_H(frame) (frame.size.height)
149
150