mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:00:48 +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
b5095eee61
commit
a0f098ad8c
1 changed files with 21 additions and 1 deletions
|
@ -44,6 +44,7 @@
|
||||||
#include <Foundation/NSArray.h>
|
#include <Foundation/NSArray.h>
|
||||||
#include <Foundation/NSNotification.h>
|
#include <Foundation/NSNotification.h>
|
||||||
#include <Foundation/NSValue.h>
|
#include <Foundation/NSValue.h>
|
||||||
|
#include <Foundation/NSData.h>
|
||||||
#include <Foundation/NSDebug.h>
|
#include <Foundation/NSDebug.h>
|
||||||
|
|
||||||
#include <AppKit/NSView.h>
|
#include <AppKit/NSView.h>
|
||||||
|
@ -54,6 +55,9 @@
|
||||||
#include <AppKit/NSAffineTransform.h>
|
#include <AppKit/NSAffineTransform.h>
|
||||||
#include <AppKit/NSScrollView.h>
|
#include <AppKit/NSScrollView.h>
|
||||||
#include <AppKit/NSClipView.h>
|
#include <AppKit/NSClipView.h>
|
||||||
|
#include <AppKit/NSPasteboard.h>
|
||||||
|
#include <AppKit/NSPrintInfo.h>
|
||||||
|
#include <AppKit/NSPrintOperation.h>
|
||||||
|
|
||||||
struct NSWindow_struct
|
struct NSWindow_struct
|
||||||
{
|
{
|
||||||
|
@ -2344,20 +2348,36 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
*/
|
*/
|
||||||
- (NSData*) dataWithEPSInsideRect: (NSRect)aRect
|
- (NSData*) dataWithEPSInsideRect: (NSRect)aRect
|
||||||
{
|
{
|
||||||
return nil;
|
NSMutableData *data = [NSMutableData data];
|
||||||
|
|
||||||
|
[[NSPrintOperation EPSOperationWithView: self
|
||||||
|
insideRect: aRect
|
||||||
|
toData: data] runOperation];
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) fax: (id)sender
|
- (void) fax: (id)sender
|
||||||
{
|
{
|
||||||
|
NSPrintInfo *aPrintInfo = [NSPrintInfo sharedPrintInfo];
|
||||||
|
|
||||||
|
[aPrintInfo setJobDisposition: NSPrintFaxJob];
|
||||||
|
[[NSPrintOperation printOperationWithView: self
|
||||||
|
printInfo: aPrintInfo] runOperation];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) print: (id)sender
|
- (void) print: (id)sender
|
||||||
{
|
{
|
||||||
|
[[NSPrintOperation printOperationWithView: self] runOperation];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) writeEPSInsideRect: (NSRect)rect
|
- (void) writeEPSInsideRect: (NSRect)rect
|
||||||
toPasteboard: (NSPasteboard*)pasteboard
|
toPasteboard: (NSPasteboard*)pasteboard
|
||||||
{
|
{
|
||||||
|
NSData *data = [self dataWithEPSInsideRect: rect];
|
||||||
|
|
||||||
|
if (data != nil)
|
||||||
|
[pasteboard setData: data
|
||||||
|
forType: NSPostScriptPboardType];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue