The source code, duh.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
6.0KB

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