├── .gitignore ├── AppearanceLifeCycle.xm ├── Dragging.xm ├── HSWidgetLoader.h ├── HSWidgetLoader.mm ├── HSWidgetPageController.h ├── HSWidgetPageController.xm ├── HSWidgetUnrotateableViewController.h ├── HSWidgetUnrotateableViewController.xm ├── HSWidgets.plist ├── LICENSE.md ├── Makefile ├── README.md ├── Resources ├── HSExpand@2x.png ├── HSExpand@3x.png ├── HSPlaceholderShape@2x.png ├── HSPlaceholderShape@3x.png ├── HSSettings@2x.png ├── HSSettings@3x.png ├── HSShrink@2x.png └── HSShrink@3x.png ├── Rotation.xm ├── SBAccessoryBoxViews.xm ├── SBIconListModel.xm ├── Tweak.xm ├── ZoomAnimation.xm ├── api ├── HSModernWidgetViewController.h ├── HSModernWidgetViewController.mm ├── HSWidgetAddNewAdditionalOptionsDelegate.h ├── HSWidgetAdditionalOptions.h ├── HSWidgetAdditionalOptionsViewController.h ├── HSWidgetAdditionalOptionsViewController.mm ├── HSWidgetCombinedAdditionalOptionsAndPreferencesViewController.h ├── HSWidgetCombinedAdditionalOptionsAndPreferencesViewController.mm ├── HSWidgetDelegate.h ├── HSWidgetPreferences.h ├── HSWidgetPreferencesListController.h ├── HSWidgetPreferencesListController.mm ├── HSWidgetResources.h ├── HSWidgetResources.mm ├── HSWidgetUnclippedView.h ├── HSWidgetUnclippedView.mm ├── HSWidgetViewController.h ├── HSWidgetViewController.xm ├── HSWidgets.h └── core │ ├── HSWidgetAvailablePositionObject.h │ ├── HSWidgetAvailablePositionObject.mm │ ├── HSWidgetFrameObject.h │ ├── HSWidgetFrameObject.mm │ ├── HSWidgetGridPositionConverterCache.h │ ├── HSWidgetGridPositionConverterCache.mm │ ├── HSWidgetPositionObject.h │ ├── HSWidgetPositionObject.mm │ ├── HSWidgetSizeObject.h │ ├── HSWidgetSizeObject.mm │ ├── HSWidgets-core.h │ └── HSWidgets-structs.h ├── control ├── docs ├── Core │ ├── HSWidgetAvailablePositionObject.html │ ├── HSWidgetAvailablePositionObject │ │ ├── containsIcon.html │ │ ├── initwithavailablewidgetposition_containingicon.html │ │ └── objectwithavailablewidgetposition_containingicon.html │ ├── HSWidgetDirection.html │ ├── HSWidgetDirection │ │ ├── HSWidgetDirectionDown.html │ │ ├── HSWidgetDirectionLeft.html │ │ ├── HSWidgetDirectionNone.html │ │ ├── HSWidgetDirectionRight.html │ │ ├── HSWidgetDirectionUp.html │ │ ├── HSWidgetPositionInDirection.html │ │ ├── HSWidgetPositionIsAdjacent.html │ │ └── HSWidgetReverseDirection.html │ ├── HSWidgetFrame.html │ ├── HSWidgetFrame │ │ ├── HSWidgetFrameContainsPosition.html │ │ ├── HSWidgetFrameEqualsFrame.html │ │ ├── HSWidgetFrameMake.html │ │ ├── HSWidgetFrameMake_cpp.html │ │ ├── HSWidgetFrameZero.html │ │ ├── origin.html │ │ └── size.html │ ├── HSWidgetFrameObject.html │ ├── HSWidgetFrameObject │ │ ├── frame.html │ │ ├── initWithWidgetFrame.html │ │ ├── isEqualToWidgetFrameObject.html │ │ ├── objectWithWidgetFrame.html │ │ ├── origin.html │ │ └── size.html │ ├── HSWidgetGridPositionConverterCache.html │ ├── HSWidgetGridPositionConverterCache │ │ ├── canFitWidgetOfSize_inGridPositions.html │ │ ├── canFitWidget_inGridPositions.html │ │ ├── css │ │ │ └── gridPositionsForWidgetFrame.css │ │ ├── gridPositionsForWidgetFrame.html │ │ └── originForWidgetOfSize_inGridPositions.html │ ├── HSWidgetPosition.html │ ├── HSWidgetPosition │ │ ├── HSWidgetPositionAdd.html │ │ ├── HSWidgetPositionEqualsPosition.html │ │ ├── HSWidgetPositionIsValid.html │ │ ├── HSWidgetPositionMake.html │ │ ├── HSWidgetPositionZero.html │ │ ├── col.html │ │ └── row.html │ ├── HSWidgetPositionObject.html │ ├── HSWidgetPositionObject │ │ ├── col.html │ │ ├── initWithWidgetPosition.html │ │ ├── isEqualToWidgetPositionObject.html │ │ ├── objectWithWidgetPosition.html │ │ ├── position.html │ │ └── row.html │ ├── HSWidgetSize.html │ ├── HSWidgetSize │ │ ├── HSWidgetSizeAdd.html │ │ ├── HSWidgetSizeEqualsSize.html │ │ ├── HSWidgetSizeMake.html │ │ ├── HSWidgetSizeZero.html │ │ ├── SpacesForWidgetSize.html │ │ ├── numCols.html │ │ └── numRows.html │ ├── HSWidgetSizeObject.html │ ├── HSWidgetSizeObject │ │ ├── initWithWidgetSize.html │ │ ├── isEqualToWidgetSizeObject.html │ │ ├── numCols.html │ │ ├── numRows.html │ │ ├── objectWithWidgetSize.html │ │ └── size.html │ └── css │ │ ├── HSWidgetDirection.css │ │ └── HSWidgetFrame.css ├── Getting_Started │ ├── AccessorySquareWidget.png │ ├── Adding_Basic_Preferences.html │ ├── Adding_Dynamic_Size.html │ ├── BuggyExpandedSquareWidget.png │ ├── ExpandedSquareWidget.png │ ├── ExpandedWidgetColors.png │ ├── PillRedSquareWidget.png │ ├── RedSquareWidget.png │ ├── RoundedRedSquareWidget.png │ ├── Simple_Widget.html │ ├── Theos_Environment_Setup.html │ ├── WidgetAdditionalOptions.png │ ├── WidgetSettings.png │ └── WidgetSettingsAccessory.png ├── Preferences │ ├── HSWidgetAddNewAdditionalOptionsDelegate.html │ ├── HSWidgetAddNewAdditionalOptionsDelegate │ │ ├── additionalOptionsViewController_addWidgetForClass.html │ │ └── dismissAddWidget.html │ ├── HSWidgetAdditionalOptions.html │ ├── HSWidgetAdditionalOptions │ │ ├── delegate.html │ │ ├── initWithWidgetsOptionsToExclude_withDelegate_availablePositions.html │ │ ├── requestWidgetSize.html │ │ ├── widgetClass.html │ │ └── widgetOptions.html │ ├── HSWidgetAdditionalOptionsViewController.html │ ├── HSWidgetAdditionalOptionsViewController │ │ ├── addWidget.html │ │ ├── availablePositions.html │ │ ├── cancelAdditionalOptions.html │ │ ├── containsSpaceForGridPositions.html │ │ └── containsSpaceForWidgetSize.html │ ├── HSWidgetCombinedAdditionalOptionsAndPreferencesViewController.html │ ├── HSWidgetCombinedAdditionalOptionsAndPreferencesViewController │ │ ├── addWidget.html │ │ ├── cancelAdditionalOptions.html │ │ ├── containsSpaceForGridPositions.html │ │ └── containsSpaceForWidgetSize.html │ ├── HSWidgetPreferences.html │ ├── HSWidgetPreferences │ │ ├── availablePositions.html │ │ ├── initWithWidgetViewController_availablePositions.html │ │ └── widgetViewController.html │ ├── HSWidgetPreferencesListController.html │ └── HSWidgetPreferencesListController │ │ ├── containsSpaceForGridPositions.html │ │ ├── containsSpaceForWidgetSize.html │ │ ├── readFileValue.html │ │ ├── readPreferenceValue.html │ │ ├── readUserDefaultsValue.html │ │ ├── readWidgetOptionsValue.html │ │ ├── resetAllSettings.html │ │ ├── resetFileValues.html │ │ ├── resetUserDefaults.html │ │ ├── resetWidgetOptions.html │ │ ├── setFileValue_specifier.html │ │ ├── setPreferenceValue_specifier.html │ │ ├── setUserDefaultsValue_specifier.html │ │ └── setWidgetOptionsValue_specifier.html ├── User_Interface │ ├── HSModernWidgetViewController.html │ ├── HSModernWidgetViewController │ │ ├── blurView.html │ │ ├── contentView.html │ │ ├── expandWidget.html │ │ ├── shrinkWidget.html │ │ └── titleLabel.html │ ├── HSWidgetDelegate.html │ ├── HSWidgetDelegate │ │ ├── canDragWidget.html │ │ ├── canWidget_expandOrShrinkToGridPositions.html │ │ ├── closeTapped.html │ │ ├── setDraggingWidget.html │ │ ├── settingsTapped.html │ │ ├── updatePageForExpandOrShrinkOfWidget_toGridPositions.html │ │ ├── widgetDragged_toPoint.html │ │ ├── widgetOptionsChanged.html │ │ └── widgetOriginForWidgetSize_withPreferredOrigin.html │ ├── HSWidgetResources.html │ ├── HSWidgetResources │ │ ├── HSWidgetBezierShape.html │ │ ├── HSWidgetBezierShape │ │ │ ├── HSWidgetBezierShapeCircle.html │ │ │ ├── HSWidgetBezierShapeDefault.html │ │ │ ├── HSWidgetBezierShapeRect.html │ │ │ ├── HSWidgetBezierShapeRoundedRect.html │ │ │ ├── HSWidgetBezierShapeStar.html │ │ │ └── HSWidgetBezierShapeTriangle.html │ │ ├── HSWidgetDomain.html │ │ ├── HSWidgetDomain │ │ │ ├── HSWidgetBezierShapeChangedNotification.html │ │ │ └── HSWidgetBezierShapeKey.html │ │ ├── HSWidgetExpandImageName.html │ │ ├── HSWidgetPlaceholderImageName.html │ │ ├── HSWidgetPlaceholderShapeImageName.html │ │ ├── HSWidgetSettingsImageName.html │ │ ├── HSWidgetShrinkImageName.html │ │ ├── allBezierShapes.html │ │ ├── allBezierShapes │ │ │ ├── HSWidgetBezierShapeDisplayNameKey.html │ │ │ └── HSWidgetBezierShapeEnumKey.html │ │ ├── bezierPathForRect_withShape_lineThickness.html │ │ └── imageNamed.html │ ├── HSWidgetUnclippedView.html │ ├── HSWidgetViewController.html │ └── HSWidgetViewController │ │ ├── AccessoryType.html │ │ ├── AccessoryType │ │ ├── AccessoryTypeExpand.html │ │ ├── AccessoryTypeNone.html │ │ ├── AccessoryTypeSettings.html │ │ └── AccessoryTypeShrink.html │ │ ├── HSWidgetAllWidgetsConfiguredNotification.html │ │ ├── HSWidgetAnimationDuration.html │ │ ├── HSWidgetAvailableSpaceDidChangeNotification.html │ │ ├── HSWidgetEditingStateChangedNotification.html │ │ ├── HSWidgetEditingStateChangedNotification │ │ └── HSWidgetEditingStateKey.html │ │ ├── HSWidgetQuickAnimationDuration.html │ │ ├── ZoomAnimationViewStyle.html │ │ ├── ZoomAnimationViewStyle │ │ ├── ZoomAnimationViewStyleCustom.html │ │ ├── ZoomAnimationViewStyleDefault.html │ │ └── ZoomAnimationViewStyleImageCopy.html │ │ ├── _delegate.html │ │ ├── _gridPositions.html │ │ ├── _setDelegate.html │ │ ├── accessoryTypeTapped.html │ │ ├── addNewWidgetAdditionalOptionsControllerClass.html │ │ ├── allowedInstancesPerPage.html │ │ ├── bundle.html │ │ ├── calculatedFrame.html │ │ ├── canAddWidgetForAvailableGridPositions.html │ │ ├── clearZoomAnimatingView.html │ │ ├── containsSpaceToExpandOrShrinkToGridPositions.html │ │ ├── containsSpaceToExpandOrShrinkToWidgetSize.html │ │ ├── cornerRadius.html │ │ ├── createOptionsFromController_withAvailableGridPosition.html │ │ ├── initForWidgetFrame_withOptions.html │ │ ├── isAccessoryTypeEnabled.html │ │ ├── isAvailable.html │ │ ├── minimumSize.html │ │ ├── options.html │ │ ├── preferencesOptionsControllerClass.html │ │ ├── requestedSize.html │ │ ├── setWidgetOptionValue_forKey.html │ │ ├── updateForExpandOrShrinkToGridPositions.html │ │ ├── updateForExpandOrShrinkToWidgetSize.html │ │ ├── viewStyleForZoomAnimaton.html │ │ ├── widgetDisplayInfo.html │ │ ├── widgetDisplayInfo │ │ ├── HSWidgetDisplayCreatorKey.html │ │ ├── HSWidgetDisplayIconKey.html │ │ └── HSWidgetDisplayNameKey.html │ │ ├── widgetFrame.html │ │ ├── widgetOptions.html │ │ ├── widgetSizeFromController_withAvailableGridPosition.html │ │ └── zoomAnimatingView.html └── index.html ├── editing ├── HSAddNewWidgetDelegate.h ├── HSAddNewWidgetPositionView.h ├── HSAddNewWidgetPositionView.mm ├── HSAddNewWidgetPositionViewDelegate.h ├── HSAddNewWidgetView.h ├── HSAddNewWidgetView.mm ├── HSAddWidgetRootViewController.h ├── HSAddWidgetRootViewController.mm ├── HSAddWidgetSelectionDelegate.h ├── HSWidgetBezierShapeDisclosureTableViewCell.h ├── HSWidgetBezierShapeDisclosureTableViewCell.mm ├── HSWidgetBezierShapeSelectorViewController.h ├── HSWidgetBezierShapeSelectorViewController.mm ├── HSWidgetBezierShapeTableViewCell.h ├── HSWidgetBezierShapeTableViewCell.mm ├── HSWidgetHeaderTableView.h ├── HSWidgetHeaderTableView.mm ├── HSWidgetSubtitleTableViewCell.h └── HSWidgetSubtitleTableViewCell.mm ├── hsccmodulewidget ├── CCSupportCompatibility.x ├── HSCCModuleController.h ├── HSCCModuleController.x ├── HSCCModuleWidgetViewController.h ├── HSCCModuleWidgetViewController.x ├── HSCCModulesListViewController.h ├── HSCCModulesListViewController.mm ├── HSCCModulesListViewController.x ├── HSCCNotifications.h ├── HSCCNotifications.x ├── Makefile ├── Resources │ ├── Info.plist │ ├── icon@2x.png │ └── icon@3x.png └── private_headers │ ├── CCSModuleMetadata.h │ ├── CCSModuleProviderManager.h │ ├── CCSModuleRepository.h │ ├── CCUIContentModule.h │ ├── CCUIContentModuleBackgroundView.h │ ├── CCUIContentModuleContainerView.h │ ├── CCUIContentModuleContainerViewController.h │ ├── CCUIContentModuleContainerViewControllerDelegate.h │ ├── CCUIContentModuleContext.h │ ├── CCUIContentModuleContextDelegate.h │ ├── CCUIContentModulePresentationContext.h │ ├── CCUILayoutOptions.h │ ├── CCUILayoutSize.h │ ├── CCUIModularControlCenterViewController.h │ ├── CCUIModuleCollectionViewController.h │ ├── CCUIModuleInstance.h │ ├── CCUIModuleInstanceManager.h │ ├── CCUIModuleSettings.h │ ├── CCUIModuleSettingsManager.h │ ├── CCUISettingsModuleDescription.h │ ├── CCUISettingsModulesController.h │ ├── SBCoverSheetPresentationManager.h │ ├── SBIconController.h │ ├── SpringBoard.h │ ├── UIViewController+bs.h │ └── UIViewController+ccui.h ├── hsclockwidget ├── HSClockWidgetPreferencesViewController.h ├── HSClockWidgetPreferencesViewController.mm ├── HSClockWidgetViewController.h ├── HSClockWidgetViewController.xm ├── Makefile ├── Resources │ ├── Info.plist │ ├── Root.plist │ ├── icon@2x.png │ └── icon@3x.png └── private_headers │ ├── LegibilitySettings.h │ ├── SBDateTimeController.h │ ├── SBDateTimeOverrideObserver.h │ ├── SBFLegibilityDomain.h │ ├── SBFLockScreenDateView.h │ ├── SBPreciseClockTimer.h │ ├── SBPrototypeController.h │ ├── SBRootSettings.h │ ├── SBUIPreciseClockTimer.h │ ├── _UILegibilitySettings.h │ └── _UISettingsKeyObserver.h ├── hsmodernweatherwidget ├── HSModernWeatherDailyForecastView.h ├── HSModernWeatherDailyForecastView.m ├── HSModernWeatherHourlyForecastView.h ├── HSModernWeatherHourlyForecastView.m ├── HSModernWeatherWidgetViewController.h ├── HSModernWeatherWidgetViewController.x ├── HSWeatherController.h ├── HSWeatherController.mm ├── HSWeatherControllerObserver.h ├── Makefile ├── Resources │ └── Info.plist └── private_headers │ ├── City.h │ ├── SpringBoard.h │ ├── UIImage+Private.h │ ├── WACurrentForecast.h │ ├── WADayForecast.h │ ├── WAForecastModel.h │ ├── WAHourlyForecast.h │ ├── WATodayModel.h │ ├── WATodayModelObserver.h │ ├── WFAQIScaleCategory.h │ ├── WFAirQualityConditions.h │ ├── WFLocation.h │ ├── WFTemperature.h │ ├── WFTemperatureFormatter.h │ ├── WFTemperatureUnitObserver.h │ ├── WUIDynamicWeatherBackground.h │ ├── WUIGradientLayer.h │ ├── WUIWeatherCondition.h │ ├── Weather-Externs.h │ ├── WeatherInternalPreferences.h │ └── WeatherPreferences.h ├── hsspacerwidget ├── HSSpacerWidgetViewController.h ├── HSSpacerWidgetViewController.mm ├── Makefile └── Resources │ ├── Info.plist │ ├── icon@2x.png │ └── icon@3x.png ├── hstodaywidget ├── HSTodayWidgetAdvancedPreferencesViewController.h ├── HSTodayWidgetAdvancedPreferencesViewController.mm ├── HSTodayWidgetController.h ├── HSTodayWidgetController.x ├── HSTodayWidgetRootPreferencesViewController.h ├── HSTodayWidgetRootPreferencesViewController.mm ├── HSTodayWidgetStepperCell.h ├── HSTodayWidgetStepperCell.mm ├── HSTodayWidgetViewController.h ├── HSTodayWidgetViewController.x ├── HSTodayWidgetsListViewController.h ├── HSTodayWidgetsListViewController.mm ├── Makefile ├── Resources │ ├── Advanced.plist │ ├── Info.plist │ ├── Root.plist │ ├── icon@2x.png │ └── icon@3x.png ├── SBIconListView.x ├── SBRootFolderController.x ├── SBUIIconForceTouchController.x └── private_headers │ ├── MTMaterialView.h │ ├── NSExtension.h │ ├── SBIconController.h │ ├── SBUIIconForceTouchController.h │ ├── SBWidgetController.h │ ├── SpringBoard.h │ ├── UIViewController+Widgets.h │ ├── WGMajorListViewContorller.h │ ├── WGWidgetDiscoveryController.h │ ├── WGWidgetDiscoveryObserving.h │ ├── WGWidgetExtensionVisibilityProviding.h │ ├── WGWidgetGroupViewController.h │ ├── WGWidgetHostingViewController.h │ ├── WGWidgetHostingViewControllerDelegate.h │ ├── WGWidgetHostingViewControllerHost.h │ ├── WGWidgetInfo.h │ ├── WGWidgetPlatterView.h │ └── WGWidgetShortLookView.h ├── layout └── Library │ └── HSWidgets │ ├── BatteryWidget.bundle │ ├── BatteryWidget │ ├── Info.plist │ ├── icon@2x.png │ └── icon@3x.png │ └── PhotosWidget.bundle │ ├── Info.plist │ ├── PhotosWidget │ ├── Root.plist │ ├── icon@2x.png │ └── icon@3x.png ├── private_headers ├── HSWidget-Availability.h ├── NSUserDefaults.h ├── SBFolder.h ├── SBIconController.h ├── SBIconCoordinate.h ├── SBIconListModel.h ├── SBIconListView.h ├── SBRootFolderController.h └── SpringBoard.h └── theos_template ├── HSWidgets.framework.zip ├── HSWidgets.framework ├── HSWidgets.tbd └── Headers │ ├── HSModernWidgetViewController.h │ ├── HSWidgetAddNewAdditionalOptionsDelegate.h │ ├── HSWidgetAdditionalOptions.h │ ├── HSWidgetAdditionalOptionsViewController.h │ ├── HSWidgetAvailablePositionObject.h │ ├── HSWidgetCombinedAdditionalOptionsAndPreferencesViewController.h │ ├── HSWidgetDelegate.h │ ├── HSWidgetFrameObject.h │ ├── HSWidgetGridPositionConverterCache.h │ ├── HSWidgetPositionObject.h │ ├── HSWidgetPreferences.h │ ├── HSWidgetPreferencesListController.h │ ├── HSWidgetResources.h │ ├── HSWidgetSizeObject.h │ ├── HSWidgetUnclippedView.h │ ├── HSWidgetViewController.h │ ├── HSWidgets-core.h │ ├── HSWidgets-structs.h │ └── HSWidgets.h ├── create_tbd.sh ├── hscustomwidget ├── HSCustomWidgetPreferencesViewController.h ├── HSCustomWidgetPreferencesViewController.mm ├── HSCustomWidgetViewController.h ├── HSCustomWidgetViewController.mm ├── Makefile ├── Resources │ ├── Info.plist │ ├── Root.plist │ ├── icon@2x.png │ └── icon@3x.png └── control └── iphone_hswidget.nic.tar /.gitignore: -------------------------------------------------------------------------------- 1 | .theos/ 2 | packages/ 3 | -------------------------------------------------------------------------------- /HSWidgetLoader.h: -------------------------------------------------------------------------------- 1 | __attribute__((visibility("hidden"))) 2 | @interface HSWidgetLoader : NSObject 3 | +(NSMutableArray *)availableHSWidgetClasses; 4 | +(void)loadAllWidgets; 5 | +(void)unloadAllWidgets; 6 | @end 7 | -------------------------------------------------------------------------------- /HSWidgetPageController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HSWidgets-core.h" 3 | #import "HSWidgetViewController.h" 4 | #import "HSAddNewWidgetView.h" 5 | #import "HSAddWidgetRootViewController.h" 6 | #import "SBIconCoordinate.h" 7 | #import "SBIconListModel.h" 8 | #import "SBIconListView.h" 9 | 10 | typedef NS_ENUM(NSUInteger, HSWidgetAvailableSpaceRule) { 11 | HSWidgetAvailableSpaceRuleIncludeIconsWithMark = 0, 12 | HSWidgetAvailableSpaceRuleIncludeIconsWithMarkExceptLast, 13 | HSWidgetAvailableSpaceRuleExcludeIcons, 14 | HSWidgetAvailableSpaceRuleExcludeIconsExceptLast 15 | }; 16 | 17 | __attribute__((visibility("hidden"))) 18 | @interface HSWidgetPageController : NSObject { 19 | @private 20 | SBIconListView *_iconListView; 21 | SBIconListModel *_model; 22 | BOOL _isRemoving; 23 | } 24 | @property (nonatomic, retain) HSWidgetViewController *draggingWidgetViewController; 25 | @property (nonatomic, assign) HSWidgetPosition newWidgetPositionForDraggingAnimation; 26 | @property (nonatomic, retain) HSAddNewWidgetView *addNewWidgetView; 27 | @property (nonatomic, assign) BOOL requiresSaveToFileForWidgetChanges; 28 | @property (nonatomic, retain) UIViewController *widgetPickerViewController; 29 | @property (nonatomic, retain) UIViewController *widgetPreferenceViewController; 30 | @property (nonatomic, assign) BOOL shouldDisableWidgetLayout; 31 | -(instancetype)initWithIconListView:(SBIconListView *)iconListView; 32 | -(void)configureWidgetsIfNeededWithIndex:(NSInteger)index; 33 | -(void)layoutWidgetPage; 34 | -(void)viewWillTransitionToSize:(CGSize)arg1 withTransitionCoordinator:(id)arg2; 35 | -(SBIconCoordinate)coordinateForPoint:(CGPoint)arg1 withRow:(NSInteger)row column:(NSInteger)column; 36 | -(void)setEditing:(BOOL)editing; 37 | -(NSArray *)availableSpaceWithRule:(HSWidgetAvailableSpaceRule)rule; 38 | -(NSArray *)occupiedWidgetSpaces; 39 | -(void)animateUpdateOfIconChangesExcludingCurrentIcon:(BOOL)excluded completion:(void(^)(void))completion; 40 | -(CGSize)sizeForWidgetSize:(HSWidgetSize)size; 41 | @end 42 | -------------------------------------------------------------------------------- /HSWidgetUnrotateableViewController.h: -------------------------------------------------------------------------------- 1 | __attribute__((visibility("hidden"))) 2 | @interface HSWidgetUnrotateableViewController : UIViewController 3 | @end 4 | -------------------------------------------------------------------------------- /HSWidgetUnrotateableViewController.xm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetUnrotateableViewController.h" 2 | #import "SBIconController.h" 3 | 4 | @implementation HSWidgetUnrotateableViewController 5 | -(BOOL)shouldAutorotate { 6 | return NO; 7 | } 8 | 9 | -(UIInterfaceOrientationMask)supportedInterfaceOrientations { 10 | return (UIInterfaceOrientationMask)(1 << [[%c(SBIconController) sharedInstance] orientation]); 11 | } 12 | @end -------------------------------------------------------------------------------- /HSWidgets.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.apple.springboard" ); }; } 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 DGh0st (Deep Patel) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | export ARCHS = armv7 arm64 arm64e 2 | export TARGET = iphone:clang:latest:10.0 3 | 4 | PUBLIC_HEADERS_DIR := api api/core 5 | 6 | include $(THEOS)/makefiles/common.mk 7 | 8 | TWEAK_NAME = HSWidgets 9 | HSWidgets_FILES = $(wildcard api/core/*.mm api/*.mm api/*.xm editing/*.mm *.mm *.xm) 10 | HSWidgets_FRAMEWORKS = UIKit CoreGraphics QuartzCore 11 | HSWidgets_PRIVATE_FRAMEWORKS = Preferences 12 | HSWidgets_CFLAGS = -Iapi -Iapi/core -Iediting -Iprivate_headers -std=c++11 -stdlib=libc++ 13 | HSWidgets_LDFLAGS = -std=c++11 -stdlib=libc++ 14 | 15 | include $(THEOS_MAKE_PATH)/tweak.mk 16 | 17 | BUNDLE_NAME = Assets 18 | Assets_INSTALL_PATH = /Library/Application Support/HSWidgets 19 | 20 | include $(THEOS_MAKE_PATH)/bundle.mk 21 | 22 | after-install:: 23 | install.exec "killall -9 SpringBoard" 24 | 25 | FRAMEWORK_NAME = HSWidgets 26 | HSWIDGETS_THEOS_TEMPLATE_STAGING_DIR = $(THEOS_PROJECT_DIR)/theos_template 27 | FRAMEWORK_PATH = $(HSWIDGETS_THEOS_TEMPLATE_STAGING_DIR)/$(FRAMEWORK_NAME).framework 28 | export TBD_INPUT_PATH = $(THEOS_OBJ_DIR)/$(FRAMEWORK_NAME).dylib 29 | export TBD_OUTPUT_PATH = $(FRAMEWORK_PATH)/$(FRAMEWORK_NAME).tbd 30 | internal-all:: 31 | mkdir -p $(FRAMEWORK_PATH)/Headers 32 | find $(PUBLIC_HEADERS_DIR) -maxdepth 1 -name "*.h" -exec cp {} $(FRAMEWORK_PATH)/Headers \; 33 | chmod +x $(HSWIDGETS_THEOS_TEMPLATE_STAGING_DIR)/create_tbd.sh 34 | $(HSWIDGETS_THEOS_TEMPLATE_STAGING_DIR)/create_tbd.sh 35 | cp -r $(FRAMEWORK_PATH) $(THEOS)/lib/ 36 | 37 | clean-env: 38 | rm -r $(HSWIDGETS_THEOS_TEMPLATE_STAGING_DIR)/$(FRAMEWORK_NAME).framework $(THEOS)/lib/$(FRAMEWORK_NAME).framework 39 | 40 | create-framework-zip: 41 | cd $(HSWIDGETS_THEOS_TEMPLATE_STAGING_DIR) && zip -r $(FRAMEWORK_PATH).zip $(FRAMEWORK_NAME).framework 42 | 43 | clean-framework-zip: 44 | rm $(FRAMEWORK_PATH).zip 45 | 46 | SUBPROJECTS += hsccmodulewidget 47 | SUBPROJECTS += hsclockwidget 48 | SUBPROJECTS += hsmodernweatherwidget 49 | SUBPROJECTS += hsspacerwidget 50 | SUBPROJECTS += hstodaywidget 51 | include $(THEOS_MAKE_PATH)/aggregate.mk 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HSWidgets 2 | 3 | Add options to display widgets right on your homescreen. 4 | 5 | ## Building 6 | 7 | ### Required Dependencies 8 | 9 | [Theos](https://github.com/theos/theos) - build system used 10 | [tbd](https://github.com/DGh0st/tbd) - tbd generation from mach-o, fork of [https://github.com/inoahdev/tbd](https://github.com/inoahdev/tbd) to add ignore weak symbol defs 11 | 12 | Compiling the source using `make package` which should create a packaged deb file that can then be installed on the device for testing. 13 | 14 | ## How to create your own widgets 15 | 16 | See [HSWidget docs](https://dgh0st.github.io/HSWidgets) to get started. 17 | -------------------------------------------------------------------------------- /Resources/HSExpand@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/Resources/HSExpand@2x.png -------------------------------------------------------------------------------- /Resources/HSExpand@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/Resources/HSExpand@3x.png -------------------------------------------------------------------------------- /Resources/HSPlaceholderShape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/Resources/HSPlaceholderShape@2x.png -------------------------------------------------------------------------------- /Resources/HSPlaceholderShape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/Resources/HSPlaceholderShape@3x.png -------------------------------------------------------------------------------- /Resources/HSSettings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/Resources/HSSettings@2x.png -------------------------------------------------------------------------------- /Resources/HSSettings@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/Resources/HSSettings@3x.png -------------------------------------------------------------------------------- /Resources/HSShrink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/Resources/HSShrink@2x.png -------------------------------------------------------------------------------- /Resources/HSShrink@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/Resources/HSShrink@3x.png -------------------------------------------------------------------------------- /Rotation.xm: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | #import "SBIconController.h" 3 | #import "SBIconListModel.h" 4 | #import "SBIconListView.h" 5 | #import "SBRootFolderController.h" 6 | 7 | static inline BOOL IsIconLayoutOrientationIndependent() { 8 | if ([%c(SBIconListView) respondsToSelector:@selector(iconRowsForInterfaceOrientation:)]&& [%c(SBIconListView) respondsToSelector:@selector(iconColumnsForInterfaceOrientation:)]) { 9 | NSUInteger maxRowsForPortrait = [%c(SBIconListView) iconRowsForInterfaceOrientation:UIInterfaceOrientationPortrait]; 10 | NSUInteger maxRowsForLandscape = [%c(SBIconListView) iconRowsForInterfaceOrientation:UIInterfaceOrientationLandscapeRight]; 11 | NSUInteger maxColsForPortrait = [%c(SBIconListView) iconColumnsForInterfaceOrientation:UIInterfaceOrientationPortrait]; 12 | NSUInteger maxColsForLandscape = [%c(SBIconListView) iconColumnsForInterfaceOrientation:UIInterfaceOrientationLandscapeRight]; 13 | if (maxRowsForPortrait == maxRowsForLandscape && maxColsForPortrait == maxColsForLandscape) { 14 | return YES; 15 | } 16 | } else { 17 | SBIconController *iconController = [%c(SBIconController) sharedInstance]; 18 | SBRootFolderController *rootFolderController = [iconController _rootFolderController]; 19 | if ([rootFolderController respondsToSelector:@selector(iconModel)]) { 20 | SBHIconModel *iconModel = [rootFolderController iconModel]; 21 | NSUInteger maxRowsForPortrait = [iconModel maxRowCountForListInRootFolderWithInterfaceOrientation:UIInterfaceOrientationPortrait]; 22 | NSUInteger maxRowsForLandscape = [iconModel maxRowCountForListInRootFolderWithInterfaceOrientation:UIInterfaceOrientationLandscapeRight]; 23 | NSUInteger maxColsForPortrait = [iconModel maxColumnCountForListInRootFolderWithInterfaceOrientation:UIInterfaceOrientationPortrait]; 24 | NSUInteger maxColsForLandscape = [iconModel maxColumnCountForListInRootFolderWithInterfaceOrientation:UIInterfaceOrientationLandscapeRight]; 25 | if (maxRowsForPortrait == maxRowsForLandscape && maxColsForPortrait == maxColsForLandscape) { 26 | return YES; 27 | } 28 | } 29 | } 30 | return NO; 31 | } 32 | 33 | // disable homescreen rotation if needed 34 | %hook SpringBoard 35 | -(BOOL)homeScreenSupportsRotation { // iOS 8 - 13 36 | UIUserInterfaceIdiom userInterfaceIdiom = [UIDevice currentDevice].userInterfaceIdiom; 37 | if (userInterfaceIdiom == UIUserInterfaceIdiomPhone && !IsIconLayoutOrientationIndependent()) { 38 | return NO; 39 | } 40 | return %orig(); 41 | } 42 | 43 | -(NSInteger)homeScreenRotationStyle { // iOS 8 - 13 44 | UIUserInterfaceIdiom userInterfaceIdiom = [UIDevice currentDevice].userInterfaceIdiom; 45 | if (userInterfaceIdiom == UIUserInterfaceIdiomPhone && !IsIconLayoutOrientationIndependent()) { 46 | return 0; 47 | } 48 | return %orig(); 49 | } 50 | %end -------------------------------------------------------------------------------- /SBAccessoryBoxViews.xm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetResources.h" 2 | 3 | %group iOS11Plus 4 | %subclass SBExpandBoxView : SBXCloseBoxView 5 | +(id)defaultContentImage { 6 | return [HSWidgetResources imageNamed:HSWidgetExpandImageName]; 7 | } 8 | %end 9 | 10 | %subclass SBShrinkBoxView : SBXCloseBoxView 11 | +(id)defaultContentImage { 12 | return [HSWidgetResources imageNamed:HSWidgetShrinkImageName]; 13 | } 14 | %end 15 | 16 | %subclass SBSettingsBoxView : SBXCloseBoxView 17 | +(id)defaultContentImage { 18 | return [HSWidgetResources imageNamed:HSWidgetSettingsImageName]; 19 | } 20 | %end 21 | %end 22 | 23 | %ctor { 24 | if (%c(SBXCloseBoxView)) { 25 | %init(iOS11Plus); 26 | } 27 | } -------------------------------------------------------------------------------- /SBIconListModel.xm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetViewController.h" 2 | #import "SBIconListModel.h" 3 | 4 | %hook SBIconListModel 5 | %property (nonatomic, assign) PageType pageLayoutType; // PageType enum 6 | %property (nonatomic, retain) NSMutableArray *widgetViewControllers; 7 | 8 | -(instancetype)initWithFolder:(id)arg1 maxIconCount:(NSUInteger)arg2 { // iOS 10 - 12 9 | self = %orig(arg1, arg2); 10 | if (self != nil) { 11 | self.pageLayoutType = PageTypeNone; 12 | self.widgetViewControllers = nil; 13 | } 14 | return self; 15 | } 16 | 17 | -(instancetype)initWithUniqueIdentifier:(id)arg1 folder:(id)arg2 maxIconCount:(NSUInteger)arg3 { // iOS 13 18 | self = %orig(arg1, arg2, arg3); 19 | if (self != nil) { 20 | self.pageLayoutType = PageTypeNone; 21 | self.widgetViewControllers = nil; 22 | } 23 | return self; 24 | } 25 | 26 | -(BOOL)addIcon:(id)arg1 asDirty:(BOOL)arg2 { 27 | BOOL result = %orig(arg1, arg2); 28 | [[NSNotificationCenter defaultCenter] postNotificationName:HSWidgetAvailableSpaceDidChangeNotification object:nil userInfo:nil]; 29 | return result; 30 | } 31 | 32 | -(void)removeIconAtIndex:(NSUInteger)arg1 { 33 | %orig(arg1); 34 | 35 | [[NSNotificationCenter defaultCenter] postNotificationName:HSWidgetAvailableSpaceDidChangeNotification object:nil userInfo:nil]; 36 | } 37 | 38 | -(void)dealloc { 39 | if (self.widgetViewControllers != nil) { 40 | for (HSWidgetViewController *widgetViewController in self.widgetViewControllers) { 41 | [widgetViewController _setDelegate:nil]; 42 | [widgetViewController.view removeFromSuperview]; 43 | [widgetViewController release]; 44 | } 45 | self.widgetViewControllers = nil; 46 | } 47 | 48 | %orig(); 49 | } 50 | %end -------------------------------------------------------------------------------- /api/HSModernWidgetViewController.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetViewController.h" 2 | 3 | NS_ASSUME_NONNULL_BEGIN 4 | 5 | @interface HSModernWidgetViewController : HSWidgetViewController 6 | @property (nonatomic, retain, nullable) UIVisualEffectView *blurView; 7 | @property (nonatomic, retain, nullable) UILabel *titleLabel; 8 | @property (nonatomic, readonly, nullable) UIView *contentView; 9 | @property (nonatomic, assign) BOOL isExpanded; 10 | +(HSWidgetSize)minimumSize; 11 | +(NSInteger)allowedInstancesPerPage; 12 | -(instancetype)initForWidgetFrame:(HSWidgetFrame)frame withOptions:(nullable NSDictionary *)options NS_REQUIRES_SUPER; 13 | -(CGRect)calculatedFrame; 14 | -(void)setCornerRadius:(CGFloat)cornerRadius; 15 | -(BOOL)isAccessoryTypeEnabled:(AccessoryType)accessory; 16 | -(void)accessoryTypeTapped:(AccessoryType)accessory; 17 | -(void)expandWidget; 18 | -(void)shrinkWidget; 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /api/HSWidgetAddNewAdditionalOptionsDelegate.h: -------------------------------------------------------------------------------- 1 | @protocol HSWidgetAdditionalOptions; 2 | 3 | @protocol HSWidgetAddNewAdditionalOptionsDelegate 4 | -(void)dismissAddWidget; 5 | -(void)additionalOptionsViewController:(id)additionalOptionsViewController addWidgetForClass:(Class)widgetClass; 6 | @end 7 | -------------------------------------------------------------------------------- /api/HSWidgetAdditionalOptions.h: -------------------------------------------------------------------------------- 1 | @protocol HSWidgetAddNewAdditionalOptionsDelegate; 2 | @class HSWidgetAvailablePositionObject; 3 | 4 | struct HSWidgetSize; 5 | 6 | @protocol HSWidgetAdditionalOptions 7 | @required 8 | @property (nonatomic, retain) Class widgetClass; 9 | @property (nonatomic, retain) NSMutableDictionary *widgetOptions; 10 | @property (nonatomic, assign) HSWidgetSize requestWidgetSize; 11 | @property (nonatomic, assign) id delegate; 12 | @optional 13 | -(instancetype)initWithWidgetsOptionsToExclude:(NSArray *)optionsToExclude withDelegate:(id)delegate availablePositions:(NSArray *)positions; 14 | @end 15 | -------------------------------------------------------------------------------- /api/HSWidgetAdditionalOptionsViewController.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetAdditionalOptions.h" 2 | #import "HSWidgetAddNewAdditionalOptionsDelegate.h" 3 | #import "HSWidgetAvailablePositionObject.h" 4 | 5 | @interface HSWidgetAdditionalOptionsViewController : UITableViewController 6 | @property (nonatomic, retain) Class widgetClass; 7 | @property (nonatomic, retain) NSMutableDictionary *widgetOptions; 8 | @property (nonatomic, assign) HSWidgetSize requestWidgetSize; 9 | @property (nonatomic, retain) NSArray *availablePositions; 10 | @property (nonatomic, assign) id delegate; 11 | -(instancetype)initWithWidgetsOptionsToExclude:(NSArray *)optionsToExclude withDelegate:(id)delegate availablePositions:(NSArray *)positions; 12 | -(void)cancelAdditionalOptions; 13 | -(void)addWidget; 14 | -(BOOL)containsSpaceForGridPositions:(NSArray *)positions; 15 | -(BOOL)containsSpaceForWidgetSize:(HSWidgetSize)size; 16 | @end -------------------------------------------------------------------------------- /api/HSWidgetAdditionalOptionsViewController.mm: -------------------------------------------------------------------------------- 1 | #import "HSWidget-Availability.h" 2 | #import "HSWidgetAdditionalOptionsViewController.h" 3 | #import "HSWidgetAvailablePositionObject.h" 4 | #import "HSWidgetViewController.h" 5 | 6 | @implementation HSWidgetAdditionalOptionsViewController 7 | -(instancetype)initWithWidgetsOptionsToExclude:(NSArray *)optionsToExclude withDelegate:(id)delegate availablePositions:(NSArray *)positions { 8 | #pragma clang diagnostic push 9 | #pragma clang diagnostic ignored "-Wunguarded-availability-new" 10 | self = [super initWithStyle:isAtLeastiOS13() ? UITableViewStyleInsetGrouped : UITableViewStyleGrouped]; 11 | #pragma clang diagnostic pop 12 | if (self != nil) { 13 | self.delegate = delegate; 14 | self.widgetClass = nil; 15 | self.widgetOptions = [NSMutableDictionary dictionary]; 16 | self.requestWidgetSize = HSWidgetSizeZero; 17 | self.availablePositions = positions; 18 | } 19 | return self; 20 | } 21 | 22 | -(void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | // hide the scroll indicators 26 | [self.tableView setShowsHorizontalScrollIndicator:NO]; 27 | [self.tableView setShowsVerticalScrollIndicator:NO]; 28 | 29 | if ([self.widgetClass isSubclassOfClass:[HSWidgetViewController class]]) { 30 | self.navigationItem.title = [self.widgetClass widgetDisplayInfo][HSWidgetDisplayNameKey]; 31 | } 32 | } 33 | 34 | -(void)cancelAdditionalOptions { 35 | // perform actions when additional options is cancelled 36 | [self.delegate dismissAddWidget]; 37 | } 38 | 39 | -(void)addWidget { 40 | // perform actions when additional options is added/done 41 | [self.delegate additionalOptionsViewController:self addWidgetForClass:self.widgetClass]; 42 | } 43 | 44 | -(BOOL)containsSpaceForGridPositions:(NSArray *)positions { 45 | return [HSWidgetGridPositionConverterCache canFitWidget:positions inGridPositions:self.availablePositions]; 46 | } 47 | 48 | -(BOOL)containsSpaceForWidgetSize:(HSWidgetSize)size { 49 | return [HSWidgetGridPositionConverterCache canFitWidgetOfSize:size inGridPositions:self.availablePositions]; 50 | } 51 | 52 | -(void)dealloc { 53 | self.delegate = nil; 54 | self.widgetClass = nil; 55 | self.widgetOptions = nil; 56 | self.availablePositions = nil; 57 | 58 | [super dealloc]; 59 | } 60 | @end -------------------------------------------------------------------------------- /api/HSWidgetCombinedAdditionalOptionsAndPreferencesViewController.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetAdditionalOptions.h" 2 | #import "HSWidgetAddNewAdditionalOptionsDelegate.h" 3 | #import "HSWidgetPreferencesListController.h" 4 | 5 | @interface HSWidgetCombinedAdditionalOptionsAndPreferencesViewController : HSWidgetPreferencesListController 6 | @property (nonatomic, retain) Class widgetClass; 7 | @property (nonatomic, retain) NSMutableDictionary *widgetOptions; 8 | @property (nonatomic, assign) HSWidgetSize requestWidgetSize; 9 | @property (nonatomic, assign) id delegate; 10 | -(void)cancelAdditionalOptions; 11 | -(void)addWidget; 12 | -(BOOL)containsSpaceForGridPositions:(NSArray *)positions; 13 | -(BOOL)containsSpaceForWidgetSize:(HSWidgetSize)size; 14 | @end -------------------------------------------------------------------------------- /api/HSWidgetDelegate.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @class HSWidgetViewController; 4 | 5 | @protocol HSWidgetDelegate 6 | @required 7 | -(void)closeTapped:(HSWidgetViewController *)widgetViewController; 8 | -(void)settingsTapped:(HSWidgetViewController *)widgetViewController; 9 | -(void)widgetOptionsChanged:(HSWidgetViewController *)widgetViewController; 10 | -(BOOL)canDragWidget:(HSWidgetViewController *)widgetViewController; 11 | -(void)setDraggingWidget:(HSWidgetViewController *)widgetViewController; 12 | -(void)widgetDragged:(HSWidgetViewController *)widgetViewController toPoint:(CGPoint)point; 13 | -(BOOL)canWidget:(HSWidgetViewController *)widgetViewController expandOrShrinkToGridPositions:(NSArray *)positions; 14 | -(void)updatePageForExpandOrShrinkOfWidget:(HSWidgetViewController *)widgetViewController toGridPositions:(NSArray *)positions; 15 | -(HSWidgetPosition)widgetOriginForWidgetSize:(HSWidgetSize)size withPreferredOrigin:(HSWidgetPosition)position; 16 | @end -------------------------------------------------------------------------------- /api/HSWidgetPreferences.h: -------------------------------------------------------------------------------- 1 | @class HSWidgetAvailablePositionObject, HSWidgetViewController; 2 | 3 | @protocol HSWidgetPreferences 4 | @required 5 | @property (nonatomic, retain) HSWidgetViewController *widgetViewController; 6 | @property (nonatomic, retain) NSArray *availablePositions; 7 | -(instancetype)initWithWidgetViewController:(HSWidgetViewController *)widgetViewController availablePositions:(NSArray *)positions; 8 | @end 9 | -------------------------------------------------------------------------------- /api/HSWidgetPreferencesListController.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetAvailablePositionObject.h" 2 | #import "HSWidgetPreferences.h" 3 | #import "HSWidgetViewController.h" 4 | #import 5 | #import 6 | 7 | @interface HSWidgetPreferencesListController : PSListController 8 | @property (nonatomic, retain) HSWidgetViewController *widgetViewController; 9 | @property (nonatomic, retain) NSArray *availablePositions; 10 | -(void)resetAllSettings; 11 | -(id)readPreferenceValue:(PSSpecifier *)specifier; 12 | -(void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier; 13 | -(void)resetWidgetOptions; 14 | -(id)readWidgetOptionsValue:(PSSpecifier *)specifier; 15 | -(void)setWidgetOptionsValue:(id)value specifier:(PSSpecifier *)specifier; 16 | -(void)resetUserDefaults; 17 | -(id)readUserDefaultsValue:(PSSpecifier *)specifier; 18 | -(void)setUserDefaultsValue:(id)value specifier:(PSSpecifier *)specifier; 19 | -(void)resetFileValues; 20 | -(id)readFileValue:(PSSpecifier *)specifier; 21 | -(void)setFileValue:(id)value specifier:(PSSpecifier *)specifier; 22 | -(BOOL)containsSpaceForGridPositions:(NSArray *)positions; 23 | -(BOOL)containsSpaceForWidgetSize:(HSWidgetSize)size; 24 | @end -------------------------------------------------------------------------------- /api/HSWidgetResources.h: -------------------------------------------------------------------------------- 1 | NS_ASSUME_NONNULL_BEGIN 2 | 3 | extern NSString *const HSWidgetDomain; 4 | 5 | extern NSString *const HSWidgetExpandImageName; 6 | extern NSString *const HSWidgetShrinkImageName; 7 | extern NSString *const HSWidgetSettingsImageName; 8 | extern NSString *const HSWidgetPlaceholderImageName; 9 | extern NSString *const HSWidgetPlaceholderShapeImageName; 10 | 11 | extern NSString *const HSWidgetBezierShapeChangedNotification; 12 | extern NSString *const HSWidgetBezierShapeKey; 13 | extern NSString *const HSWidgetBezierShapeEnumKey; 14 | extern NSString *const HSWidgetBezierShapeDisplayNameKey; 15 | 16 | typedef NS_ENUM(NSUInteger, HSWidgetBezierShape) { 17 | HSWidgetBezierShapeDefault = 0, 18 | HSWidgetBezierShapeCustom, 19 | HSWidgetBezierShapeRoundedRect, 20 | HSWidgetBezierShapeRect, 21 | HSWidgetBezierShapeCircle, 22 | HSWidgetBezierShapeTriangle, 23 | HSWidgetBezierShapeStar 24 | }; 25 | 26 | @interface HSWidgetResources : NSObject 27 | +(nullable UIImage *)imageNamed:(NSString *)name; 28 | +(NSArray *)allBezierShapes; 29 | +(nullable UIBezierPath *)bezierPathForRect:(CGRect)rect withShape:(HSWidgetBezierShape)shape lineThickness:(CGFloat)thickness; 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /api/HSWidgetUnclippedView.h: -------------------------------------------------------------------------------- 1 | // used so that accessories outside the widget can still be tapped 2 | @interface HSWidgetUnclippedView : UIView 3 | @end 4 | -------------------------------------------------------------------------------- /api/HSWidgetUnclippedView.mm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetUnclippedView.h" 2 | 3 | @implementation HSWidgetUnclippedView 4 | -(instancetype)init { 5 | self = [super init]; 6 | self.clipsToBounds = NO; 7 | return self; 8 | } 9 | 10 | -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 11 | // override the hit test only if the point is outside the view's bounds (unclip the bounds for event) 12 | if (!CGRectContainsPoint(self.bounds, point)) { 13 | for (UIView *subview in [[self subviews] reverseObjectEnumerator]) { 14 | if (subview.hidden || subview.alpha == 0 || !subview.userInteractionEnabled) { 15 | continue; 16 | } 17 | 18 | CGPoint convertedPoint = [self convertPoint:point toView:subview]; 19 | if ([subview isKindOfClass:[HSWidgetUnclippedView class]]) { 20 | UIView *subviewHitTest = [subview hitTest:convertedPoint withEvent:event]; 21 | if (subviewHitTest != nil) { 22 | return subviewHitTest; 23 | } 24 | } else if (CGRectContainsPoint(subview.bounds, convertedPoint)) { 25 | return subview; 26 | } 27 | } 28 | } 29 | return [super hitTest:point withEvent:event]; 30 | } 31 | @end -------------------------------------------------------------------------------- /api/HSWidgets.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | -------------------------------------------------------------------------------- /api/core/HSWidgetAvailablePositionObject.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetPositionObject.h" 2 | 3 | @interface HSWidgetAvailablePositionObject : HSWidgetPositionObject 4 | @property (nonatomic, assign) BOOL containsIcon; 5 | +(instancetype)objectWithAvailableWidgetPosition:(HSWidgetPosition)position containingIcon:(BOOL)containsIcon; 6 | -(instancetype)initWithAvailableWidgetPosition:(HSWidgetPosition)position containingIcon:(BOOL)containsIcon; 7 | @end 8 | -------------------------------------------------------------------------------- /api/core/HSWidgetAvailablePositionObject.mm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetAvailablePositionObject.h" 2 | 3 | @implementation HSWidgetAvailablePositionObject 4 | +(instancetype)objectWithAvailableWidgetPosition:(HSWidgetPosition)position containingIcon:(BOOL)containsIcon { 5 | return [[[self alloc] initWithAvailableWidgetPosition:position containingIcon:containsIcon] autorelease]; 6 | } 7 | 8 | -(instancetype)initWithAvailableWidgetPosition:(HSWidgetPosition)position containingIcon:(BOOL)containsIcon { 9 | self = [super initWithWidgetPosition:position]; 10 | self.containsIcon = containsIcon; 11 | return self; 12 | } 13 | 14 | -(instancetype)copyWithZone:(NSZone *)zone { 15 | return [[[self class] allocWithZone:zone] initWithAvailableWidgetPosition:self.position containingIcon:self.containsIcon]; 16 | } 17 | 18 | -(NSString *)description { 19 | return [NSString stringWithFormat:@"(%zu, %zu) %@ icon", self.position.row, self.position.col, self.containsIcon ? @"contains" : @"does not contain"]; 20 | } 21 | @end 22 | -------------------------------------------------------------------------------- /api/core/HSWidgetFrameObject.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @interface HSWidgetFrameObject : NSObject 4 | @property (nonatomic, assign) HSWidgetFrame frame; 5 | @property (nonatomic, assign) HSWidgetPosition origin; 6 | @property (nonatomic, assign) HSWidgetSize size; 7 | +(instancetype)objectWithWidgetFrame:(HSWidgetFrame)frame; 8 | -(instancetype)initWithWidgetFrame:(HSWidgetFrame)frame; 9 | -(BOOL)isEqualToWidgetFrameObject:(HSWidgetFrameObject *)object; 10 | -(BOOL)isEqual:(id)object; 11 | @end 12 | -------------------------------------------------------------------------------- /api/core/HSWidgetFrameObject.mm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetFrameObject.h" 2 | 3 | @implementation HSWidgetFrameObject 4 | +(instancetype)objectWithWidgetFrame:(HSWidgetFrame)frame { 5 | return [[[self alloc] initWithWidgetFrame:frame] autorelease]; 6 | } 7 | 8 | -(instancetype)initWithWidgetFrame:(HSWidgetFrame)frame { 9 | self = [super init]; 10 | self.frame = frame; 11 | return self; 12 | } 13 | 14 | -(instancetype)copyWithZone:(NSZone *)zone { 15 | return [[[self class] allocWithZone:zone] initWithWidgetFrame:self.frame]; 16 | } 17 | 18 | -(HSWidgetPosition)origin 19 | { 20 | return self.frame.origin; 21 | } 22 | 23 | -(void)setOrigin:(HSWidgetPosition)origin { 24 | self.frame = HSWidgetFrameMake(origin, self.frame.size); 25 | } 26 | 27 | -(HSWidgetSize)size 28 | { 29 | return self.frame.size; 30 | } 31 | 32 | -(void)setSize:(HSWidgetSize)size { 33 | self.frame = HSWidgetFrameMake(self.frame.origin, size); 34 | } 35 | 36 | -(BOOL)isEqualToWidgetFrameObject:(HSWidgetFrameObject *)object { 37 | return HSWidgetFrameEqualsFrame(self.frame, object.frame); 38 | } 39 | 40 | -(BOOL)isEqual:(id)object { 41 | if ([object isKindOfClass:[HSWidgetFrameObject class]]) 42 | return [self isEqualToWidgetFrameObject:object]; 43 | return [super isEqual:object]; 44 | } 45 | 46 | -(NSString *)description { 47 | return [NSString stringWithFormat:@"(%zu, %zu, %zu, %zu)", self.frame.origin.row, self.frame.origin.col, self.frame.size.numRows, self.frame.size.numCols]; 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /api/core/HSWidgetGridPositionConverterCache.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetPositionObject.h" 2 | #import "HSWidgetAvailablePositionObject.h" 3 | 4 | struct HSWidgetSize; 5 | struct HSWidgetFrame; 6 | 7 | @interface HSWidgetGridPositionConverterCache : NSObject 8 | +(NSMutableArray *)gridPositionsForWidgetFrame:(HSWidgetFrame)frame; 9 | +(HSWidgetPosition)originForWidgetOfSize:(HSWidgetSize)size inGridPositions:(NSArray *)positions; 10 | +(BOOL)canFitWidgetOfSize:(HSWidgetSize)size inGridPositions:(NSArray *)positions; 11 | +(BOOL)canFitWidget:(NSArray *)widgetPositions inGridPositions:(NSArray *)positions; 12 | @end 13 | -------------------------------------------------------------------------------- /api/core/HSWidgetPositionObject.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @interface HSWidgetPositionObject : NSObject 4 | @property (nonatomic, assign) HSWidgetPosition position; 5 | @property (nonatomic, assign, getter=row, setter=setRow:) NSUInteger row; 6 | @property (nonatomic, assign, getter=col, setter=setCol:) NSUInteger col; 7 | +(instancetype)objectWithWidgetPosition:(HSWidgetPosition)position; 8 | -(instancetype)initWithWidgetPosition:(HSWidgetPosition)position; 9 | -(BOOL)isEqualToWidgetPositionObject:(HSWidgetPositionObject *)object; 10 | -(BOOL)isEqual:(id)object; 11 | @end 12 | -------------------------------------------------------------------------------- /api/core/HSWidgetPositionObject.mm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetPositionObject.h" 2 | 3 | @implementation HSWidgetPositionObject 4 | +(instancetype)objectWithWidgetPosition:(HSWidgetPosition)position { 5 | return [[[self alloc] initWithWidgetPosition:position] autorelease]; 6 | } 7 | 8 | -(instancetype)initWithWidgetPosition:(HSWidgetPosition)position { 9 | self = [super init]; 10 | self.position = position; 11 | return self; 12 | } 13 | 14 | -(instancetype)copyWithZone:(NSZone *)zone { 15 | return [[[self class] allocWithZone:zone] initWithWidgetPosition:self.position]; 16 | } 17 | 18 | -(NSUInteger)row { 19 | return self.position.row; 20 | } 21 | 22 | -(void)setRow:(NSUInteger)row { 23 | self.position = HSWidgetPositionMake(row, self.position.col); 24 | } 25 | 26 | -(NSUInteger)col { 27 | return self.position.col; 28 | } 29 | 30 | -(void)setCol:(NSUInteger)col { 31 | self.position = HSWidgetPositionMake(self.position.row, col); 32 | } 33 | 34 | -(BOOL)isEqualToWidgetPositionObject:(HSWidgetPositionObject *)object { 35 | return HSWidgetPositionEqualsPosition(self.position, object.position); 36 | } 37 | 38 | -(BOOL)isEqual:(id)object { 39 | if ([object isKindOfClass:[HSWidgetPositionObject class]]) 40 | return [self isEqualToWidgetPositionObject:object]; 41 | return [super isEqual:object]; 42 | } 43 | 44 | -(NSString *)description { 45 | return [NSString stringWithFormat:@"(%zu, %zu)", self.position.row, self.position.col]; 46 | } 47 | @end 48 | -------------------------------------------------------------------------------- /api/core/HSWidgetSizeObject.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @interface HSWidgetSizeObject : NSObject 4 | @property (nonatomic, assign) HSWidgetSize size; 5 | @property (nonatomic, assign) NSUInteger numRows; 6 | @property (nonatomic, assign) NSUInteger numCols; 7 | +(instancetype)objectWithWidgetSize:(HSWidgetSize)size; 8 | -(instancetype)initWithWidgetSize:(HSWidgetSize)size; 9 | -(BOOL)isEqualToWidgetSizeObject:(HSWidgetSizeObject *)object; 10 | -(BOOL)isEqual:(id)object; 11 | @end 12 | -------------------------------------------------------------------------------- /api/core/HSWidgetSizeObject.mm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetSizeObject.h" 2 | 3 | @implementation HSWidgetSizeObject 4 | +(instancetype)objectWithWidgetSize:(HSWidgetSize)size { 5 | return [[[self alloc] initWithWidgetSize:size] autorelease]; 6 | } 7 | 8 | -(instancetype)initWithWidgetSize:(HSWidgetSize)size { 9 | self = [super init]; 10 | self.size = size; 11 | return self; 12 | } 13 | 14 | -(instancetype)copyWithZone:(NSZone *)zone { 15 | return [[[self class] allocWithZone:zone] initWithWidgetSize:self.size]; 16 | } 17 | 18 | -(NSUInteger)numRows { 19 | return self.size.numRows; 20 | } 21 | 22 | -(void)setNumRows:(NSUInteger)numRows { 23 | self.size = HSWidgetSizeMake(numRows, self.size.numCols); 24 | } 25 | 26 | -(NSUInteger)numCols { 27 | return self.size.numCols; 28 | } 29 | 30 | -(void)setNumCols:(NSUInteger)numCols { 31 | self.size = HSWidgetSizeMake(self.size.numCols, numCols); 32 | } 33 | 34 | -(BOOL)isEqualToWidgetSizeObject:(HSWidgetSizeObject *)object { 35 | return HSWidgetSizeEqualsSize(self.size, object.size); 36 | } 37 | 38 | -(BOOL)isEqual:(id)object { 39 | if ([object isKindOfClass:[HSWidgetSizeObject class]]) 40 | return [self isEqualToWidgetSizeObject:object]; 41 | return [super isEqual:object]; 42 | } 43 | 44 | -(NSString *)description { 45 | return [NSString stringWithFormat:@"(%zu, %zu)", self.size.numRows, self.size.numCols]; 46 | } 47 | @end 48 | -------------------------------------------------------------------------------- /api/core/HSWidgets-core.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | #import "HSWidgetPositionObject.h" 3 | #import "HSWidgetAvailablePositionObject.h" 4 | #import "HSWidgetSizeObject.h" 5 | #import "HSWidgetFrameObject.h" 6 | #import "HSWidgetGridPositionConverterCache.h" 7 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.dgh0st.hswidgets 2 | Name: HSWidgets 3 | Depends: mobilesubstrate 4 | Version: 0.3 5 | Architecture: iphoneos-arm 6 | Description: Add today widgets or custom widgets to home screen. 7 | Maintainer: DGh0st 8 | Author: DGh0st 9 | Section: Tweaks 10 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetAvailablePositionObject/containsIcon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetAvailablePositionObject - containsIcon 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetDirection/HSWidgetDirectionDown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetDirection - HSWidgetDirectionDown 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetDirection/HSWidgetDirectionLeft.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetDirection - HSWidgetDirectionLeft 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetDirection/HSWidgetDirectionNone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetDirection - HSWidgetDirectionNone 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetDirection/HSWidgetDirectionRight.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetDirection - HSWidgetDirectionRight 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetDirection/HSWidgetDirectionUp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetDirection - HSWidgetDirectionUp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetFrame/HSWidgetFrameZero.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetFrame - HSWidgetFrameZero 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetGridPositionConverterCache/css/gridPositionsForWidgetFrame.css: -------------------------------------------------------------------------------- 1 | .widgetFrameGraph { 2 | display: grid; 3 | grid-template-columns: 80px 80px 80px 80px; 4 | grid-template-rows: 80px 80px 80px 80px; 5 | grid-gap: 8px; 6 | 7 | justify-content: center; 8 | } 9 | 10 | .widgetFrameGraph div { 11 | background-color: #272822; /* gray */ 12 | opacity: 0.33; 13 | 14 | display: flex; 15 | justify-content: center; 16 | align-items: center; 17 | text-align: center; 18 | -moz-text-align: center; 19 | } 20 | 21 | div.widgetframe { 22 | grid-row-start: 2; 23 | grid-column-start: 1; 24 | grid-row-end: 5; 25 | grid-column-end: 3; 26 | opacity: unset; 27 | } 28 | 29 | .convertChevron { 30 | width: 100%; 31 | font-size: 40px; 32 | text-align: center; 33 | padding: 20px 0px 20px 0px; 34 | } 35 | 36 | .widgetPositions { 37 | display: grid; 38 | grid-template-columns: repeat(auto-fit, 80px); 39 | grid-gap: 8px; 40 | 41 | justify-content: center; 42 | } 43 | 44 | .widgetPositions div { 45 | background-color: #272822; /* gray */ 46 | 47 | width: 80px; 48 | height: 80px; 49 | 50 | display: inline-flex; 51 | justify-content: center; 52 | align-items: center; 53 | text-align: center; 54 | -moz-text-align: center; 55 | } -------------------------------------------------------------------------------- /docs/Core/HSWidgetPosition/HSWidgetPositionZero.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetPosition - HSWidgetPositionZero 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/HSWidgetSize/HSWidgetSizeZero.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetSize - HSWidgetSizeZero 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Core/css/HSWidgetDirection.css: -------------------------------------------------------------------------------- 1 | .directionGraph { 2 | display: grid; 3 | grid-template-columns: 80px 80px 80px; 4 | grid-template-rows: 80px 80px 80px; 5 | grid-gap: 8px; 6 | 7 | justify-content: center; 8 | } 9 | 10 | .directionGraph div { 11 | background-color: #272822; /* gray */ 12 | opacity: 0.33; 13 | 14 | display: flex; 15 | justify-content: center; 16 | align-items: center; 17 | text-align: center; 18 | -moz-text-align: center; 19 | } 20 | 21 | div.up, 22 | div.left, 23 | div.none, 24 | div.right, 25 | div.down { 26 | opacity: unset; 27 | } -------------------------------------------------------------------------------- /docs/Core/css/HSWidgetFrame.css: -------------------------------------------------------------------------------- 1 | .frameGraph { 2 | display: grid; 3 | grid-template-columns: 80px 80px 80px 80px; 4 | grid-template-rows: 80px 80px 80px 80px 80px; 5 | grid-gap: 8px; 6 | 7 | justify-content: center; 8 | } 9 | 10 | .frameGraph div { 11 | background-color: #272822; /* gray */ 12 | opacity: 0.33; 13 | 14 | display: flex; 15 | justify-content: center; 16 | align-items: center; 17 | text-align: center; 18 | -moz-text-align: center; 19 | } 20 | 21 | div.widgetframe { 22 | grid-row-start: 2; 23 | grid-column-start: 2; 24 | grid-row-end: 5; 25 | grid-column-end: 4; 26 | opacity: unset; 27 | } -------------------------------------------------------------------------------- /docs/Getting_Started/AccessorySquareWidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/AccessorySquareWidget.png -------------------------------------------------------------------------------- /docs/Getting_Started/BuggyExpandedSquareWidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/BuggyExpandedSquareWidget.png -------------------------------------------------------------------------------- /docs/Getting_Started/ExpandedSquareWidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/ExpandedSquareWidget.png -------------------------------------------------------------------------------- /docs/Getting_Started/ExpandedWidgetColors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/ExpandedWidgetColors.png -------------------------------------------------------------------------------- /docs/Getting_Started/PillRedSquareWidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/PillRedSquareWidget.png -------------------------------------------------------------------------------- /docs/Getting_Started/RedSquareWidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/RedSquareWidget.png -------------------------------------------------------------------------------- /docs/Getting_Started/RoundedRedSquareWidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/RoundedRedSquareWidget.png -------------------------------------------------------------------------------- /docs/Getting_Started/WidgetAdditionalOptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/WidgetAdditionalOptions.png -------------------------------------------------------------------------------- /docs/Getting_Started/WidgetSettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/WidgetSettings.png -------------------------------------------------------------------------------- /docs/Getting_Started/WidgetSettingsAccessory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/docs/Getting_Started/WidgetSettingsAccessory.png -------------------------------------------------------------------------------- /docs/Preferences/HSWidgetPreferencesListController/resetAllSettings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetPreferencesListController - resetAllSettings 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/Preferences/HSWidgetPreferencesListController/resetFileValues.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetPreferencesListController - resetFileValues 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /docs/User_Interface/HSWidgetUnclippedView.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetUnclippedView 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 32 | 33 | 34 | 42 | 43 | 44 | 54 |
55 | 56 | 57 | 63 | 64 | 65 |
66 |

