Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial check-in.

  • Loading branch information...
commit bad5c89d318bd60f4844edd26bca021424aceef6 0 parents
@rentzsch authored
15 .gitignore
@@ -0,0 +1,15 @@
+build
+
+*.pbxuser
+*.perspectivev3
+*.mode1v3
+*.mode2v3
+!default.pbxuser
+!default.perspectivev3
+!default.mode1v3
+!default.mode2v3
+
+*~.nib
+*~.xib
+
+.DS_Store
BIN  Blitz.xcodeproj/TemplateIcon.icns
Binary file not shown
318 Blitz.xcodeproj/project.pbxproj
@@ -0,0 +1,318 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58280DA1D0D100B32029 /* MyDocument.xib */; };
+ 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; };
+ 79BB568B0FF7374A00D94BEB /* BlitzPDFView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79BB56890FF7374A00D94BEB /* BlitzPDFView.m */; };
+ 79BB56AC0FF7386500D94BEB /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79BB56AB0FF7386500D94BEB /* Quartz.framework */; };
+ 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; };
+ 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; };
+ 8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */; settings = {ATTRIBUTES = (); }; };
+ 8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
+ 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+ 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MyDocument.xib; sourceTree = "<group>"; };
+ 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
+ 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocument.m; sourceTree = "<group>"; };
+ 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = "<group>"; };
+ 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; };
+ 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32DBCF750370BD2300C91783 /* Blitz_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Blitz_Prefix.pch; sourceTree = "<group>"; };
+ 79BB56890FF7374A00D94BEB /* BlitzPDFView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlitzPDFView.m; sourceTree = "<group>"; };
+ 79BB568A0FF7374A00D94BEB /* BlitzPDFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlitzPDFView.h; sourceTree = "<group>"; };
+ 79BB56AB0FF7386500D94BEB /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = /System/Library/Frameworks/Quartz.framework; sourceTree = "<absolute>"; };
+ 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 8D15AC370486D014006FF6A4 /* Blitz.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Blitz.app; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D15AC330486D014006FF6A4 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */,
+ 79BB56AC0FF7386500D94BEB /* Quartz.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 79BB56AB0FF7386500D94BEB /* Quartz.framework */,
+ 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */,
+ 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */,
+ 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FB0FE9D524F11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D15AC370486D014006FF6A4 /* Blitz.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 2A37F4AAFDCFA73011CA2CEA /* C4BlitzPlayer */ = {
+ isa = PBXGroup;
+ children = (
+ 2A37F4ABFDCFA73011CA2CEA /* Classes */,
+ 2A37F4AFFDCFA73011CA2CEA /* Other Sources */,
+ 2A37F4B8FDCFA73011CA2CEA /* Resources */,
+ 2A37F4C3FDCFA73011CA2CEA /* Frameworks */,
+ 19C28FB0FE9D524F11CA2CBB /* Products */,
+ );
+ name = C4BlitzPlayer;
+ sourceTree = "<group>";
+ };
+ 2A37F4ABFDCFA73011CA2CEA /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */,
+ 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */,
+ 79BB568A0FF7374A00D94BEB /* BlitzPDFView.h */,
+ 79BB56890FF7374A00D94BEB /* BlitzPDFView.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32DBCF750370BD2300C91783 /* Blitz_Prefix.pch */,
+ 2A37F4B0FDCFA73011CA2CEA /* main.m */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 2A37F4B8FDCFA73011CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */,
+ 8D15AC360486D014006FF6A4 /* Info.plist */,
+ 089C165FFE840EACC02AAC07 /* InfoPlist.strings */,
+ 1DDD58280DA1D0D100B32029 /* MyDocument.xib */,
+ 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */,
+ 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D15AC270486D014006FF6A4 /* Blitz */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "Blitz" */;
+ buildPhases = (
+ 8D15AC2B0486D014006FF6A4 /* Resources */,
+ 8D15AC300486D014006FF6A4 /* Sources */,
+ 8D15AC330486D014006FF6A4 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Blitz;
+ productInstallPath = "$(HOME)/Applications";
+ productName = C4BlitzPlayer;
+ productReference = 8D15AC370486D014006FF6A4 /* Blitz.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 2A37F4A9FDCFA73011CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "Blitz" */;
+ compatibilityVersion = "Xcode 3.1";
+ hasScannedForEncodings = 1;
+ mainGroup = 2A37F4AAFDCFA73011CA2CEA /* C4BlitzPlayer */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D15AC270486D014006FF6A4 /* Blitz */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D15AC2B0486D014006FF6A4 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */,
+ 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */,
+ 1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */,
+ 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D15AC300486D014006FF6A4 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */,
+ 8D15AC320486D014006FF6A4 /* main.m in Sources */,
+ 79BB568B0FF7374A00D94BEB /* BlitzPDFView.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C165FFE840EACC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C1660FE840EACC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 1DDD58280DA1D0D100B32029 /* MyDocument.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1DDD58290DA1D0D100B32029 /* English */,
+ );
+ name = MyDocument.xib;
+ sourceTree = "<group>";
+ };
+ 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1DDD582B0DA1D0D100B32029 /* English */,
+ );
+ name = MainMenu.xib;
+ sourceTree = "<group>";
+ };
+ 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 2A37F4BAFDCFA73011CA2CEA /* English */,
+ );
+ name = Credits.rtf;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C05733C808A9546B00998B17 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = Blitz_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = Blitz;
+ };
+ name = Debug;
+ };
+ C05733C908A9546B00998B17 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = Blitz_Prefix.pch;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = Blitz;
+ };
+ name = Release;
+ };
+ C05733CC08A9546B00998B17 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = x86_64;
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ PRODUCT_VERSION = 0.1;
+ SDKROOT = macosx10.5;
+ };
+ name = Debug;
+ };
+ C05733CD08A9546B00998B17 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = x86_64;
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ PREBINDING = NO;
+ PRODUCT_VERSION = 0.1;
+ SDKROOT = macosx10.5;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "Blitz" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C05733C808A9546B00998B17 /* Debug */,
+ C05733C908A9546B00998B17 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "Blitz" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C05733CC08A9546B00998B17 /* Debug */,
+ C05733CD08A9546B00998B17 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 2A37F4A9FDCFA73011CA2CEA /* Project object */;
+}
9 BlitzPDFView.h
@@ -0,0 +1,9 @@
+#import <Cocoa/Cocoa.h>
+#import <Quartz/Quartz.h>
+
+@interface BlitzPDFView : PDFView
+@property uint16_t secondsElapsed;
+
+- (IBAction)updateSecondsElapsed:(id)sender;
+
+@end
141 BlitzPDFView.m
@@ -0,0 +1,141 @@
+#import "BlitzPDFView.h"
+
+@implementation BlitzPDFView
+@synthesize secondsElapsed;
+
+// Following function stolen from http://cocoa.karelia.com/Foundation_Categories/NSColor__Instantiat.m
+static NSColor* colorFromHexRGB( NSString *inColorString ) {
+ NSColor *result = nil;
+ unsigned int colorCode = 0;
+ unsigned char redByte, greenByte, blueByte;
+
+ if (nil != inColorString) {
+ NSScanner *scanner = [NSScanner scannerWithString:inColorString];
+ (void) [scanner scanHexInt:&colorCode]; // ignore error
+ }
+ redByte = (unsigned char) (colorCode >> 16);
+ greenByte = (unsigned char) (colorCode >> 8);
+ blueByte = (unsigned char) (colorCode); // masks off high bits
+ result = [NSColor
+ colorWithCalibratedRed: (float)redByte / 0xff
+ green: (float)greenByte/ 0xff
+ blue: (float)blueByte / 0xff
+ alpha: 1.0];
+ return result;
+}
+
+#define threeOclock 0.0f
+#define twelveOclock 90.0f
+#define nineOclock 180.0f
+#define sixOclock 270.0f
+
+- (void)drawPagePost:(PDFPage*)page {
+#if 0
+ [[NSColor grayColor] set];
+ NSFrameRect([self bounds]);
+#endif
+
+ const CGFloat kSize = 80.0f;
+ const CGFloat kOuterRingWidth = 8.0f;
+ const CGFloat kPadding = 20.0f;
+
+ NSColor *outerSlideElapsedWedgeColor = colorFromHexRGB(@"2c8fff");
+
+ NSRect bounds = NSMakeRect([self bounds].size.width - kPadding - kSize, kPadding, kSize, kSize);
+ NSPoint center = NSMakePoint(NSMidX(bounds), NSMidY(bounds));
+
+ {
+ NSBezierPath *outerSlideRingBackground = [NSBezierPath bezierPathWithOvalInRect:bounds];
+
+ NSShadow *shadow = [[[NSShadow alloc] init] autorelease];
+ [shadow setShadowBlurRadius:6.0];
+ [shadow setShadowColor:[[NSColor blackColor] colorWithAlphaComponent:0.50]];
+ [shadow setShadowOffset:NSMakeSize(2.0, -2.0)];
+ [shadow set];
+
+ [colorFromHexRGB(@"32303d") set];
+ [outerSlideRingBackground fill];
+
+ [[[[NSShadow alloc] init] autorelease] set];
+ }
+
+ CGFloat degreesElapsed;
+ {
+ NSBezierPath *outerSlideElapsedWedge = [NSBezierPath bezierPath];
+ [outerSlideElapsedWedge moveToPoint:center];
+
+ float slideSeconds = fmod(self.secondsElapsed, 15.0f);
+ degreesElapsed = (slideSeconds * 360.0f) / 14.0f;
+ if (300 == self.secondsElapsed) degreesElapsed = 360.0f;
+
+ [outerSlideElapsedWedge appendBezierPathWithArcWithCenter:center
+ radius:bounds.size.width / 2.0f
+ startAngle:twelveOclock-degreesElapsed
+ endAngle:twelveOclock];
+ [outerSlideElapsedWedge lineToPoint:center];
+ [outerSlideElapsedWedge closePath];
+
+ [outerSlideElapsedWedgeColor set];
+ [outerSlideElapsedWedge fill];
+ }
+
+ NSRect innerCircleBounds = NSInsetRect(bounds, kOuterRingWidth, kOuterRingWidth);
+ {
+ NSBezierPath *innerTalkCircleBackground = [NSBezierPath bezierPathWithOvalInRect:innerCircleBounds];
+
+ [[NSColor blackColor] set];
+ [innerTalkCircleBackground fill];
+ }
+
+ {
+ NSBezierPath *innerTalkElapsedWedge = [NSBezierPath bezierPath];
+ [innerTalkElapsedWedge moveToPoint:center];
+
+ CGFloat degreesElapsed = ((CGFloat)self.secondsElapsed * 360.0f) / 300.0f;
+ [innerTalkElapsedWedge appendBezierPathWithArcWithCenter:center
+ radius:innerCircleBounds.size.width / 2.0f
+ startAngle:twelveOclock-degreesElapsed
+ endAngle:twelveOclock];
+ [innerTalkElapsedWedge lineToPoint:center];
+ [innerTalkElapsedWedge closePath];
+
+ [colorFromHexRGB(@"0046a8") set];
+ [innerTalkElapsedWedge fill];
+ }
+
+ {
+ const CGFloat dotSize = 10.0f;
+ NSRect dotBounds = NSMakeRect(-dotSize/2, (kSize/2)-dotSize+1, dotSize, dotSize);
+ NSRect glowBounds = NSInsetRect(dotBounds, -5.0f, -5.0f);
+
+ NSBezierPath *outerSlideElapsedDotGlow = [NSBezierPath bezierPathWithOvalInRect:glowBounds];
+ NSBezierPath *outerSlideElapsedDot = [NSBezierPath bezierPathWithOvalInRect:dotBounds];
+
+ NSGradient *glowGradient = [[[NSGradient alloc] initWithColorsAndLocations:
+ [outerSlideElapsedWedgeColor colorWithAlphaComponent:0.99f], 0.00,
+ [outerSlideElapsedWedgeColor colorWithAlphaComponent:0.02f], 0.80,
+ [outerSlideElapsedWedgeColor colorWithAlphaComponent:0.01f], 1.00,
+ nil] autorelease];
+ NSGradient *dotGradient = [[[NSGradient alloc] initWithStartingColor:colorFromHexRGB(@"ffffff")
+ endingColor:outerSlideElapsedWedgeColor] autorelease];
+
+ [[NSGraphicsContext currentContext] saveGraphicsState]; {
+ NSAffineTransform *transform = [NSAffineTransform transform];
+
+ // translate and rotate graphics state (order is important, translate first before rotating)
+ [transform translateXBy:center.x yBy:center.y];
+ [transform rotateByDegrees:-degreesElapsed];
+ [transform concat];
+
+ [glowGradient drawInBezierPath:outerSlideElapsedDotGlow relativeCenterPosition:NSZeroPoint];
+ [dotGradient drawInBezierPath:outerSlideElapsedDot relativeCenterPosition:NSZeroPoint];
+ } [[NSGraphicsContext currentContext] restoreGraphicsState];
+ }
+}
+
+- (IBAction)updateSecondsElapsed:(id)sender {
+ self.secondsElapsed = [sender intValue];
+ [self setNeedsDisplay:YES];
+}
+
+@end
7 Blitz_Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'C4BlitzPlayer' target in the 'C4BlitzPlayer' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
29 English.lproj/Credits.rtf
@@ -0,0 +1,29 @@
+{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\paperw9840\paperh8400
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+
+\f0\b\fs24 \cf0 Engineering:
+\b0 \
+ Some people\
+\
+
+\b Human Interface Design:
+\b0 \
+ Some other people\
+\
+
+\b Testing:
+\b0 \
+ Hopefully not nobody\
+\
+
+\b Documentation:
+\b0 \
+ Whoever\
+\
+
+\b With special thanks to:
+\b0 \
+ Mom\
+}
BIN  English.lproj/InfoPlist.strings
Binary file not shown
2,985 English.lproj/MainMenu.xib
2,985 additions, 0 deletions not shown
247 English.lproj/MyDocument.xib
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
+ <data>
+ <int key="IBDocument.SystemTarget">1050</int>
+ <string key="IBDocument.SystemVersion">9J61</string>
+ <string key="IBDocument.InterfaceBuilderVersion">677</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.pdfkit.ibplugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="580458321">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="512844837">
+ <string key="NSClassName">MyDocument</string>
+ </object>
+ <object class="NSCustomObject" id="613418571">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSWindowTemplate" id="275939982">
+ <int key="NSWindowStyleMask">7</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{18, 816}, {1280, 720}}</string>
+ <int key="NSWTFlags">1886912512</int>
+ <string key="NSWindowTitle">Blitz</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <string key="NSViewClass">View</string>
+ <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMinSize">{94, 86}</string>
+ <object class="NSView" key="NSWindowView" id="568628114">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="PDFView" id="458521135">
+ <reference key="NSNextResponder" ref="568628114"/>
+ <int key="NSvFlags">12</int>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSFilenamesPboardType</string>
+ </object>
+ </object>
+ <string key="NSFrameSize">{1280, 720}</string>
+ <reference key="NSSuperview" ref="568628114"/>
+ <int key="DisplayMode">0</int>
+ <bool key="PageBreaks">NO</bool>
+ <float key="ScaleFactor">9.090909e-01</float>
+ <bool key="AutoScale">YES</bool>
+ </object>
+ </object>
+ <string key="NSFrameSize">{1280, 720}</string>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {2560, 1578}}</string>
+ <string key="NSMinSize">{94, 108}</string>
+ <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSFrameAutosaveName">BlitzMainWindow</string>
+ </object>
+ <object class="NSCustomObject" id="796877042">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="275939982"/>
+ <reference key="destination" ref="512844837"/>
+ </object>
+ <int key="connectionID">17</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="275939982"/>
+ </object>
+ <int key="connectionID">18</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">pdfView</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="458521135"/>
+ </object>
+ <int key="connectionID">100027</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <object class="NSArray" key="object" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="children" ref="580458321"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="512844837"/>
+ <reference key="parent" ref="0"/>
+ <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="613418571"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="275939982"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="568628114"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Window</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="568628114"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="458521135"/>
+ </object>
+ <reference key="parent" ref="275939982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="796877042"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100026</int>
+ <reference key="object" ref="458521135"/>
+ <reference key="parent" ref="568628114"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.IBPluginDependency</string>
+ <string>-2.IBPluginDependency</string>
+ <string>-3.IBPluginDependency</string>
+ <string>100026.CustomClassName</string>
+ <string>100026.IBPluginDependency</string>
+ <string>5.IBEditorWindowLastContentRect</string>
+ <string>5.IBWindowTemplateEditedContentRect</string>
+ <string>5.ImportedFromIB2</string>
+ <string>5.editorWindowContentRectSynchronizationRect</string>
+ <string>5.windowTemplate.hasMinSize</string>
+ <string>5.windowTemplate.minSize</string>
+ <string>6.IBPluginDependency</string>
+ <string>6.ImportedFromIB2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>BlitzPDFView</string>
+ <string>com.apple.pdfkit.ibplugin</string>
+ <string>{{18, 816}, {1280, 720}}</string>
+ <string>{{18, 816}, {1280, 720}}</string>
+ <integer value="1" id="5"/>
+ <string>{{201, 387}, {507, 413}}</string>
+ <reference ref="5"/>
+ <string>{94, 86}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="5"/>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">100027</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">BlitzPDFView</string>
+ <string key="superclassName">PDFView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">MyDocument</string>
+ <string key="superclassName">NSDocument</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">pdfView</string>
+ <string key="NS.object.0">BlitzPDFView</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">MyDocument.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../C4BlitzPlayer.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
59 Info.plist
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>pdf</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string></string>
+ <key>CFBundleTypeMIMETypes</key>
+ <array>
+ <string>application/pdf</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>DocumentType</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>????</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>com.adobe.pdf</string>
+ </array>
+ <key>NSDocumentClass</key>
+ <string>MyDocument</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.rentzsch.${PRODUCT_NAME:identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>${PRODUCT_VERSION}</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${PRODUCT_VERSION}</string>
+</dict>
+</plist>
8 MyDocument.h
@@ -0,0 +1,8 @@
+#import <Cocoa/Cocoa.h>
+#import <Quartz/Quartz.h>
+
+@class BlitzPDFView;
+
+@interface MyDocument : NSDocument {}
+@property (retain, nonatomic) IBOutlet BlitzPDFView *pdfView;
+@end
60 MyDocument.m
@@ -0,0 +1,60 @@
+#import "MyDocument.h"
+#import "BlitzPDFView.h"
+
+@interface MyDocument ()
+@property (retain, nonatomic) PDFDocument *pdfDocument;
+@property (retain, nonatomic) NSTimer *timer;
+@end
+
+@implementation MyDocument
+@synthesize pdfDocument, pdfView, timer;
+
+- (void)windowControllerDidLoadNib:(NSWindowController*)controller_ {
+ [super windowControllerDidLoadNib:controller_];
+
+ if (!self.pdfDocument) {
+ self.pdfDocument = [[PDFDocument alloc] init];
+ }
+ [self.pdfView setDocument:self.pdfDocument];
+
+ self.pdfView.secondsElapsed = 0;
+ self.timer = [[NSTimer scheduledTimerWithTimeInterval:1.0
+ target:self
+ selector:@selector(updateElapsedTimer:)
+ userInfo:nil
+ repeats:YES] retain];
+}
+
+- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError {
+ //return [self.pdfDocument writeToURL:absoluteURL];
+ [self doesNotRecognizeSelector:_cmd]; // Renounce writing the PDF to disk.
+ return NO;
+}
+
+- (BOOL)readFromURL:(NSURL *)initWithURL ofType:(NSString *)typeName error:(NSError **)outError {
+ self.pdfDocument = [[PDFDocument alloc] initWithURL:initWithURL];
+ return self.pdfDocument ? YES : NO;
+}
+
+- (void)updateElapsedTimer:(NSTimer*)timer_ {
+ if (self.pdfView.secondsElapsed != 0 && (self.pdfView.secondsElapsed % 15 == 0)) {
+ [self.pdfView goToNextPage:nil];
+ }
+ self.pdfView.secondsElapsed += 1;
+ [self.pdfView setNeedsDisplay:YES];
+}
+
+//--
+
+- (NSString *)windowNibName {
+ return @"MyDocument";
+}
+
+- (void)dealloc {
+ self.pdfDocument = nil;
+ [self.timer invalidate];
+ self.timer = nil;
+ [super dealloc];
+}
+
+@end
14 main.m
@@ -0,0 +1,14 @@
+//
+// main.m
+// C4BlitzPlayer
+//
+// Created by wolf on 6/28/09.
+// Copyright Red Shed Software Company 2009 . All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+ return NSApplicationMain(argc, (const char **) argv);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.