diff --git a/Blitz.xcodeproj/project.pbxproj b/Blitz.xcodeproj/project.pbxproj index d642dc9..dba0645 100644 --- a/Blitz.xcodeproj/project.pbxproj +++ b/Blitz.xcodeproj/project.pbxproj @@ -7,9 +7,11 @@ objects = { /* Begin PBXBuildFile section */ - 1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58280DA1D0D100B32029 /* MyDocument.xib */; }; + 1DDD582C0DA1D0D100B32029 /* Slides.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58280DA1D0D100B32029 /* Slides.xib */; }; 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; }; 345BF6AC10668503004BCEE3 /* SpeakerSlidesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 345BF6AB10668503004BCEE3 /* SpeakerSlidesView.m */; }; + 345BF8FE1066A324004BCEE3 /* SlidesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 345BF8FD1066A324004BCEE3 /* SlidesWindowController.m */; }; + 3484EC60106722D500B1BC64 /* BlitzButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3484EC5F106722D500B1BC64 /* BlitzButtonCell.m */; }; 34E6611E1065E938001B6FE9 /* presenter-notes.xsl in Resources */ = {isa = PBXBuildFile; fileRef = 34E6611D1065E938001B6FE9 /* presenter-notes.xsl */; }; 34E6612E1065EB97001B6FE9 /* SpeakerNotes.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34E6612D1065EB97001B6FE9 /* SpeakerNotes.xib */; }; 34E6614E1065EBAE001B6FE9 /* SpeakerNotesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E6614D1065EBAE001B6FE9 /* SpeakerNotesWindowController.m */; }; @@ -44,7 +46,7 @@ 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; - 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MyDocument.xib; sourceTree = ""; }; + 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Slides.xib; sourceTree = ""; }; 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocument.m; sourceTree = ""; }; 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = ""; }; @@ -55,6 +57,10 @@ 32DBCF750370BD2300C91783 /* Blitz_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Blitz_Prefix.pch; sourceTree = ""; }; 345BF6AA10668503004BCEE3 /* SpeakerSlidesView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeakerSlidesView.h; sourceTree = ""; }; 345BF6AB10668503004BCEE3 /* SpeakerSlidesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpeakerSlidesView.m; sourceTree = ""; }; + 345BF8FC1066A324004BCEE3 /* SlidesWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlidesWindowController.h; sourceTree = ""; }; + 345BF8FD1066A324004BCEE3 /* SlidesWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SlidesWindowController.m; sourceTree = ""; }; + 3484EC5E106722D500B1BC64 /* BlitzButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlitzButtonCell.h; sourceTree = ""; }; + 3484EC5F106722D500B1BC64 /* BlitzButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlitzButtonCell.m; sourceTree = ""; }; 34E6611D1065E938001B6FE9 /* presenter-notes.xsl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "presenter-notes.xsl"; sourceTree = ""; }; 34E6612D1065EB97001B6FE9 /* SpeakerNotes.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SpeakerNotes.xib; sourceTree = ""; }; 34E6614C1065EBAE001B6FE9 /* SpeakerNotesWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeakerNotesWindowController.h; sourceTree = ""; }; @@ -138,6 +144,10 @@ 34E6614D1065EBAE001B6FE9 /* SpeakerNotesWindowController.m */, 345BF6AA10668503004BCEE3 /* SpeakerSlidesView.h */, 345BF6AB10668503004BCEE3 /* SpeakerSlidesView.m */, + 345BF8FC1066A324004BCEE3 /* SlidesWindowController.h */, + 345BF8FD1066A324004BCEE3 /* SlidesWindowController.m */, + 3484EC5E106722D500B1BC64 /* BlitzButtonCell.h */, + 3484EC5F106722D500B1BC64 /* BlitzButtonCell.m */, ); name = Classes; sourceTree = ""; @@ -160,7 +170,7 @@ 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */, 8D15AC360486D014006FF6A4 /* Info.plist */, 089C165FFE840EACC02AAC07 /* InfoPlist.strings */, - 1DDD58280DA1D0D100B32029 /* MyDocument.xib */, + 1DDD58280DA1D0D100B32029 /* Slides.xib */, 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */, 34E6612D1065EB97001B6FE9 /* SpeakerNotes.xib */, ); @@ -223,7 +233,7 @@ files = ( 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */, 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */, - 1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */, + 1DDD582C0DA1D0D100B32029 /* Slides.xib in Resources */, 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */, 79BFE55A0FF7ECDD000668B2 /* dsa_pub.pem in Resources */, 79BFE61A0FF81A2C000668B2 /* blitz.icns in Resources */, @@ -262,6 +272,8 @@ 376586FD1009A33F00B9BC9B /* MyApplication.m in Sources */, 34E6614E1065EBAE001B6FE9 /* SpeakerNotesWindowController.m in Sources */, 345BF6AC10668503004BCEE3 /* SpeakerSlidesView.m in Sources */, + 345BF8FE1066A324004BCEE3 /* SlidesWindowController.m in Sources */, + 3484EC60106722D500B1BC64 /* BlitzButtonCell.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -276,12 +288,12 @@ name = InfoPlist.strings; sourceTree = ""; }; - 1DDD58280DA1D0D100B32029 /* MyDocument.xib */ = { + 1DDD58280DA1D0D100B32029 /* Slides.xib */ = { isa = PBXVariantGroup; children = ( 1DDD58290DA1D0D100B32029 /* English */, ); - name = MyDocument.xib; + name = Slides.xib; sourceTree = ""; }; 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = { diff --git a/BlitzButtonCell.h b/BlitzButtonCell.h new file mode 100644 index 0000000..ea9792b --- /dev/null +++ b/BlitzButtonCell.h @@ -0,0 +1,12 @@ +// +// BlitzButton.h +// Blitz +// +// Created by Timothy J. Wood on 9/20/09. +// Copyright 2009 The Omni Group. All rights reserved. +// + +#import + +@interface BlitzButtonCell : NSButtonCell +@end diff --git a/BlitzButtonCell.m b/BlitzButtonCell.m new file mode 100644 index 0000000..5eaa419 --- /dev/null +++ b/BlitzButtonCell.m @@ -0,0 +1,52 @@ +// +// BlitzButton.m +// Blitz +// +// Created by Timothy J. Wood on 9/20/09. +// Copyright 2009 The Omni Group. All rights reserved. +// + +#import "BlitzButtonCell.h" + +static void OSAppendRoundedRect(CGContextRef ctx, NSRect rect, CGFloat radius) +{ + NSPoint topMid = NSMakePoint(NSMidX(rect), NSMaxY(rect)); + NSPoint topLeft = NSMakePoint(NSMinX(rect), NSMaxY(rect)); + NSPoint topRight = NSMakePoint(NSMaxX(rect), NSMaxY(rect)); + NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect)); + + CGContextMoveToPoint(ctx, topMid.x, topMid.y); + CGContextAddArcToPoint(ctx, topLeft.x, topLeft.y, rect.origin.x, rect.origin.y, radius); + CGContextAddArcToPoint(ctx, rect.origin.x, rect.origin.y, bottomRight.x, bottomRight.y, radius); + CGContextAddArcToPoint(ctx, bottomRight.x, bottomRight.y, topRight.x, topRight.y, radius); + CGContextAddArcToPoint(ctx, topRight.x, topRight.y, topLeft.x, topLeft.y, radius); + CGContextClosePath(ctx); +} + +@implementation BlitzButtonCell + +- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)controlView; +{ + // White with a blue shadow to try to show up on white or black slides, and we have a black background in the slide preview area that this overlays. + [NSGraphicsContext saveGraphicsState]; + { + BOOL pressed = [self isHighlighted]; + + [[NSColor colorWithCalibratedWhite:1.0f alpha:(pressed ? 0.80f : 0.6f)] set]; + NSShadow *shadow = [[[NSShadow alloc] init] autorelease]; + + [shadow setShadowBlurRadius:(pressed ? 3.0f : 6.0f)]; + + [shadow setShadowOffset:NSZeroSize]; + [shadow setShadowColor:[NSColor blueColor]]; + [shadow set]; + + NSRect bezelFrame = NSInsetRect(frame, 3, 3); + CGContextRef ctx = [[NSGraphicsContext currentContext] graphicsPort]; + OSAppendRoundedRect(ctx, bezelFrame, NSHeight(bezelFrame)/2.0); + CGContextFillPath(ctx); + } + [NSGraphicsContext restoreGraphicsState]; +} + +@end diff --git a/BlitzPDFView.h b/BlitzPDFView.h index 0a159c3..fc120eb 100644 --- a/BlitzPDFView.h +++ b/BlitzPDFView.h @@ -8,8 +8,9 @@ CounterView *counterView; } @property uint16_t secondsElapsed; +@property(assign) NSUInteger pageIndex; +@property(assign) BOOL running; -- (void)atLastPage; - (IBAction)updateSecondsElapsed:(id)sender; @end \ No newline at end of file diff --git a/BlitzPDFView.m b/BlitzPDFView.m index 4322553..fecc307 100644 --- a/BlitzPDFView.m +++ b/BlitzPDFView.m @@ -147,21 +147,10 @@ @implementation BlitzPDFView @dynamic secondsElapsed; - (void)drawPagePost:(PDFPage*)page { - const CGFloat kSize = 80.0f; - const CGFloat kPadding = 20.0f; - - if (counterView == nil) { - counterView = [[CounterView alloc] initWithFrame:NSMakeRect(0, 0, kSize, kSize)]; - [self addSubview: counterView]; - } - - NSRect frame = NSMakeRect([self bounds].size.width - kPadding - kSize, kPadding, kSize, kSize); - counterView.frame = frame; - [counterView setNeedsDisplay: YES]; } - (void)dealloc { - [self atLastPage]; + [counterView release]; [super dealloc]; } @@ -172,11 +161,36 @@ - (uint16_t) secondsElapsed { - (void)setSecondsElapsed:(uint16_t)secs { secondsElapsed = secs; counterView.secondsElapsed = secs; + [counterView setNeedsDisplay:YES]; } -- (void)atLastPage { - [[counterView animator] removeFromSuperview]; - counterView = nil; +- (BOOL)running; +{ + return ([counterView superview] == self); +} +- (void)setRunning:(BOOL)running; +{ + BOOL wasRunning = (counterView != nil); + + if (running == wasRunning) + return; + + if (running) { + const CGFloat kSize = 80.0f; + const CGFloat kPadding = 20.0f; + + NSRect frame = NSMakeRect([self bounds].size.width - kPadding - kSize, kPadding, kSize, kSize); + counterView = [[CounterView alloc] initWithFrame:frame]; + + [self addSubview: counterView]; + [counterView setNeedsDisplay: YES]; + + [self addSubview:counterView]; + } else { + [[counterView animator] removeFromSuperview]; + [counterView release]; + counterView = nil; + } } - (IBAction)updateSecondsElapsed:(id)sender { @@ -184,4 +198,23 @@ - (IBAction)updateSecondsElapsed:(id)sender { [self setNeedsDisplay:YES]; } +- (NSUInteger)pageIndex; +{ + if (!self.document) + return NSNotFound; + return [self.document indexForPage:self.currentPage]; +} +- (void)setPageIndex:(NSUInteger)pageIndex; +{ + NSUInteger pageCount = [self.document pageCount]; + PDFPage *page = nil; + if (pageCount > 0) { + if (pageIndex >= pageCount) + pageIndex = pageCount - 1; + page = [self.document pageAtIndex:pageIndex]; + } + + [self goToPage:page]; +} + @end \ No newline at end of file diff --git a/English.lproj/MyDocument.xib b/English.lproj/MyDocument.xib deleted file mode 100644 index 9aa27c4..0000000 --- a/English.lproj/MyDocument.xib +++ /dev/null @@ -1,247 +0,0 @@ - - - - 1050 - 9J61 - 677 - 949.46 - 353.00 - - YES - - - YES - com.apple.pdfkit.ibplugin - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - YES - - - - YES - - MyDocument - - - FirstResponder - - - 7 - 2 - {{18, 816}, {1280, 720}} - 1886912512 - Blitz - NSWindow - View - {3.40282e+38, 3.40282e+38} - {94, 86} - - - 256 - - YES - - - 12 - - YES - - YES - NSFilenamesPboardType - - - {1280, 720} - - 0 - NO - 9.090909e-01 - YES - - - {1280, 720} - - {{0, 0}, {2560, 1578}} - {94, 108} - {3.40282e+38, 3.40282e+38} - BlitzMainWindow - - - NSApplication - - - - - YES - - - delegate - - - - 17 - - - - window - - - - 18 - - - - pdfView - - - - 100027 - - - - - YES - - 0 - - YES - - - - - - -2 - - - RmlsZSdzIE93bmVyA - - - -1 - - - First Responder - - - 5 - - - YES - - - - Window - - - 6 - - - YES - - - - - - -3 - - - Application - - - 100026 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 100026.CustomClassName - 100026.IBPluginDependency - 5.IBEditorWindowLastContentRect - 5.IBWindowTemplateEditedContentRect - 5.ImportedFromIB2 - 5.editorWindowContentRectSynchronizationRect - 5.windowTemplate.hasMinSize - 5.windowTemplate.minSize - 6.IBPluginDependency - 6.ImportedFromIB2 - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - BlitzPDFView - com.apple.pdfkit.ibplugin - {{18, 816}, {1280, 720}} - {{18, 816}, {1280, 720}} - - {{201, 387}, {507, 413}} - - {94, 86} - com.apple.InterfaceBuilder.CocoaPlugin - - - - - YES - - YES - - - YES - - - - - YES - - YES - - - YES - - - - 100027 - - - - YES - - BlitzPDFView - PDFView - - IBUserSource - - - - - MyDocument - NSDocument - - pdfView - BlitzPDFView - - - IBProjectSource - MyDocument.h - - - - - 0 - ../C4BlitzPlayer.xcodeproj - 3 - - diff --git a/English.lproj/Slides.xib b/English.lproj/Slides.xib new file mode 100644 index 0000000..db35b0a --- /dev/null +++ b/English.lproj/Slides.xib @@ -0,0 +1,764 @@ + + + + 1050 + 10B504 + 732 + 1038.2 + 437.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.pdfkit.ibplugin + + + YES + 732 + 1.1.0 + + + + YES + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.pdfkit.ibplugin + + + YES + + YES + + + YES + + + + YES + + SlidesWindowController + + + FirstResponder + + + 7 + 2 + {{18, 816}, {1280, 720}} + 1886912512 + Blitz + NSWindow + View + {1.79769e+308, 1.79769e+308} + {94, 86} + + + 256 + + YES + + + 12 + + YES + + YES + NSFilenamesPboardType + + + {1280, 720} + + 0 + NO + 0.90909087657928467 + YES + + + {1280, 720} + + {{0, 0}, {2560, 1578}} + {94, 108} + {1.79769e+308, 1.79769e+308} + BlitzMainWindow + + + NSApplication + + + + + YES + + + delegate + + + + 17 + + + + window + + + + 18 + + + + pdfView + + + + 100027 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 5 + + + YES + + + + Window + + + 6 + + + YES + + + + + + -3 + + + Application + + + 100026 + + + + + + + YES + + YES + -3.IBPluginDependency + 100026.CustomClassName + 100026.IBPluginDependency + 5.IBEditorWindowLastContentRect + 5.IBPluginDependency + 5.IBWindowTemplateEditedContentRect + 5.ImportedFromIB2 + 5.editorWindowContentRectSynchronizationRect + 5.windowTemplate.hasMinSize + 5.windowTemplate.minSize + 6.IBPluginDependency + 6.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + BlitzPDFView + com.apple.pdfkit.ibplugin + {{18, 816}, {1280, 720}} + com.apple.InterfaceBuilder.CocoaPlugin + {{18, 816}, {1280, 720}} + + {{201, 387}, {507, 413}} + + {94, 86} + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + + YES + + + + + YES + + + YES + + + + 100027 + + + + YES + + BlitzPDFView + PDFView + + updateSecondsElapsed: + id + + + IBProjectSource + BlitzPDFView.h + + + + BlitzPDFView + PDFView + + IBUserSource + + + + + SlidesWindowController + NSWindowController + + pdfView + BlitzPDFView + + + IBProjectSource + SlidesWindowController.h + + + + + YES + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKImageBrowserView.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/IKSaveOptions.h + + + + NSObject + + IBFrameworkSource + ImageKit.framework/Headers/ImageKitDeprecated.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFDocument.h + + + + NSObject + + IBFrameworkSource + PDFKit.framework/Headers/PDFView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionParameterView.h + + + + NSObject + + IBFrameworkSource + QuartzComposer.framework/Headers/QCCompositionPickerView.h + + + + NSObject + + IBFrameworkSource + QuartzFilters.framework/Headers/QuartzFilterManager.h + + + + NSObject + + IBFrameworkSource + QuickLookUI.framework/Headers/QLPreviewPanel.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + PDFView + NSView + + YES + + YES + goBack: + goForward: + goToFirstPage: + goToLastPage: + goToNextPage: + goToPreviousPage: + selectAll: + takeBackgroundColorFrom: + zoomIn: + zoomOut: + + + YES + id + id + id + id + id + id + id + id + id + id + + + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../Blitz.xcodeproj + 3 + + diff --git a/MyDocument.h b/MyDocument.h index 48276d7..4d8fcc5 100644 --- a/MyDocument.h +++ b/MyDocument.h @@ -1,26 +1,20 @@ #import #import -@class BlitzPDFView; - -#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 -@interface MyDocument : NSDocument { -#else @interface MyDocument : NSDocument { -#endif - IBOutlet BlitzPDFView *pdfView; @private PDFDocument *pdfDocument; @private NSTimer *timer; @private BOOL isInFullScreenMode; -#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 - QLPreviewPanel *previewPanel; -#endif + NSUInteger secondsElapsed; NSUInteger pageIndex; + BOOL running; } -@property (retain, nonatomic) IBOutlet BlitzPDFView *pdfView; @property (readwrite) NSUInteger pageIndex; +@property (readonly) BOOL running; + +- (IBAction)start:(id)sender; @end diff --git a/MyDocument.m b/MyDocument.m index b4e55c8..c6fe227 100644 --- a/MyDocument.m +++ b/MyDocument.m @@ -1,6 +1,8 @@ #import "MyDocument.h" -#import "BlitzPDFView.h" + +#import "SlidesWindowController.h" #import "SpeakerNotesWindowController.h" +#import "BlitzPDFView.h" @interface NSObject (UndocumentedQuickLookUI) - (id)_previewView; // -[QLPreviewPanelController _previewView] @@ -12,44 +14,63 @@ @interface MyDocument () @property (retain, nonatomic) PDFDocument *pdfDocument; @property (retain, nonatomic) NSTimer *timer; @property (nonatomic) BOOL isInFullScreenMode; +@property(assign) NSUInteger secondsElapsed; +@property(assign,readwrite) BOOL running; @end @implementation MyDocument -@synthesize pdfView, pdfDocument, timer, isInFullScreenMode; +@synthesize pdfDocument, timer, isInFullScreenMode, secondsElapsed, running; @synthesize pageIndex; - (void)toggleFullScreenMode { - if (self.isInFullScreenMode) { - [self.pdfView exitFullScreenModeWithOptions: nil]; - self.isInFullScreenMode = NO; - } - else { - // TODO - //NSWindow *window = [[[self windowControllers] objectAtIndex:0] window]; - //self.isInFullScreenMode = [self.pdfView enterFullScreenMode: window.screen withOptions: nil]; - } + SlidesWindowController *slides = [self.windowControllers objectAtIndex:0]; + SpeakerNotesWindowController *notes = [self.windowControllers objectAtIndex:1]; + + NSView *slidesView = slides.pdfView; + NSView *notesView = notes.window.contentView; + + if (self.isInFullScreenMode) { + [slidesView exitFullScreenModeWithOptions:nil]; + [notesView exitFullScreenModeWithOptions:nil]; + self.isInFullScreenMode = NO; + } else { + // Notes are on the MacBook Pro main screen at 1920x1200, slides are on the projector at 1280x720. + // For now, assuming that we don't need to change display resolutions and that these will be the only two displays and that the main screen will be the one for the notes. + NSScreen *notesScreen = [NSScreen mainScreen]; + NSScreen *slidesScreen = nil; + for (NSScreen *screen in [NSScreen screens]) { + if (screen != notesScreen) { + slidesScreen = screen; + break; + } + } + + if (!notesScreen || !slidesScreen) { + NSInteger rc = NSRunAlertPanel(@"Missing a screen", @"Unable to find both a note and slide screen", @"Cancel", @"Run Slides", nil); + if (rc == NSAlertDefaultReturn) + return; + slidesScreen = [NSScreen mainScreen]; + notesScreen = nil; + } + + if (notesScreen) { + NSLog(@"notes %@ on %@ %@", notes, notesScreen, NSStringFromRect([notesScreen frame])); + [notesView enterFullScreenMode:notesScreen withOptions:nil]; + } + NSLog(@"slides %@ on %@ %@", slides, slidesScreen, NSStringFromRect([slidesScreen frame])); + [slidesView enterFullScreenMode:slidesScreen withOptions:nil]; + + [NSCursor setHiddenUntilMouseMoves:YES]; + + self.isInFullScreenMode = YES; + } } - (void)initPDFView { - [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]; self.isInFullScreenMode = NO; [self toggleFullScreenMode]; } -- (void)windowControllerDidLoadNib:(NSWindowController*)controller_ { - [super windowControllerDidLoadNib:controller_]; - if (self.pdfDocument) { - [self initPDFView]; - } -} - - (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError { //return [self.pdfDocument writeToURL:absoluteURL]; [self doesNotRecognizeSelector:_cmd]; // Renounce writing the PDF to disk. @@ -69,7 +90,7 @@ - (void)pollPDFPageCount:(NSTimer*)timer_ { PDFDocument *pdfDisplayBundlePDFDocument = [myQLDisplayBundle pdfDocument]; - [pdfDisplayBundlePDFDocument writeToFile:@"/tmp/key.pdf"]; + //[pdfDisplayBundlePDFDocument writeToFile:@"/tmp/key.pdf"]; //NSLog(@"pdfDisplayBundlePDFDocument: %@", pdfDisplayBundlePDFDocument); @@ -113,56 +134,26 @@ - (BOOL)readFromURL:(NSURL *)initWithURL ofType:(NSString *)typeName error:(NSEr } - (void)updateElapsedTimer:(NSTimer*)timer_ { - if (self.pdfView.secondsElapsed != 0 && (self.pdfView.secondsElapsed % SECONDS_PER_SLIDE == 0)) { - if ([self.pdfView canGoToNextPage]) { - [self.pdfView goToNextPage:nil]; - - // Triggers page change in associated speaker notes window controller - self.pageIndex = [[self.pdfView document] indexForPage:self.pdfView.currentPage]; - } - else { - [self.pdfView atLastPage]; + if (self.secondsElapsed != 0 && (self.secondsElapsed % SECONDS_PER_SLIDE == 0)) { + // Triggers page change in associated speaker notes window controller + self.pageIndex++; + if (self.pageIndex >= pdfDocument.pageCount) { + self.running = NO; [timer_ invalidate]; } } - self.pdfView.secondsElapsed += 1; - [self.pdfView setNeedsDisplay:YES]; -} - -//-- - -#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 -- (BOOL)acceptsPreviewPanelControl:(QLPreviewPanel *)panel { - return YES; -} - -- (void)beginPreviewPanelControl:(QLPreviewPanel *)panel { - previewPanel = [panel retain]; - panel.delegate = self; - panel.dataSource = self; -} - -- (void)endPreviewPanelControl:(QLPreviewPanel *)panel { - [previewPanel release]; - previewPanel = nil; -} - -- (NSInteger)numberOfPreviewItemsInPreviewPanel:(QLPreviewPanel*)panel { - return 1; -} - -- (id )previewPanel:(QLPreviewPanel *)panel previewItemAtIndex:(NSInteger)index { - return [self fileURL]; - //return [NSURL fileURLWithPath:@"/Users/wolf/code/github/Blitz/blitz-example.pdf"];//[selectedDownloads objectAtIndex:index]; + + self.secondsElapsed += 1; } -#endif - -//-- - (void)makeWindowControllers; { - [super makeWindowControllers]; - + // Slides + { + SlidesWindowController *slides = [[SlidesWindowController alloc] initWithWindowNibName:@"Slides"]; + [self addWindowController:slides]; + [slides release]; + } // Extract the notes from the Keynote file, converting to HTML. Duct tape and bailing wire. { @@ -205,10 +196,6 @@ - (void)makeWindowControllers; } } -- (NSString *)windowNibName { - return @"MyDocument"; -} - - (void)dealloc { self.pdfDocument = nil; [self.timer invalidate]; @@ -216,4 +203,15 @@ - (void)dealloc { [super dealloc]; } +- (IBAction)start:(id)sender; +{ + self.running = YES; + self.secondsElapsed = 0.0; + self.timer = [[NSTimer scheduledTimerWithTimeInterval:1.0 + target:self + selector:@selector(updateElapsedTimer:) + userInfo:nil + repeats:YES] retain]; +} + @end diff --git a/SlidesWindowController.h b/SlidesWindowController.h new file mode 100644 index 0000000..f462757 --- /dev/null +++ b/SlidesWindowController.h @@ -0,0 +1,28 @@ +// +// SlidesWindowController.h +// Blitz +// +// Created by Timothy J. Wood on 9/20/09. +// Copyright 2009 The Omni Group. All rights reserved. +// + +#import +#import + +@class BlitzPDFView; + +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 +@interface SlidesWindowController : NSWindowController +#else +@interface SlidesWindowController : NSWindowController +#endif +{ + IBOutlet BlitzPDFView *pdfView; +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 + QLPreviewPanel *previewPanel; +#endif +} + +@property (retain, nonatomic) IBOutlet BlitzPDFView *pdfView; + +@end diff --git a/SlidesWindowController.m b/SlidesWindowController.m new file mode 100644 index 0000000..40c66dd --- /dev/null +++ b/SlidesWindowController.m @@ -0,0 +1,71 @@ +// +// SlidesWindowController.m +// Blitz +// +// Created by Timothy J. Wood on 9/20/09. +// Copyright 2009 The Omni Group. All rights reserved. +// + +#import "SlidesWindowController.h" + +#import "BlitzPDFView.h" + +@interface SlidesWindowController (/*Private*/) +@end + +@implementation SlidesWindowController + +@synthesize pdfView; + +- (void)windowDidLoad; +{ + [super windowDidLoad]; + + [self.pdfView setBackgroundColor:[NSColor blackColor]]; +} + +- (void)setDocument:(NSDocument *)document; +{ + [super setDocument:document]; + + if (document) { + [self window]; // make sure our nib is loaded + [self.pdfView bind:@"document" toObject:document withKeyPath:@"pdfDocument" options:nil]; + [self.pdfView bind:@"secondsElapsed" toObject:document withKeyPath:@"secondsElapsed" options:nil]; + [self.pdfView bind:@"pageIndex" toObject:document withKeyPath:@"pageIndex" options:nil]; + [self.pdfView bind:@"running" toObject:document withKeyPath:@"running" options:nil]; + } else { + [self.pdfView unbind:@"document"]; + [self.pdfView unbind:@"secondsElapsed"]; + [self.pdfView unbind:@"pageIndex"]; + [self.pdfView unbind:@"running"]; + } +} + +#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 +- (BOOL)acceptsPreviewPanelControl:(QLPreviewPanel *)panel { + return YES; +} + +- (void)beginPreviewPanelControl:(QLPreviewPanel *)panel { + previewPanel = [panel retain]; + panel.delegate = self; + panel.dataSource = self; +} + +- (void)endPreviewPanelControl:(QLPreviewPanel *)panel { + [previewPanel release]; + previewPanel = nil; +} + +- (NSInteger)numberOfPreviewItemsInPreviewPanel:(QLPreviewPanel*)panel { + return 1; +} + +- (id )previewPanel:(QLPreviewPanel *)panel previewItemAtIndex:(NSInteger)index { + return [self.document fileURL]; + //return [NSURL fileURLWithPath:@"/Users/wolf/code/github/Blitz/blitz-example.pdf"];//[selectedDownloads objectAtIndex:index]; +} +#endif + +@end diff --git a/SpeakerNotes.xib b/SpeakerNotes.xib index dc7fc62..dd0753e 100644 --- a/SpeakerNotes.xib +++ b/SpeakerNotes.xib @@ -23,7 +23,7 @@ YES - + YES @@ -75,6 +75,98 @@ 274 YES + + + 293 + {{432, 26}, {161, 19}} + + YES + + 68288064 + 272630784 + 2) Deep breath… + + LucidaGrande + 16 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 1 + MSAxIDEAA + + + + + + 292 + {{15, 26}, {161, 19}} + + YES + + 68288064 + 272630784 + 1) Tweak Notes Size + + + + + + + + + 292 + {{18, 6}, {274, 15}} + + YES + + -2079981824 + 131072 + + + 10 + 0.5 + 1 + 0.0 + 0 + 1 + NO + NO + + + + + 289 + {{801, 4}, {205, 66}} + + YES + + 67239424 + 134217728 + ▶ Blitz! + + LucidaGrande + 45 + 16 + + + -2033434369 + 130 + + + 400 + 75 + + 12 @@ -89,7 +181,7 @@ 0 NO - 0.25252524018287659 + 0.10000000149011612 YES @@ -106,7 +198,7 @@ 0 NO - 0.25252524018287659 + 0.10000000149011612 YES @@ -167,7 +259,7 @@ - + Helvetica @@ -232,6 +324,90 @@ 12 + + + hidden: document.running + + + + + + hidden: document.running + hidden + document.running + 2 + + + 22 + + + + target: document + + + + + + target: document + target + document + + NSSelectorName + start: + + 2 + + + 26 + + + + changeFont: + + + + 33 + + + + hidden: document.running + + + + + + hidden: document.running + hidden + document.running + 2 + + + 34 + + + + hidden: document.running + + + + + + hidden: document.running + hidden + document.running + 2 + + + 35 + + + + frameLoadDelegate + + + + 36 + @@ -295,6 +471,10 @@ YES + + + + @@ -313,6 +493,62 @@ + + 19 + + + YES + + + + + + 20 + + + + + 27 + + + YES + + + + + + 28 + + + + + 29 + + + YES + + + + + + 30 + + + + + 31 + + + YES + + + + + + 32 + + + @@ -330,7 +566,16 @@ 1.editorWindowContentRectSynchronizationRect 10.CustomClassName 10.IBPluginDependency + 19.IBPluginDependency 2.IBPluginDependency + 20.CustomClassName + 20.IBPluginDependency + 27.IBPluginDependency + 28.IBPluginDependency + 29.IBPluginDependency + 30.IBPluginDependency + 31.IBPluginDependency + 32.IBPluginDependency 4.IBPluginDependency 6.IBPluginDependency 9.CustomClassName @@ -341,15 +586,24 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{624, 356}, {1024, 740}} + {{589, 186}, {1024, 740}} com.apple.InterfaceBuilder.CocoaPlugin - {{624, 356}, {1024, 740}} + {{589, 186}, {1024, 740}} {196, 240} {{357, 418}, {480, 270}} SpeakerSlidePDFView com.apple.pdfkit.ibplugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + BlitzButtonCell + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.WebKitIBPlugin com.apple.InterfaceBuilder.CocoaPlugin SpeakerSlidePDFView @@ -372,14 +626,34 @@ - 12 + 36 YES + + BlitzButtonCell + NSButtonCell + + IBProjectSource + BlitzButtonCell.h + + + + FirstResponder + NSObject + + IBUserSource + + + SpeakerNotesWindowController NSWindowController + + changeFont: + id + YES @@ -427,6 +701,14 @@ YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + NSApplication NSResponder @@ -470,6 +752,46 @@ AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + NSMenu NSObject @@ -499,10 +821,7 @@ NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - + NSObject @@ -817,6 +1136,22 @@ AppKit.framework/Headers/NSResponder.h + + NSSlider + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSlider.h + + + + NSSliderCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSliderCell.h + + NSSplitView NSView @@ -825,6 +1160,22 @@ AppKit.framework/Headers/NSSplitView.h + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + NSView diff --git a/SpeakerNotesWindowController.h b/SpeakerNotesWindowController.h index 2f7e18f..c1dadc4 100644 --- a/SpeakerNotesWindowController.h +++ b/SpeakerNotesWindowController.h @@ -27,4 +27,6 @@ @property(retain) IBOutlet SpeakerSlidesView *slidesView; @property(readwrite) NSUInteger pageIndex; +- (void)changeFont:(id)sender; + @end diff --git a/SpeakerNotesWindowController.m b/SpeakerNotesWindowController.m index 5e06530..53feee4 100644 --- a/SpeakerNotesWindowController.m +++ b/SpeakerNotesWindowController.m @@ -39,8 +39,7 @@ - (void)dealloc; - (void)windowDidLoad; { [super windowDidLoad]; - - self.pageIndex = 0; // set the first media style and load the results + [[_webView mainFrame] loadData:_htmlData MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:nil]; } - (void)setDocument:(NSDocument *)document; @@ -63,16 +62,25 @@ - (void)setDocument:(NSDocument *)document; #pragma mark - #pragma mark KVC +- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)webFrame; +{ + // show the first set of speaker notes once we are fully loaded. + self.pageIndex = 0; +} + @synthesize pageIndex = _pageIndex; - (void)setPageIndex:(NSUInteger)pageIndex; { _pageIndex = pageIndex; - //NSLog(@"speaker pageIndex = %lu", pageIndex); - - // Horrifying but easy! - NSString *mediaStyle = [NSString stringWithFormat:@"mBGSlide%lu", _pageIndex]; - [_webView setMediaStyle:mediaStyle]; - [[_webView mainFrame] loadData:_htmlData MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:nil]; + [[_webView windowScriptObject] evaluateWebScript:[NSString stringWithFormat:@"displayNotesForSlide(%lu);", pageIndex]]; +} + +#pragma mark - +#pragma mark Actions + +- (void)changeFont:(id)sender; +{ + [_webView setTextSizeMultiplier:[sender floatValue]]; } @end diff --git a/blitz-example.key b/blitz-example.key index 2710f96..588e283 100644 Binary files a/blitz-example.key and b/blitz-example.key differ diff --git a/presenter-notes.xsl b/presenter-notes.xsl index f57b096..1032c31 100644 --- a/presenter-notes.xsl +++ b/presenter-notes.xsl @@ -19,82 +19,37 @@ --> - - - - - - - - - - - - - - - - - - - - + +
- - - - - - -

@@ -105,4 +60,3 @@ -