mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Clean up all the header imports in teh Printing directory.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32009 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
89eb95e7d4
commit
18813674f2
25 changed files with 102 additions and 262 deletions
|
@ -1,3 +1,7 @@
|
|||
2011-02-07 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Printing/*: Clean up all the header includes.
|
||||
|
||||
2011-01-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSBrowser.h,
|
||||
|
|
|
@ -29,11 +29,7 @@
|
|||
#ifndef _GNUstep_H_GSCUPSPageLayout
|
||||
#define _GNUstep_H_GSCUPSPageLayout
|
||||
|
||||
#include <AppKit/NSPageLayout.h>
|
||||
|
||||
|
||||
@class NSPrintInfo;
|
||||
@class NSView;
|
||||
#import "AppKit/NSPageLayout.h"
|
||||
|
||||
|
||||
@interface GSCUPSPageLayout: NSPageLayout
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include "GSCUPSPageLayout.h"
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import "GSCUPSPageLayout.h"
|
||||
|
||||
|
||||
@implementation GSCUPSPageLayout
|
||||
|
@ -35,7 +35,6 @@
|
|||
//
|
||||
+ (void)initialize
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
if (self == [GSCUPSPageLayout class])
|
||||
{
|
||||
// Initial version
|
||||
|
@ -46,9 +45,7 @@
|
|||
|
||||
+ (id) allocWithZone: (NSZone*)zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _GSCUPSPRINCIPALCLASS_H_
|
||||
#define _GSCUPSPRINCIPALCLASS_H_
|
||||
|
||||
#include <GNUstepGUI/GSPrinting.h>
|
||||
#import "GNUstepGUI/GSPrinting.h"
|
||||
|
||||
@interface GSCUPSPrincipalClass : GSPrintingPrincipalClass
|
||||
{
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include "GSCUPSPrincipalClass.h"
|
||||
#include "GSCUPSPageLayout.h"
|
||||
#include "GSCUPSPrintInfo.h"
|
||||
#include "GSCUPSPrintOperation.h"
|
||||
#include "GSCUPSPrintPanel.h"
|
||||
#include "GSCUPSPrinter.h"
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import "GSCUPSPrincipalClass.h"
|
||||
#import "GSCUPSPageLayout.h"
|
||||
#import "GSCUPSPrintInfo.h"
|
||||
#import "GSCUPSPrintOperation.h"
|
||||
#import "GSCUPSPrintPanel.h"
|
||||
#import "GSCUPSPrinter.h"
|
||||
|
||||
|
||||
@implementation GSCUPSPrincipalClass
|
||||
|
@ -42,43 +42,35 @@
|
|||
//
|
||||
+(Class) pageLayoutClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSCUPSPageLayout class];
|
||||
}
|
||||
|
||||
+(Class) printInfoClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSCUPSPrintInfo class];
|
||||
}
|
||||
|
||||
+(Class) printOperationClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSCUPSPrintOperation class];
|
||||
}
|
||||
|
||||
|
||||
+(Class) printPanelClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSCUPSPrintPanel class];
|
||||
}
|
||||
|
||||
|
||||
+(Class) printerClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSCUPSPrinter class];
|
||||
}
|
||||
|
||||
|
||||
+(Class) gsPrintOperationClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSCUPSPrintOperation class];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -29,16 +29,12 @@
|
|||
#ifndef _GNUstep_H_GSCUPSPrintInfo
|
||||
#define _GNUstep_H_GSCUPSPrintInfo
|
||||
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <AppKit/NSPrintInfo.h>
|
||||
|
||||
|
||||
#import <Foundation/NSCoder.h>
|
||||
#import "AppKit/NSPrintInfo.h"
|
||||
|
||||
@interface GSCUPSPrintInfo: NSPrintInfo
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
#endif // _GNUstep_H_GSCUPSPrintInfo
|
||||
|
|
|
@ -27,17 +27,11 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <AppKit/NSPrinter.h>
|
||||
#include "GSCUPSPrintInfo.h"
|
||||
#include "GSCUPSPrinter.h"
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import "AppKit/NSPrinter.h"
|
||||
#import "GSCUPSPrintInfo.h"
|
||||
#import "GSCUPSPrinter.h"
|
||||
#include <cups/cups.h>
|
||||
|
||||
|
||||
|
@ -48,7 +42,6 @@
|
|||
//
|
||||
+ (void)initialize
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
if (self == [GSCUPSPrintInfo class])
|
||||
{
|
||||
// Initial version
|
||||
|
@ -59,7 +52,6 @@
|
|||
|
||||
+ (id) allocWithZone: (NSZone*)zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _GNUstep_H_GSCUPSPrintOperation
|
||||
#define _GNUstep_H_GSCUPSPrintOperation
|
||||
|
||||
#include <GNUstepGUI/GSPrintOperation.h>
|
||||
#import "GNUstepGUI/GSPrintOperation.h"
|
||||
|
||||
//GSPrintOperation is subclasses of GSPrintOperation, NOT NSPrintOperation.
|
||||
//NSPrintOperation does a lot of work that is pretty generic.
|
||||
|
@ -40,7 +40,6 @@
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
#endif // _GNUstep_H_GSCUPSPrintOperation
|
||||
|
|
|
@ -29,33 +29,21 @@
|
|||
|
||||
#include <math.h>
|
||||
#include <config.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSFileManager.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSPathUtilities.h>
|
||||
#include <Foundation/NSTask.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <AppKit/AppKitExceptions.h>
|
||||
#include <AppKit/NSAffineTransform.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSPrinter.h>
|
||||
#include <AppKit/NSPrintPanel.h>
|
||||
#include <AppKit/NSPrintInfo.h>
|
||||
#include <AppKit/NSPrintOperation.h>
|
||||
#include <AppKit/NSWorkspace.h>
|
||||
#include <AppKit/PSOperators.h>
|
||||
#include "GSCUPSPrintOperation.h"
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSPathUtilities.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <AppKit/NSGraphicsContext.h>
|
||||
#import <AppKit/NSView.h>
|
||||
#import <AppKit/NSPrinter.h>
|
||||
#import <AppKit/NSPrintPanel.h>
|
||||
#import <AppKit/NSPrintInfo.h>
|
||||
#import <AppKit/NSPrintOperation.h>
|
||||
#import "GSGuiPrivate.h"
|
||||
#import "GSCUPSPrintOperation.h"
|
||||
#include <cups/cups.h>
|
||||
|
||||
|
||||
|
||||
|
||||
//A subclass of GSPrintOperation, NOT NSPrintOperation.
|
||||
@implementation GSCUPSPrintOperation
|
||||
//
|
||||
|
@ -63,7 +51,6 @@
|
|||
//
|
||||
+ (id) allocWithZone: (NSZone*)zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
@ -73,6 +60,8 @@
|
|||
{
|
||||
self = [super initWithView: aView
|
||||
printInfo: aPrintInfo];
|
||||
if (self == nil)
|
||||
return nil;
|
||||
|
||||
_path = [NSTemporaryDirectory()
|
||||
stringByAppendingPathComponent: @"GSCUPSPrintJob-"];
|
||||
|
@ -91,41 +80,16 @@
|
|||
|
||||
- (BOOL) _deliverSpooledResult
|
||||
{
|
||||
//int copies;
|
||||
//NSDictionary *dict;
|
||||
//NSTask *task;
|
||||
NSString *name, *status;
|
||||
//NSMutableArray *args;
|
||||
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
name = [[[self printInfo] printer] name];
|
||||
status = [NSString stringWithFormat: @"Spooling to printer %@.", name];
|
||||
status = [NSString stringWithFormat: _(@"Spooling to printer %@."), name];
|
||||
[[self printPanel] _setStatusStringValue: status];
|
||||
|
||||
cupsPrintFile( [name UTF8String],
|
||||
[_path UTF8String],
|
||||
[_path UTF8String],
|
||||
0, NULL );
|
||||
|
||||
|
||||
//dict = [[self printInfo] dictionary];
|
||||
//args = [NSMutableArray array];
|
||||
//copies = [[dict objectForKey: NSPrintCopies] intValue];
|
||||
//if (copies > 1)
|
||||
// [args addObject: [NSString stringWithFormat: @"-#%0d", copies]];
|
||||
//if ([name isEqual: @"Unknown"] == NO)
|
||||
// {
|
||||
// [args addObject: @"-P"];
|
||||
// [args addObject: name];
|
||||
// }
|
||||
//[args addObject: _path];
|
||||
|
||||
//task = [NSTask new];
|
||||
//[task setLaunchPath: @"lpr"];
|
||||
//[task setArguments: args];
|
||||
//[task launch];
|
||||
//[task waitUntilExit];
|
||||
//AUTORELEASE(task);
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
@ -134,7 +98,6 @@
|
|||
NSMutableDictionary *info;
|
||||
NSString *output;
|
||||
|
||||
//NSDebugMLLog(@"GSPrinting", @"_path is %@", _path);
|
||||
if (_context)
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"Already had context, returning it.");
|
||||
|
|
|
@ -30,14 +30,13 @@
|
|||
#ifndef _GNUstep_H_GSCUPSPrintPanel
|
||||
#define _GNUstep_H_GSCUPSPrintPanel
|
||||
|
||||
#include <AppKit/NSPrintPanel.h>
|
||||
#import "AppKit/NSPrintPanel.h"
|
||||
|
||||
|
||||
@interface GSCUPSPrintPanel : NSPrintPanel
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
#endif // _GNUstep_H_GSCUPSPrintPanel
|
||||
|
|
|
@ -26,9 +26,8 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include "GSCUPSPrintPanel.h"
|
||||
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import "GSCUPSPrintPanel.h"
|
||||
|
||||
|
||||
@implementation GSCUPSPrintPanel
|
||||
|
@ -37,7 +36,6 @@
|
|||
//
|
||||
+ (id) allocWithZone: (NSZone*)zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
#ifndef _GNUstep_H_GSCUPSPrinter
|
||||
#define _GNUstep_H_GSCUPSPrinter
|
||||
|
||||
#include <AppKit/NSPrinter.h>
|
||||
#import "AppKit/NSPrinter.h"
|
||||
|
||||
|
||||
@class NSString;
|
||||
|
||||
extern NSString *GSCUPSDummyPrinterName;
|
||||
|
||||
@interface GSCUPSPrinter : NSPrinter <NSCoding>
|
||||
@interface GSCUPSPrinter : NSPrinter
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,6 @@ NSString *GSCUPSDummyPrinterName = @"GSCUPSDummyPrinter";
|
|||
//
|
||||
+(void) initialize
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
if (self == [GSCUPSPrinter class])
|
||||
{
|
||||
// Initial version
|
||||
|
@ -71,7 +70,6 @@ NSString *GSCUPSDummyPrinterName = @"GSCUPSDummyPrinter";
|
|||
|
||||
+(id) allocWithZone: (NSZone*) zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
@ -164,18 +162,5 @@ static BOOL didWarn;
|
|||
return [set allObjects];
|
||||
}
|
||||
|
||||
|
||||
-(id) initWithCoder: (NSCoder*) coder
|
||||
{
|
||||
return [super initWithCoder: coder];
|
||||
}
|
||||
|
||||
|
||||
-(void) encodeWithCoder: (NSCoder*) coder
|
||||
{
|
||||
[super encodeWithCoder: coder];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -32,13 +32,11 @@
|
|||
#ifndef _GNUstep_H_GSLPRPageLayout
|
||||
#define _GNUstep_H_GSLPRPageLayout
|
||||
|
||||
#include <AppKit/NSPageLayout.h>
|
||||
|
||||
#import "AppKit/NSPageLayout.h"
|
||||
|
||||
@class NSPrintInfo;
|
||||
@class NSView;
|
||||
|
||||
|
||||
@interface GSLPRPageLayout: NSPageLayout
|
||||
{
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include "GSLPRPageLayout.h"
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import "GSLPRPageLayout.h"
|
||||
|
||||
|
||||
@implementation GSLPRPageLayout
|
||||
|
@ -35,7 +35,6 @@
|
|||
//
|
||||
+ (void)initialize
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
if (self == [GSLPRPageLayout class])
|
||||
{
|
||||
// Initial version
|
||||
|
@ -46,9 +45,7 @@
|
|||
|
||||
+ (id) allocWithZone: (NSZone*)zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#ifndef _GNUstep_H_GSLPRPrincipalClass
|
||||
#define _GNUstep_H_GSLPRPrincipalClass
|
||||
|
||||
#include <GNUstepGUI/GSPrinting.h>
|
||||
#import "GNUstepGUI/GSPrinting.h"
|
||||
|
||||
@interface GSLPRPrincipalClass : GSPrintingPrincipalClass
|
||||
{
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include "GSLPRPrincipalClass.h"
|
||||
#include "GSLPRPageLayout.h"
|
||||
#include "GSLPRPrintInfo.h"
|
||||
#include "GSLPRPrintOperation.h"
|
||||
#include "GSLPRPrintPanel.h"
|
||||
#include "GSLPRPrinter.h"
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import "GSLPRPrincipalClass.h"
|
||||
#import "GSLPRPageLayout.h"
|
||||
#import "GSLPRPrintInfo.h"
|
||||
#import "GSLPRPrintOperation.h"
|
||||
#import "GSLPRPrintPanel.h"
|
||||
#import "GSLPRPrinter.h"
|
||||
|
||||
|
||||
@implementation GSLPRPrincipalClass
|
||||
|
@ -42,43 +42,35 @@
|
|||
//
|
||||
+(Class) pageLayoutClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSLPRPageLayout class];
|
||||
}
|
||||
|
||||
+(Class) printInfoClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSLPRPrintInfo class];
|
||||
}
|
||||
|
||||
+(Class) printOperationClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSLPRPrintOperation class];
|
||||
}
|
||||
|
||||
|
||||
+(Class) printPanelClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSLPRPrintPanel class];
|
||||
}
|
||||
|
||||
|
||||
+(Class) printerClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSLPRPrinter class];
|
||||
}
|
||||
|
||||
|
||||
+(Class) gsPrintOperationClass
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return [GSLPRPrintOperation class];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -34,16 +34,12 @@
|
|||
#ifndef _GNUstep_H_GSLPRPrintInfo
|
||||
#define _GNUstep_H_GSLPRPrintInfo
|
||||
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <AppKit/NSPrintInfo.h>
|
||||
|
||||
|
||||
#import <Foundation/NSCoder.h>
|
||||
#import "AppKit/NSPrintInfo.h"
|
||||
|
||||
@interface GSLPRPrintInfo: NSPrintInfo
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
#endif // _GNUstep_H_GSLPRPrintInfo
|
||||
|
|
|
@ -30,19 +30,13 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <AppKit/NSPrinter.h>
|
||||
#include "GSLPRPrintInfo.h"
|
||||
#include "GSLPRPrinter.h"
|
||||
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import "AppKit/NSPrinter.h"
|
||||
#import "GSLPRPrintInfo.h"
|
||||
|
||||
|
||||
@implementation GSLPRPrintInfo
|
||||
|
@ -52,7 +46,6 @@
|
|||
//
|
||||
+ (void)initialize
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
if (self == [GSLPRPrintInfo class])
|
||||
{
|
||||
// Initial version
|
||||
|
@ -63,7 +56,6 @@
|
|||
|
||||
+ (id) allocWithZone: (NSZone*)zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
@ -73,37 +65,36 @@
|
|||
NSUserDefaults *defaults;
|
||||
NSString *name;
|
||||
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
NSDebugMLLog(@"GSPrinting", @"defaultPrinter");
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
name = [defaults objectForKey: @"GSLPRDefaultPrinter"];
|
||||
|
||||
if( name == nil )
|
||||
if (name == nil)
|
||||
{
|
||||
name = [[NSPrinter printerNames] objectAtIndex: 0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if( [NSPrinter printerWithName: name] == nil )
|
||||
if ([NSPrinter printerWithName: name] == nil)
|
||||
{
|
||||
name = [[GSLPRPrinter printerNames] objectAtIndex: 0];
|
||||
name = [[NSPrinter printerNames] objectAtIndex: 0];
|
||||
}
|
||||
}
|
||||
return [NSPrinter printerWithName: name];
|
||||
}
|
||||
|
||||
|
||||
|
||||
+ (void)setDefaultPrinter:(NSPrinter *)printer
|
||||
{
|
||||
NSUserDefaults *defaults;
|
||||
NSMutableDictionary *globalDomain;
|
||||
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
NSDebugMLLog(@"GSPrinting", @"setDefaultPrinter");
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
globalDomain = (NSMutableDictionary*)[defaults persistentDomainForName: NSGlobalDomain];
|
||||
|
||||
if( globalDomain )
|
||||
if (globalDomain)
|
||||
{
|
||||
globalDomain = [globalDomain mutableCopy];
|
||||
|
||||
|
@ -112,14 +103,12 @@
|
|||
|
||||
[defaults setPersistentDomain: globalDomain
|
||||
forName: NSGlobalDomain];
|
||||
RELEASE(globalDomain);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"(GSLPR) Could not save default printer named %@ to NSUserDefaults GSLPRDefaultPrinter in NSGlobalDomain.", [printer name]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#ifndef _GNUstep_H_GSLPRPrintOperation
|
||||
#define _GNUstep_H_GSLPRPrintOperation
|
||||
|
||||
#include <GNUstepGUI/GSPrintOperation.h>
|
||||
#import "GNUstepGUI/GSPrintOperation.h"
|
||||
|
||||
//GSPrintOperation is subclasses of GSPrintOperation, NOT NSPrintOperation.
|
||||
//NSPrintOperation does a lot of work that is pretty generic.
|
||||
|
|
|
@ -33,33 +33,21 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <config.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSFileManager.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSPathUtilities.h>
|
||||
#include <Foundation/NSTask.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <AppKit/AppKitExceptions.h>
|
||||
#include <AppKit/NSAffineTransform.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSPrinter.h>
|
||||
#include <AppKit/NSPrintPanel.h>
|
||||
#include <AppKit/NSPrintInfo.h>
|
||||
#include <AppKit/NSPrintOperation.h>
|
||||
#include <AppKit/NSWorkspace.h>
|
||||
#include <AppKit/PSOperators.h>
|
||||
#include "GSLPRPrintOperation.h"
|
||||
|
||||
|
||||
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSPathUtilities.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSTask.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import "AppKit/NSGraphicsContext.h"
|
||||
#import "AppKit/NSView.h"
|
||||
#import "AppKit/NSPrinter.h"
|
||||
#import "AppKit/NSPrintPanel.h"
|
||||
#import "AppKit/NSPrintInfo.h"
|
||||
#import "AppKit/NSPrintOperation.h"
|
||||
#import "GSGuiPrivate.h"
|
||||
#import "GSLPRPrintOperation.h"
|
||||
|
||||
//A subclass of GSPrintOperation, NOT NSPrintOperation.
|
||||
@implementation GSLPRPrintOperation
|
||||
|
@ -68,7 +56,6 @@
|
|||
//
|
||||
+ (id) allocWithZone: (NSZone*)zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
@ -78,6 +65,8 @@
|
|||
{
|
||||
self = [super initWithView: aView
|
||||
printInfo: aPrintInfo];
|
||||
if (self == nil)
|
||||
return nil;
|
||||
|
||||
_path = [NSTemporaryDirectory()
|
||||
stringByAppendingPathComponent: @"GSLPRPrintJob-"];
|
||||
|
@ -91,7 +80,6 @@
|
|||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (BOOL) _deliverSpooledResult
|
||||
|
@ -102,9 +90,8 @@
|
|||
NSString *name, *status;
|
||||
NSMutableArray *args;
|
||||
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
name = [[[self printInfo] printer] name];
|
||||
status = [NSString stringWithFormat: @"Spooling to printer %@.", name];
|
||||
status = [NSString stringWithFormat: _(@"Spooling to printer %@."), name];
|
||||
[[self printPanel] _setStatusStringValue: status];
|
||||
|
||||
dict = [[self printInfo] dictionary];
|
||||
|
@ -133,7 +120,6 @@
|
|||
NSMutableDictionary *info;
|
||||
NSString *output;
|
||||
|
||||
//NSDebugMLLog(@"GSPrinting", @"_path is %@", _path);
|
||||
if (_context)
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"Already had context, returning it.");
|
||||
|
|
|
@ -33,14 +33,12 @@
|
|||
#ifndef _GNUstep_H_GSLPRPrintPanel
|
||||
#define _GNUstep_H_GSLPRPrintPanel
|
||||
|
||||
#include <AppKit/NSPrintPanel.h>
|
||||
|
||||
#import "AppKit/NSPrintPanel.h"
|
||||
|
||||
@interface GSLPRPrintPanel : NSPrintPanel
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
#endif // _GNUstep_H_GSLPRPrintPanel
|
||||
|
|
|
@ -29,9 +29,8 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include "GSLPRPrintPanel.h"
|
||||
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import "GSLPRPrintPanel.h"
|
||||
|
||||
|
||||
@implementation GSLPRPrintPanel
|
||||
|
@ -40,7 +39,6 @@
|
|||
//
|
||||
+ (id) allocWithZone: (NSZone*)zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,11 +33,10 @@
|
|||
#ifndef _GNUstep_H_GSLPRPrinter
|
||||
#define _GNUstep_H_GSLPRPrinter
|
||||
|
||||
#include <AppKit/NSPrinter.h>
|
||||
#import "AppKit/NSPrinter.h"
|
||||
|
||||
|
||||
|
||||
@interface GSLPRPrinter : NSPrinter <NSCoding>
|
||||
@interface GSLPRPrinter : NSPrinter
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -38,27 +38,15 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
#include <Foundation/NSCharacterSet.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSFileManager.h>
|
||||
#include <Foundation/NSPathUtilities.h>
|
||||
#include <Foundation/NSScanner.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSMapTable.h>
|
||||
#include "AppKit/AppKitExceptions.h"
|
||||
#include "AppKit/NSGraphics.h"
|
||||
#include "GSLPRPrinter.h"
|
||||
#include "GNUstepGUI/GSPrinting.h"
|
||||
|
||||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSBundle.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import "GSLPRPrinter.h"
|
||||
#import "GNUstepGUI/GSPrinting.h"
|
||||
|
||||
|
||||
@implementation GSLPRPrinter
|
||||
|
@ -68,7 +56,6 @@
|
|||
//
|
||||
+(void) initialize
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
if (self == [GSLPRPrinter class])
|
||||
{
|
||||
// Initial version
|
||||
|
@ -79,7 +66,6 @@
|
|||
|
||||
+(id) allocWithZone: (NSZone*) zone
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
return NSAllocateObject(self, 0, zone);
|
||||
}
|
||||
|
||||
|
@ -93,7 +79,6 @@
|
|||
NSPrinter* printer;
|
||||
|
||||
printersDict = [self printersDictionary];
|
||||
|
||||
printerEntry = [printersDict objectForKey: name];
|
||||
|
||||
if( printerEntry == nil)
|
||||
|
@ -120,26 +105,9 @@
|
|||
|
||||
+ (NSArray *)printerNames
|
||||
{
|
||||
NSDebugMLLog(@"GSPrinting", @"");
|
||||
|
||||
return [[self printersDictionary] allKeys];
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(id) initWithCoder: (NSCoder*) coder
|
||||
{
|
||||
return [super initWithCoder: coder];
|
||||
}
|
||||
|
||||
|
||||
-(void) encodeWithCoder: (NSCoder*) coder
|
||||
{
|
||||
[super encodeWithCoder: coder];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Load the printer setup from NSUserDefaults
|
||||
//
|
||||
|
@ -150,7 +118,6 @@
|
|||
NSDictionary *printers;
|
||||
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
printers = [defaults dictionaryForKey: @"GSLPRPrinters"];
|
||||
|
||||
if (!printers) //Not set, make a default printer because we are nice.
|
||||
|
@ -197,5 +164,4 @@
|
|||
return printers;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue