The source code, duh.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

91 lines
4.3KB

  1. #line 1 "Tweak.x"
  2. #import <SpringBoard/SpringBoard.h>
  3. #import <SpringBoard/SBDockIconListView.h>
  4. #import <Cephei/HBPreferences.h>
  5. #include <UIKit/UIKit.h>
  6. static BOOL transparent;
  7. static BOOL hidden;
  8. static double setHeight;
  9. static double customOpacity;
  10. static NSInteger setIconNumber;
  11. HBPreferences *preferences;
  12. #include <substrate.h>
  13. #if defined(__clang__)
  14. #if __has_feature(objc_arc)
  15. #define _LOGOS_SELF_TYPE_NORMAL __unsafe_unretained
  16. #define _LOGOS_SELF_TYPE_INIT __attribute__((ns_consumed))
  17. #define _LOGOS_SELF_CONST const
  18. #define _LOGOS_RETURN_RETAINED __attribute__((ns_returns_retained))
  19. #else
  20. #define _LOGOS_SELF_TYPE_NORMAL
  21. #define _LOGOS_SELF_TYPE_INIT
  22. #define _LOGOS_SELF_CONST
  23. #define _LOGOS_RETURN_RETAINED
  24. #endif
  25. #else
  26. #define _LOGOS_SELF_TYPE_NORMAL
  27. #define _LOGOS_SELF_TYPE_INIT
  28. #define _LOGOS_SELF_CONST
  29. #define _LOGOS_RETURN_RETAINED
  30. #endif
  31. @class SBDockIconListView; @class SBDockView;
  32. static void (*_logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$)(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL, double); static void _logos_method$_ungrouped$SBDockView$setBackgroundAlpha$(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL, double); static double (*_logos_orig$_ungrouped$SBDockView$dockHeight)(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL); static double _logos_method$_ungrouped$SBDockView$dockHeight(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST, SEL); static NSInteger (*_logos_meta_orig$_ungrouped$SBDockIconListView$maxIcons)(_LOGOS_SELF_TYPE_NORMAL Class _LOGOS_SELF_CONST, SEL); static NSInteger _logos_meta_method$_ungrouped$SBDockIconListView$maxIcons(_LOGOS_SELF_TYPE_NORMAL Class _LOGOS_SELF_CONST, SEL);
  33. #line 17 "Tweak.x"
  34. static void _logos_method$_ungrouped$SBDockView$setBackgroundAlpha$(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd, double arg1) {
  35. if (transparent == NO && hidden == NO) {
  36. _logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$(self, _cmd, customOpacity);
  37. }else if (transparent || hidden) {
  38. _logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$(self, _cmd, 0.0);
  39. } else {
  40. NSLog(@"Dock not Transparent/hidden, no custom opacity\n");
  41. }
  42. }
  43. static double _logos_method$_ungrouped$SBDockView$dockHeight(_LOGOS_SELF_TYPE_NORMAL SBDockView* _LOGOS_SELF_CONST __unused self, SEL __unused _cmd) {
  44. return (_logos_orig$_ungrouped$SBDockView$dockHeight(self, _cmd)*setHeight);
  45. }
  46. static NSInteger _logos_meta_method$_ungrouped$SBDockIconListView$maxIcons(_LOGOS_SELF_TYPE_NORMAL Class _LOGOS_SELF_CONST __unused self, SEL __unused _cmd) {
  47. if (hidden) {
  48. return (0);
  49. } else {
  50. return (setIconNumber);
  51. }
  52. }
  53. static __attribute__((constructor)) void _logosLocalCtor_44056092(int __unused argc, char __unused **argv, char __unused **envp) {
  54. preferences = [[HBPreferences alloc] initWithIdentifier:@"com.burritoz.dockifyprefs"];
  55. [preferences registerDefaults:@{
  56. @"setHeight": @1,
  57. @"customOpacity": @1,
  58. @"hidden": @NO,
  59. @"setIconNumber": @4,
  60. }];
  61. [preferences registerBool:&transparent default:YES forKey:@"transparent"];
  62. [preferences registerBool:&hidden default:NO forKey:@"hidden"];
  63. [preferences registerDouble:(double *)&setHeight default:1 forKey:@"setHeight"];
  64. [preferences registerDouble:(double *)&customOpacity default:1 forKey:@"customOpacity"];
  65. [preferences registerInteger:(NSInteger *)&setIconNumber default:4 forKey:@"setIconNumber"];
  66. }
  67. static __attribute__((constructor)) void _logosLocalInit() {
  68. {Class _logos_class$_ungrouped$SBDockView = objc_getClass("SBDockView"); MSHookMessageEx(_logos_class$_ungrouped$SBDockView, @selector(setBackgroundAlpha:), (IMP)&_logos_method$_ungrouped$SBDockView$setBackgroundAlpha$, (IMP*)&_logos_orig$_ungrouped$SBDockView$setBackgroundAlpha$);MSHookMessageEx(_logos_class$_ungrouped$SBDockView, @selector(dockHeight), (IMP)&_logos_method$_ungrouped$SBDockView$dockHeight, (IMP*)&_logos_orig$_ungrouped$SBDockView$dockHeight);Class _logos_class$_ungrouped$SBDockIconListView = objc_getClass("SBDockIconListView"); Class _logos_metaclass$_ungrouped$SBDockIconListView = object_getClass(_logos_class$_ungrouped$SBDockIconListView); MSHookMessageEx(_logos_metaclass$_ungrouped$SBDockIconListView, @selector(maxIcons), (IMP)&_logos_meta_method$_ungrouped$SBDockIconListView$maxIcons, (IMP*)&_logos_meta_orig$_ungrouped$SBDockIconListView$maxIcons);} }
  69. #line 62 "Tweak.x"