mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Implement printing
This commit is contained in:
parent
3312d2ecc0
commit
1839222754
|
@ -13,6 +13,7 @@
|
|||
@class VLSheetWindow;
|
||||
@class VLPDFWindow;
|
||||
@class VLLogWindow;
|
||||
@class PDFDocument;
|
||||
|
||||
@interface VLDocument : NSDocument
|
||||
{
|
||||
|
@ -34,6 +35,7 @@
|
|||
VLLogWindow * logWin;
|
||||
VLPDFWindow * pdfWin;
|
||||
VLKeyValueUndo* undo;
|
||||
PDFDocument * printDoc;
|
||||
}
|
||||
|
||||
- (VLSong *) song;
|
||||
|
|
|
@ -11,11 +11,18 @@
|
|||
#import "VLLilypondDocument.h"
|
||||
#import "VLMMADocument.h"
|
||||
#import "VLMIDIDocument.h"
|
||||
#import "VLPDFDocument.h"
|
||||
#import "VLPDFWindow.h"
|
||||
#import "VLLogWindow.h"
|
||||
#import "VLSheetWindow.h"
|
||||
#import "VLSoundOut.h"
|
||||
|
||||
#import <Quartz/Quartz.h>
|
||||
|
||||
@interface PDFDocument (PDFKitSecretsIKnow)
|
||||
- (NSPrintOperation *)getPrintOperationForPrintInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate;
|
||||
@end
|
||||
|
||||
@interface VLSongWrapper : NSObject {
|
||||
VLSong * wrappedSong;
|
||||
}
|
||||
|
@ -87,6 +94,7 @@
|
|||
@"", @"songGroove",
|
||||
@"", @"songTempo",
|
||||
nil]];
|
||||
printDoc = nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -421,6 +429,24 @@
|
|||
[pdfWin reloadPDF];
|
||||
}
|
||||
|
||||
- (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)printSettings
|
||||
error:(NSError **)outError
|
||||
{
|
||||
[self createTmpFileWithExtension:@"pdf" ofType:@"VLPDFType"];
|
||||
[printDoc autorelease];
|
||||
printDoc = [[PDFDocument alloc] initWithURL:[self fileURLWithExtension:@"pdf"]];
|
||||
|
||||
NSPrintOperation *printOperation = [printDoc getPrintOperationForPrintInfo:[self printInfo] autoRotate:NO];
|
||||
|
||||
// Specify that the print operation can run in a separate thread. This will cause the print progress panel to appear as a sheet on the document window.
|
||||
[printOperation setCanSpawnSeparateThread:YES];
|
||||
|
||||
// Set any print settings that might have been specified in a Print Document Apple event.
|
||||
[[[printOperation printInfo] dictionary] addEntriesFromDictionary:printSettings];
|
||||
|
||||
return printOperation;
|
||||
}
|
||||
|
||||
- (IBAction) showLog:(id)sender
|
||||
{
|
||||
[[self logWin] showWindow:sender];
|
||||
|
|
Loading…
Reference in New Issue
Block a user