std.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 UIColorFromRGB(rgbValue) [UIColor \
  35. colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
  36. green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
  37. blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
  38. #define LineForSubLineViewColor RGB(214, 215, 217)
  39. #define LineForDrawColor [UIColor lightGrayColor]
  40. /**
  41. * 持久化存储相关
  42. */
  43. #define userDefaults [NSUserDefaults standardUserDefaults]
  44. #define Login_Name [userDefaults objectForKey:USERDEFAULT_LOGIN_NAME]
  45. #define Login_Word [userDefaults objectForKey:USERDEFAULT_PASSWORD]
  46. #define Server_ID [userDefaults objectForKey:USERDEFAULT_SERVER_ID]
  47. #define APP_HOST [userDefaults objectForKey:USERDEFAULT_APP_HOST]
  48. /**
  49. * 文件相关的绝对路径.
  50. */
  51. #define FileAbsoluteSaveRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@",@"Library",Login_Name]]
  52. #define CloudStorageFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"cloudstorage"]]
  53. #define FileFolderFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"file"]]
  54. #define VoiceFolderFullRouter [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"voice"]]
  55. #define PhotosMessageDir [NSHomeDirectory() stringByAppendingString:[NSString stringWithFormat:@"/%@/%@/%@",@"Library",Login_Name,@"photo"]]
  56. //#define FontType(LargeFloatFont,SmailFloatFont) [GeneralSetting returnGeneralSetting].appFontModel.intValue == FontTypeChooseLarger?[UIFont systemFontOfSize:LargeFloatFont]:[UIFont systemFontOfSize:SmailFloatFont]
  57. #define FontType(LargeFloatFont,SmailFloatFont) [UIFont systemFontOfSize:SmailFloatFont]
  58. /**
  59. * IOS X.X系统判定
  60. *
  61. */
  62. #define isIOS7 [[UIDevice currentDevice].systemVersion doubleValue]>=7.0?YES:NO
  63. #define isIOS8 [[UIDevice currentDevice].systemVersion doubleValue]>=8.0?YES:NO
  64. #define LOG(...) NSLog(__VA_ARGS__);
  65. #define MaxYplus(view,margin) (CGRectGetMaxY(view.frame)+margin)
  66. //CGRectGetMaxY(logoimageview.frame)