From a0f098ad8c32f8e3a43d314edacda034545a5558 Mon Sep 17 00:00:00 2001 From: FredKiefer Date: Mon, 13 Nov 2000 15:17:24 +0000 Subject: [PATCH] Implemented [print:], [fax:], [dataWithEPSInsideRect:] and [writeEPSInsideRect:toPasteboard:]. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8104 72102866-910b-0410-8b05-ffd578937521 --- Source/NSView.m | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Source/NSView.m b/Source/NSView.m index f6ad6a184..ef4a87af6 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -54,6 +55,9 @@ #include #include #include +#include +#include +#include struct NSWindow_struct { @@ -2344,20 +2348,36 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) */ - (NSData*) dataWithEPSInsideRect: (NSRect)aRect { - return nil; + NSMutableData *data = [NSMutableData data]; + + [[NSPrintOperation EPSOperationWithView: self + insideRect: aRect + toData: data] runOperation]; + return data; } - (void) fax: (id)sender { + NSPrintInfo *aPrintInfo = [NSPrintInfo sharedPrintInfo]; + + [aPrintInfo setJobDisposition: NSPrintFaxJob]; + [[NSPrintOperation printOperationWithView: self + printInfo: aPrintInfo] runOperation]; } - (void) print: (id)sender { + [[NSPrintOperation printOperationWithView: self] runOperation]; } - (void) writeEPSInsideRect: (NSRect)rect toPasteboard: (NSPasteboard*)pasteboard { + NSData *data = [self dataWithEPSInsideRect: rect]; + + if (data != nil) + [pasteboard setData: data + forType: NSPostScriptPboardType]; } /*