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.

62 lines
1.9KB

  1. //import needed files/headers
  2. #import <SpringBoard/SpringBoard.h>
  3. #import <SpringBoard/SBDockIconListView.h>
  4. #import <Cephei/HBPreferences.h>
  5. #include <UIKit/UIKit.h>
  6. //Set up variables for use with Cephei
  7. static BOOL transparent;
  8. static BOOL hidden;
  9. static double setHeight;
  10. static double customOpacity;
  11. static NSInteger setIconNumber;
  12. HBPreferences *preferences;
  13. //hook the dock
  14. %hook SBDockView
  15. //this deals with everything adjusting opacity/transparency
  16. -(void)setBackgroundAlpha:(double)arg1 {
  17. if (transparent == NO && hidden == NO) { //if not transparent and not hidden
  18. %orig(customOpacity);
  19. }else if (transparent || hidden) { // Note: || means or in objc
  20. %orig(0.0); //hides background of the dock (transparent)
  21. } else {
  22. NSLog(@"Dock not Transparent/hidden, no custom opacity\n");
  23. }
  24. }
  25. -(double)dockHeight {
  26. return (%orig*setHeight); //sets custom height if dock is not set to hidden
  27. }
  28. %end
  29. %hook SBDockIconListView
  30. +(NSInteger)maxIcons {
  31. if (hidden) {
  32. return (0);
  33. } else {
  34. return (setIconNumber);
  35. }
  36. }
  37. %end
  38. %ctor {
  39. preferences = [[HBPreferences alloc] initWithIdentifier:@"com.burritoz.dockifyprefs"];
  40. [preferences registerDefaults:@{ //defaults for prefernces
  41. @"setHeight": @1,
  42. @"customOpacity": @1,
  43. @"hidden": @NO,
  44. @"setIconNumber": @4,
  45. }];
  46. [preferences registerBool:&transparent default:YES forKey:@"transparent"]; //registering transparent as a Boolean
  47. [preferences registerBool:&hidden default:NO forKey:@"hidden"]; //registering hidden as a Boolean
  48. [preferences registerDouble:(double *)&setHeight default:1 forKey:@"setHeight"]; //registering setHeigt as a double (number)
  49. [preferences registerDouble:(double *)&customOpacity default:1 forKey:@"customOpacity"]; //registering customOpacity as a double (number)
  50. [preferences registerInteger:(NSInteger *)&setIconNumber default:4 forKey:@"setIconNumber"]; //Integer of how many icons to allow
  51. }