Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RaafatAkkad committed Dec 3, 2022
1 parent 23b6083 commit 8a68395
Show file tree
Hide file tree
Showing 178 changed files with 1,098 additions and 1,528 deletions.
Binary file modified Sparkle.framework/Versions/B/Autoupdate
Binary file not shown.
7 changes: 0 additions & 7 deletions Sparkle.framework/Versions/B/Headers/SPUDownloadData.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif

#ifdef BUILDING_SPARKLE_DOWNLOADER_SERVICE
// Ignore incorrect warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -38,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
SU_EXPORT @interface SPUStandardUpdaterController : NSObject
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-interface-ivars"
/**
* Interface builder outlet for the updater's delegate.
*/
Expand All @@ -47,6 +42,7 @@ SU_EXPORT @interface SPUStandardUpdaterController : NSObject
* Interface builder outlet for the user driver's delegate.
*/
IBOutlet __weak id<SPUStandardUserDriverDelegate> userDriverDelegate;
#pragma clang diagnostic pop
}

/**
Expand Down
7 changes: 0 additions & 7 deletions Sparkle.framework/Versions/B/Headers/SPUStandardUserDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SPUUserDriver.h>
#import <Sparkle/SUExport.h>

Expand Down
124 changes: 116 additions & 8 deletions Sparkle.framework/Versions/B/Headers/SPUStandardUserDriverDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>

NS_ASSUME_NONNULL_BEGIN

@protocol SUVersionDisplay;
@class SUAppcastItem;
@class SPUUserUpdateState;

/**
A protocol for Sparkle's standard user driver's delegate
Expand Down Expand Up @@ -59,6 +56,117 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
@param item The appcast item corresponding to the latest version available.
*/
- (void)standardUserDriverShowVersionHistoryForAppcastItem:(SUAppcastItem *_Nonnull)item;
- (void)standardUserDriverShowVersionHistoryForAppcastItem:(SUAppcastItem *)item;

/**
Specifies whether or not the download, extraction, and installing status windows allows to be minimized.
By default, the status window showing the current status of the update (download, extraction, ready to install) is allowed to be minimized
for regular application bundle updates.
@return @c YES if the status window is allowed to be minimized (default behavior), otherwise @c NO.
*/
- (BOOL)standardUserDriverAllowsMinimizableStatusWindow;

/**
Declares whether or not gentle scheduled update reminders are supported.
The delegate may implement scheduled update reminders that are presented in a gentle manner by implementing one or both of:
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:` and `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@return @c YES if gentle scheduled update reminders are implemented by standard user driver delegate, otherwise @c NO (default).
*/
@property (nonatomic, readonly) BOOL supportsGentleScheduledUpdateReminders;

/**
Specifies if the standard user driver should handle showing a new scheduled update, or if its delegate should handle showing the update instead.
If you implement this method and return @c NO the delegate is then responsible for showing the update,
which must be implemented and done in `-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
The motivation for the delegate being responsible for showing updates is to override Sparkle's default behavior
and add gentle reminders for new updates.
Returning @c YES is the default behavior and allows the standard user driver to handle showing the update.
If the standard user driver handles showing the update, `immediateFocus` reflects whether or not it will show the update in immediate and utmost focus.
The standard user driver may choose to show the update in immediate and utmost focus when the app was launched recently
or the system has been idle for some time.
If `immediateFocus` is @c NO the standard user driver may want to defer showing the update until the user comes back to the app.
For background running applications, when `immediateFocus` is @c NO the standard user driver will always want to show
the update alert immediately, but behind other running applications or behind the app's own windows if it's currently active.
There should be no side effects made when implementing this method so you should just return @c YES or @c NO
You will also want to implement `-standardUserDriverWillHandleShowingUpdate:forUpdate:state:` for adding additional update reminders.
This method is not called for user-initiated update checks. The standard user driver always handles those.
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@param update The update the standard user driver should show.
@param immediateFocus If @c immediateFocus is @c YES, then the standard user driver proposes to show the update in immediate and utmost focus. See discussion for more details.
@return @c YES if the standard user should handle showing the scheduled update (default behavior), otherwise @c NO if the delegate handles showing it.
*/
- (BOOL)standardUserDriverShouldHandleShowingScheduledUpdate:(SUAppcastItem *)update andInImmediateFocus:(BOOL)immediateFocus;

