mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 16:40:53 +00:00
Set up print context and view coords for priting
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11006 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
217fa10eae
commit
8f75f002cd
2 changed files with 73 additions and 19 deletions
|
@ -318,6 +318,7 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
|
|||
|
||||
- (void)destroyContext
|
||||
{
|
||||
[_context destroyContext];
|
||||
DESTROY(_context);
|
||||
}
|
||||
|
||||
|
@ -465,7 +466,7 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
|
|||
- (void) _print
|
||||
{
|
||||
// This is the actual printing
|
||||
[_view displayRect: _rect];
|
||||
[_view displayRectIgnoringOpacity: _rect];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -554,14 +555,24 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
|
|||
|
||||
- (NSGraphicsContext*)createContext
|
||||
{
|
||||
// FIXME
|
||||
return nil;
|
||||
NSMutableDictionary *info = [_printInfo dictionary];
|
||||
NSGraphicsContext *psContext;
|
||||
|
||||
[info setObject: _path forKey: @"NSOutputFile"];
|
||||
psContext = [NSGraphicsContext postscriptContextWithInfo: info];
|
||||
|
||||
return psContext;
|
||||
}
|
||||
|
||||
- (BOOL)deliverResult
|
||||
{
|
||||
if (_data != nil && _path != nil && [_data length])
|
||||
return [_data writeToFile: _path atomically: NO];
|
||||
if (_data != nil && _path != nil)
|
||||
{
|
||||
NSString *eps;
|
||||
|
||||
eps = [NSString stringWithContentsOfFile: _path];
|
||||
[_data setData: [eps dataUsingEncoding:NSASCIIStringEncoding]];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue