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.

100 lines
5.2KB

  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);
  34. #line 21 "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 __attribute__((constructor)) void _logosLocalCtor_7d006fd9(int __unused argc, char __unused **argv, char __unused **envp) {
  58. preferences = [[HBPreferences alloc] initWithIdentifier:@"com.burritoz.dockifyprefs"];
  59. [preferences registerDefaults:@{
  60. @"setHeight": @1,
  61. @"customOpacity": @1,
  62. @"hidden": @NO,
  63. @"setIconNumber": @4,
  64. }];
  65. [preferences registerBool:&transparent default:YES forKey:@"transparent"];
  66. [preferences registerBool:&hidden default:NO forKey:@"hidden"];
  67. [preferences registerDouble:(double *)&setHeight default:1 forKey:@"setHeight"];
  68. [preferences registerDouble:(double *)&customOpacity default:1 forKey:@"customOpacity"];
  69. [preferences registerInteger:(NSInteger *)&setIconNumber default:4 forKey:@"setIconNumber"];
  70. }
  71. static __attribute__((constructor)) void _logosLocalInit() {
  72. {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);} }
  73. #line 71 "Tweak.x"