/**
Called before an update will be shown to the user.
If the standard user driver handles showing the update, `handleShowingUpdate` will be `YES`.
Please see `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:` for how the standard user driver
may handle showing scheduled updates when `handleShowingUpdate` is `YES` and `state.userInitiated` is `NO`.
If the delegate declared it handles showing the update by returning @c NO in `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
then the delegate should handle showing update reminders in this method, or at some later point.
In this case, `handleShowingUpdate` will be @c NO.
To bring the update alert in focus, you may call `-[SPUStandardUpdaterController checkForUpdates:]` or `-[SPUUpdater checkForUpdates]`.
You may want to show additional UI indicators in your application that will show this update in focus
and want to dismiss additional UI indicators in `-standardUserDriverWillFinishUpdateSession` or `-standardUserDriverDidReceiveUserAttentionForUpdate:`
If `state.userInitiated` is @c YES then the standard user driver always handles showing the new update and `handleShowingUpdate` will be @c YES.
In this case, it may still be useful for the delegate to intercept this method right before a new update will be shown.
This method is not called when bringing an update that has already been presented back in focus.
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@param handleShowingUpdate @c YES if the standard user driver handles showing the update, otherwise @c NO if the delegate handles showing the update.
@param update The update that will be shown.
@param state The user state of the update which includes if the update check was initiated by the user.
*/
- (void)standardUserDriverWillHandleShowingUpdate:(BOOL)handleShowingUpdate forUpdate:(SUAppcastItem *)update state:(SPUUserUpdateState *)state;

/**
Called when a new update first receives attention from the user.
This occurs either when the user first brings the update alert in utmost focus or when the user makes a choice to install an update or dismiss/skip it.
This may be useful to intercept for dismissing custom attention-based UI indicators (e.g, user notifications) introduced when implementing
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
For custom UI indicators that need to still be on screen after the user has started to install an update, please see `-standardUserDriverWillFinishUpdateSession`.
@param update The new update that the user gave attention to.
*/
- (void)standardUserDriverDidReceiveUserAttentionForUpdate:(SUAppcastItem *)update;

/**
Called before the standard user driver session will finish its current update session.
This may occur after the user has dismissed / skipped a new update or after an update error has occurred.
For updaters updating external/other bundles, this may also be called after an update has been successfully installed.
This may be useful to intercept for dismissing custom UI indicators introduced when implementing
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
For UI indicators that need to be dismissed when the user has given attention to a new update alert,
please see `-standardUserDriverDidReceiveUserAttentionForUpdate:`
*/
- (void)standardUserDriverWillFinishUpdateSession;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
// Copyright © 2016 Sparkle Project. All rights reserved.
//

#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>

NS_ASSUME_NONNULL_BEGIN
Expand Down
55 changes: 33 additions & 22 deletions Sparkle.framework/Versions/B/Headers/SPUUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//

#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUUserDriver.h>

Expand All @@ -32,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
Prefer to set initial properties in your bundle's Info.plist as described in [Customizing Sparkle](https://sparkle-project.org/documentation/customization/).
Otherwise only if you need dynamic behavior (eg. for user preferences) should you set properties on the updater such as:
Otherwise only if you need dynamic behavior for user settings should you set properties on the updater such as:
- `automaticallyChecksForUpdates`
- `updateCheckInterval`
- `automaticallyDownloadsUpdates`
Expand Down Expand Up @@ -102,18 +95,23 @@ SU_EXPORT @interface SPUUpdater : NSObject
- (void)checkForUpdates;

/**
Checks for updates, but does not display any UI unless an update is found.
Checks for updates, but does not show any UI unless an update is found.
You usually do not need to call this method directly. If `automaticallyChecksForUpdates` is @c YES,
Sparkle calls this method automatically according to its update schedule using the `updateCheckInterval`
and the `lastUpdateCheckDate`.
and the `lastUpdateCheckDate`. Therefore, you should typically only consider calling this method directly if you
opt out of automatic update checks.
This is meant for programmatically initating a check for updates.
That is, it will display no UI unless it finds an update, in which case it proceeds as usual.
This will not find updates that the user has opted into skipping.
This is meant for programmatically initating a check for updates in the background without the user initiating it.
This check will not show UI if no new updates are found.
If a new update is found, the updater's user driver may handle showing it at an appropriate (but not necessarily immediate) time.
If you want control over when and how a new update is shown, please see https://sparkle-project.org/documentation/gentle-reminders/
Note if there is no resumable update found, and automated updating is turned on,
the update will be downloaded in the background without disrupting the user.
Note if automated updating is turned on, either a new update may be downloaded in the background to be installed silently,
or an already downloaded update may be shown.
This will not find updates that the user has opted into skipping.
This method does not do anything if there is a `sessionInProgress`.
*/
Expand Down Expand Up @@ -177,7 +175,11 @@ SU_EXPORT @interface SPUUpdater : NSObject
this permission request is not performed however.
Setting this property will persist in the host bundle's user defaults.
Only set this property if you need dynamic behavior (e.g. user preferences).
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
For testing environments, you can disable update checks by passing `-SUEnableAutomaticChecks NO`
to your app's command line arguments instead of setting this property.
The update schedule cycle will be reset in a short delay after the property's new value is set.
This is to allow reverting this property without kicking off a schedule change immediately
Expand All @@ -187,9 +189,12 @@ SU_EXPORT @interface SPUUpdater : NSObject
/**
A property indicating the current automatic update check interval in seconds.
Prefer to set SUScheduledCheckInterval directly in your Info.plist for setting the initial value.
Setting this property will persist in the host bundle's user defaults.
For this reason, only set this property if you need dynamic behavior (eg user preferences).
Otherwise prefer to set SUScheduledCheckInterval directly in your Info.plist.
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
The update schedule cycle will be reset in a short delay after the property's new value is set.
This is to allow reverting this property without kicking off a schedule change immediately
Expand All @@ -201,12 +206,15 @@ SU_EXPORT @interface SPUUpdater : NSObject
By default, updates are not automatically downloaded.
Note that the developer can disallow automatic downloading of updates from being enabled.
Note that the developer can disallow automatic downloading of updates from being enabled (via `SUAllowsAutomaticUpdates` Info.plist key).
In this case, this property will return NO regardless of how this property is set.
Prefer to set SUAutomaticallyUpdate directly in your Info.plist for setting the initial value.
Setting this property will persist in the host bundle's user defaults.
For this reason, only set this property if you need dynamic behavior (eg user preferences).
Otherwise prefer to set SUAutomaticallyUpdate directly in your Info.plist.
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
*/
@property (nonatomic) BOOL automaticallyDownloadsUpdates;

Expand All @@ -218,6 +226,9 @@ SU_EXPORT @interface SPUUpdater : NSObject
Otherwise the feed URL in the host bundle's Info.plist will be returned.
If no feed URL can be retrieved, returns nil.
For setting a primary feed URL, please set the `SUFeedURL` property in your Info.plist.
For setting an alternative feed URL, please prefer `-[SPUUpdaterDelegate feedURLStringForUpdater:]` over `-setFeedURL:`
This property must be called on the main thread; calls from background threads will return nil.
*/
@property (nonatomic, readonly, nullable) NSURL *feedURL;
Expand Down Expand Up @@ -281,7 +292,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
@property (nonatomic, readonly, copy, nullable) NSDate *lastUpdateCheckDate;

/**
Appropriately schedules or cancels the update checking timer according to the preferences for time interval and automatic checks.
Appropriately schedules or cancels the update checking timer according to the settings for the time interval and automatic checks.
If you change the `updateCheckInterval` or `automaticallyChecksForUpdates` properties, the update cycle will be reset automatically after a short delay.
The update cycle is also started automatically after the updater is started. In all these cases, this method should not be called directly.
Expand Down
Loading

0 comments on commit 8a68395

Please sign in to comment.