mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2025-03-01 08:17:29 +00:00

- NSDocument initWithContentsOfURL, printDocument:, printDocumentWithSettings:, printOperationWithSettings:error: implemented - NSDocumentController recent document menu implemented, and some of the URL based methods. -[NSURL isEqual:], -[NSURL isFileURL] implemented within the limits of the current capabilities -[NSApplication windowsMenu] corrected (finds menu by name in nib) +[NSMenuItem separatorItem] fixed (was returning broken separator) - NSMenu loads special name (windows, font, recent doc.s, etc.) from nib and private API for locating by name - Most NSPrintInfo getters/setters implemented. - NSPrintPanel added - Split KGRenderingContext into KGRenderingContext and KGDeviceContext and cleaned up around these classes - Fixed page locating bug in KGPDFDocument
39 lines
924 B
Objective-C
39 lines
924 B
Objective-C
#import <AppKit/NSPrintPanel.h>
|
|
#import <AppKit/NSPrintOperation.h>
|
|
#import <AppKit/NSPrintInfo.h>
|
|
#import <AppKit/NSPanel.h>
|
|
#import <AppKit/NSDisplay.h>
|
|
#import <Foundation/NSDictionary.h>
|
|
|
|
@implementation NSPrintPanel
|
|
|
|
+(NSPrintPanel *)printPanel {
|
|
return [[[self alloc] init] autorelease];
|
|
}
|
|
|
|
-(int)runModal {
|
|
int result;
|
|
|
|
[self updateFromPrintInfo];
|
|
result=[[NSDisplay currentDisplay] runModalPrintPanelWithPrintInfoDictionary:_attributes];
|
|
if(result==NSOKButton)
|
|
[self finalWritePrintInfo];
|
|
|
|
return result;
|
|
}
|
|
|
|
-(void)updateFromPrintInfo {
|
|
NSDictionary *source=[[[NSPrintOperation currentOperation] printInfo] dictionary];
|
|
|
|
[_attributes release];
|
|
_attributes=[source mutableCopy];
|
|
}
|
|
|
|
-(void)finalWritePrintInfo {
|
|
NSMutableDictionary *destination=[[[NSPrintOperation currentOperation] printInfo] dictionary];
|
|
|
|
[destination addEntriesFromDictionary:_attributes];
|
|
}
|
|
|
|
@end
|