// // std.h // WSCloudStorage // // Created by JonathanH on 2017/7/26. // Copyright © 2017年 wswinsoft. All rights reserved. // #ifndef std_h #define std_h #endif /* std_h */ //#import "GeneralSetting.h" //#define USERDEFAULT_APP_NAME (@"USERDEFAULT_APP_NAME") //#define USERDEFAULT_USER_NAME (@"USERDEFAULT_USER_NAME") #define USERDEFAULT_LOGIN_NAME (@"USERDEFAULT_LOGIN_NAME") //#define USERDEFAULT_USER_ID (@"USERDEFAULT_USER_ID") #define USERDEFAULT_PASSWORD (@"USERDEFAULT_PASSWORD") #define USERDEFAULT_SERVER_ID (@"USERDEFAULT_SERVER_ID") #define USERDEFAULT_APP_TOKEN (@"USERDEFAULT_APP_TOKEN") //#define USERDEFAULT_ROOT_NAME (@"USERDEFAULT_ROOT_NAME") #define USERDEFAULT_APP_HOST (@"USERDEFAULT_APP_HOST") // 屏幕高度 #define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height // 屏幕宽度 #define kKeyWindow [UIApplication sharedApplication].keyWindow #define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width #define NavBarHeight self.navigationController.navigationBar.frame.size.height #define STATUSBAR_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height /** * RGB */ #define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a] #define RGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0] #define SahreColorRGB(r,g,b) [UIColor colorWithRed:r green:g blue:b alpha:1.000] #define UIColorFromRGB(rgbValue) [UIColor \ colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] #define LineForSubLineViewColor RGB(214, 215, 217) #define LineForDrawColor [UIColor lightGrayColor] /** * 持久化存储相关 */ #define userDefaults [NSUserDefaults standardUserDefaults] #define Login_Name [userDefaults objectForKey:USERDEFAULT_LOGIN_NAME] #define Login_Word [userDefaults objectForKey:USERDEFAULT_PASSWORD] #define Server_ID [userDefaults objectForKey:USERDEFAULT_SERVER_ID] #define APP_HOST [userDefaults objectForKey:USERDEFAULT_APP_HOST] /** * 文件相关的绝对路径. */ #define FileAbsoluteSaveRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@",@"Library",Login_Name]] #define CloudStorageFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"cloudstorage"]] #define FileFolderFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"file"]] #define VoiceFolderFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"voice"]] #define PhotosMessageDir [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"photo"]] //#define FontType(LargeFloatFont,SmailFloatFont) [GeneralSetting returnGeneralSetting].appFontModel.intValue == FontTypeChooseLarger?[UIFont systemFontOfSize:LargeFloatFont]:[UIFont systemFontOfSize:SmailFloatFont] #define FontType(LargeFloatFont,SmailFloatFont) [UIFont systemFontOfSize:SmailFloatFont] /** * IOS X.X系统判定 * */ #define isIOS7 [[UIDevice currentDevice].systemVersion doubleValue]>=7.0?YES:NO #define isIOS8 [[UIDevice currentDevice].systemVersion doubleValue]>=8.0?YES:NO #define LOG(...) NSLog(__VA_ARGS__); #define MaxYplus(view,margin) (CGRectGetMaxY(view.frame)+margin) //CGRectGetMaxY(logoimageview.frame)