mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 05:40:37 +00:00
GSPrinting changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19839 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d4818d3966
commit
8a5264e83f
16 changed files with 2640 additions and 1670 deletions
|
@ -150,7 +150,10 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
|||
//
|
||||
- (id)initWithDictionary:(NSDictionary *)aDict
|
||||
{
|
||||
[super init];
|
||||
NSPrinter *printer;
|
||||
NSString *pageSize;
|
||||
|
||||
self = [super init];
|
||||
|
||||
_info = [[NSMutableDictionary alloc] init];
|
||||
|
||||
|
@ -166,6 +169,31 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
|||
[self setVerticallyCentered: YES];
|
||||
|
||||
[self setOrientation: NSPortraitOrientation];
|
||||
|
||||
printer = [NSPrintInfo defaultPrinter];
|
||||
[self setPrinter: printer];
|
||||
|
||||
|
||||
/* Set up other defaults from the printer object */
|
||||
pageSize = [printer stringForKey: @"DefaultPageSize"
|
||||
inTable: @"PPD"];
|
||||
|
||||
/* FIXME: Need to check for AutoSelect and probably a million other things... */
|
||||
if (pageSize == nil)
|
||||
pageSize = @"A4";
|
||||
|
||||
[self setPaperName: pageSize];
|
||||
|
||||
/* Set default margins. FIXME: Probably should check ImageableArea */
|
||||
[self setRightMargin: 36];
|
||||
|
||||
[self setLeftMargin: 36];
|
||||
|
||||
[self setTopMargin: 72];
|
||||
|
||||
[self setBottomMargin: 72];
|
||||
|
||||
|
||||
|
||||
if( aDict != nil )
|
||||
{
|
||||
|
@ -174,7 +202,6 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
|||
if([[_info objectForKey: NSPrintPrinter] isKindOfClass: [NSString class]])
|
||||
{
|
||||
NSString *printerName;
|
||||
NSPrinter *printer;
|
||||
|
||||
printerName = [_info objectForKey: NSPrintPrinter];
|
||||
printer = [NSPrinter printerWithName: printerName];
|
||||
|
@ -188,6 +215,7 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
|||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_info);
|
||||
|
|
1500
Source/NSPrinter.m
1500
Source/NSPrinter.m
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue