Skip to content

Commit dcdb825

Browse files
committed
releasing as opensource on github (bzr revno 518)
0 parents  commit dcdb825

File tree

545 files changed

+45424
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

545 files changed

+45424
-0
lines changed

Diff for: CTProjection.h

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// CTProjection.h
3+
// Mercatalog
4+
//
5+
// Created by Nathan Vander Wilt on 2/6/08.
6+
// Copyright 2008 Calf Trail Software, LLC. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
11+
#include "TLCoordinate.h"
12+
#include "TLProjection.h"
13+
14+
15+
@interface CTProjection : NSObject {
16+
@private
17+
TLProjectionRef wrappedProjection;
18+
int errorFromOperation;
19+
}
20+
21+
// These are exposed to aid transition to pure TLProjectionRef use
22+
- (id)initWithWrappedProjection:(TLProjectionRef)theWrappedProjection;
23+
- (TLProjectionRef)wrappedProjection;
24+
25+
26+
- (CGPoint)projectCoordinate:(TLCoordinate)coord;
27+
- (TLCoordinate)unprojectPoint:(CGPoint)aPoint;
28+
- (BOOL)hadErrorResult;
29+
- (NSString*)stringForError;
30+
- (TLCoordinateDegrees)antimeridian;
31+
32+
@end

Diff for: CTProjection.m

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
//
2+
// CTProjection.m
3+
// Mercatalog
4+
//
5+
// Created by Nathan Vander Wilt on 2/6/08.
6+
// Copyright 2008 Calf Trail Software, LLC. All rights reserved.
7+
//
8+
9+
#import "CTProjection.h"
10+
#import "TLCoordGeometry.h"
11+
12+
13+
@implementation CTProjection
14+
15+
#pragma mark Lifecycle
16+
17+
// designated initializer
18+
- (id)initWithWrappedProjection:(TLProjectionRef)theWrappedProjection {
19+
self = [super init];
20+
if (self) {
21+
wrappedProjection = TLProjectionCopy(theWrappedProjection);
22+
}
23+
return self;
24+
}
25+
26+
- (void)dealloc {
27+
TLProjectionRelease([self wrappedProjection]);
28+
[super dealloc];
29+
}
30+
31+
- (id)copyWithZone:(NSZone*)zone {
32+
id copy = [[self class] allocWithZone:zone];
33+
return [copy initWithWrappedProjection:[self wrappedProjection]];
34+
}
35+
36+
37+
#pragma mark Convenience creators
38+
39+
+ (id)projectionWithCodename:(NSString*)projectionName {
40+
TLMutableProjectionParametersRef projParams = TLProjectionParametersCreateMutable();
41+
TLProjectionParametersSetLongitudeOfOrigin(projParams, -98.0);
42+
TLProjectionParametersSetLatitudeOfOrigin(projParams, 45.0);
43+
if ([projectionName isEqualToString:@"lcc"]) {
44+
TLProjectionParametersSetStandardParallels(projParams, 37.0, 65.0);
45+
//TLProjectionParametersSetStandardParallels(projParams, 0.0, 5.0);
46+
}
47+
TLProjectionError err = 0;
48+
TLProjectionRef wrappedProj = TLProjectionCreate([projectionName cStringUsingEncoding:NSASCIIStringEncoding], TLProjectionGeoidWGS84, projParams, &err);
49+
(void)err;
50+
TLProjectionParametersRelease(projParams);
51+
if (!wrappedProj) return nil;
52+
CTProjection* projection = [[CTProjection alloc] initWithWrappedProjection:wrappedProj];
53+
TLProjectionRelease(wrappedProj);
54+
return [projection autorelease];
55+
}
56+
57+
58+
#pragma mark Accessors
59+
60+
-(TLCoordinateDegrees)antimeridian {
61+
TLProjectionParametersRef projParams = TLProjectionGetParameters([self wrappedProjection]);
62+
TLCoordinateDegrees longitudeOfOrigin = TLProjectionParametersGetLongitudeOfOrigin(projParams);
63+
// the antimeridian is opposite the meridian on the spheroid
64+
TLCoordinateDegrees antimeridian = longitudeOfOrigin + 180.0;
65+
// make sure antimeridian is in [-180,180]
66+
antimeridian = TLCoordinateLongitudeAdjustToRange(antimeridian);
67+
//printf("antimeridian: %f\n", antimeridian);
68+
return antimeridian;
69+
}
70+
71+
- (TLProjectionRef)wrappedProjection {
72+
return (TLProjectionRef)wrappedProjection;
73+
}
74+
75+
- (CGPoint)projectCoordinate:(TLCoordinate)coord {
76+
TLProjectionError err = 0;
77+
CGPoint point = TLProjectionProjectCoordinate([self wrappedProjection], coord, &err);
78+
errorFromOperation = err;
79+
return point;
80+
}
81+
82+
- (TLCoordinate)unprojectPoint:(CGPoint)aPoint {
83+
TLProjectionError err = 0;
84+
TLCoordinate coord = TLProjectionUnprojectPoint([self wrappedProjection], aPoint, &err);
85+
errorFromOperation = err;
86+
return coord;
87+
}
88+
89+
-(BOOL)hadErrorResult {
90+
//NSAssert(!errorFromOperation, @"Debug helper used to check if any errors are received");
91+
return (BOOL)errorFromOperation;
92+
}
93+
94+
-(NSString*)stringForError {
95+
if (!errorFromOperation) return nil;
96+
char errorMessage[255];
97+
(void)TLProjectionErrorGetString(errorFromOperation, errorMessage, 255);
98+
return [NSString stringWithCString:errorMessage encoding:NSASCIIStringEncoding];
99+
}
100+
101+
@end

Diff for: Dependencies/OriginalSources/lbp4-3_060124R.tar.gz

84.3 KB
Binary file not shown.

Diff for: Dependencies/OriginalSources/libproj4.prep.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#! /bin/bash
2+
3+
# extract and clean up source files from a libproj4 RCS distro
4+
# written on February 4, 2008 by Nathan Vander Wilt
5+
6+
# copy RCS files to working directory
7+
cd libproj4
8+
cp -r src/ src-co/
9+
chmod -R a+r,ug+w src-co
10+
11+
# extract top level files (README, Makefile)
12+
cd src-co
13+
rm REL_*
14+
co -f *
15+
rm *,v
16+
17+
# checkout main source code and remove versioned files
18+
cd RCS
19+
co -f *
20+
rm *,v
21+
22+
# move extracted files out of RCS directory...
23+
mv -f * ../
24+
cd ..
25+
rm -r RCS
26+
27+
# ...and into main directory
28+
mv -f * ../
29+
cd ..
30+
rm -r src-co
31+
32+
33+
# remove original source directory
34+
rm -rf src

Diff for: Dependencies/OriginalSources/libproj4.webarchive

7.05 KB
Binary file not shown.

Diff for: Dependencies/OriginalSources/libproj4.webloc

Whitespace-only changes.

Diff for: Dependencies/Sparkle.framework/Headers

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Headers

Diff for: Dependencies/Sparkle.framework/Resources

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Resources

Diff for: Dependencies/Sparkle.framework/Sparkle

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Sparkle
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// SUAppcast.h
3+
// Sparkle
4+
//
5+
// Created by Andy Matuschak on 3/12/06.
6+
// Copyright 2006 Andy Matuschak. All rights reserved.
7+
//
8+
9+
#ifndef SUAPPCAST_H
10+
#define SUAPPCAST_H
11+
12+
@class SUAppcastItem;
13+
@interface SUAppcast : NSObject {
14+
NSArray *items;
15+
NSString *userAgentString;
16+
id delegate;
17+
NSMutableData *incrementalData;
18+
}
19+
20+
- (void)fetchAppcastFromURL:(NSURL *)url;
21+
- (void)setDelegate:delegate;
22+
- (void)setUserAgentString:(NSString *)userAgentString;
23+
24+
- (NSArray *)items;
25+
26+
@end
27+
28+
@interface NSObject (SUAppcastDelegate)
29+
- (void)appcastDidFinishLoading:(SUAppcast *)appcast;
30+
- (void)appcast:(SUAppcast *)appcast failedToLoadWithError:(NSError *)error;
31+
@end
32+
33+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//
2+
// SUAppcastItem.h
3+
// Sparkle
4+
//
5+
// Created by Andy Matuschak on 3/12/06.
6+
// Copyright 2006 Andy Matuschak. All rights reserved.
7+
//
8+
9+
#ifndef SUAPPCASTITEM_H
10+
#define SUAPPCASTITEM_H
11+
12+
@interface SUAppcastItem : NSObject {
13+
NSString *title;
14+
NSDate *date;
15+
NSString *itemDescription;
16+
17+
NSURL *releaseNotesURL;
18+
19+
NSString *DSASignature;
20+
NSString *minimumSystemVersion;
21+
22+
NSURL *fileURL;
23+
NSString *versionString;
24+
NSString *displayVersionString;
25+
26+
NSDictionary *propertiesDictionary;
27+
}
28+
29+
// Initializes with data from a dictionary provided by the RSS class.
30+
- initWithDictionary:(NSDictionary *)dict;
31+
32+
- (NSString *)title;
33+
- (NSString *)versionString;
34+
- (NSString *)displayVersionString;
35+
- (NSDate *)date;
36+
- (NSString *)itemDescription;
37+
- (NSURL *)releaseNotesURL;
38+
- (NSURL *)fileURL;
39+
- (NSString *)DSASignature;
40+
- (NSString *)minimumSystemVersion;
41+
42+
// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
43+
- (NSDictionary *)propertiesDictionary;
44+
45+
@end
46+
47+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
//
2+
// SUUpdater.h
3+
// Sparkle
4+
//
5+
// Created by Andy Matuschak on 1/4/06.
6+
// Copyright 2006 Andy Matuschak. All rights reserved.
7+
//
8+
9+
#ifndef SUUPDATER_H
10+
#define SUUPDATER_H
11+
12+
#import <Sparkle/SUVersionComparisonProtocol.h>
13+
14+
@class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast;
15+
@interface SUUpdater : NSObject {
16+
NSTimer *checkTimer;
17+
SUUpdateDriver *driver;
18+
19+
SUHost *host;
20+
IBOutlet id delegate;
21+
}
22+
23+
+ (SUUpdater *)sharedUpdater;
24+
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
25+
- (NSBundle *)hostBundle;
26+
27+
- (void)setDelegate:(id)delegate;
28+
- delegate;
29+
30+
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
31+
- (BOOL)automaticallyChecksForUpdates;
32+
33+
- (void)setUpdateCheckInterval:(NSTimeInterval)interval;
34+
- (NSTimeInterval)updateCheckInterval;
35+
36+
- (void)setFeedURL:(NSURL *)feedURL;
37+
- (NSURL *)feedURL;
38+
39+
- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile;
40+
- (BOOL)sendsSystemProfile;
41+
42+
- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates;
43+
- (BOOL)automaticallyDownloadsUpdates;
44+
45+
// This IBAction is meant for a main menu item. Hook up any menu item to this action,
46+
// and Sparkle will check for updates and report back its findings verbosely.
47+
- (IBAction)checkForUpdates:sender;
48+
49+
// This kicks off an update meant to be programmatically initiated. That is, it will display no UI unless it actually finds an update,
50+
// in which case it proceeds as usual. If the fully automated updating is turned on, however, this will invoke that behavior, and if an
51+
// update is found, it will be downloaded and prepped for installation.
52+
- (void)checkForUpdatesInBackground;
53+
54+
// Date of last update check. Returns null if no check has been performed.
55+
- (NSDate*)lastUpdateCheckDate;
56+
57+
// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
58+
// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI.
59+
- (void)checkForUpdateInformation;
60+
61+
// Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks. This call does not change the date of the next check, but only the internal NSTimer.
62+
- (void)resetUpdateCycle;
63+
64+
- (BOOL)updateInProgress;
65+
@end
66+
67+
@interface NSObject (SUUpdaterDelegateInformalProtocol)
68+
// This method allows you to add extra parameters to the appcast URL, potentially based on whether or not Sparkle will also be sending along the system profile. This method should return an array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user.
69+
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
70+
71+
// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
72+
- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle;
73+
74+
// Implement this if you want to do some special handling with the appcast once it finishes loading.
75+
- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
76+
77+
// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding
78+
// a valid update, if any, in the given appcast.
79+
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)bundle;
80+
81+
// Sent when a valid update is found by the update driver.
82+
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update;
83+
84+
// Sent when a valid update is not found.
85+
- (void)updaterDidNotFindUpdate:(SUUpdater *)update;
86+
87+
// Sent immediately before installing the specified update.
88+
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
89+
90+
// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
91+
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
92+
93+
// Called immediately before relaunching.
94+
- (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
95+
96+
// This method allows you to provide a custom version comparator.
97+
// If you don't implement this method or return nil, the standard version comparator will be used.
98+
- (id <SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)updater;
99+
100+
// Returns the path which is used to relaunch the client after the update is installed. By default, the path of the host bundle.
101+
- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
102+
103+
@end
104+
105+
// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.
106+
#ifdef DEBUG
107+
#define SU_MIN_CHECK_INTERVAL 60
108+
#else
109+
#define SU_MIN_CHECK_INTERVAL 60*60
110+
#endif
111+
112+
#ifdef DEBUG
113+
#define SU_DEFAULT_CHECK_INTERVAL 60
114+
#else
115+
#define SU_DEFAULT_CHECK_INTERVAL 60*60*24
116+
#endif
117+
118+
#endif

0 commit comments

Comments
 (0)