67 |
68 | 69 | -------------------------------------------------------------------------------- /docs/User_Interface/HSWidgetViewController/_delegate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HSWidgetViewController - _delegate 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 |
27 | 34 | 35 | 36 | 44 | 45 | 46 | 56 |
57 | 58 | 59 | 65 | 66 | 67 |
68 |

69 |
70 | 71 | -------------------------------------------------------------------------------- /editing/HSAddNewWidgetDelegate.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-core.h" 2 | 3 | @protocol HSAddNewWidgetDelegate 4 | @required 5 | -(CGRect)rectForWidgetPosition:(HSWidgetPosition)position; 6 | -(void)addNewWidgetTappedForPosition:(HSWidgetPosition)position; 7 | @end 8 | -------------------------------------------------------------------------------- /editing/HSAddNewWidgetPositionView.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-core.h" 2 | #import "HSAddNewWidgetPositionViewDelegate.h" 3 | #import "HSWidgetResources.h" 4 | 5 | __attribute__((visibility("hidden"))) 6 | @interface HSAddNewWidgetPositionView : UIView { 7 | @private 8 | id _delegate; 9 | } 10 | @property (nonatomic, retain) HSWidgetPositionObject *position; 11 | @property (nonatomic, assign) HSWidgetBezierShape bezierShape; 12 | -(instancetype)initWithWidgetPosition:(HSWidgetPositionObject *)position; 13 | -(void)setDelegate:(id)delegate; 14 | @end 15 | -------------------------------------------------------------------------------- /editing/HSAddNewWidgetPositionView.mm: -------------------------------------------------------------------------------- 1 | #import "HSAddNewWidgetPositionView.h" 2 | 3 | @interface HSAddNewWidgetPositionView () 4 | @property (nonatomic, assign) BOOL _isTouchDown; 5 | @property (nonatomic, assign) BOOL _isTouchInside; 6 | @end 7 | 8 | @implementation HSAddNewWidgetPositionView 9 | -(instancetype)initWithWidgetPosition:(HSWidgetPositionObject *)position { 10 | self = [self init]; 11 | if (self != nil) { 12 | _delegate = nil; 13 | self._isTouchDown = NO; 14 | self._isTouchInside = NO; 15 | self.position = position; 16 | self.backgroundColor = [UIColor clearColor]; 17 | self.tintColor = [UIColor whiteColor]; 18 | self.bezierShape = HSWidgetBezierShapeDefault; 19 | 20 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_bezierShapeChanged) name:HSWidgetBezierShapeChangedNotification object:nil]; 21 | } 22 | return self; 23 | } 24 | 25 | -(void)_bezierShapeChanged { 26 | // foce widget relayout 27 | [self setNeedsDisplay]; 28 | } 29 | 30 | -(void)setDelegate:(id)delegate { 31 | _delegate = delegate; 32 | } 33 | 34 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 35 | self._isTouchDown = YES; 36 | self._isTouchInside = YES; 37 | [self setNeedsDisplay]; 38 | } 39 | 40 | -(void)touchesMoved:(NSSet *)touches withEvent:(id)event { 41 | if (self._isTouchDown) { 42 | CGPoint point = [[touches anyObject] locationInView:self]; 43 | self._isTouchInside = [self pointInside:point withEvent:event]; 44 | [self setNeedsDisplay]; 45 | } 46 | } 47 | 48 | -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 49 | if (self._isTouchDown) { 50 | self._isTouchInside = NO; 51 | 52 | CGPoint point = [[touches anyObject] locationInView:self]; 53 | if ([self pointInside:point withEvent:event]) { 54 | [_delegate addNewWidgetPositionViewTapped:self]; 55 | } 56 | 57 | [self setNeedsDisplay]; 58 | } 59 | } 60 | 61 | -(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { 62 | if (self._isTouchDown) { 63 | self._isTouchDown = NO; 64 | self._isTouchInside = NO; 65 | [self setNeedsDisplay]; 66 | } 67 | } 68 | 69 | -(void)drawRect:(CGRect)arg1 { 70 | if (arg1.size.width > 0 && arg1.size.height > 0) { 71 | @autoreleasepool { 72 | CGFloat lineWidth = 2.0; 73 | UIBezierPath *borderPath = [HSWidgetResources bezierPathForRect:self.bounds withShape:self.bezierShape lineThickness:lineWidth]; 74 | if (self._isTouchInside) { 75 | [[self.tintColor colorWithAlphaComponent:0.25] setFill]; 76 | } else { 77 | [[UIColor clearColor] setFill]; 78 | } 79 | [borderPath fill]; 80 | 81 | borderPath.lineWidth = lineWidth; 82 | CGFloat dashedLines[2] = {15.0, 5.0}; 83 | [borderPath setLineDash:dashedLines count:2 phase:0.0]; 84 | [[self.tintColor colorWithAlphaComponent:0.5] setStroke]; 85 | [borderPath stroke]; 86 | } 87 | } 88 | } 89 | 90 | -(void)dealloc { 91 | _delegate = nil; 92 | self.position = nil; 93 | 94 | [super dealloc]; 95 | } 96 | @end -------------------------------------------------------------------------------- /editing/HSAddNewWidgetPositionViewDelegate.h: -------------------------------------------------------------------------------- 1 | @class HSAddNewWidgetPositionView; 2 | 3 | @protocol HSAddNewWidgetPositionViewDelegate 4 | @required 5 | -(void)addNewWidgetPositionViewTapped:(HSAddNewWidgetPositionView *)view; 6 | @end 7 | -------------------------------------------------------------------------------- /editing/HSAddNewWidgetView.h: -------------------------------------------------------------------------------- 1 | #import "HSAddNewWidgetPositionView.h" 2 | #import "HSAddNewWidgetDelegate.h" 3 | 4 | __attribute__((visibility("hidden"))) 5 | @interface HSAddNewWidgetView : UIView { 6 | @private 7 | id _delegate; 8 | } 9 | -(instancetype)initWithFrame:(CGRect)frame; 10 | -(void)updateAvailableSpaces:(NSArray *)availableSpaces withAnimationDuration:(CGFloat)animationDuration; 11 | -(void)setDelegate:(id)delegate; 12 | @end 13 | -------------------------------------------------------------------------------- /editing/HSAddWidgetRootViewController.h: -------------------------------------------------------------------------------- 1 | #import "HSAddWidgetSelectionDelegate.h" 2 | #import "HSWidgets-structs.h" 3 | #import "HSWidgetAddNewAdditionalOptionsDelegate.h" 4 | 5 | @class HSWidgetAvailablePositionObject; 6 | 7 | __attribute__((visibility("hidden"))) 8 | @interface HSAddWidgetRootViewController : UITableViewController { 9 | @private 10 | id _delegate; 11 | } 12 | @property (nonatomic, assign) HSWidgetPosition preferredPosition; 13 | @property (nonatomic, retain) NSArray *availablePositions; 14 | -(instancetype)initWithWidgets:(NSArray *)availableClasses insufficientSpaceWidgets:(NSArray *)insufficientSpaceClasses excludingWidgetsOptions:(NSDictionary *)excludes; 15 | -(void)setDelegate:(id)delegate; 16 | @end 17 | -------------------------------------------------------------------------------- /editing/HSAddWidgetSelectionDelegate.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @protocol HSAddWidgetSelectionDelegate 4 | @required 5 | -(void)cancelAddWidgetAnimated:(BOOL)animated; 6 | -(void)addWidgetOfClass:(Class)widgetClass withWidgetFrame:(HSWidgetFrame)widgetFrame options:(NSDictionary *)options; 7 | -(HSWidgetPosition)widgetOriginForWidgetSize:(HSWidgetSize)size withPreferredOrigin:(HSWidgetPosition)position; 8 | @end 9 | -------------------------------------------------------------------------------- /editing/HSWidgetBezierShapeDisclosureTableViewCell.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetResources.h" 2 | 3 | __attribute__((visibility("hidden"))) 4 | @interface HSWidgetBezierShapeDisclosureTableViewCell : UITableViewCell 5 | @property (nonatomic, retain) UILabel *headlineLabel; 6 | @property (nonatomic, retain) UILabel *descriptionLabel; 7 | @end 8 | -------------------------------------------------------------------------------- /editing/HSWidgetBezierShapeSelectorViewController.h: -------------------------------------------------------------------------------- 1 | @protocol HSWidgetAddNewAdditionalOptionsDelegate; 2 | 3 | __attribute__((visibility("hidden"))) 4 | @interface HSWidgetBezierShapeSelectorViewController : UITableViewController { 5 | @private 6 | id _delegate; 7 | NSArray *_bezierShapes; 8 | NSUInteger selectedBezierShapeIndex; 9 | } 10 | -(instancetype)initWithDelegate:(id)delegate; 11 | @end 12 | -------------------------------------------------------------------------------- /editing/HSWidgetBezierShapeTableViewCell.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetResources.h" 2 | 3 | __attribute__((visibility("hidden"))) 4 | @interface HSWidgetBezierShapeTableViewCell : UITableViewCell 5 | @property (nonatomic, assign, setter=setBezierShape:) HSWidgetBezierShape bezierShape; 6 | @property (nonatomic, retain) UILabel *nameLabel; 7 | @end 8 | -------------------------------------------------------------------------------- /editing/HSWidgetHeaderTableView.h: -------------------------------------------------------------------------------- 1 | #define HSWidgetAddMinimumHeaderHeight 100 2 | 3 | __attribute__((visibility("hidden"))) 4 | @interface HSWidgetHeaderTableView : UITableViewHeaderFooterView 5 | @property (nonatomic, retain) UILabel *sectionName; 6 | @property (nonatomic, retain) UILabel *sectionDescription; 7 | @end 8 | -------------------------------------------------------------------------------- /editing/HSWidgetSubtitleTableViewCell.h: -------------------------------------------------------------------------------- 1 | __attribute__((visibility("hidden"))) 2 | @interface HSWidgetSubtitleTableViewCell : UITableViewCell 3 | @end 4 | -------------------------------------------------------------------------------- /editing/HSWidgetSubtitleTableViewCell.mm: -------------------------------------------------------------------------------- 1 | #import "HSWidgetSubtitleTableViewCell.h" 2 | 3 | @implementation HSWidgetSubtitleTableViewCell 4 | -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)identifier { 5 | return [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier]; 6 | } 7 | @end -------------------------------------------------------------------------------- /hsccmodulewidget/CCSupportCompatibility.x: -------------------------------------------------------------------------------- 1 | #import "HSCCModuleController.h" 2 | 3 | #import 4 | 5 | // CCSupport compatibility 6 | %hook CCUIModuleInstanceManager 7 | -(CCUIModuleInstance *)instanceForModuleIdentifier:(NSString*)identifier { 8 | CCUIModuleInstance *moduleInstance = %orig(identifier); 9 | if (moduleInstance == nil/*|| ![[%c(SBCoverSheetPresentationManager) sharedInstance] isPresented]*/) { 10 | HSCCModuleController *moduleController = [HSCCModuleController sharedInstance]; 11 | moduleInstance = moduleController.moduleInstanceByIdentifiers[identifier] ?: moduleController.dynamicSizedModuleInstanceByIdentifiers[identifier]; 12 | 13 | // if our module controller doesn't have it then we are either requesting the widget settings of dynamic widget for first time or we are about to crash 14 | /*if (moduleInstance == nil) { 15 | NSString *reason = [NSString stringWithFormat:@"Failed to load module with %@, CCSupport 1.2.3+ is required if using along side HSWidgets", identifier]; 16 | @throw [NSException exceptionWithName:@"HSCCModuleUnableToLoadModuleException" reason:reason userInfo:@{ @"Identifier" : identifier }]; 17 | }*/ 18 | } 19 | return moduleInstance; 20 | } 21 | %end 22 | 23 | %ctor { 24 | if (dlopen("/Library/MobileSubstrate/DynamicLibraries/CCSupport.dylib", RTLD_NOW) != NULL) { 25 | %init(); 26 | } 27 | } -------------------------------------------------------------------------------- /hsccmodulewidget/HSCCModuleController.h: -------------------------------------------------------------------------------- 1 | @class CCSModuleMetadata, CCUILayoutOptions, CCUIModuleInstance, CCUIModuleInstanceManager, CCUIModuleSettings, CCUIModuleSettingsManager, HSCCModuleWidgetViewController; 2 | 3 | @interface HSCCModuleController : NSObject 4 | @property (nonatomic, retain) CCUIModuleSettingsManager *settingsManager; 5 | @property (nonatomic, retain) CCUIModuleInstanceManager *moduleInstanceManager; 6 | @property (nonatomic, retain) CCUILayoutOptions *layoutOptions; 7 | @property (nonatomic, retain) NSMutableDictionary *moduleInstanceByIdentifiers; 8 | @property (nonatomic, retain) NSMutableDictionary *dynamicSizedModuleInstanceByIdentifiers; 9 | @property (nonatomic, retain) NSBundle *ccSettingsBundle; 10 | @property (nonatomic, retain) HSCCModuleWidgetViewController *expandedModuleViewController; 11 | +(instancetype)sharedInstance; 12 | -(NSSet *)unusedModuleIdentifiers; 13 | -(CCUIModuleSettings *)moduleSettingForIdentifier:(NSString *)identifier; 14 | -(CCSModuleMetadata *)moduleMetadataForIdentifier:(NSString *)identifier; 15 | -(CCUIModuleInstance *)moduleInstanceForIdentifier:(NSString *)identifier; 16 | -(void)removeModuleInstanceForIdentifier:(NSString *)identifier; 17 | -(void)loadCCSettingsBundleIfNeeded; 18 | -(void)unloadSettingsBundle; 19 | @end 20 | -------------------------------------------------------------------------------- /hsccmodulewidget/HSCCModuleWidgetViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CCUIContentModuleContainerViewControllerDelegate.h" 3 | #import "CCUIContentModuleContextDelegate.h" 4 | 5 | @class CCUIContentModuleContainerView, CCUIContentModuleContainerViewController, CCUIModuleSettings; 6 | 7 | @interface HSCCModuleWidgetViewController : HSWidgetViewController 8 | @property (nonatomic, retain, readonly) NSString *moduleIdentifier; 9 | @property (nonatomic, retain) CCUIContentModuleContainerViewController *moduleContainerViewController; 10 | @property (nonatomic, retain) CCUIContentModuleContainerView *moduleContainerView; 11 | @property (nonatomic, retain) CCUIModuleSettings *moduleSettings; 12 | -(void)dismissExpandedModule; 13 | @end -------------------------------------------------------------------------------- /hsccmodulewidget/HSCCModulesListViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @class CCUISettingsModulesController; 5 | 6 | @interface HSCCModulesListViewController : HSWidgetAdditionalOptionsViewController { 7 | NSMutableArray *_moduleInfos; 8 | CCUISettingsModulesController *_settingsModulesController; 9 | NSDictionary *_prefsModuleInfo; 10 | } 11 | @end -------------------------------------------------------------------------------- /hsccmodulewidget/HSCCModulesListViewController.mm: -------------------------------------------------------------------------------- 1 | #import "HSCCModulesListViewController.h" 2 | #import "HSCCModuleController.h" 3 | #import "CCUILayoutSize.h" 4 | #import "CCUIModuleSettings.h" 5 | 6 | #import 7 | 8 | @implementation HSCCModulesListViewController 9 | -(instancetype)initWithWidgetsOptionsToExclude:(NSArray *)optionsToExclude withDelegate:(id)delegate availablePositions:(NSArray *)positions { 10 | self = [super initWithWidgetsOptionsToExclude:optionsToExclude withDelegate:delegate availablePositions:positions]; 11 | if (self != nil) { 12 | HSCCModuleController *moduleController = [HSCCModuleController sharedInstance]; 13 | NSSet *identifiers = [moduleController loadableModuleIdentifiers]; 14 | 15 | _moduleInfos = [[NSMutableArray alloc] initWithCapacity:identifiers.count]; 16 | for (NSString *identifier in identifiers) { 17 | CCUIModuleSettings *settings = [moduleController moduleSettingForIdentifier:identifier]; 18 | CCUILayoutSize portraitSize = [settings layoutSizeForInterfaceOrientation:UIInterfaceOrientationPortrait]; 19 | CCUILayoutSize landscapeSize =[settings layoutSizeForInterfaceOrientation:UIInterfaceOrientationLandscapeLeft]; 20 | HSWidgetSize widgetSize = HSWidgetSizeMake(MAX(portraitSize.height, landscapeSize.height), MAX(portraitSize.width, landscapeSize.width)); 21 | if ([super containsSpaceForWidgetSize:widgetSize]) { 22 | [_moduleInfos addObject:@{ 23 | @"identifier" : identifier, 24 | @"widgetSize" : [HSWidgetSizeObject objectWithWidgetSize:widgetSize] 25 | }]; 26 | } 27 | } 28 | } 29 | return self; 30 | } 31 | 32 | -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 33 | return 1; 34 | } 35 | 36 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 37 | return [_moduleInfos count]; 38 | } 39 | 40 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 41 | static NSString *const ReusableCellIdentifier = @"HSCustomCCModuleCell"; 42 | 43 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ReusableCellIdentifier]; 44 | if (cell == nil) { 45 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ReusableCellIdentifier] autorelease]; 46 | } 47 | 48 | NSDictionary *moduleInfo = [_moduleInfos objectAtIndex:indexPath.row]; 49 | cell.textLabel.text = moduleInfo[@"identifier"]; 50 | return cell; 51 | } 52 | 53 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 54 | NSDictionary *moduleInfo = [_moduleInfos objectAtIndex:indexPath.row]; 55 | self.widgetOptions[@"moduleIdentifier"] = moduleInfo[@"identifier"]; 56 | self.requestWidgetSize = ((HSWidgetSizeObject *)moduleInfo[@"widgetSize"]).size; 57 | [self addWidget]; // this begins the dismiss animation so its better to do it at the end 58 | } 59 | 60 | -(void)dealloc { 61 | [_moduleInfos release]; 62 | _moduleInfos = nil; 63 | 64 | [super dealloc]; 65 | } 66 | @end -------------------------------------------------------------------------------- /hsccmodulewidget/HSCCNotifications.h: -------------------------------------------------------------------------------- 1 | #define HSCCDisplayTurnOffNotification @"HSCCDisplayTurnOffNotification" 2 | -------------------------------------------------------------------------------- /hsccmodulewidget/HSCCNotifications.x: -------------------------------------------------------------------------------- 1 | #import "HSCCNotifications.h" 2 | #import "HSCCModuleController.h" 3 | #import "HSCCModuleWidgetViewController.h" 4 | #import "SpringBoard.h" 5 | 6 | %hook SBMainSwitcherViewController 7 | -(void)viewWillAppear:(BOOL)animated { 8 | %orig(animated); 9 | 10 | if ([[%c(SpringBoard) sharedApplication] hasFinishedLaunching]) 11 | [[HSCCModuleController sharedInstance].expandedModuleViewController dismissExpandedModule]; 12 | } 13 | %end 14 | 15 | %hook SBIconController 16 | -(void)handleHomeButtonTap { 17 | if ([[%c(SpringBoard) sharedApplication] hasFinishedLaunching]) { 18 | HSCCModuleController *moduleController = [HSCCModuleController sharedInstance]; 19 | if (moduleController.expandedModuleViewController != nil) { 20 | [moduleController.expandedModuleViewController dismissExpandedModule]; 21 | return; 22 | } 23 | } 24 | 25 | %orig(); 26 | } 27 | %end 28 | 29 | static void DisplayTurnedOffNotification(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { 30 | [[NSNotificationCenter defaultCenter] postNotificationName:HSCCDisplayTurnOffNotification object:nil userInfo:nil]; 31 | } 32 | 33 | %ctor { 34 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)DisplayTurnedOffNotification, CFSTR("SBDidTurnOffDisplayNotification"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately); 35 | } 36 | 37 | %dtor { 38 | CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, CFSTR("SBDidTurnOffDisplayNotification"), NULL); 39 | } -------------------------------------------------------------------------------- /hsccmodulewidget/Makefile: -------------------------------------------------------------------------------- 1 | ARCHS = arm64 arm64e 2 | TARGET = iphone:clang:latest:13.0 3 | 4 | include $(THEOS)/makefiles/common.mk 5 | 6 | BUNDLE_NAME = HSCCModuleWidget 7 | HSCCModuleWidget_FILES = HSCCModuleWidgetViewController.x HSCCModuleController.x CCSupportCompatibility.x HSCCModulesListViewController.x HSCCNotifications.x 8 | HSCCModuleWidget_FRAMEWORKS = UIKit 9 | HSCCModuleWidget_EXTRA_FRAMEWORKS = CydiaSubstrate HSWidgets 10 | HSCCModuleWidget_INSTALL_PATH = /Library/HSWidgets 11 | HSCCModuleWidget_CFLAGS += -Iprivate_headers 12 | 13 | include $(THEOS_MAKE_PATH)/bundle.mk 14 | -------------------------------------------------------------------------------- /hsccmodulewidget/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.dgh0st.hswidgets.ccmodule 7 | HSWidgetAddNewOptionsControllerClass 8 | HSCCModulesListViewController 9 | HSWidgetCreator 10 | DGh0st 11 | HSWidgetDisplayName 12 | Control Center Module 13 | HSWidgetIcon 14 | icon.png 15 | NSPrincipalClass 16 | HSCCModuleWidgetViewController 17 | 18 | 19 | -------------------------------------------------------------------------------- /hsccmodulewidget/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/hsccmodulewidget/Resources/icon@2x.png -------------------------------------------------------------------------------- /hsccmodulewidget/Resources/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/hsccmodulewidget/Resources/icon@3x.png -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCSModuleMetadata.h: -------------------------------------------------------------------------------- 1 | @interface CCSModuleMetadata : NSObject // iOS 11 - 13 2 | @property (nonatomic, copy, readonly) NSURL *moduleBundleURL; 3 | @property (nonatomic, copy, readonly) NSString *moduleIdentifier; 4 | @end 5 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCSModuleProviderManager.h: -------------------------------------------------------------------------------- 1 | @interface CCSModuleProviderManager : NSObject // iOS 11 - 13 2 | +(instancetype)sharedInstance; // iOS 11 - 13 3 | -(id)listControllerForModuleIdentifier:(NSString *)identifier; // iOS 11 - 13 4 | @end 5 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCSModuleRepository.h: -------------------------------------------------------------------------------- 1 | @class CCSModuleMetadata; 2 | 3 | @interface CCSModuleRepository : NSObject // iOS 11 - 13 4 | @property (nonatomic, copy, readonly) NSSet *loadableModuleIdentifiers; // iOS 11 - 13 5 | -(void)_updateAllModuleMetadata; // iOS 11 - 13 6 | -(void)_updateAvailableModuleMetadata; // iOS 11 - 13 7 | -(CCSModuleMetadata *)moduleMetadataForModuleIdentifier:(NSString *)identifier; // iOS 11 - 13 8 | @end 9 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIContentModule.h: -------------------------------------------------------------------------------- 1 | @protocol CCUIContentModule // iOS 11 - 13 2 | @property (nonatomic, readonly) id contentViewController; // iOS 10 - 13 3 | @property (nonatomic, readonly) id backgroundViewController; // iOS 10 - 13 4 | @optional 5 | -(void)setContentModuleContext:(id)context; // iOS 11 - 13 6 | -(id)contentViewControllerForContext:(id)context; // iOS 13 7 | -(id)backgroundViewControllerForContext:(id)context; // iOS 13 8 | @required 9 | -(id)contentViewController; // requierd on iOS 11 - 12, optional in 13 10 | @end 11 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIContentModuleBackgroundView.h: -------------------------------------------------------------------------------- 1 | @interface CCUIContentModuleBackgroundView : UIView 2 | @end 3 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIContentModuleContainerView.h: -------------------------------------------------------------------------------- 1 | @interface CCUIContentModuleContainerView : UIView // iOS 11 - 13 2 | @property (assign,nonatomic) BOOL ignoreFrameUpdates; // iOS 11 - 13 3 | @property (nonatomic,readonly) UIView *containerView; // iOS 11 - 13 4 | -(instancetype)initWithModuleIdentifier:(NSString *)identifier options:(NSUInteger)options; // iOS 11 - 13 5 | @end -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIContentModuleContainerViewController.h: -------------------------------------------------------------------------------- 1 | @protocol CCUIContentModule, CCUIContentModuleContainerViewControllerDelegate; 2 | @class CCUIContentModuleBackgroundView, CCUIContentModulePresentationContext; 3 | 4 | @interface CCUIContentModuleContainerViewController : UIViewController // iOS 11 - 13 5 | @property (nonatomic, assign, weak) id delegate; // iOS 11 - 13 6 | @property (nonatomic, retain) CCUIContentModuleBackgroundView *backgroundView; // iOS 11 - 13 7 | @property (nonatomic, assign, getter=isExpanded) BOOL expanded; // iOS 11 - 13 8 | @property (nonatomic, retain) id contentModule; // iOS 11 - 13 9 | @property (nonatomic, retain) UIView *contentView; // iOS 11 - 13 10 | -(instancetype)initWithModuleIdentifier:(NSString *)identifier contentModule:(id)module presentationContext:(CCUIContentModulePresentationContext *)context; // iOS 13 11 | -(instancetype)initWithModuleIdentifier:(NSString *)identifier contentModule:(id)module; // iOS 11 - 12 12 | -(void)expandModule; // iOS 11 - 13 13 | -(void)dismissPresentedContentAnimated:(BOOL)animated; // iOS 11 - 13 14 | -(void)setMaterialGroupName:(NSString *)groupName; // iOS 12 - 13 15 | -(void)willBecomeActive; // iOS 11 - 13 16 | -(void)willResignActive; // iOS 11 - 13 17 | -(void)displayWillTurnOff; // iOS 13 18 | @end 19 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIContentModuleContainerViewControllerDelegate.h: -------------------------------------------------------------------------------- 1 | @protocol CCUIContentModuleContainerViewControllerDelegate // iOS 11 - 13 2 | @required 3 | -(CGRect)compactModeFrameForContentModuleContainerViewController:(id)moduleContainerViewController; // iOS 11 - 13 4 | -(BOOL)contentModuleContainerViewController:(id)moduleContainerViewController canBeginInteractionWithModule:(id)module; // iOS 11 - 13 5 | -(void)contentModuleContainerViewController:(id)moduleContainerViewController didBeginInteractionWithModule:(id)module; // iOS 11 - 13 6 | -(void)contentModuleContainerViewController:(id)moduleContainerViewController didFinishInteractionWithModule:(id)module; // iOS 11 - 13 7 | -(void)contentModuleContainerViewController:(id)moduleContainerViewController willOpenExpandedModule:(id)module; // iOS 11 - 13 8 | -(void)contentModuleContainerViewController:(id)moduleContainerViewController didOpenExpandedModule:(id)module; // iOS 11 - 13 9 | -(void)contentModuleContainerViewController:(id)moduleContainerViewController willCloseExpandedModule:(id)module; // iOS 11 - 13 10 | -(void)contentModuleContainerViewController:(id)moduleContainerViewController didCloseExpandedModule:(id)module; // iOS 11 - 13 11 | -(BOOL)shouldApplyBackgroundEffectsForContentModuleContainerViewController:(id)moduleContainerViewController; // iOS 11 - 12 12 | -(id)backgroundViewForContentModuleContainerViewController:(id)moduleContainerViewController; // iOS 11 - 12 13 | -(void)contentModuleContainerViewController:(id)moduleContainerViewController willPresentViewController:(id)viewController; // iOS 13 14 | -(void)contentModuleContainerViewController:(id)moduleContainerViewController willDismissViewController:(id)viewController; // iOS 13 15 | -(void)contentModuleContainerViewControllerDismissPresentedContent:(id)presentedContent; // iOS 13 16 | @end 17 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIContentModuleContext.h: -------------------------------------------------------------------------------- 1 | @protocol CCUIContentModuleContextDelegate; 2 | 3 | @interface CCUIContentModuleContext : NSObject 4 | @property (assign, nonatomic, weak) id delegate; 5 | -(instancetype)initWithModuleIdentifier:(id)identifier; 6 | @end 7 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIContentModuleContextDelegate.h: -------------------------------------------------------------------------------- 1 | @protocol CCUIContentModuleContextDelegate 2 | @required 3 | -(void)contentModuleContext:(id)context enqueueStatusUpdate:(id)status; 4 | -(void)requestExpandModuleForContentModuleContext:(id)context; 5 | -(void)dismissExpandedViewForContentModuleContext:(id)context; 6 | @end 7 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIContentModulePresentationContext.h: -------------------------------------------------------------------------------- 1 | @interface CCUIContentModulePresentationContext // iOS 13 2 | +(instancetype)defaultControlCenterPresentationContext; // iOS 13 3 | @end 4 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUILayoutOptions.h: -------------------------------------------------------------------------------- 1 | @interface CCUILayoutOptions : NSObject // iOS 11 - 13 2 | @property (nonatomic, readonly) CGFloat itemEdgeSize; // iOS 11 - 13 3 | @property (nonatomic, readonly) CGFloat itemSpacing; // iOS 11 - 13 4 | @end 5 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUILayoutSize.h: -------------------------------------------------------------------------------- 1 | typedef struct CCUILayoutSize { 2 | NSUInteger width; 3 | NSUInteger height; 4 | } CCUILayoutSize; 5 | 6 | static inline CCUILayoutSize CCUILayoutSizeMake(NSUInteger width, NSUInteger height) { 7 | CCUILayoutSize layoutSize; 8 | layoutSize.width = width; 9 | layoutSize.height = height; 10 | return layoutSize; 11 | } 12 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIModularControlCenterViewController.h: -------------------------------------------------------------------------------- 1 | @class CCUIModuleCollectionViewController; 2 | 3 | @interface CCUIModularControlCenterViewController : UIViewController // iOS 11 - 13 4 | +(CCUIModuleCollectionViewController *)_sharedCollectionViewController; // iOS 11 - 13 5 | @end 6 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIModuleCollectionViewController.h: -------------------------------------------------------------------------------- 1 | @class CCUILayoutOptions; 2 | 3 | @interface CCUIModuleCollectionViewController : UIViewController // iOS 11 - 13 4 | -(CCUILayoutOptions *)_currentLayoutOptions; // iOS 11 - 13 5 | @end 6 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIModuleInstance.h: -------------------------------------------------------------------------------- 1 | @protocol CCUIContentModule; 2 | @class CCSModuleMetadata; 3 | 4 | @interface CCUIModuleInstance : NSObject // iOS 11 - 13 5 | @property (nonatomic, readonly) CCSModuleMetadata *metadata; // iOS 11 - 13 6 | @property (nonatomic, readonly) id module; // iOS 11 - 13 7 | @end 8 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIModuleInstanceManager.h: -------------------------------------------------------------------------------- 1 | @class CCSModuleMetadata, CCUIModuleInstance; 2 | 3 | @interface CCUIModuleInstanceManager : NSObject // iOS 11 - 13 4 | +(instancetype)sharedInstance; // iOS 11 - 13 5 | -(CCUIModuleInstance *)_instantiateModuleWithMetadata:(CCSModuleMetadata *)metadata; // iOS 11 - 13 6 | -(NSArray *)_loadBundlesForModuleMetadata:(NSArray *)arg1; // iOS 13 7 | @end 8 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIModuleSettings.h: -------------------------------------------------------------------------------- 1 | struct CCUILayoutSize; 2 | 3 | @interface CCUIModuleSettings : NSObject // iOS 11 - 13 4 | @property (nonatomic, assign) BOOL ccs_usesDynamicSize; // CCSupport 1.2.3 5 | -(CCUILayoutSize)layoutSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation; // iOS 11 - 13 6 | @end -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUIModuleSettingsManager.h: -------------------------------------------------------------------------------- 1 | struct CCUILayoutSize; 2 | @class CCUIModuleSettings; 3 | 4 | @interface CCUIModuleSettingsManager : NSObject // iOS 11 - 13 5 | -(instancetype)init; // iOS 11 - 13 6 | -(CCUIModuleSettings *)moduleSettingsForModuleIdentifier:(NSString *)identifier prototypeSize:(CCUILayoutSize)size; // iOS 11 - 13 7 | -(void)_loadSettings; // iOS 11 - 13 8 | @end 9 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUISettingsModuleDescription.h: -------------------------------------------------------------------------------- 1 | @interface CCUISettingsModuleDescription : NSObject 2 | -(NSString *)displayName; 3 | -(UIImage *)iconImage; 4 | @end 5 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/CCUISettingsModulesController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class CCUISettingsModuleDescription; 4 | 5 | @interface CCUISettingsModulesController : PSViewController // iOS 11 - 13 6 | -(NSDictionary *)preferenceClassForModuleIdentifiers; // added by CCSupport 7 | -(void)_repopulateModuleData; // iOS 11 - 13 8 | -(CCUISettingsModuleDescription *)_descriptionForIdentifier:(NSString*)identifier; // iOS 11 - 13 9 | @end 10 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/SBCoverSheetPresentationManager.h: -------------------------------------------------------------------------------- 1 | @interface SBCoverSheetPresentationManager : NSObject // iOS 11 - 13 2 | +(instancetype)sharedInstance; 3 | -(BOOL)isPresented; 4 | @end 5 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/SBIconController.h: -------------------------------------------------------------------------------- 1 | @interface SBFloatingDockViewController : UIViewController // iOS 13 2 | @property (nonatomic, assign) CGFloat dockOffscreenProgress; // iOS 13 3 | @end 4 | 5 | @interface SBHIconManager : NSObject // iOS 13 6 | @property (nonatomic, retain) SBFloatingDockViewController *floatingDockViewController; // iOS 13 7 | @end 8 | 9 | @interface SBIconController : UIViewController // iOS 3 - 13 10 | @property (nonatomic, readonly) SBHIconManager *iconManager; // iOS 13 11 | +(instancetype)sharedInstance; // iOS 3 - 13 12 | -(UIInterfaceOrientation)orientation; // iOS 3 - 13 13 | @end 14 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/SpringBoard.h: -------------------------------------------------------------------------------- 1 | @interface SpringBoard : UIApplication // iOS 3 - 13 2 | +(instancetype)sharedApplication; // iOS 3 - 13 3 | -(BOOL)hasFinishedLaunching; // iOS 8 - 13 4 | @end 5 | -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/UIViewController+bs.h: -------------------------------------------------------------------------------- 1 | @interface UIViewController (bs) 2 | -(UIViewController *)bs_presentationContextDefiningViewController; 3 | @end -------------------------------------------------------------------------------- /hsccmodulewidget/private_headers/UIViewController+ccui.h: -------------------------------------------------------------------------------- 1 | @interface UIViewController (CCUI) 2 | -(void)ccui_safelyBeginAppearanceTransition:(BOOL)transition animated:(BOOL)animated; 3 | -(void)ccui_safelyEndAppearanceTransition; 4 | @end -------------------------------------------------------------------------------- /hsclockwidget/HSClockWidgetPreferencesViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface HSClockWidgetPreferencesViewController : HSWidgetCombinedAdditionalOptionsAndPreferencesViewController 4 | @end -------------------------------------------------------------------------------- /hsclockwidget/HSClockWidgetPreferencesViewController.mm: -------------------------------------------------------------------------------- 1 | #import "HSClockWidgetPreferencesViewController.h" 2 | 3 | @implementation HSClockWidgetPreferencesViewController 4 | -(NSArray *)specifiers { 5 | if (!_specifiers) { 6 | _specifiers = [[self loadSpecifiersFromPlistName:@"Root" target:self] retain]; 7 | } 8 | 9 | return _specifiers; 10 | } 11 | @end -------------------------------------------------------------------------------- /hsclockwidget/HSClockWidgetViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "SBDateTimeOverrideObserver.h" 4 | #import "_UISettingsKeyObserver.h" 5 | 6 | @class SBFLockScreenDateView, _UILegibilitySettings; 7 | 8 | @interface HSClockWidgetViewController : HSWidgetViewController { 9 | _UILegibilitySettings* _legibilitySettings; 10 | NSNumber *_timerToken; 11 | } 12 | @property (nonatomic, retain) SBFLockScreenDateView *dateView; 13 | @end -------------------------------------------------------------------------------- /hsclockwidget/Makefile: -------------------------------------------------------------------------------- 1 | include $(THEOS)/makefiles/common.mk 2 | 3 | BUNDLE_NAME = HSClockWidget 4 | HSClockWidget_FILES = HSClockWidgetViewController.xm HSClockWidgetPreferencesViewController.mm 5 | HSClockWidget_FRAMEWORKS = UIKit 6 | HSClockWidget_EXTRA_FRAMEWORKS = CydiaSubstrate HSWidgets 7 | HSClockWidget_PRIVATE_FRAMEWORKS = Preferences 8 | HSClockWidget_INSTALL_PATH = /Library/HSWidgets 9 | HSClockWidget_CFLAGS = -Iprivate_headers 10 | 11 | include $(THEOS_MAKE_PATH)/bundle.mk 12 | -------------------------------------------------------------------------------- /hsclockwidget/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.dgh0st.hswidgets.clock 7 | NSPrincipalClass 8 | HSClockWidgetViewController 9 | HSWidgetAddNewOptionsControllerClass 10 | HSClockWidgetPreferencesViewController 11 | HSWidgetPreferencesControllerClass 12 | HSClockWidgetPreferencesViewController 13 | HSWidgetDisplayName 14 | Time & Date 15 | HSWidgetIcon 16 | icon.png 17 | HSWidgetCreator 18 | DGh0st 19 | 20 | 21 | -------------------------------------------------------------------------------- /hsclockwidget/Resources/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | label 11 | Alignment 12 | footerText 13 | Set the alignment for the time & date. 14 | 15 | 16 | cell 17 | PSSliderCell 18 | min 19 | -1.0 20 | max 21 | 1.0 22 | default 23 | 0.0 24 | key 25 | AlignmentPercent 26 | 27 | 28 | cell 29 | PSGroupCell 30 | footerAlignment 31 | 1 32 | footerText 33 | HSClockWidget © 2020 DGh0st 34 | 35 | 36 | cell 37 | PSButtonCell 38 | label 39 | Reset All Settings 40 | action 41 | resetAllSettings 42 | alignment 43 | 1 44 | 45 | 46 | title 47 | Time & Date 48 | 49 | -------------------------------------------------------------------------------- /hsclockwidget/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/hsclockwidget/Resources/icon@2x.png -------------------------------------------------------------------------------- /hsclockwidget/Resources/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/hsclockwidget/Resources/icon@3x.png -------------------------------------------------------------------------------- /hsclockwidget/private_headers/LegibilitySettings.h: -------------------------------------------------------------------------------- 1 | @interface LegibilitySettings : NSObject // SBLegibilitySettings (iOS 7 - 12) and SBFLegibilitySettings (iOS 13) 2 | -(void)addKeyObserverIfPrototyping:(id)arg1; // iOS 10 - 12 (inherited from SBUISettings) 3 | -(void)addKeyObserver:(id)arg1; // iOS 12 - 13 (inherited from PTSettings) 4 | -(void)removeKeyObserver:(id)arg1; // iOS 10 - 13 5 | -(CGFloat)timeStrengthForStyle:(NSInteger)arg1; // iOS 7 - 13 6 | -(CGFloat)dateStrengthForStyle:(NSInteger)arg1; // iOS 7 - 13 7 | @end 8 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/SBDateTimeController.h: -------------------------------------------------------------------------------- 1 | @interface SBDateTimeController : NSObject // iOS 9 - 13 2 | +(id)sharedInstance; // iOS 9 - 13 3 | -(NSDate *)overrideDate; // iOS 9 - 13 4 | -(void)removeObserver:(id)arg1; // iOS 9 - 13 5 | -(void)addObserver:(id)arg1; // iOS 9 - 13 6 | @end 7 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/SBDateTimeOverrideObserver.h: -------------------------------------------------------------------------------- 1 | @protocol SBDateTimeOverrideObserver // iOS 9 - 13 2 | @required 3 | -(void)controller:(id)arg1 didChangeOverrideDateFromDate:(id)arg2; // iOS 9 - 13 4 | @end 5 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/SBFLegibilityDomain.h: -------------------------------------------------------------------------------- 1 | #import "LegibilitySettings.h" 2 | 3 | @interface SBFLegibilityDomain : NSObject // iOS 13 4 | +(LegibilitySettings *)rootSettings; // iOS 13 5 | @end 6 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/SBFLockScreenDateView.h: -------------------------------------------------------------------------------- 1 | @interface SBFLockScreenDateView : UIView // iOS 7 - 13 2 | // +(CGFloat)defaultHeight; // iOS 7 - 13 3 | -(instancetype)initWithFrame:(CGRect)arg1; // iOS 7 - 13 4 | -(void)updateFormat; // iOS 7 - 13 5 | -(void)setTimeLegibilityStrength:(CGFloat)arg1; // iOS 10 - 13 6 | -(void)setSubtitleLegibilityStrength:(CGFloat)arg1; // iOS 10 - 13 7 | -(void)setLegibilitySettings:(id)arg1; // iOS 7 - 13 8 | -(void)setDate:(NSDate *)arg1; // iOS 7 - 13 9 | -(void)setAlignmentPercent:(CGFloat)arg1; // iOS 10 - 13 10 | @end 11 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/SBPreciseClockTimer.h: -------------------------------------------------------------------------------- 1 | @interface SBPreciseClockTimer : NSObject // iOS 9 - 11 2 | +(id)sharedInstance; // iOS 9 - 11 3 | +(id)now; // iOS 9 - 11 4 | -(NSNumber *)startMinuteUpdatesWithHandler:(id)arg1; // iOS 9 - 11 5 | -(void)stopMinuteUpdatesForToken:(NSNumber *)arg1; // iOS 9 - 11 6 | @end 7 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/SBPrototypeController.h: -------------------------------------------------------------------------------- 1 | #import "SBRootSettings.h" 2 | 3 | @interface SBPrototypeController : NSObject // iOS 7 - 13 4 | +(id)sharedInstance; // iOS 7 - 13 5 | -(SBRootSettings *)rootSettings; // iOS 7 - 13 6 | @end 7 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/SBRootSettings.h: -------------------------------------------------------------------------------- 1 | #import "LegibilitySettings.h" 2 | 3 | @interface SBRootSettings : NSObject // iOS 7 - 12 4 | -(LegibilitySettings *)legibilitySettings; // iOS 7 - 12 5 | @end 6 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/SBUIPreciseClockTimer.h: -------------------------------------------------------------------------------- 1 | @interface SBUIPreciseClockTimer : NSObject // iOS 12 - 13 2 | +(id)sharedInstance; // iOS 12 - 13 3 | +(id)now; // iOS 12 - 13 4 | -(NSNumber *)startMinuteUpdatesWithHandler:(id)arg1; // iOS 12 - 13 5 | -(void)stopMinuteUpdatesForToken:(NSNumber *)arg1; // iOS 12 - 13 6 | @end 7 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/_UILegibilitySettings.h: -------------------------------------------------------------------------------- 1 | @interface _UILegibilitySettings : NSObject // iOS 7 - 13 2 | -(NSInteger)style; // iOS 7 - 13 3 | @end 4 | -------------------------------------------------------------------------------- /hsclockwidget/private_headers/_UISettingsKeyObserver.h: -------------------------------------------------------------------------------- 1 | @protocol _UISettingsKeyObserver // iOS 7 - 13 2 | @required 3 | -(void)settings:(id)arg1 changedValueForKey:(id)arg2; // iOS 7 - 13 4 | @end 5 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/HSModernWeatherDailyForecastView.h: -------------------------------------------------------------------------------- 1 | @interface HSModernWeatherDailyForecastView : UIView 2 | @property (nonatomic, retain) UILabel *weekDayLabel; 3 | @property (nonatomic, retain) UIImageView *imageView; 4 | @property (nonatomic, retain) UILabel *highTemperatureLabel; 5 | @property (nonatomic, retain) UILabel *lowTemperatureLabel; 6 | -(instancetype)init; 7 | @end 8 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/HSModernWeatherHourlyForecastView.h: -------------------------------------------------------------------------------- 1 | @interface HSModernWeatherHourlyForecastView : UIView 2 | @property (nonatomic, retain) UILabel *timeLabel; 3 | @property (nonatomic, retain) UIImageView *imageView; 4 | @property (nonatomic, retain) UILabel *temperatureLabel; 5 | -(instancetype)init; 6 | @end 7 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/HSModernWeatherHourlyForecastView.m: -------------------------------------------------------------------------------- 1 | #import "HSModernWeatherHourlyForecastView.h" 2 | 3 | #define FONT_SIZE 14 4 | #define IMAGE_SIZE 40 5 | #define IMAGE_PADDING 6 6 | 7 | @implementation HSModernWeatherHourlyForecastView 8 | -(instancetype)init { 9 | self = [super init]; 10 | if (self != nil) { 11 | self.timeLabel = [[UILabel alloc] init]; 12 | self.timeLabel.text = @"-"; 13 | self.timeLabel.font = [UIFont systemFontOfSize:FONT_SIZE weight:UIFontWeightMedium]; 14 | self.timeLabel.numberOfLines = 1; 15 | self.timeLabel.textAlignment = NSTextAlignmentCenter; 16 | self.timeLabel.contentMode = UIViewContentModeBottom; 17 | self.timeLabel.textColor = [UIColor whiteColor]; 18 | self.timeLabel.backgroundColor = [UIColor clearColor]; 19 | self.timeLabel.adjustsFontSizeToFitWidth = YES; 20 | [self addSubview:self.timeLabel]; 21 | 22 | self.imageView = [[UIImageView alloc] init]; 23 | self.imageView.image = nil; 24 | self.imageView.contentMode = UIViewContentModeCenter; 25 | self.imageView.backgroundColor = [UIColor clearColor]; 26 | [self addSubview:self.imageView]; 27 | 28 | self.temperatureLabel = [[UILabel alloc] init]; 29 | self.temperatureLabel.text = @"--"; 30 | self.temperatureLabel.font = [UIFont systemFontOfSize:FONT_SIZE weight:UIFontWeightMedium]; 31 | self.temperatureLabel.numberOfLines = 1; 32 | self.temperatureLabel.textAlignment = NSTextAlignmentCenter; 33 | self.temperatureLabel.contentMode = UIViewContentModeTop; 34 | self.temperatureLabel.textColor = [UIColor whiteColor]; 35 | self.temperatureLabel.backgroundColor = [UIColor clearColor]; 36 | self.temperatureLabel.adjustsFontSizeToFitWidth = YES; 37 | [self addSubview:self.temperatureLabel]; 38 | 39 | self.timeLabel.translatesAutoresizingMaskIntoConstraints = NO; 40 | [self.timeLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor].active = YES; 41 | [self.timeLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor].active = YES; 42 | [self.timeLabel.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES; 43 | [self.timeLabel.bottomAnchor constraintEqualToAnchor:self.imageView.topAnchor constant:IMAGE_PADDING].active = YES; 44 | 45 | self.imageView.translatesAutoresizingMaskIntoConstraints = NO; 46 | [self.imageView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor].active = YES; 47 | [self.imageView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor].active = YES; 48 | [self.imageView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor].active = YES; 49 | [self.imageView.heightAnchor constraintEqualToConstant:IMAGE_SIZE].active = YES; 50 | 51 | self.temperatureLabel.translatesAutoresizingMaskIntoConstraints = NO; 52 | [self.temperatureLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor].active = YES; 53 | [self.temperatureLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor].active = YES; 54 | [self.temperatureLabel.topAnchor constraintEqualToAnchor:self.imageView.bottomAnchor constant:-IMAGE_PADDING].active = YES; 55 | [self.temperatureLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES; 56 | } 57 | return self; 58 | } 59 | @end 60 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/HSModernWeatherWidgetViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HSWeatherControllerObserver.h" 3 | 4 | @class WUIDynamicWeatherBackground, HSModernWeatherDailyForecastView, HSModernWeatherHourlyForecastView; 5 | 6 | typedef NS_ENUM(NSUInteger, HSModernWeatherWidgetBackgroundStyle) { 7 | HSModernWeatherWidgetBackgroundStyleGradient = 0, 8 | HSModernWeatherWidgetBackgroundStyleAnimated 9 | }; 10 | 11 | typedef NS_ENUM(NSUInteger, HSModernWeatherWidgetDisplayMode) { 12 | HSModernWeatherWidgetDisplayModeSmall = 0, 13 | HSModernWeatherWidgetDisplayModeMedium, 14 | // HSModernWeatherWidgetDisplayModeLarge, 15 | HSModernWeatherWidgetDisplayModeExtraLarge 16 | }; 17 | 18 | @interface HSModernWeatherWidgetViewController : HSModernWidgetViewController 19 | @property (nonatomic, retain) UILabel *location; 20 | @property (nonatomic, retain) UILabel *temperature; 21 | @property (nonatomic, retain) UIImageView *conditionImageView; 22 | @property (nonatomic, retain) UILabel *conditionDescription; 23 | @property (nonatomic, retain) UILabel *highLowTemperature; 24 | @property (nonatomic, retain) WUIDynamicWeatherBackground *dynamicWeatherBackground; 25 | @property (nonatomic, retain) UIStackView *hourlyForecastContainerView; 26 | @property (nonatomic, retain) NSMutableArray *hourlyForecastViews; 27 | @property (nonatomic, retain) UIStackView *dailyForecastContainerView; 28 | @property (nonatomic, retain) NSMutableArray *dailyForecastViews; 29 | @property (nonatomic, assign, setter=_setDisplayMode:) HSModernWeatherWidgetDisplayMode displayMode; 30 | @property (nonatomic, assign) HSModernWeatherWidgetBackgroundStyle backgroundStyle; 31 | @property (nonatomic, assign, setter=_setEdgePadding:) CGFloat edgePadding; 32 | @end -------------------------------------------------------------------------------- /hsmodernweatherwidget/HSWeatherController.h: -------------------------------------------------------------------------------- 1 | #import "WATodayModelObserver.h" 2 | 3 | @class City, WATodayModel; 4 | @protocol HSWeatherControllerObserver; 5 | 6 | extern NSString *const HSWeatherFakeDisplayName; 7 | extern NSString *const HSWeatherFakeDescription; 8 | extern NSString *const HSWeatherFakeTemperature; 9 | extern NSString *const HSWeatherFakeHighLowDescription; 10 | 11 | extern NSString *const HSWeatherHourlyForecastIndexKey; 12 | extern NSString *const HSWeatherHourlyForecastTimeKey; 13 | extern NSString *const HSWeatherHourlyForecastConditionImageKey; 14 | extern NSString *const HSWeatherHourlyForecastTemperatureKey; 15 | 16 | extern NSString *const HSWeatherDailyForecastIndexKey; 17 | extern NSString *const HSWeatherDailyForecastHighTemperatureKey; 18 | extern NSString *const HSWeatherDailyForecastLowTemperatureKey; 19 | extern NSString *const HSWeatherDailyForecastConditionImageKey; 20 | extern NSString *const HSWeatherDailyForecastDayOfWeekKey; 21 | 22 | @interface HSWeatherController : NSObject 23 | @property (nonatomic, retain) WATodayModel *todayModel; 24 | @property (nonatomic, retain) NSTimer *updateTimer; 25 | @property (nonatomic, retain) NSDate *lastUpdateTime; 26 | @property (nonatomic, retain) NSMutableArray *observers; 27 | +(instancetype)sharedInstance; 28 | -(NSString *)locationName; 29 | -(NSString *)temperature; 30 | -(UIImage *)conditionsImage; 31 | -(NSString *)conditionsDescription; 32 | -(NSString *)highLowDescription; 33 | -(NSArray *)hourlyForecasts; 34 | -(NSArray *)dailyForecasts; 35 | -(void)startUpdateTimer; 36 | -(void)stopUpdateTimer; 37 | -(void)requestModelUpdate; 38 | -(void)addObserver:(id)observer; 39 | -(void)removeObserver:(id)observer; 40 | -(City *)currentCity; 41 | @end 42 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/HSWeatherControllerObserver.h: -------------------------------------------------------------------------------- 1 | @class HSWeatherController; 2 | 3 | @protocol HSWeatherControllerObserver 4 | @required 5 | -(void)weatherModelUpdatedForController:(HSWeatherController *)weatherController; 6 | @end 7 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/Makefile: -------------------------------------------------------------------------------- 1 | include $(THEOS)/makefiles/common.mk 2 | 3 | BUNDLE_NAME = HSModernWeatherWidget 4 | HSModernWeatherWidget_FILES = HSModernWeatherWidgetViewController.x HSModernWeatherHourlyForecastView.m HSModernWeatherDailyForecastView.m HSWeatherController.mm 5 | HSModernWeatherWidget_FRAMEWORKS = CoreLocation UIKit 6 | HSModernWeatherWidget_EXTRA_FRAMEWORKS = HSWidgets 7 | HSModernWeatherWidget_PRIVATE_FRAMEWORKS = Weather WeatherFoundation WeatherUI 8 | HSModernWeatherWidget_INSTALL_PATH = /Library/HSWidgets 9 | HSModernWeatherWidget_CFLAGS += -Iprivate_headers 10 | 11 | include $(THEOS_MAKE_PATH)/bundle.mk 12 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.dgh0st.hswidgets.modernweatherwidget 7 | NSPrincipalClass 8 | HSModernWeatherWidgetViewController 9 | HSWidgetDisplayName 10 | Weather (Modern) 11 | HSWidgetIcon 12 | icon.png 13 | HSWidgetCreator 14 | DGh0st 15 | 16 | 17 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/City.h: -------------------------------------------------------------------------------- 1 | @class WFAQIScaleCategory; 2 | 3 | @interface City : NSObject // iOS 5 - 13 4 | @property (nonatomic, copy) NSString *name; // iOS 7 - 13 5 | @property (nonatomic, assign) BOOL isLocalWeatherCity; // iOS 7 - 13 6 | @property (nonatomic, retain) WFAQIScaleCategory *airQualityScaleCategory; // iOS 13 7 | @end 8 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/SpringBoard.h: -------------------------------------------------------------------------------- 1 | @interface SpringBoard : UIApplication 2 | -(BOOL)launchApplicationWithIdentifier:(NSString *)identifier suspended:(BOOL)suspended; 3 | @end -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/UIImage+Private.h: -------------------------------------------------------------------------------- 1 | @interface UIImage (Private) 2 | +(instancetype)_applicationIconImageForBundleIdentifier:(NSString *)identifier format:(int)format scale:(CGFloat)scale; // iOS 5 - 13 3 | @end -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WACurrentForecast.h: -------------------------------------------------------------------------------- 1 | @class WFTemperature; 2 | 3 | @interface WACurrentForecast : NSObject // iOS 10 - 13 4 | @property (nonatomic, retain) WFTemperature *temperature; // iOS 10 - 13 5 | @property (nonatomic, assign) NSInteger conditionCode; // iOS 10 - 13 6 | @end 7 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WADayForecast.h: -------------------------------------------------------------------------------- 1 | @class WFTemperature; 2 | 3 | @interface WADayForecast : NSObject // iOS 10 - 13 4 | @property (nonatomic, copy) WFTemperature *high; // iOS 10 - 13 5 | @property (nonatomic, copy) WFTemperature *low; // iOS 10 - 13 6 | @property (nonatomic, assign) NSUInteger icon; // iOS 10 - 13 7 | @property (nonatomic, assign) NSUInteger dayOfWeek; // iOS 10 - 13 8 | @property (nonatomic, assign) NSUInteger dayNumber; // iOS 10 - 13 9 | @end 10 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WAForecastModel.h: -------------------------------------------------------------------------------- 1 | @class City, WACurrentForecast, WFLocation; 2 | 3 | @interface WAForecastModel : NSObject // iOS 10 - 13 4 | @property (nonatomic, retain) City *city; // iOS 10 - 13 5 | @property (nonatomic, retain) WFLocation *location; // iOS 10 - 13 6 | @property (nonatomic, retain) WACurrentForecast *currentConditions; // iOS 10 - 13 7 | @property (nonatomic, copy) NSArray *dailyForecasts; // iOS 10 - 13 8 | @property (nonatomic, copy) NSArray *hourlyForecasts; // iOS 10 - 13 9 | @end -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WAHourlyForecast.h: -------------------------------------------------------------------------------- 1 | @class WFTemperature; 2 | 3 | @interface WAHourlyForecast : NSObject // iOS 10 - 13 4 | @property (nonatomic, retain) WFTemperature *temperature; // iOS 10 - 13 5 | @property (nonatomic, assign) NSInteger conditionCode; // iOS 10 - 13 6 | @property (nonatomic, copy) NSString *time; // iOS 10 - 13 7 | @property (nonatomic, assign) NSInteger hourIndex; // iOS 10 - 13 8 | @end 9 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WATodayModel.h: -------------------------------------------------------------------------------- 1 | @protocol WATodayModelObserver; 2 | @class WATodayAutoupdatingLocationModel, WeatherPreferences, WFLocation; 3 | 4 | @interface WATodayModel : NSObject // iOS 10 - 13 5 | @property (nonatomic, retain) WAForecastModel *forecastModel; // iOS 10 - 13 6 | +(WATodayAutoupdatingLocationModel *)autoupdatingLocationModelWithPreferences:(WeatherPreferences *)preferences effectiveBundleIdentifier:(id)identifier; // iOS 10 - 13 7 | +(instancetype)modelWithLocation:(WFLocation *)location; // iOS 10 - 13 8 | -(void)addObserver:(id)observer; // iOS 10 - 13 9 | -(void)removeObserver:(id)observer; // iOS 10 - 13 10 | -(BOOL)executeModelUpdateWithCompletion:(id)completion; // iOS 10 - 13 11 | @end 12 | 13 | @interface WATodayAutoupdatingLocationModel : WATodayModel // iOS 10 - 13 14 | @property (nonatomic, assign) BOOL isLocationTrackingEnabled; // iOS 10 - 13 15 | -(void)setLocationServicesActive:(BOOL)active; // iOS 10 - 13 16 | -(BOOL)updateLocationTrackingStatus; // iOS 12 - 13 17 | @end 18 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WATodayModelObserver.h: -------------------------------------------------------------------------------- 1 | @class WATodayModel; 2 | 3 | @protocol WATodayModelObserver // iOS 10 - 13 4 | @required 5 | -(void)todayModelWantsUpdate:(WATodayModel *)model; // iOS 10 - 13 6 | -(void)todayModel:(WATodayModel *)model forecastWasUpdated:(id)forecast; // iOS 10 - 13 7 | @end 8 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WFAQIScaleCategory.h: -------------------------------------------------------------------------------- 1 | @interface WFAQIScaleCategory : NSObject // iOS 13 2 | @property (nonatomic, copy, readonly) NSString *longDescription; // iOS 13 3 | @property (nonatomic, readonly) NSUInteger warningLevel; // iOS 13 4 | @property (nonatomic, readonly) NSUInteger categoryIndex; // iOS 13 5 | @end 6 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WFAirQualityConditions.h: -------------------------------------------------------------------------------- 1 | @interface WFAirQualityConditions : NSObject // iOS 10 - 13 2 | @property (nonatomic, assign) NSUInteger category; // iOS 10 - 13 3 | @property (nonatomic, assign) NSUInteger localizedAirQualityIndex; // iOS 10 - 13 4 | @end 5 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WFLocation.h: -------------------------------------------------------------------------------- 1 | @class CLLocation; 2 | 3 | @interface WFLocation : NSObject // iOS 10 - 13 4 | @property (nonatomic, copy) NSString *displayName; // iOS 10 - 13 5 | @property (nonatomic, copy) CLLocation *geoLocation; // iOS 10 - 13 6 | @end 7 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WFTemperature.h: -------------------------------------------------------------------------------- 1 | @interface WFTemperature : NSObject // iOS 10 - 13 2 | @end 3 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WFTemperatureFormatter.h: -------------------------------------------------------------------------------- 1 | @class WFTemperature; 2 | 3 | @interface WFTemperatureFormatter : NSFormatter // iOS 10 - 13 4 | -(void)setOutputUnit:(int)unit; // iOS 10 - 13 5 | -(void)setIncludeDegreeSymbol:(BOOL)symbolIncluded; // iOS 11 - 13 6 | -(NSString *)stringForObjectValue:(id)value; // iOS 10 - 13 7 | @end 8 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WFTemperatureUnitObserver.h: -------------------------------------------------------------------------------- 1 | @interface WFTemperatureUnitObserver : NSObject // iOS 10 - 13 2 | @property (nonatomic, readonly) int temperatureUnit; // iOS 10 - 13 3 | +(instancetype)sharedObserver; // iOS 10 - 13 4 | @end -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WUIDynamicWeatherBackground.h: -------------------------------------------------------------------------------- 1 | @class City, WUIGradientLayer, WUIWeatherCondition; 2 | 3 | @interface WUIDynamicWeatherBackground : UIView // iOS 9 - 13 4 | @property (nonatomic, retain) WUIGradientLayer *gradientLayer; // iOS 9 - 13 5 | @property (nonatomic, retain) WUIWeatherCondition *condition; // iOS 9 - 13 6 | -(void)setCity:(City *)city; // iOS 9 - 13 7 | @end -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WUIGradientLayer.h: -------------------------------------------------------------------------------- 1 | @interface WUIGradientLayer : CAGradientLayer // iOS 9 - 13 2 | @end 3 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WUIWeatherCondition.h: -------------------------------------------------------------------------------- 1 | @class City; 2 | 3 | @interface WUIWeatherCondition : NSObject // iOS 9 - 13 4 | @property (nonatomic, assign, weak) City *city; 5 | -(void)pause; // iOS 9 - 13 6 | -(void)resume; // iOS 9 - 13 7 | @end -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/Weather-Externs.h: -------------------------------------------------------------------------------- 1 | @class WACurrentForecast, WFAirQualityConditions; 2 | 3 | FOUNDATION_EXPORT NSString *const kCityNotificationNameDidUpdate; // iOS 10 - 13 4 | 5 | FOUNDATION_EXPORT BOOL WAIsChinaSKUAndSimplifiedChinese(); // iOS 11 - 13 6 | FOUNDATION_EXPORT NSString *WAConditionsLineStringFromCurrentForecasts(WACurrentForecast *currentForecast); // iOS 10 - 13 7 | FOUNDATION_EXPORT UIImage *WAImageForLegacyConditionCode(int conditionCode); // iOS 10 - 13 8 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WeatherInternalPreferences.h: -------------------------------------------------------------------------------- 1 | @interface WeatherInternalPreferences : NSObject // iOS 10 - 13 2 | +(instancetype)sharedInternalPreferences; // iOS 10 - 13 3 | -(BOOL)isV3Enabled; // iOS 13; 4 | -(id)objectForKey:(id)key; // iOS 10 - 13 5 | @end 6 | -------------------------------------------------------------------------------- /hsmodernweatherwidget/private_headers/WeatherPreferences.h: -------------------------------------------------------------------------------- 1 | @interface WeatherPreferences : NSObject // iOS 5 - 13 2 | @end 3 | -------------------------------------------------------------------------------- /hsspacerwidget/HSSpacerWidgetViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface HSSpacerWidgetViewController : HSWidgetViewController 4 | @end -------------------------------------------------------------------------------- /hsspacerwidget/HSSpacerWidgetViewController.mm: -------------------------------------------------------------------------------- 1 | #import "HSSpacerWidgetViewController.h" 2 | 3 | #import 4 | #import 5 | 6 | #define MIN_NUM_ROWS 1U // spacer needs atleast 1 row 7 | #define MIN_NUM_COLS 1U // spacer needs atleast 1 col 8 | 9 | @implementation HSSpacerWidgetViewController 10 | +(HSWidgetSize)minimumSize { 11 | return HSWidgetSizeMake(MIN_NUM_ROWS, MIN_NUM_COLS); // least amount of rows and cols the widget needs 12 | } 13 | 14 | -(BOOL)_canExpand:(inout HSWidgetSize *)expandSize { 15 | std::vector expandSizes; 16 | expandSizes.push_back(HSWidgetSizeAdd(self.widgetFrame.size, 1, 1)); // expand row and col 17 | expandSizes.push_back(HSWidgetSizeAdd(self.widgetFrame.size, 0, 1)); // expand col 18 | expandSizes.push_back(HSWidgetSizeAdd(self.widgetFrame.size, 1, 0)); // expand row 19 | 20 | // sort by biggest to smalles spaces 21 | std::sort(expandSizes.begin(), expandSizes.end(), [](const HSWidgetSize &first, const HSWidgetSize &second) { 22 | return SpacesForWidgetSize(first) > SpacesForWidgetSize(second); 23 | }); 24 | 25 | for (const HSWidgetSize &size : expandSizes) { 26 | if ([super containsSpaceToExpandOrShrinkToWidgetSize:size]) { 27 | if (expandSize != nil) { 28 | *expandSize = size; 29 | } 30 | return YES; 31 | } 32 | } 33 | 34 | // we can't expand 35 | return NO; 36 | } 37 | 38 | -(BOOL)_canShrink:(inout HSWidgetSize *)shrinkSize { 39 | // try shrinking row and/or col 40 | HSWidgetSize shrunkWidgetSize; 41 | shrunkWidgetSize.numRows = MAX(self.widgetFrame.size.numRows - 1, MIN_NUM_ROWS); 42 | shrunkWidgetSize.numCols = MAX(self.widgetFrame.size.numCols - 1, MIN_NUM_COLS); 43 | if (!HSWidgetSizeEqualsSize(self.widgetFrame.size, shrunkWidgetSize)) { 44 | if (shrinkSize != nil) { 45 | *shrinkSize = shrunkWidgetSize; 46 | } 47 | return YES; 48 | } 49 | 50 | // we can't shrink 51 | return NO; 52 | } 53 | 54 | -(BOOL)isAccessoryTypeEnabled:(AccessoryType)accessory { 55 | // check if expand or shrink 56 | if (accessory == AccessoryTypeExpand) { 57 | return [self _canExpand:nil]; 58 | } else if (accessory == AccessoryTypeShrink) { 59 | return [self _canShrink:nil]; 60 | } 61 | 62 | // anything else we don't support but let super class handle it incase new accessory types are added 63 | return [super isAccessoryTypeEnabled:accessory]; 64 | } 65 | 66 | -(void)accessoryTypeTapped:(AccessoryType)accessory { 67 | if (accessory == AccessoryTypeExpand) { 68 | // handle expand tapped 69 | HSWidgetSize expandSize; 70 | if ([self _canExpand:&expandSize]) { 71 | [super updateForExpandOrShrinkToWidgetSize:expandSize]; 72 | } 73 | } else if (accessory == AccessoryTypeShrink) { 74 | // handle shrink tapped 75 | HSWidgetSize shrinkSize; 76 | if ([self _canShrink:&shrinkSize]) { 77 | [super updateForExpandOrShrinkToWidgetSize:shrinkSize]; 78 | } 79 | } 80 | } 81 | @end -------------------------------------------------------------------------------- /hsspacerwidget/Makefile: -------------------------------------------------------------------------------- 1 | include $(THEOS)/makefiles/common.mk 2 | 3 | BUNDLE_NAME = HSSpacerWidget 4 | HSSpacerWidget_FILES = HSSpacerWidgetViewController.mm 5 | HSSpacerWidget_FRAMEWORKS = UIKit 6 | HSSpacerWidget_EXTRA_FRAMEWORKS = HSWidgets 7 | HSSpacerWidget_INSTALL_PATH = /Library/HSWidgets 8 | 9 | include $(THEOS_MAKE_PATH)/bundle.mk 10 | -------------------------------------------------------------------------------- /hsspacerwidget/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.dgh0st.hswidgets.spacer 7 | NSPrincipalClass 8 | HSSpacerWidgetViewController 9 | HSWidgetDisplayName 10 | Empty Spacer 11 | HSWidgetIcon 12 | icon.png 13 | HSWidgetCreator 14 | DGh0st 15 | 16 | 17 | -------------------------------------------------------------------------------- /hsspacerwidget/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/hsspacerwidget/Resources/icon@2x.png -------------------------------------------------------------------------------- /hsspacerwidget/Resources/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/hsspacerwidget/Resources/icon@3x.png -------------------------------------------------------------------------------- /hstodaywidget/HSTodayWidgetAdvancedPreferencesViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface HSTodayWidgetAdvancedPreferencesViewController : HSWidgetPreferencesListController { 4 | PSSpecifier *_expansionModeSpecifier; 5 | PSSpecifier *_heightDescriptorSpecifier; 6 | } 7 | @end -------------------------------------------------------------------------------- /hstodaywidget/HSTodayWidgetController.h: -------------------------------------------------------------------------------- 1 | @protocol WGWidgetHostingViewControllerDelegate, WGWidgetHostingViewControllerHost; 2 | @class WGWidgetDiscoveryController, WGWidgetHostingViewController; 3 | 4 | @interface HSTodayWidgetController : NSObject 5 | @property (nonatomic, retain) WGWidgetDiscoveryController *widgetDiscoveryController; 6 | @property (nonatomic, retain) NSMutableDictionary *cancelTouchesAssertionsByWidgetID; 7 | +(instancetype)sharedInstance; 8 | -(NSUInteger)availableWidgetsCount; 9 | -(NSDictionary *)availableWidgetIdentifiersToWidgetInfos; 10 | -(void)removeWidgetWithIdentifier:(NSString *)widgetIdentifier; 11 | -(WGWidgetHostingViewController *)widgetWithIdentifier:(NSString *)identifier delegate:(id)delegate host:(id)host; 12 | -(void)enumerateWidgetsWithBlock:(void(^)(HSTodayWidgetController *, WGWidgetHostingViewController *))block; 13 | @end 14 | -------------------------------------------------------------------------------- /hstodaywidget/HSTodayWidgetRootPreferencesViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface HSTodayWidgetRootPreferencesViewController : HSWidgetPreferencesListController { 4 | PSSpecifier *_descriptorSpecifier; 5 | PSSpecifier *_pickerSpecifier; 6 | PSSpecifier *_widthSpecifier; 7 | PSSpecifier *_spacesRowSpecifier; 8 | PSSpecifier *_spacesColSpecifier; 9 | } 10 | @end -------------------------------------------------------------------------------- /hstodaywidget/HSTodayWidgetStepperCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface HSTodayWidgetStepperCell : PSControlTableCell 5 | @end 6 | -------------------------------------------------------------------------------- /hstodaywidget/HSTodayWidgetStepperCell.mm: -------------------------------------------------------------------------------- 1 | #import "HSTodayWidgetStepperCell.h" 2 | 3 | @interface PSSpecifier (Private) 4 | -(id)performGetter; // iOS 9 - 13 5 | @end 6 | 7 | @interface PSTableCell (Private) 8 | -(void)reloadWithSpecifier:(PSSpecifier *)specifier animated:(BOOL)animated; // iOS 6 - 13 9 | @end 10 | 11 | @interface HSTodayWidgetStepperCell () 12 | @property (nonatomic, retain) UIStepper *control; 13 | @end 14 | 15 | @implementation HSTodayWidgetStepperCell 16 | @dynamic control; 17 | 18 | -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)identifier specifier:(PSSpecifier *)specifier { 19 | self = [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier specifier:specifier]; 20 | if (self != nil) { 21 | self.accessoryView = self.control; 22 | 23 | NSNumber *currentValue = [self.specifier performGetter]; 24 | self.control.value = [currentValue unsignedIntegerValue]; 25 | self.detailTextLabel.text = [currentValue stringValue]; 26 | } 27 | return self; 28 | } 29 | 30 | -(void)refreshCellContentsWithSpecifier:(PSSpecifier *)specifier { 31 | [super refreshCellContentsWithSpecifier:specifier]; 32 | [self _configureForSpecifier:specifier]; 33 | } 34 | 35 | -(void)reloadWithSpecifier:(PSSpecifier *)specifier animated:(BOOL)animated { 36 | [super reloadWithSpecifier:specifier animated:animated]; 37 | [self _configureForSpecifier:specifier]; 38 | } 39 | 40 | -(UIStepper *)newControl { 41 | UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectZero]; 42 | stepper.continuous = NO; 43 | stepper.minimumValue = [self.specifier.properties[PSControlMinimumKey] unsignedIntegerValue]; 44 | stepper.maximumValue = [self.specifier.properties[PSControlMaximumKey] unsignedIntegerValue]; 45 | stepper.value = [[self.specifier performGetter] unsignedIntegerValue]; 46 | return stepper; 47 | } 48 | 49 | -(NSNumber *)controlValue { 50 | return @(self.control.value); 51 | } 52 | 53 | -(void)setValue:(NSNumber *)value { 54 | [super setValue:value]; 55 | [self _configureForSpecifier:self.specifier]; 56 | } 57 | 58 | -(void)controlChanged:(UIStepper *)stepper { 59 | [super controlChanged:stepper]; 60 | self.detailTextLabel.text = [@(stepper.value) stringValue]; 61 | } 62 | 63 | -(void)_configureForSpecifier:(PSSpecifier *)specifier { 64 | NSNumber *currentValue = [specifier performGetter]; 65 | self.control.minimumValue = [specifier.properties[PSControlMinimumKey] unsignedIntegerValue]; 66 | self.control.maximumValue = [specifier.properties[PSControlMaximumKey] unsignedIntegerValue]; 67 | self.control.value = [currentValue unsignedIntegerValue]; 68 | 69 | self.detailTextLabel.text = [currentValue stringValue]; 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /hstodaywidget/HSTodayWidgetViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "WGWidgetHostingViewControllerDelegate.h" 4 | #import "WGWidgetHostingViewControllerHost.h" 5 | #import "WGWidgetExtensionVisibilityProviding.h" 6 | 7 | #define HSTodayWidgetMinNumRows 2U // today widgets takes up atleast 2 row 8 | #define HSTodayWidgetMinNumCols 4U // today widgets takes up atleast 4 col 9 | 10 | // widget width style 11 | typedef NS_ENUM(NSUInteger, WidthStyle) { 12 | WidthStyleAuto = 0, 13 | WidthStyleFillSpace, 14 | WidthStyleCustom, 15 | }; 16 | 17 | @class WGWidgetHostingViewController; 18 | 19 | @interface HSTodayWidgetViewController : HSWidgetViewController { 20 | BOOL _isExpandedMode; 21 | BOOL _isWidgetVisible; 22 | } 23 | @property (nonatomic, retain) UIView *widgetView; 24 | @property (nonatomic, retain) WGWidgetHostingViewController *hostingViewController; 25 | @property (nonatomic, retain, readonly) NSString *widgetIdentifier; 26 | @end -------------------------------------------------------------------------------- /hstodaywidget/HSTodayWidgetsListViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface HSTodayWidgetsListViewController : HSWidgetAdditionalOptionsViewController { 4 | NSArray *_widgetInfos; 5 | } 6 | @end -------------------------------------------------------------------------------- /hstodaywidget/Makefile: -------------------------------------------------------------------------------- 1 | include $(THEOS)/makefiles/common.mk 2 | 3 | BUNDLE_NAME = HSTodayWidget 4 | HSTodayWidget_FILES = $(wildcard *.mm *.x) 5 | HSTodayWidget_FRAMEWORKS = UIKit CoreGraphics 6 | HSTodayWidget_EXTRA_FRAMEWORKS = CydiaSubstrate HSWidgets 7 | HSTodayWidget_PRIVATE_FRAMEWORKS = Preferences 8 | HSTodayWidget_INSTALL_PATH = /Library/HSWidgets 9 | HSTodayWidget_CFLAGS = -Iprivate_headers 10 | 11 | include $(THEOS_MAKE_PATH)/bundle.mk 12 | -------------------------------------------------------------------------------- /hstodaywidget/Resources/Advanced.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | footerText 11 | Note: Expanded mode doesn't fully function on some devices (specially iPad). Some widgets have inconsistent heights and will span outside the space widget has available so it is recommended to set a custom height below. 12 | 13 | 14 | cell 15 | PSSwitchCell 16 | id 17 | ExpansionMode 18 | key 19 | isExpandedMode 20 | label 21 | Enable Expanded Mode 22 | default 23 | 24 | 25 | 26 | cell 27 | PSGroupCell 28 | id 29 | ModeHeightDescriptor 30 | label 31 | Custom Height 32 | footerText 33 | Set the custom height for current mode. Leave empty or set to 0 to automatically calculate height. 34 | 35 | 36 | cell 37 | PSEditTextCell 38 | key 39 | modeHeight 40 | placeholder 41 | 0.0 42 | isDecimalPad 43 | 44 | 45 | 46 | cell 47 | PSGroupCell 48 | label 49 | Offset X 50 | footerText 51 | Set the offset of the widget in x direction. 52 | 53 | 54 | cell 55 | PSEditTextCell 56 | key 57 | offsetX 58 | placeholder 59 | 0.0 60 | 61 | 62 | cell 63 | PSGroupCell 64 | label 65 | Offset Y 66 | footerText 67 | Set the offset of the widget in y direction. 68 | 69 | 70 | cell 71 | PSEditTextCell 72 | key 73 | offsetY 74 | placeholder 75 | 0.0 76 | 77 | 78 | cell 79 | PSGroupCell 80 | footerAlignment 81 | 1 82 | footerText 83 | HSTodayWidget © 2020 DGh0st 84 | 85 | 86 | cell 87 | PSButtonCell 88 | label 89 | Reset Advanced Settings 90 | action 91 | resetAllSettings 92 | alignment 93 | 1 94 | 95 | 96 | title 97 | Advanced 98 | 99 | -------------------------------------------------------------------------------- /hstodaywidget/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.dgh0st.hswidgets.todaywidgets 7 | NSPrincipalClass 8 | HSTodayWidgetViewController 9 | HSWidgetAddNewOptionsControllerClass 10 | HSTodayWidgetsListViewController 11 | HSWidgetPreferencesControllerClass 12 | HSTodayWidgetRootPreferencesViewController 13 | HSWidgetDisplayName 14 | Today Widgets 15 | HSWidgetIcon 16 | icon.png 17 | HSWidgetCreator 18 | DGh0st 19 | 20 | 21 | -------------------------------------------------------------------------------- /hstodaywidget/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/hstodaywidget/Resources/icon@2x.png -------------------------------------------------------------------------------- /hstodaywidget/Resources/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/hstodaywidget/Resources/icon@3x.png -------------------------------------------------------------------------------- /hstodaywidget/SBIconListView.x: -------------------------------------------------------------------------------- 1 | #import "HSTodayWidgetViewController.h" 2 | 3 | @interface SBIconListModel // iOS 4 - 12 4 | @property (nonatomic, retain) NSMutableArray *widgetViewControllers; // added by HSWidgets 5 | @end 6 | 7 | %hook SBIconListView 8 | %new 9 | -(BOOL)containsWidget:(NSString *)identifier { 10 | NSArray *widgetViewControllers = ((SBIconListModel *)[self valueForKey:@"_model"]).widgetViewControllers; 11 | if (widgetViewControllers != nil) { 12 | for (HSWidgetViewController *widgetViewController in widgetViewControllers) { 13 | if ([widgetViewController isKindOfClass:%c(HSTodayWidgetViewController)]) { 14 | NSString *widgetIdentifier = [(HSTodayWidgetViewController *)widgetViewController widgetIdentifier]; 15 | if ([identifier isEqualToString:widgetIdentifier]) 16 | return YES; 17 | } 18 | } 19 | } 20 | return NO; 21 | } 22 | %end -------------------------------------------------------------------------------- /hstodaywidget/SBRootFolderController.x: -------------------------------------------------------------------------------- 1 | #import "HSTodayWidgetController.h" 2 | #import "HSTodayWidgetViewController.h" 3 | #import "WGWidgetHostingViewController.h" 4 | #import "WGWidgetPlatterView.h" 5 | 6 | %hook SBRootFolderController 7 | -(void)folderViewWillBeginDragging:(id)arg1 { 8 | %orig(arg1); 9 | 10 | HSTodayWidgetController *todayWidgetController = [HSTodayWidgetController sharedInstance]; 11 | [todayWidgetController enumerateWidgetsWithBlock:^(HSTodayWidgetController *widgetController, WGWidgetHostingViewController *hostingViewController) { 12 | if ([hostingViewController.delegate isKindOfClass:%c(HSTodayWidgetViewController)]) { 13 | HSTodayWidgetViewController *widgetViewController = (HSTodayWidgetViewController *)hostingViewController.delegate; 14 | WGWidgetPlatterView *platterView = (WGWidgetPlatterView *)widgetViewController.widgetView; 15 | [platterView setContentViewHitTestingDisabled:YES]; 16 | 17 | if (widgetController.cancelTouchesAssertionsByWidgetID[widgetViewController.widgetIdentifier] == nil) 18 | widgetController.cancelTouchesAssertionsByWidgetID[widgetViewController.widgetIdentifier] = [hostingViewController _cancelTouches]; 19 | } 20 | }]; 21 | } 22 | 23 | -(void)folderViewWillEndDragging:(id)arg1 { 24 | %orig(arg1); 25 | 26 | HSTodayWidgetController *todayWidgetController = [HSTodayWidgetController sharedInstance]; 27 | [todayWidgetController enumerateWidgetsWithBlock:^(HSTodayWidgetController *widgetController, WGWidgetHostingViewController *hostingViewController) { 28 | if ([hostingViewController.delegate isKindOfClass:%c(HSTodayWidgetViewController)]) { 29 | HSTodayWidgetViewController *widgetViewController = (HSTodayWidgetViewController *)hostingViewController.delegate; 30 | WGWidgetPlatterView *platterView = (WGWidgetPlatterView *)widgetViewController.widgetView; 31 | [platterView setContentViewHitTestingDisabled:NO]; 32 | } 33 | }]; 34 | 35 | for (NSString *widgetIdentifier in todayWidgetController.cancelTouchesAssertionsByWidgetID) 36 | [todayWidgetController.cancelTouchesAssertionsByWidgetID[widgetIdentifier] invalidate]; 37 | [todayWidgetController.cancelTouchesAssertionsByWidgetID removeAllObjects]; 38 | } 39 | %end 40 | 41 | %ctor { 42 | if (%c(SBHIconManager) && %c(WGWidgetPlatterView)) 43 | %init(); 44 | } -------------------------------------------------------------------------------- /hstodaywidget/SBUIIconForceTouchController.x: -------------------------------------------------------------------------------- 1 | @interface SBUIIconForceTouchController // iOS 10 - 12 2 | +(BOOL)_isPeekingOrShowing; // iOS 10 - 12 3 | +(BOOL)_isWidgetVisible:(id)arg1; // iOS 10 - 12 4 | @end 5 | 6 | @interface SBIconListView // iOS 7 - 12 7 | -(BOOL)containsWidget:(NSString *)identifier; 8 | @end 9 | 10 | @interface SBHIconManager : NSObject 11 | -(BOOL)isScrolling; // iOS 13 12 | -(SBIconListView *)currentRootIconList; // iOS 13 13 | @end 14 | 15 | @interface SBIconController : UIViewController // iOS 3 - 13 16 | @property (nonatomic,readonly) SBHIconManager *iconManager; // iOS 13 17 | +(id)sharedInstance; // iOS 3 - 13 18 | -(BOOL)isScrolling; // iOS 3 - 12 19 | -(SBIconListView *)currentRootIconList; // iOS 4 - 12 20 | @end 21 | 22 | %hook SBUIIconForceTouchController 23 | +(BOOL)_isWidgetVisible:(id)arg1 { 24 | BOOL result = %orig; 25 | if (!result) { 26 | SBIconController *iconController = [%c(SBIconController) sharedInstance]; 27 | SBIconListView *currentRootIconListView = [iconController respondsToSelector:@selector(currentRootIconList)] ? [iconController currentRootIconList] : [iconController.iconManager currentRootIconList]; 28 | BOOL isScrolling = [iconController respondsToSelector:@selector(isScrolling)] ? [iconController isScrolling] : [iconController.iconManager isScrolling]; 29 | if (![%c(SBUIIconForceTouchController) _isPeekingOrShowing] && !isScrolling && [currentRootIconListView containsWidget:arg1]) { 30 | result = YES; // to fix widget not launching URLs that open the application 31 | } 32 | } 33 | return result; 34 | } 35 | %end -------------------------------------------------------------------------------- /hstodaywidget/private_headers/MTMaterialView.h: -------------------------------------------------------------------------------- 1 | @interface NCMaterialSettings : NSObject // iOS 10 2 | -(void)setDefaultValues; // iOS 10 3 | @end 4 | 5 | @interface MTMaterialView : UIView // iOS 11 - 13 6 | +(id)materialViewWithRecipe:(NSInteger)arg1 options:(NSUInteger)arg2; // iOS 11 - 12 7 | // +(id)materialViewWithRecipe:(NSInteger)arg1 configuration:(NSUInteger)arg2; // iOS 13 8 | -(void)_setContinuousCornerRadius:(CGFloat)arg1; // iOS 11 - 12 9 | -(void)setFinalRecipe:(NSInteger)arg1 options:(NSUInteger)arg2 ; // iOS 12 10 | -(void)setRecipe:(NSInteger)arg1; // iOS 13 11 | -(void)setConfiguration:(NSInteger)arg1; // iOS 13 12 | @end 13 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/NSExtension.h: -------------------------------------------------------------------------------- 1 | @interface NSExtension : NSObject // iOS 10 - 13 2 | +(id)extensionWithIdentifier:(id)arg1 error:(id*)arg2; // iOS 10 - 13 3 | -(id)_containingAppIdentifer; // iOS 12 - 13 ? 4 | @end 5 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/SBIconController.h: -------------------------------------------------------------------------------- 1 | @class WGWidgetGroupViewController; 2 | 3 | @interface SBIconController : UIViewController // iOS 3 - 13 4 | +(instancetype)sharedInstance; // iOS 3 - 13 5 | -(UIInterfaceOrientation)orientation; // iOS 3 - 13 6 | -(CGSize)widgetGroupViewController:(WGWidgetGroupViewController *)groupViewController sizeForInterfaceOrientation:(UIInterfaceOrientation)orientation; // iOS 13 7 | @end 8 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/SBUIIconForceTouchController.h: -------------------------------------------------------------------------------- 1 | @interface SBUIIconForceTouchController // iOS 10 - 12 2 | +(BOOL)_isWidgetVisible:(id)widget; // iOS 10 - 12 3 | @end 4 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/SBWidgetController.h: -------------------------------------------------------------------------------- 1 | @class WGWidgetDiscoveryController; 2 | 3 | @interface SBWidgetController : NSObject // iOS 10 - 13 4 | -(WGWidgetDiscoveryController *)_widgetDiscoveryController; // iOS 10 - 13 5 | @end 6 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/SpringBoard.h: -------------------------------------------------------------------------------- 1 | @class SBWidgetController; 2 | 3 | @interface SpringBoard : UIApplication 4 | +(instancetype)sharedApplication; 5 | -(SBWidgetController *)widgetController; // iOS 10 - 13 6 | -(BOOL)homeScreenSupportsRotation; // iOS 8 - 13 7 | @end -------------------------------------------------------------------------------- /hstodaywidget/private_headers/UIViewController+Widgets.h: -------------------------------------------------------------------------------- 1 | @interface UIViewController (Widgets) 2 | -(BOOL)wg_beginAppearanceTransitionIfNecessary:(BOOL)arg1 animated:(BOOL)arg2; 3 | -(BOOL)wg_endAppearanceTransitionIfNecessary; 4 | -(BOOL)wg_isAppearingOrAppeared; 5 | -(BOOL)wg_isDisappearingOrDisappeared; 6 | @end 7 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGMajorListViewContorller.h: -------------------------------------------------------------------------------- 1 | @interface WGMajorListViewContorller : UIViewController // iOS 10 - 13 2 | -(CGSize)maxSizeForWidget:(id)arg1 forDisplayMode:(NSInteger)arg2; // iOS 10 - 13 3 | @end 4 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetDiscoveryController.h: -------------------------------------------------------------------------------- 1 | #import "WGWidgetHostingViewControllerHost.h" 2 | 3 | @interface WGWidgetDiscoveryController : NSObject { 4 | NSMutableDictionary* _identifiersToWidgetInfos; // iOS 10 - 13 5 | } 6 | -(id)debuggingHandler; // iOS 10 - 13 7 | -(void)beginDiscovery; // iOS 10 - 13 8 | -(id)widgetWithIdentifier:(id)arg1 delegate:(id)arg2 forRequesterWithIdentifier:(id)arg3; // iOS 10 - 13 9 | -(void)registerIdentifierForRefreshEvents:(id)arg1; // iOS 13 10 | -(void)unregisterIdentifierForRefreshEvents:(id)arg1; // iOS 13 11 | -(void)addDiscoveryObserver:(id)arg1; // iOS 10 - 13 12 | -(void)removeDiscoveryObserver:(id)arg1; // iOS 10 - 13 13 | -(BOOL)_setEnabled:(BOOL)arg1 forElementWithIdentifier:(id)arg2; // iOS 10 - 13 14 | -(id)_widgetIDsToWidgets; // iOS 12 - 13 15 | @end 16 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetDiscoveryObserving.h: -------------------------------------------------------------------------------- 1 | @protocol WGWidgetDiscoveryObserving // iOS 10 - 13 2 | @optional 3 | -(void)widgetDiscoveryController:(id)arg1 widgetWithIdentifier:(id)arg2 shouldBecomeVisibleInGroup:(id)arg3; // iOS 10 - 13 4 | -(void)widgetDiscoveryController:(id)arg1 widgetWithIdentifier:(id)arg2 shouldBecomeHiddenInGroup:(id)arg3; // iOS 10 - 13 5 | -(void)widgetDiscoveryControllerSignificantWidgetsChange:(id)arg1; // iOS 13 6 | -(void)orderOfVisibleWidgetsDidChange:(id)arg1; // iOS 10 - 13 7 | -(void)widgetDiscoveryController:(id)arg1 orderDidChangeForWidgetIdentifiers:(id)arg2; // iOS 13 8 | @end 9 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetExtensionVisibilityProviding.h: -------------------------------------------------------------------------------- 1 | @protocol WGWidgetExtensionVisibilityProviding // iOS 10 - 13 2 | @required 3 | -(BOOL)isWidgetExtensionVisible:(id)arg1; // iOS 10 - 13 4 | @end 5 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetGroupViewController.h: -------------------------------------------------------------------------------- 1 | @interface WGWidgetGroupViewController : UIViewController // iOS 10 - 13 2 | -(CGSize)widgetListViewController:(id)arg1 sizeForInterfaceOrientation:(UIInterfaceOrientation)arg2; // iOS 12 - 13 3 | @end 4 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetHostingViewController.h: -------------------------------------------------------------------------------- 1 | @protocol WGWidgetHostingViewControllerHost; 2 | @class WGWidgetInfo; 3 | 4 | @interface WGWidgetHostingViewController : UIViewController // iOS 10 - 13 5 | @property (nonatomic, readonly) WGWidgetInfo *widgetInfo; // iOS 10 - 13 6 | @property (assign, nonatomic, weak) id delegate; // iOS 10 - 13 7 | @property (assign, nonatomic, weak) id host; // iOS 10 - 13 8 | @property (assign, nonatomic) NSInteger userSpecifiedDisplayMode; // iOS 10 - 13 9 | // @property (nonatomic,readonly) NSInteger activeDisplayMode; // iOS 10 - 13 10 | -(instancetype)initWithWidgetInfo:(id)arg1 delegate:(id)arg2 host:(id)arg3; // iOS 10 - 13 11 | // -(void)_updateWidgetWithCompletionHandler:(id)arg1; // iOS 10 - 13 12 | // -(void)setActiveDisplayMode:(NSInteger)arg1; // iOS 10 - 13 13 | // -(void)_updatePreferredContentSizeWithHeight:(CGFloat)arg1; // iOS 10 - 13 14 | // -(void)_requestRemoteViewControllerForSequence:(id)arg1 completionHander:(id)arg2; // iOS 10 - 13 15 | // -(void)_connectRemoteViewControllerForReason:(id)arg1 sequence:(id)arg2 completionHandler:(id)arg3; // iOS 10 - 13 16 | // -(void)_requestInsertionOfRemoteViewAfterViewWillAppearForSequence:(id)arg1 completionHandler:(id)arg2 ; // iOS 10 - 13 17 | // -(void)_disconnectRemoteViewControllerForSequence:(id)arg1 completion:(id)arg2; // iOS 10 - 13 18 | // -(id)_activeLifeCycleSequence; // iOS 10 - 13 19 | // -(void)_initiateNewSequenceIfNecessary; // iOS 10 - 13 20 | // -(void)_abortActiveSequence; // iOS 10 - 13 21 | // -(id)host; // iOS 10 - 13 22 | // -(id)delegate; // iOS 10 - 13 23 | -(void)_removeAllSnapshotsForActiveDisplayMode; // iOS 10 24 | -(void)_removeAllSnapshotFilesForActiveDisplayMode; // iOS 11 - 13 25 | // -(void)_performUpdateForSequence:(id)arg1 withCompletionHandler:(id)arg2; // iOS 10 - 13 26 | -(void)_setLargestAvailableDisplayMode:(NSInteger)arg1; // iOS 10 - 13 27 | -(void)managingContainerWillAppear:(id)arg1; // iOS 11 - 13 28 | -(void)managingContainerDidDisappear:(id)arg1; // iOS 11 - 13 29 | -(void)setDisconnectsImmediately:(BOOL)arg1; // iOS 10 - 13 30 | -(id)_cancelTouches; // iOS 10 - 13 31 | @end 32 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetHostingViewControllerDelegate.h: -------------------------------------------------------------------------------- 1 | @protocol WGWidgetHostingViewControllerDelegate // iOS 10 - 13 2 | @optional 3 | -(void)remoteViewControllerDidConnectForWidget:(id)arg1; // iOS 10 - 13 4 | -(void)remoteViewControllerDidDisconnectForWidget:(id)arg1; // iOS 10 - 13 5 | -(void)remoteViewControllerViewDidAppearForWidget:(id)arg1; // iOS 10 - 13 6 | -(void)remoteViewControllerViewDidHideForWidget:(id)arg1; // iOS 10 - 13 7 | -(void)brokenViewDidAppearForWidget:(id)arg1; // iOS 10 - 13 8 | -(id)widget:(id)arg1 didUpdatePreferredHeight:(CGFloat)arg2 completion:(id)arg3; // iOS 10 - 13 9 | -(void)contentAvailabilityDidChangeForWidget:(id)arg1; // iOS 10 - 13 10 | -(void)widget:(id)arg1 didChangeLargestSupportedDisplayMode:(NSInteger)arg2; // iOS 10 - 13 11 | -(BOOL)shouldRequestWidgetRemoteViewControllers; // iOS 10 - 13 12 | -(NSInteger)activeLayoutModeForWidget:(id)arg1; // iOS 10 - 13 13 | -(UIEdgeInsets*)marginInsetsForWidget:(id)arg1; // iOS 10 - 13 14 | -(UIEdgeInsets*)layoutMarginForWidget:(id)arg1; // iOS 13 15 | -(BOOL)managingContainerIsVisibleForWidget:(id)arg1; // iOS 11 - 13 16 | -(CGRect)visibleFrameForWidget:(id)arg1; // iOS 11 - 13 17 | @required 18 | -(CGSize)maxSizeForWidget:(id)arg1 forDisplayMode:(NSInteger)arg2; // iOS 10 - 13 19 | -(void)registerWidgetForRefreshEvents:(id)arg1; // iOS 13 20 | -(void)unregisterWidgetForRefreshEvents:(id)arg1; // iOS 13 21 | @end 22 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetHostingViewControllerHost.h: -------------------------------------------------------------------------------- 1 | @protocol WGWidgetHostingViewControllerHost // iOS 10 - 13 2 | @optional 3 | -(NSInteger)userSpecifiedDisplayModeForWidget:(id)arg1; // iOS 10 - 13 4 | -(void)widget:(id)arg1 didChangeUserSpecifiedDisplayMode:(NSInteger)arg2; // iOS 10 - 13 5 | -(NSInteger)largestAvailableDisplayModeForWidget:(id)arg1; // iOS 10 - 13 6 | -(void)widget:(id)arg1 didChangeLargestAvailableDisplayMode:(NSInteger)arg2; // iOS 10 - 13 7 | -(void)widget:(id)arg1 didEncounterProblematicSnapshotAtURL:(id)arg2; // iOS 10 - 13 8 | -(void)widget:(id)arg1 didRemoveSnapshotAtURL:(id)arg2; // iOS 11 - 13 9 | -(BOOL)shouldPurgeArchivedSnapshotsForWidget:(id)arg1; // iOS 10 - 13 10 | -(BOOL)shouldPurgeNonCAMLSnapshotsForWidget:(id)arg1; // iOS 11 - 13 11 | -(BOOL)shouldPurgeNonASTCSnapshotsForWidget:(id)arg1; // iOS 11 - 13 12 | -(BOOL)shouldRemoveSnapshotWhenNotVisibleForWidget:(id)arg1; // iOS 11 - 13 13 | @end 14 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetInfo.h: -------------------------------------------------------------------------------- 1 | @class NSExtension; 2 | 3 | @interface WGWidgetInfo : NSObject // iOS 10 - 13 4 | @property (nonatomic, readonly) NSExtension *extension; // iOS 10 - 13 5 | @property (setter=_setDisplayName:, nonatomic, copy) NSString *displayName; // iOS 10 - 13 6 | @property (nonatomic, copy, readonly) NSString *widgetIdentifier; // iOS 10 - 13 7 | @property (assign, setter=_setLargestAllowedDisplayMode:, nonatomic) NSInteger largestAllowedDisplayMode; // iOS 10 - 13 8 | +(id)widgetInfoWithExtension:(id)arg1; // iOS 10 - 13 9 | +(CGFloat)maximumContentHeightForCompactDisplayMode; // iOS 10 - 13 10 | -(UIImage *)icon; // iOS 10 - 11 11 | -(id)_icon; // iOS 12 - 13 12 | -(id)_outlineIcon; // iOS 12 - 13 13 | -(void)requestSettingsIconWithHandler:(id)arg1; // iOS 12 - 13 14 | @end 15 | 16 | @interface WGCalendarWidgetInfo : WGWidgetInfo // iOS 10 - 13 17 | +(BOOL)isCalendarExtension:(id)arg1; // iOS 10 - 13 18 | -(void)_setDate:(id)arg1; // iOS 11 - 13 19 | @end 20 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetPlatterView.h: -------------------------------------------------------------------------------- 1 | #import "WGWidgetShortLookView.h" 2 | 3 | @interface WGWidgetPlatterView : UIView // iOS 11 - 13 4 | -(instancetype)initWithFrame:(CGRect)arg1 andCornerRadius:(CGFloat)arg2; // iOS 11 - 12 5 | -(instancetype)initWithFrame:(CGRect)arg1; // iOS 13 6 | -(void)_setContinuousCornerRadius:(CGFloat)arg1; // iOS 13 7 | -(void)setWidgetHost:(id)arg1; // iOS 11 - 13 8 | -(WGWidgetHostingViewController *)widgetHost; // iOS 11 - 13 9 | -(void)setShowMoreButtonVisible:(BOOL)arg1; // iOS 11 - 13 10 | -(void)updateWithRecipe:(NSInteger)arg1 options:(NSUInteger)arg2; // iOS 12 11 | -(void)setMaterialGroupNameBase:(NSString *)arg1; // iOS 13 12 | -(void)_configureHeaderViewsIfNecessary; // iOS 13 13 | -(void)_configureBackgroundMaterialViewIfNecessary; // iOS 13 14 | -(void)setContentViewHitTestingDisabled:(BOOL)arg1; // iOS 13 15 | @end 16 | -------------------------------------------------------------------------------- /hstodaywidget/private_headers/WGWidgetShortLookView.h: -------------------------------------------------------------------------------- 1 | @interface WGWidgetShortLookView : UIView // iOS 10 2 | -(instancetype)initWithFrame:(CGRect)arg1 andCornerRadius:(CGFloat)arg2; // iOS 10 3 | -(void)setWidgetHost:(id)arg1; // iOS 10 4 | -(WGWidgetHostingViewController *)widgetHost; // iOS 10 5 | -(void)setShowMoreButtonVisible:(BOOL)arg1; // iOS 10 6 | @end 7 | -------------------------------------------------------------------------------- /layout/Library/HSWidgets/BatteryWidget.bundle/BatteryWidget: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/layout/Library/HSWidgets/BatteryWidget.bundle/BatteryWidget -------------------------------------------------------------------------------- /layout/Library/HSWidgets/BatteryWidget.bundle/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.qiop1379.batterywidget 7 | NSPrincipalClass 8 | BatteryWidgetViewController 9 | HSWidgetDisplayName 10 | Batteries (Modern) 11 | HSWidgetIcon 12 | icon.png 13 | HSWidgetCreator 14 | qwertyuiop1379 15 | 16 | 17 | -------------------------------------------------------------------------------- /layout/Library/HSWidgets/BatteryWidget.bundle/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/layout/Library/HSWidgets/BatteryWidget.bundle/icon@2x.png -------------------------------------------------------------------------------- /layout/Library/HSWidgets/BatteryWidget.bundle/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/layout/Library/HSWidgets/BatteryWidget.bundle/icon@3x.png -------------------------------------------------------------------------------- /layout/Library/HSWidgets/PhotosWidget.bundle/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.tr1fecta.photoswidget 7 | NSPrincipalClass 8 | HSPhotosWidgetViewController 9 | HSWidgetAddNewOptionsControllerClass 10 | HSPhotoWidgetPreferencesViewController 11 | HSWidgetPreferencesControllerClass 12 | HSPhotoWidgetPreferencesViewController 13 | HSWidgetDisplayName 14 | Photos Widget 15 | HSWidgetIcon 16 | icon.png 17 | HSWidgetCreator 18 | Tr1Fecta 19 | 20 | 21 | -------------------------------------------------------------------------------- /layout/Library/HSWidgets/PhotosWidget.bundle/PhotosWidget: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/layout/Library/HSWidgets/PhotosWidget.bundle/PhotosWidget -------------------------------------------------------------------------------- /layout/Library/HSWidgets/PhotosWidget.bundle/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | label 11 | Image Selector 12 | id 13 | SelectionDescription 14 | footerText 15 | Pick the selector used to choose displayed images. 16 | 17 | 18 | cell 19 | PSSegmentCell 20 | key 21 | ImageSelectionType 22 | id 23 | TypeSelection 24 | validTitles 25 | 26 | Album 27 | Image 28 | Random 29 | 30 | validValues 31 | 32 | 2 33 | 1 34 | 0 35 | 36 | default 37 | 0 38 | 39 | 40 | cellClass 41 | HSPhotosWidgetImageViewPickerCell 42 | key 43 | SelectedImageLocalIdentifier 44 | id 45 | ImageSelection 46 | height 47 | 350 48 | 49 | 50 | cellClass 51 | HSPhotosWidgetAlbumPickerCell 52 | key 53 | SelectedAlbumLocalIdentifier 54 | id 55 | AlbumSelection 56 | height 57 | 350 58 | 59 | 60 | title 61 | Photos 62 | 63 | -------------------------------------------------------------------------------- /layout/Library/HSWidgets/PhotosWidget.bundle/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/layout/Library/HSWidgets/PhotosWidget.bundle/icon@2x.png -------------------------------------------------------------------------------- /layout/Library/HSWidgets/PhotosWidget.bundle/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/layout/Library/HSWidgets/PhotosWidget.bundle/icon@3x.png -------------------------------------------------------------------------------- /private_headers/HSWidget-Availability.h: -------------------------------------------------------------------------------- 1 | static inline BOOL isAtLeastiOS13() { 2 | NSOperatingSystemVersion version; 3 | version.majorVersion = 13; 4 | version.minorVersion = 0; 5 | version.patchVersion = 0; 6 | return [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:version]; 7 | } 8 | -------------------------------------------------------------------------------- /private_headers/NSUserDefaults.h: -------------------------------------------------------------------------------- 1 | @interface NSUserDefaults (Private) 2 | -(id)objectForKey:(id)arg1 inDomain:(id)arg2; 3 | -(void)setObject:(id)arg1 forKey:(id)arg2 inDomain:(id)arg3; 4 | @end 5 | -------------------------------------------------------------------------------- /private_headers/SBFolder.h: -------------------------------------------------------------------------------- 1 | @interface SBFolder : NSObject // iOS 4 - 13 2 | -(NSArray *)_listsForCompaction; // iOS 7 - 13 3 | @end 4 | -------------------------------------------------------------------------------- /private_headers/SBIconController.h: -------------------------------------------------------------------------------- 1 | @class SBIconController, SBHIconManager, SBRootFolderController; 2 | 3 | @interface SBIconDragManager : NSObject // iOS 11 - 13 4 | -(BOOL)isIconDragging; // iOS 11 - 13 5 | -(SBIconController *)iconController; // iOS 11 - 12 6 | -(SBHIconManager *)iconManager; // iOS 13 7 | @end 8 | 9 | @interface SBFloatingDockViewController : UIViewController // iOS 13 10 | @property (nonatomic, assign) CGFloat dockOffscreenProgress; // iOS 13 11 | @end 12 | 13 | @interface SBHIconManager : NSObject // iOS 13 14 | @property (nonatomic, retain) SBFloatingDockViewController *floatingDockViewController; // iOS 13 15 | @property (nonatomic, retain) NSTimer *editingEndTimer; // iOS 13 16 | @property (getter=isScrolling, nonatomic, readonly) BOOL scrolling; // iOS 13 17 | -(void)_restartEditingEndTimer; // iOS 13 18 | -(SBRootFolderController *)rootFolderController; // iOS 13 19 | @end 20 | 21 | @interface SBIconController : UIViewController // iOS 3 - 13 22 | @property (nonatomic, readonly) SBHIconManager *iconManager; // iOS 13 23 | @property (nonatomic, retain) NSTimer *editingEndTimer; // iOS 11 - 13 24 | @property (nonatomic, assign) BOOL isDraggingWidget; 25 | +(instancetype)sharedInstance; // iOS 3 - 13 26 | -(UIInterfaceOrientation)orientation; // iOS 3 - 13 27 | // -(NSUInteger)maxColCountForListInRootFolderWithInterfaceOrientation:(NSInteger)arg1; // iOS 7 - 12 28 | -(id)grabbedIcon; // // iOS 3 - 10 29 | -(SBIconDragManager *)iconDragManager; // iOS 11 - 13 30 | -(SBRootFolderController *)_rootFolderController; // iOS 7 - 13 31 | -(void)_restartEditingEndTimer; // iOS 11 - 12 32 | -(void)bs_beginAppearanceTransition:(BOOL)isAppearing animated:(BOOL)animated; 33 | -(void)bs_endAppearanceTransition; 34 | @end 35 | -------------------------------------------------------------------------------- /private_headers/SBIconCoordinate.h: -------------------------------------------------------------------------------- 1 | struct HSWidgetPosition; 2 | 3 | // One of SpringBoard structs (iOS 7 - 13) 4 | typedef struct SBIconCoordinate { 5 | NSInteger row; 6 | NSInteger col; 7 | } SBIconCoordinate; 8 | 9 | #define SBIconCoordinateInvalid -1 10 | 11 | static inline SBIconCoordinate SBIconCoordinateMake(NSInteger row, NSInteger col) { 12 | SBIconCoordinate iconCoordinate; 13 | iconCoordinate.row = row; 14 | iconCoordinate.col = col; 15 | return iconCoordinate; 16 | } 17 | 18 | #ifdef __cplusplus 19 | static inline SBIconCoordinate SBIconCoordinateMake(HSWidgetPosition position) { 20 | SBIconCoordinate iconCoordinate; 21 | iconCoordinate.row = position.row; 22 | iconCoordinate.col = position.col; 23 | return iconCoordinate; 24 | } 25 | 26 | static inline HSWidgetPosition HSWidgetPositionMake(SBIconCoordinate iconCoordinate) { 27 | HSWidgetPosition position; 28 | position.row = iconCoordinate.row; 29 | position.col = iconCoordinate.col; 30 | return position; 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /private_headers/SBIconListModel.h: -------------------------------------------------------------------------------- 1 | // manage current page type 2 | typedef NS_ENUM(NSUInteger, PageType) { 3 | PageTypeNone = 0, 4 | PageTypeIconsAndWidgetPage 5 | }; 6 | 7 | @interface SBIconListModel : NSObject // iOS 4 - 13 8 | @property (nonatomic, assign) PageType pageLayoutType; // PageType enum 9 | @property (nonatomic, retain) NSMutableArray *widgetViewControllers; 10 | -(NSArray *)icons; // iOS 4 - 13 11 | -(NSUInteger)maxNumberOfIcons; // iOS 7 - 13 12 | -(id)folder; // iOS 4 - 13 13 | @end 14 | 15 | @interface SBHIconModel : NSObject // iOS 13 16 | -(NSUInteger)maxRowCountForListInRootFolderWithInterfaceOrientation:(UIInterfaceOrientation)arg1; 17 | -(NSUInteger)maxColumnCountForListInRootFolderWithInterfaceOrientation:(UIInterfaceOrientation)arg1; 18 | @end 19 | -------------------------------------------------------------------------------- /private_headers/SBIconListView.h: -------------------------------------------------------------------------------- 1 | #import "SBIconCoordinate.h" 2 | 3 | @class HSWidgetPageController; 4 | 5 | @interface SBIconView : UIView // iOS 5 - 13 6 | +(CGSize)defaultIconViewSize; // iOS 13 7 | +(CGSize)defaultIconViewSizeForIconImageSize:(CGSize)arg1 configurationOptions:(NSUInteger)arg2; // iOS 13 8 | @end 9 | 10 | @interface SBIconListView : UIView // iOS 4 - 13 11 | @property (nonatomic, retain) HSWidgetPageController *widgetPageController; 12 | @property (nonatomic, assign) UIInterfaceOrientation orientation; // iOS 7 - 13 13 | +(NSUInteger)iconRowsForInterfaceOrientation:(UIInterfaceOrientation)arg1; // iOS 4 - 12 14 | +(NSUInteger)iconColumnsForInterfaceOrientation:(UIInterfaceOrientation)arg1; // iOS 4 - 12 15 | +(NSUInteger)defaultIconViewConfigurationOptions; // iOS 13 16 | -(Class)baseIconViewClass; // iOS 7 - 13 17 | // +(NSUInteger)maxIcons; // iOS 4 - 12 18 | // +(NSUInteger)maxVisibleIconRowsInterfaceOrientation:(UIInterfaceOrientation)arg1; // iOS 5 - 12 19 | -(NSUInteger)iconColumnsForCurrentOrientation; // iOS 4 - 13 20 | -(NSUInteger)iconRowsForCurrentOrientation; // iOS 4 - 13 21 | // -(SBIconCoordinate)coordinateForIcon:(id)arg1; // iOS 7 - 13 22 | -(CGPoint)originForIconAtCoordinate:(SBIconCoordinate)arg1; // iOS 7 - 13 23 | // -(SBIconCoordinate)coordinateForIconAtIndex:(NSUInteger)arg1; // iOS 7 - 13 24 | -(NSUInteger)indexForCoordinate:(SBIconCoordinate)arg1 forOrientation:(UIInterfaceOrientation)arg2; // iOS 7 - 13 25 | -(SBIconCoordinate)iconCoordinateForIndex:(NSUInteger)arg1 forOrientation:(UIInterfaceOrientation)arg2; // iOS 7 - 13 26 | -(CGPoint)originForIconAtIndex:(NSUInteger)arg1; // iOS 7 - 13 27 | -(SBIconListModel *)model; // iOS 4 - 13 28 | -(CGFloat)horizontalIconPadding; // iOS 4 - 13 29 | -(CGSize)defaultIconSize; // iOS 5 - 12 30 | // -(CGSize)alignmentIconViewSize; // iOS 13 31 | -(CGSize)alignmentIconSize; // iOS 11 - 13 32 | -(CGFloat)verticalIconPadding; // iOS 4 - 13 33 | -(void)layoutIconsNow; // iOS 4 - 13 34 | -(NSUInteger)rowAtPoint:(CGPoint)arg1; // iOS 4 - 13 35 | -(NSUInteger)columnAtPoint:(CGPoint)arg1; // iOS 4 - 13 36 | -(id)icons; // iOS 4 - 13 37 | -(BOOL)isEditing; // iOS 7 - 13 38 | @end 39 | 40 | @interface SBRootIconListView : SBIconListView // iOS 7 - 12 41 | @end 42 | -------------------------------------------------------------------------------- /private_headers/SBRootFolderController.h: -------------------------------------------------------------------------------- 1 | @class SBIconListView, SBHIconModel; 2 | 3 | @interface SBFolderController : UIViewController // iOS 7 - 13 4 | @property (nonatomic, copy, readonly) NSArray *iconListViews; // iOS 7 - 13 5 | @property (nonatomic, readonly) NSUInteger iconListViewCount; // iOS 7 - 13 6 | -(SBIconListView *)currentIconListView; // iOS 7 - 13 7 | -(BOOL)isEditing; // iOS 7 - 13 8 | -(SBIconListView *)iconListViewAtIndex:(NSUInteger)arg1; // iOS 7 - 13 9 | -(SBHIconModel *)iconModel; // iOS 13 10 | @end 11 | 12 | @interface SBRootFolderController : SBFolderController // iOS 7 - 13 13 | @property (nonatomic, retain) NSMutableDictionary *allPagesWidgetLayouts; 14 | @end 15 | -------------------------------------------------------------------------------- /private_headers/SpringBoard.h: -------------------------------------------------------------------------------- 1 | @interface SpringBoard : UIApplication 2 | +(instancetype)sharedApplication; 3 | -(void)addDisableActiveInterfaceOrientationChangeAssertion:(id)arg1; // iOS 7 - 13 4 | -(void)removeDisableActiveInterfaceOrientationChangeAssertion:(id)arg1; // iOS 7 - 12 5 | -(void)removeDisableActiveInterfaceOrientationChangeAssertion:(id)arg1 nudgeOrientationIfRemovingLast:(BOOL)arg2; // iOS 13 6 | -(BOOL)isShowingHomescreen; // iOS 9 - 13 7 | @end 8 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/theos_template/HSWidgets.framework.zip -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/HSWidgets.tbd: -------------------------------------------------------------------------------- 1 | --- 2 | archs: [ armv7, arm64, arm64e ] 3 | platform: ios 4 | install-name: /Library/MobileSubstrate/DynamicLibraries/HSWidgets.dylib 5 | current-version: 0 6 | compatibility-version: 0 7 | objc-constraint: retain_release 8 | exports: 9 | - archs: [ armv7, arm64, arm64e ] 10 | symbols: [ _HSWidgetAllWidgetsConfiguredNotification, 11 | _HSWidgetAnimationDuration, 12 | _HSWidgetAvailableSpaceDidChangeNotification, 13 | _HSWidgetBezierShapeChangedNotification, 14 | _HSWidgetBezierShapeDisplayNameKey, 15 | _HSWidgetBezierShapeEnumKey, _HSWidgetBezierShapeKey, 16 | _HSWidgetDisplayCreatorKey, _HSWidgetDisplayIconKey, 17 | _HSWidgetDisplayNameKey, _HSWidgetDomain, 18 | _HSWidgetEditingStateChangedNotification, 19 | _HSWidgetEditingStateKey, _HSWidgetExpandImageName, 20 | _HSWidgetFrameZero, _HSWidgetPlaceholderImageName, 21 | _HSWidgetPlaceholderShapeImageName, 22 | _HSWidgetPositionZero, 23 | _HSWidgetQuickAnimationDuration, 24 | _HSWidgetSettingsImageName, _HSWidgetShrinkImageName, 25 | _HSWidgetSizeZero ] 26 | objc-classes: [ _HSModernWidgetViewController, 27 | _HSWidgetAdditionalOptionsViewController, 28 | _HSWidgetAvailablePositionObject, 29 | _HSWidgetCombinedAdditionalOptionsAndPreferencesViewController, 30 | _HSWidgetFrameObject, 31 | _HSWidgetGridPositionConverterCache, 32 | _HSWidgetPositionObject, 33 | _HSWidgetPreferencesListController, 34 | _HSWidgetResources, _HSWidgetSizeObject, 35 | _HSWidgetUnclippedView, _HSWidgetViewController ] 36 | objc-ivars: [ _HSWidgetViewController._delegate, 37 | _HSWidgetViewController.widgetOptions ] 38 | ... 39 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSModernWidgetViewController.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetViewController.h" 2 | 3 | NS_ASSUME_NONNULL_BEGIN 4 | 5 | @interface HSModernWidgetViewController : HSWidgetViewController 6 | @property (nonatomic, retain, nullable) UIVisualEffectView *blurView; 7 | @property (nonatomic, retain, nullable) UILabel *titleLabel; 8 | @property (nonatomic, readonly, nullable) UIView *contentView; 9 | @property (nonatomic, assign) BOOL isExpanded; 10 | +(HSWidgetSize)minimumSize; 11 | +(NSInteger)allowedInstancesPerPage; 12 | -(instancetype)initForWidgetFrame:(HSWidgetFrame)frame withOptions:(nullable NSDictionary *)options NS_REQUIRES_SUPER; 13 | -(CGRect)calculatedFrame; 14 | -(void)setCornerRadius:(CGFloat)cornerRadius; 15 | -(BOOL)isAccessoryTypeEnabled:(AccessoryType)accessory; 16 | -(void)accessoryTypeTapped:(AccessoryType)accessory; 17 | -(void)expandWidget; 18 | -(void)shrinkWidget; 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetAddNewAdditionalOptionsDelegate.h: -------------------------------------------------------------------------------- 1 | @protocol HSWidgetAdditionalOptions; 2 | 3 | @protocol HSWidgetAddNewAdditionalOptionsDelegate 4 | -(void)dismissAddWidget; 5 | -(void)additionalOptionsViewController:(id)additionalOptionsViewController addWidgetForClass:(Class)widgetClass; 6 | @end 7 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetAdditionalOptions.h: -------------------------------------------------------------------------------- 1 | @protocol HSWidgetAddNewAdditionalOptionsDelegate; 2 | @class HSWidgetAvailablePositionObject; 3 | 4 | struct HSWidgetSize; 5 | 6 | @protocol HSWidgetAdditionalOptions 7 | @required 8 | @property (nonatomic, retain) Class widgetClass; 9 | @property (nonatomic, retain) NSMutableDictionary *widgetOptions; 10 | @property (nonatomic, assign) HSWidgetSize requestWidgetSize; 11 | @property (nonatomic, assign) id delegate; 12 | @optional 13 | -(instancetype)initWithWidgetsOptionsToExclude:(NSArray *)optionsToExclude withDelegate:(id)delegate availablePositions:(NSArray *)positions; 14 | @end 15 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetAdditionalOptionsViewController.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetAdditionalOptions.h" 2 | #import "HSWidgetAddNewAdditionalOptionsDelegate.h" 3 | #import "HSWidgetAvailablePositionObject.h" 4 | 5 | @interface HSWidgetAdditionalOptionsViewController : UITableViewController 6 | @property (nonatomic, retain) Class widgetClass; 7 | @property (nonatomic, retain) NSMutableDictionary *widgetOptions; 8 | @property (nonatomic, assign) HSWidgetSize requestWidgetSize; 9 | @property (nonatomic, retain) NSArray *availablePositions; 10 | @property (nonatomic, assign) id delegate; 11 | -(instancetype)initWithWidgetsOptionsToExclude:(NSArray *)optionsToExclude withDelegate:(id)delegate availablePositions:(NSArray *)positions; 12 | -(void)cancelAdditionalOptions; 13 | -(void)addWidget; 14 | -(BOOL)containsSpaceForGridPositions:(NSArray *)positions; 15 | -(BOOL)containsSpaceForWidgetSize:(HSWidgetSize)size; 16 | @end -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetAvailablePositionObject.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetPositionObject.h" 2 | 3 | @interface HSWidgetAvailablePositionObject : HSWidgetPositionObject 4 | @property (nonatomic, assign) BOOL containsIcon; 5 | +(instancetype)objectWithAvailableWidgetPosition:(HSWidgetPosition)position containingIcon:(BOOL)containsIcon; 6 | -(instancetype)initWithAvailableWidgetPosition:(HSWidgetPosition)position containingIcon:(BOOL)containsIcon; 7 | @end 8 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetCombinedAdditionalOptionsAndPreferencesViewController.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetAdditionalOptions.h" 2 | #import "HSWidgetAddNewAdditionalOptionsDelegate.h" 3 | #import "HSWidgetPreferencesListController.h" 4 | 5 | @interface HSWidgetCombinedAdditionalOptionsAndPreferencesViewController : HSWidgetPreferencesListController 6 | @property (nonatomic, retain) Class widgetClass; 7 | @property (nonatomic, retain) NSMutableDictionary *widgetOptions; 8 | @property (nonatomic, assign) HSWidgetSize requestWidgetSize; 9 | @property (nonatomic, assign) id delegate; 10 | -(void)cancelAdditionalOptions; 11 | -(void)addWidget; 12 | -(BOOL)containsSpaceForGridPositions:(NSArray *)positions; 13 | -(BOOL)containsSpaceForWidgetSize:(HSWidgetSize)size; 14 | @end -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetDelegate.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @class HSWidgetViewController; 4 | 5 | @protocol HSWidgetDelegate 6 | @required 7 | -(void)closeTapped:(HSWidgetViewController *)widgetViewController; 8 | -(void)settingsTapped:(HSWidgetViewController *)widgetViewController; 9 | -(void)widgetOptionsChanged:(HSWidgetViewController *)widgetViewController; 10 | -(BOOL)canDragWidget:(HSWidgetViewController *)widgetViewController; 11 | -(void)setDraggingWidget:(HSWidgetViewController *)widgetViewController; 12 | -(void)widgetDragged:(HSWidgetViewController *)widgetViewController toPoint:(CGPoint)point; 13 | -(BOOL)canWidget:(HSWidgetViewController *)widgetViewController expandOrShrinkToGridPositions:(NSArray *)positions; 14 | -(void)updatePageForExpandOrShrinkOfWidget:(HSWidgetViewController *)widgetViewController toGridPositions:(NSArray *)positions; 15 | -(HSWidgetPosition)widgetOriginForWidgetSize:(HSWidgetSize)size withPreferredOrigin:(HSWidgetPosition)position; 16 | @end -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetFrameObject.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @interface HSWidgetFrameObject : NSObject 4 | @property (nonatomic, assign) HSWidgetFrame frame; 5 | @property (nonatomic, assign) HSWidgetPosition origin; 6 | @property (nonatomic, assign) HSWidgetSize size; 7 | +(instancetype)objectWithWidgetFrame:(HSWidgetFrame)frame; 8 | -(instancetype)initWithWidgetFrame:(HSWidgetFrame)frame; 9 | -(BOOL)isEqualToWidgetFrameObject:(HSWidgetFrameObject *)object; 10 | -(BOOL)isEqual:(id)object; 11 | @end 12 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetGridPositionConverterCache.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetPositionObject.h" 2 | #import "HSWidgetAvailablePositionObject.h" 3 | 4 | struct HSWidgetSize; 5 | struct HSWidgetFrame; 6 | 7 | @interface HSWidgetGridPositionConverterCache : NSObject 8 | +(NSMutableArray *)gridPositionsForWidgetFrame:(HSWidgetFrame)frame; 9 | +(HSWidgetPosition)originForWidgetOfSize:(HSWidgetSize)size inGridPositions:(NSArray *)positions; 10 | +(BOOL)canFitWidgetOfSize:(HSWidgetSize)size inGridPositions:(NSArray *)positions; 11 | +(BOOL)canFitWidget:(NSArray *)widgetPositions inGridPositions:(NSArray *)positions; 12 | @end 13 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetPositionObject.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @interface HSWidgetPositionObject : NSObject 4 | @property (nonatomic, assign) HSWidgetPosition position; 5 | @property (nonatomic, assign, getter=row, setter=setRow:) NSUInteger row; 6 | @property (nonatomic, assign, getter=col, setter=setCol:) NSUInteger col; 7 | +(instancetype)objectWithWidgetPosition:(HSWidgetPosition)position; 8 | -(instancetype)initWithWidgetPosition:(HSWidgetPosition)position; 9 | -(BOOL)isEqualToWidgetPositionObject:(HSWidgetPositionObject *)object; 10 | -(BOOL)isEqual:(id)object; 11 | @end 12 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetPreferences.h: -------------------------------------------------------------------------------- 1 | @class HSWidgetAvailablePositionObject, HSWidgetViewController; 2 | 3 | @protocol HSWidgetPreferences 4 | @required 5 | @property (nonatomic, retain) HSWidgetViewController *widgetViewController; 6 | @property (nonatomic, retain) NSArray *availablePositions; 7 | -(instancetype)initWithWidgetViewController:(HSWidgetViewController *)widgetViewController availablePositions:(NSArray *)positions; 8 | @end 9 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetPreferencesListController.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgetAvailablePositionObject.h" 2 | #import "HSWidgetPreferences.h" 3 | #import "HSWidgetViewController.h" 4 | #import 5 | #import 6 | 7 | @interface HSWidgetPreferencesListController : PSListController 8 | @property (nonatomic, retain) HSWidgetViewController *widgetViewController; 9 | @property (nonatomic, retain) NSArray *availablePositions; 10 | -(void)resetAllSettings; 11 | -(id)readPreferenceValue:(PSSpecifier *)specifier; 12 | -(void)setPreferenceValue:(id)value specifier:(PSSpecifier *)specifier; 13 | -(void)resetWidgetOptions; 14 | -(id)readWidgetOptionsValue:(PSSpecifier *)specifier; 15 | -(void)setWidgetOptionsValue:(id)value specifier:(PSSpecifier *)specifier; 16 | -(void)resetUserDefaults; 17 | -(id)readUserDefaultsValue:(PSSpecifier *)specifier; 18 | -(void)setUserDefaultsValue:(id)value specifier:(PSSpecifier *)specifier; 19 | -(void)resetFileValues; 20 | -(id)readFileValue:(PSSpecifier *)specifier; 21 | -(void)setFileValue:(id)value specifier:(PSSpecifier *)specifier; 22 | -(BOOL)containsSpaceForGridPositions:(NSArray *)positions; 23 | -(BOOL)containsSpaceForWidgetSize:(HSWidgetSize)size; 24 | @end -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetResources.h: -------------------------------------------------------------------------------- 1 | NS_ASSUME_NONNULL_BEGIN 2 | 3 | extern NSString *const HSWidgetDomain; 4 | 5 | extern NSString *const HSWidgetExpandImageName; 6 | extern NSString *const HSWidgetShrinkImageName; 7 | extern NSString *const HSWidgetSettingsImageName; 8 | extern NSString *const HSWidgetPlaceholderImageName; 9 | extern NSString *const HSWidgetPlaceholderShapeImageName; 10 | 11 | extern NSString *const HSWidgetBezierShapeChangedNotification; 12 | extern NSString *const HSWidgetBezierShapeKey; 13 | extern NSString *const HSWidgetBezierShapeEnumKey; 14 | extern NSString *const HSWidgetBezierShapeDisplayNameKey; 15 | 16 | typedef NS_ENUM(NSUInteger, HSWidgetBezierShape) { 17 | HSWidgetBezierShapeDefault = 0, 18 | HSWidgetBezierShapeCustom, 19 | HSWidgetBezierShapeRoundedRect, 20 | HSWidgetBezierShapeRect, 21 | HSWidgetBezierShapeCircle, 22 | HSWidgetBezierShapeTriangle, 23 | HSWidgetBezierShapeStar 24 | }; 25 | 26 | @interface HSWidgetResources : NSObject 27 | +(nullable UIImage *)imageNamed:(NSString *)name; 28 | +(NSArray *)allBezierShapes; 29 | +(nullable UIBezierPath *)bezierPathForRect:(CGRect)rect withShape:(HSWidgetBezierShape)shape lineThickness:(CGFloat)thickness; 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetSizeObject.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | 3 | @interface HSWidgetSizeObject : NSObject 4 | @property (nonatomic, assign) HSWidgetSize size; 5 | @property (nonatomic, assign) NSUInteger numRows; 6 | @property (nonatomic, assign) NSUInteger numCols; 7 | +(instancetype)objectWithWidgetSize:(HSWidgetSize)size; 8 | -(instancetype)initWithWidgetSize:(HSWidgetSize)size; 9 | -(BOOL)isEqualToWidgetSizeObject:(HSWidgetSizeObject *)object; 10 | -(BOOL)isEqual:(id)object; 11 | @end 12 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgetUnclippedView.h: -------------------------------------------------------------------------------- 1 | // used so that accessories outside the widget can still be tapped 2 | @interface HSWidgetUnclippedView : UIView 3 | @end 4 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgets-core.h: -------------------------------------------------------------------------------- 1 | #import "HSWidgets-structs.h" 2 | #import "HSWidgetPositionObject.h" 3 | #import "HSWidgetAvailablePositionObject.h" 4 | #import "HSWidgetSizeObject.h" 5 | #import "HSWidgetFrameObject.h" 6 | #import "HSWidgetGridPositionConverterCache.h" 7 | -------------------------------------------------------------------------------- /theos_template/HSWidgets.framework/Headers/HSWidgets.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | -------------------------------------------------------------------------------- /theos_template/create_tbd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -x 4 | 5 | # Require noahdev's tbd, --ignore-weak-defs option was added in https://github.com/DGh0st/tbd fork (original version available https://github.com/inoahdev/tbd) 6 | # Converts a mach-o into a tbd (Create a tbd for HSWidgets for linking subprojects or custom widgets) 7 | # 8 | # TBD_INPUT_PATH := input path of the mach-o file to convert 9 | # TBD_OUTPUT_PATH := output path to generate the tbd file at 10 | # 11 | tbd -p --ignore-weak-defs --ignore-undefineds --ignore-flags --ignore-uuids $TBD_INPUT_PATH -o $TBD_OUTPUT_PATH 12 | -------------------------------------------------------------------------------- /theos_template/hscustomwidget/HSCustomWidgetPreferencesViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface HSCustomWidgetPreferencesViewController : HSWidgetCombinedAdditionalOptionsAndPreferencesViewController 4 | @end 5 | -------------------------------------------------------------------------------- /theos_template/hscustomwidget/HSCustomWidgetPreferencesViewController.mm: -------------------------------------------------------------------------------- 1 | #import "HSCustomWidgetPreferencesViewController.h" 2 | 3 | @implementation HSCustomWidgetPreferencesViewController 4 | -(NSArray *)specifiers { 5 | if (!_specifiers) { 6 | _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; 7 | } 8 | return _specifiers; 9 | } 10 | @end 11 | -------------------------------------------------------------------------------- /theos_template/hscustomwidget/HSCustomWidgetViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface HSCustomWidgetViewController : HSWidgetViewController 4 | @property (nonatomic, retain) UIView *square; 5 | @end 6 | 7 | -------------------------------------------------------------------------------- /theos_template/hscustomwidget/HSCustomWidgetViewController.mm: -------------------------------------------------------------------------------- 1 | #import "HSCustomWidgetViewController.h" 2 | 3 | @implementation HSCustomWidgetViewController 4 | -(void)viewDidLoad { 5 | [super viewDidLoad]; 6 | 7 | self.square = [[UIView alloc] initWithFrame:[self calculatedFrame]]; 8 | [self updateSquareColor]; 9 | self.square.layer.cornerRadius = self.cornerRadius; 10 | [self.view addSubview:self.square]; 11 | } 12 | 13 | -(void)setWidgetOptionValue:(id)object forKey:(NSString *)key { 14 | [super setWidgetOptionValue:object forKey:key]; 15 | 16 | if ([key isEqualToString:@"WidgetColor"]) { 17 | [self updateSquareColor]; 18 | } 19 | } 20 | 21 | -(void)updateSquareColor { 22 | NSInteger colorPicked = [widgetOptions[@"WidgetColor"] integerValue]; 23 | if (colorPicked == 0) 24 | self.square.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.5]; 25 | else if (colorPicked == 1) 26 | self.square.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.5]; 27 | else if (colorPicked == 2) 28 | self.square.backgroundColor = [[UIColor blueColor] colorWithAlphaComponent:0.5]; 29 | } 30 | 31 | -(CGRect)calculatedFrame { 32 | CGFloat length = MIN(self.requestedSize.width, self.requestedSize.height); 33 | return CGRectMake(5, 5, length - 10, length - 10); 34 | } 35 | 36 | -(BOOL)isAccessoryTypeEnabled:(AccessoryType)accessory { 37 | if (accessory == AccessoryTypeExpand) { 38 | HSWidgetSize finalExpandedSize = HSWidgetSizeAdd(self.widgetFrame.size, 1, 1); 39 | return [super containsSpaceToExpandOrShrinkToWidgetSize:finalExpandedSize]; 40 | } else if (accessory == AccessoryTypeShrink) { 41 | return self.widgetFrame.size.numRows > 1 && self.widgetFrame.size.numCols > 1; 42 | } 43 | 44 | // anything else we don't support but let super class handle it incase new accessory types are added 45 | return [super isAccessoryTypeEnabled:accessory]; 46 | } 47 | 48 | -(void)accessoryTypeTapped:(AccessoryType)accessory { 49 | if (accessory == AccessoryTypeExpand) { 50 | HSWidgetSize finalExpandSize = HSWidgetSizeAdd(self.widgetFrame.size, 1, 1); 51 | [super updateForExpandOrShrinkToWidgetSize:finalExpandSize]; 52 | } else if (accessory == AccessoryTypeShrink) { 53 | HSWidgetSize finalShrinkSize = HSWidgetSizeAdd(self.widgetFrame.size, -1, -1); 54 | [super updateForExpandOrShrinkToWidgetSize:finalShrinkSize]; 55 | } 56 | } 57 | 58 | -(void)setRequestedSize:(CGSize)size { 59 | [super setRequestedSize:size]; 60 | 61 | self.square.frame = [self calculatedFrame]; 62 | } 63 | 64 | +(HSWidgetSize)minimumSize { 65 | return HSWidgetSizeMake(1, 1); // least amount of rows and cols the widget needs 66 | } 67 | @end 68 | -------------------------------------------------------------------------------- /theos_template/hscustomwidget/Makefile: -------------------------------------------------------------------------------- 1 | INSTALL_TARGET_PROCESSES = SpringBoard 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | 5 | BUNDLE_NAME = HSCustomWidget 6 | HSCustomWidget_FILES = HSCustomWidgetViewController.mm HSCustomWidgetPreferencesViewController.mm 7 | HSCustomWidget_FRAMEWORKS = UIKit 8 | HSCustomWidget_EXTRA_FRAMEWORKS = HSWidgets 9 | HSCustomWidget_PRIVATE_FRAMEWORKS = Preferences 10 | HSCustomWidget_INSTALL_PATH = /Library/HSWidgets 11 | HSCustomWidget_CFLAGS = -fobjc-arc 12 | 13 | include $(THEOS_MAKE_PATH)/bundle.mk 14 | 15 | -------------------------------------------------------------------------------- /theos_template/hscustomwidget/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.dgh0st.hscustomwidget 7 | NSPrincipalClass 8 | HSCustomWidgetViewController 9 | HSWidgetAddNewOptionsControllerClass 10 | HSCustomWidgetPreferencesViewController 11 | HSWidgetPreferencesControllerClass 12 | HSCustomWidgetPreferencesViewController 13 | HSWidgetDisplayName 14 | Custom Widget 15 | HSWidgetIcon 16 | icon.png 17 | HSWidgetCreator 18 | DGh0st 19 | 20 | 21 | -------------------------------------------------------------------------------- /theos_template/hscustomwidget/Resources/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | label 11 | Color 12 | footerText 13 | Pick the color of the square 14 | 15 | 16 | cell 17 | PSSegmentCell 18 | key 19 | WidgetColor 20 | validTitles 21 | 22 | Red 23 | Green 24 | Blue 25 | 26 | validValues 27 | 28 | 0 29 | 1 30 | 2 31 | 32 | default 33 | 0 34 | 35 | 36 | title 37 | Square 38 | 39 | 40 | -------------------------------------------------------------------------------- /theos_template/hscustomwidget/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/theos_template/hscustomwidget/Resources/icon@2x.png -------------------------------------------------------------------------------- /theos_template/hscustomwidget/Resources/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DGh0st/HSWidgets/e36abcb90392da2af9d447350a07f604b4b9c319/theos_template/hscustomwidget/Resources/icon@3x.png -------------------------------------------------------------------------------- /theos_template/hscustomwidget/control: -------------------------------------------------------------------------------- 1 | Package: com.dgh0st.hscustomwidget 2 | Name: HSCustomWidget 3 | Depends: mobilesubstrate, com.dgh0st.hswidgets 4 | Version: 1.0 5 | Architecture: iphoneos-arm 6 | Description: An awesome HSWidgets extension! 7 | Maintainer: DGh0st 8 | Author: DGh0st 9 | Section: Addons (HSWidgets) 10 | --------------------------------------------------------------------------------