std.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // std.h
  3. // WSCloudStorage
  4. //
  5. // Created by JonathanH on 2017/7/26.
  6. // Copyright © 2017年 wswinsoft. All rights reserved.
  7. //
  8. #ifndef std_h
  9. #define std_h
  10. #endif /* std_h */
  11. //#import "GeneralSetting.h"
  12. //#define USERDEFAULT_APP_NAME (@"USERDEFAULT_APP_NAME")
  13. //#define USERDEFAULT_USER_NAME (@"USERDEFAULT_USER_NAME")
  14. #define USERDEFAULT_LOGIN_NAME (@"USERDEFAULT_LOGIN_NAME")
  15. //#define USERDEFAULT_USER_ID (@"USERDEFAULT_USER_ID")
  16. #define USERDEFAULT_PASSWORD (@"USERDEFAULT_PASSWORD")
  17. #define USERDEFAULT_SERVER_ID (@"USERDEFAULT_SERVER_ID")
  18. #define USERDEFAULT_APP_TOKEN (@"USERDEFAULT_APP_TOKEN")
  19. //#define USERDEFAULT_ROOT_NAME (@"USERDEFAULT_ROOT_NAME")
  20. #define USERDEFAULT_APP_HOST (@"USERDEFAULT_APP_HOST")
  21. // 屏幕高度
  22. #define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
  23. // 屏幕宽度
  24. #define kKeyWindow [UIApplication sharedApplication].keyWindow
  25. #define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
  26. #define NavBarHeight self.navigationController.navigationBar.frame.size.height
  27. #define STATUSBAR_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height
  28. /**
  29. * RGB
  30. */
  31. #define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
  32. #define RGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
  33. #define SahreColorRGB(r,g,b) [UIColor colorWithRed:r green:g blue:b alpha:1.000]
  34. #define LineForSubLineViewColor RGB(214, 215, 217)
  35. #define LineForDrawColor [UIColor lightGrayColor]
  36. /**
  37. * 持久化存储相关
  38. */
  39. #define userDefaults [NSUserDefaults standardUserDefaults]
  40. #define Login_Name [userDefaults objectForKey:USERDEFAULT_LOGIN_NAME]
  41. #define Login_Word [userDefaults objectForKey:USERDEFAULT_PASSWORD]
  42. #define Server_ID [userDefaults objectForKey:USERDEFAULT_SERVER_ID]
  43. #define APP_HOST [userDefaults objectForKey:USERDEFAULT_APP_HOST]
  44. /**
  45. * 文件相关的绝对路径.
  46. */
  47. #define FileAbsoluteSaveRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@",@"Library",Login_Name]]
  48. #define CloudStorageFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"cloudstorage"]]
  49. #define FileFolderFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"file"]]
  50. #define VoiceFolderFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"voice"]]
  51. #define PhotosMessageDir [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"photo"]]
  52. //#define FontType(LargeFloatFont,SmailFloatFont) [GeneralSetting returnGeneralSetting].appFontModel.intValue == FontTypeChooseLarger?[UIFont systemFontOfSize:LargeFloatFont]:[UIFont systemFontOfSize:SmailFloatFont]
  53. #define FontType(LargeFloatFont,SmailFloatFont) [UIFont systemFontOfSize:SmailFloatFont]
  54. /**
  55. * IOS X.X系统判定
  56. *
  57. */
  58. #define isIOS7 [[UIDevice currentDevice].systemVersion doubleValue]>=7.0?YES:NO
  59. #define isIOS8 [[UIDevice currentDevice].systemVersion doubleValue]>=8.0?YES:NO
  60. #define LOG(...) NSLog(__VA_ARGS__);
  61. #define MaxYplus(view,margin) (CGRectGetMaxY(view.frame)+margin)
  62. //CGRectGetMaxY(logoimageview.frame)