mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 19:23:59 +00:00
Implement printing
This commit is contained in:
parent
3312d2ecc0
commit
1839222754
|
@ -13,6 +13,7 @@
|
||||||
@class VLSheetWindow;
|
@class VLSheetWindow;
|
||||||
@class VLPDFWindow;
|
@class VLPDFWindow;
|
||||||
@class VLLogWindow;
|
@class VLLogWindow;
|
||||||
|
@class PDFDocument;
|
||||||
|
|
||||||
@interface VLDocument : NSDocument
|
@interface VLDocument : NSDocument
|
||||||
{
|
{
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
VLLogWindow * logWin;
|
VLLogWindow * logWin;
|
||||||
VLPDFWindow * pdfWin;
|
VLPDFWindow * pdfWin;
|
||||||
VLKeyValueUndo* undo;
|
VLKeyValueUndo* undo;
|
||||||
|
PDFDocument * printDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (VLSong *) song;
|
- (VLSong *) song;
|
||||||
|
|
|
@ -11,11 +11,18 @@
|
||||||
#import "VLLilypondDocument.h"
|
#import "VLLilypondDocument.h"
|
||||||
#import "VLMMADocument.h"
|
#import "VLMMADocument.h"
|
||||||
#import "VLMIDIDocument.h"
|
#import "VLMIDIDocument.h"
|
||||||
|
#import "VLPDFDocument.h"
|
||||||
#import "VLPDFWindow.h"
|
#import "VLPDFWindow.h"
|
||||||
#import "VLLogWindow.h"
|
#import "VLLogWindow.h"
|
||||||
#import "VLSheetWindow.h"
|
#import "VLSheetWindow.h"
|
||||||
#import "VLSoundOut.h"
|
#import "VLSoundOut.h"
|
||||||
|
|
||||||
|
#import <Quartz/Quartz.h>
|
||||||
|
|
||||||
|
@interface PDFDocument (PDFKitSecretsIKnow)
|
||||||
|
- (NSPrintOperation *)getPrintOperationForPrintInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate;
|
||||||
|
@end
|
||||||
|
|
||||||
@interface VLSongWrapper : NSObject {
|
@interface VLSongWrapper : NSObject {
|
||||||
VLSong * wrappedSong;
|
VLSong * wrappedSong;
|
||||||
}
|
}
|
||||||
|
@ -87,6 +94,7 @@
|
||||||
@"", @"songGroove",
|
@"", @"songGroove",
|
||||||
@"", @"songTempo",
|
@"", @"songTempo",
|
||||||
nil]];
|
nil]];
|
||||||
|
printDoc = nil;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -421,6 +429,24 @@
|
||||||
[pdfWin reloadPDF];
|
[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
|
- (IBAction) showLog:(id)sender
|
||||||
{
|
{
|
||||||
[[self logWin] showWindow:sender];
|
[[self logWin] showWindow:sender];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user