mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
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
This commit is contained in:
parent
d08bdb8b6a
commit
c0f395f492
1 changed files with 21 additions and 1 deletions
|
@ -44,6 +44,7 @@
|
|||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
|
||||
#include <AppKit/NSView.h>
|
||||
|
@ -54,6 +55,9 @@
|
|||
#include <AppKit/NSAffineTransform.h>
|
||||
#include <AppKit/NSScrollView.h>
|
||||
#include <AppKit/NSClipView.h>
|
||||
#include <AppKit/NSPasteboard.h>
|
||||
#include <AppKit/NSPrintInfo.h>
|
||||
#include <AppKit/NSPrintOperation.h>
|
||||
|
||||
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];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue