2001-12-17 16:51:51 +00:00
|
|
|
|
/** <title>NSGraphicsContext</title>
|
|
|
|
|
|
|
|
|
|
<abstract>GNUstep drawing context class.</abstract>
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
|
|
|
|
Copyright (C) 1998 Free Software Foundation, Inc.
|
|
|
|
|
|
2001-12-17 16:51:51 +00:00
|
|
|
|
Written by: Adam Fedor <fedor@gnu.org>
|
1999-02-25 15:41:17 +00:00
|
|
|
|
Date: Nov 1998
|
2001-12-17 16:51:51 +00:00
|
|
|
|
Updated by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
1999-03-05 15:47:22 +00:00
|
|
|
|
Date: Feb 1999
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
|
|
|
|
This file is part of the GNUStep GUI Library.
|
|
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
|
License along with this library; if not, write to the Free
|
1999-09-09 02:56:20 +00:00
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
1999-02-25 15:41:17 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2001-04-30 17:43:34 +00:00
|
|
|
|
#include <Foundation/NSGeometry.h>
|
1999-02-25 15:41:17 +00:00
|
|
|
|
#include <Foundation/NSString.h>
|
|
|
|
|
#include <Foundation/NSArray.h>
|
|
|
|
|
#include <Foundation/NSValue.h>
|
|
|
|
|
#include <Foundation/NSDictionary.h>
|
|
|
|
|
#include <Foundation/NSException.h>
|
|
|
|
|
#include <Foundation/NSData.h>
|
1999-03-05 15:47:22 +00:00
|
|
|
|
#include <Foundation/NSLock.h>
|
1999-06-06 19:33:13 +00:00
|
|
|
|
#include <Foundation/NSRunLoop.h>
|
2002-03-28 03:53:18 +00:00
|
|
|
|
#include <Foundation/NSSet.h>
|
1999-05-06 09:10:24 +00:00
|
|
|
|
#include <Foundation/NSThread.h>
|
1999-02-25 15:41:17 +00:00
|
|
|
|
#include <Foundation/NSZone.h>
|
|
|
|
|
#include "AppKit/NSGraphicsContext.h"
|
1999-05-02 01:34:06 +00:00
|
|
|
|
#include "AppKit/NSAffineTransform.h"
|
|
|
|
|
#include "AppKit/NSWindow.h"
|
|
|
|
|
#include "AppKit/NSView.h"
|
2001-04-29 22:30:52 +00:00
|
|
|
|
#include "AppKit/DPSOperators.h"
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
|
|
|
|
/* The memory zone where all global objects are allocated from (Contexts
|
|
|
|
|
are also allocated from this zone) */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
static NSZone *_globalGSZone = NULL;
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
|
|
|
|
/* The current concrete class */
|
|
|
|
|
static Class defaultNSGraphicsContextClass = NULL;
|
|
|
|
|
|
|
|
|
|
/* Class variable for holding pointers to method functions */
|
|
|
|
|
static NSMutableDictionary *classMethodTable;
|
|
|
|
|
|
1999-03-05 15:47:22 +00:00
|
|
|
|
/* Lock for use when creating contexts */
|
|
|
|
|
static NSRecursiveLock *contextLock = nil;
|
|
|
|
|
|
1999-05-10 08:30:14 +00:00
|
|
|
|
#ifndef GNUSTEP_BASE_LIBRARY
|
|
|
|
|
static NSString *NSGraphicsContextThreadKey = @"NSGraphicsContextThreadKey";
|
|
|
|
|
#endif
|
2002-04-01 17:34:08 +00:00
|
|
|
|
static NSString *NSGraphicsContextStackKey = @"NSGraphicsContextStackKey";
|
1999-05-10 08:30:14 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Function for rapid access to current graphics context.
|
|
|
|
|
*/
|
|
|
|
|
NSGraphicsContext *GSCurrentContext()
|
|
|
|
|
{
|
|
|
|
|
#ifdef GNUSTEP_BASE_LIBRARY
|
|
|
|
|
/*
|
|
|
|
|
* gstep-base has a faster mechanism to get the current thread.
|
|
|
|
|
*/
|
|
|
|
|
NSThread *th = GSCurrentThread();
|
|
|
|
|
|
|
|
|
|
return (NSGraphicsContext*) th->_gcontext;
|
|
|
|
|
#else
|
1999-06-04 04:26:07 +00:00
|
|
|
|
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
|
1999-05-10 08:30:14 +00:00
|
|
|
|
|
|
|
|
|
return (NSGraphicsContext*) [dict objectForKey: NSGraphicsContextThreadKey];
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
1999-03-05 15:47:22 +00:00
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
@interface NSGraphicsContext (Private)
|
|
|
|
|
+ (gsMethodTable *) _initializeMethodTable;
|
|
|
|
|
@end
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/**
|
|
|
|
|
<unit>
|
|
|
|
|
<heading>NSGraphicsContext</heading>
|
|
|
|
|
|
|
|
|
|
<p>This is an abstract class which provides a framework for a device
|
|
|
|
|
independant drawing.
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>In addition, this class provides methods to perform the actual
|
|
|
|
|
drawing. As a convenience, you can also access these through various
|
|
|
|
|
function interfaces. One is a Display Postscript interface using PS
|
|
|
|
|
and DPS opeterations. Another is a Quartz interface (not yet written).
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
</unit> */
|
1999-02-25 15:41:17 +00:00
|
|
|
|
@implementation NSGraphicsContext
|
|
|
|
|
|
|
|
|
|
+ (void) initialize
|
|
|
|
|
{
|
1999-03-05 15:47:22 +00:00
|
|
|
|
if (contextLock == nil)
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
1999-03-05 15:47:22 +00:00
|
|
|
|
[gnustep_global_lock lock];
|
|
|
|
|
if (contextLock == nil)
|
|
|
|
|
{
|
|
|
|
|
contextLock = [NSRecursiveLock new];
|
|
|
|
|
defaultNSGraphicsContextClass = [NSGraphicsContext class];
|
|
|
|
|
_globalGSZone = NSDefaultMallocZone();
|
|
|
|
|
classMethodTable =
|
|
|
|
|
[[NSMutableDictionary allocWithZone: _globalGSZone] init];
|
|
|
|
|
}
|
|
|
|
|
[gnustep_global_lock unlock];
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
+ (void) initializeBackend
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Set the concrete subclass that will provide the device dependant
|
|
|
|
|
implementation.
|
|
|
|
|
*/
|
1999-02-25 15:41:17 +00:00
|
|
|
|
+ (void) setDefaultContextClass: (Class)defaultContextClass
|
|
|
|
|
{
|
|
|
|
|
defaultNSGraphicsContextClass = defaultContextClass;
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/** Set the current context that will handle drawing. */
|
1999-05-10 08:30:14 +00:00
|
|
|
|
+ (void) setCurrentContext: (NSGraphicsContext *)context
|
|
|
|
|
{
|
|
|
|
|
#ifdef GNUSTEP_BASE_LIBRARY
|
1999-04-19 14:34:50 +00:00
|
|
|
|
/*
|
|
|
|
|
* gstep-base has a faster mechanism to get the current thread.
|
|
|
|
|
*/
|
1999-05-10 08:30:14 +00:00
|
|
|
|
NSThread *th = GSCurrentThread();
|
1999-04-19 14:34:50 +00:00
|
|
|
|
|
2000-02-19 00:40:47 +00:00
|
|
|
|
ASSIGN(th->_gcontext, context);
|
1999-05-10 08:30:14 +00:00
|
|
|
|
#else
|
1999-06-04 04:26:07 +00:00
|
|
|
|
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
|
1999-03-05 15:47:22 +00:00
|
|
|
|
|
1999-05-10 08:30:14 +00:00
|
|
|
|
[dict setObject: context forKey: NSGraphicsContextThreadKey];
|
|
|
|
|
#endif
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/** Returns the current context. Also see the convienience function
|
|
|
|
|
GSCurrentContext() */
|
1999-02-25 15:41:17 +00:00
|
|
|
|
+ (NSGraphicsContext *) currentContext
|
|
|
|
|
{
|
1999-05-10 08:30:14 +00:00
|
|
|
|
return GSCurrentContext();
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/** Returns YES if the current context is a display context */
|
2001-08-04 14:43:31 +00:00
|
|
|
|
+ (BOOL) currentContextDrawingToScreen
|
|
|
|
|
{
|
|
|
|
|
return [GSCurrentContext() isDrawingToScreen];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/**
|
|
|
|
|
<p>Create a graphics context with attributes, which contains key/value
|
|
|
|
|
pairs which describe the specifics of how the context is to
|
|
|
|
|
be initialized.
|
|
|
|
|
</p>
|
|
|
|
|
*/
|
2002-01-26 04:14:38 +00:00
|
|
|
|
+ (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes
|
2001-08-04 14:43:31 +00:00
|
|
|
|
{
|
2001-11-08 18:26:39 +00:00
|
|
|
|
NSGraphicsContext *ctxt;
|
|
|
|
|
if (self == [NSGraphicsContext class])
|
|
|
|
|
{
|
|
|
|
|
NSAssert(defaultNSGraphicsContextClass,
|
|
|
|
|
@"Internal Error: No default NSGraphicsContext set\n");
|
|
|
|
|
ctxt = [[defaultNSGraphicsContextClass allocWithZone: _globalGSZone]
|
2002-01-26 04:14:38 +00:00
|
|
|
|
initWithContextInfo: attributes];
|
2001-11-08 18:26:39 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2002-01-26 04:14:38 +00:00
|
|
|
|
ctxt = [[self allocWithZone: _globalGSZone] initWithContextInfo: attributes];
|
2002-02-27 09:40:22 +00:00
|
|
|
|
|
|
|
|
|
return AUTORELEASE(ctxt);
|
2001-08-04 14:43:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/**
|
|
|
|
|
Create graphics context with attributes speficied by aWindow's
|
|
|
|
|
device description. */
|
2001-08-04 14:43:31 +00:00
|
|
|
|
+ (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow
|
|
|
|
|
{
|
|
|
|
|
return [self graphicsContextWithAttributes: [aWindow deviceDescription]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ (void) restoreGraphicsState
|
|
|
|
|
{
|
2002-04-01 17:34:08 +00:00
|
|
|
|
NSGraphicsContext *ctxt;
|
|
|
|
|
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
|
|
|
|
|
NSMutableArray *stack = [dict objectForKey: NSGraphicsContextStackKey];
|
|
|
|
|
if (stack == nil || [stack count] == 0)
|
|
|
|
|
{
|
|
|
|
|
[NSException raise: NSGenericException
|
|
|
|
|
format: @"restoreGraphicsState without previous save"];
|
|
|
|
|
}
|
|
|
|
|
ctxt = [stack lastObject];
|
|
|
|
|
[NSGraphicsContext setCurrentContext: ctxt];
|
|
|
|
|
[stack removeLastObject];
|
|
|
|
|
[ctxt restoreGraphicsState];
|
2001-08-04 14:43:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ (void) saveGraphicsState
|
|
|
|
|
{
|
2002-04-01 17:34:08 +00:00
|
|
|
|
NSGraphicsContext *ctxt;
|
|
|
|
|
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
|
|
|
|
|
NSMutableArray *stack = [dict objectForKey: NSGraphicsContextStackKey];
|
|
|
|
|
if (stack == nil)
|
|
|
|
|
{
|
|
|
|
|
stack = [[NSMutableArray allocWithZone: _globalGSZone] init];
|
|
|
|
|
[dict setObject: stack forKey: NSGraphicsContextStackKey];
|
|
|
|
|
}
|
|
|
|
|
ctxt = GSCurrentContext();
|
|
|
|
|
[ctxt saveGraphicsState];
|
|
|
|
|
[stack addObject: ctxt];
|
2001-08-04 14:43:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+ (void) setGraphicsState: (int)graphicsState
|
|
|
|
|
{
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/* FIXME: Need to keep a table of which context goes with a graphicState,
|
|
|
|
|
or perhaps we could rely on the backend? */
|
|
|
|
|
[self notImplemented: _cmd];
|
2001-08-04 14:43:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
- (void) dealloc
|
|
|
|
|
{
|
1999-03-05 15:47:22 +00:00
|
|
|
|
DESTROY(focus_stack);
|
1999-02-25 15:41:17 +00:00
|
|
|
|
DESTROY(context_data);
|
|
|
|
|
DESTROY(context_info);
|
|
|
|
|
[super dealloc];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (id) init
|
|
|
|
|
{
|
|
|
|
|
return [self initWithContextInfo: NULL];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* designated initializer for the NSGraphicsContext class */
|
|
|
|
|
- (id) initWithContextInfo: (NSDictionary *)info
|
|
|
|
|
{
|
|
|
|
|
[super init];
|
1999-03-05 15:47:22 +00:00
|
|
|
|
|
2001-08-04 14:43:31 +00:00
|
|
|
|
ASSIGN(context_info, info);
|
1999-03-05 15:47:22 +00:00
|
|
|
|
focus_stack = [[NSMutableArray allocWithZone: [self zone]]
|
|
|
|
|
initWithCapacity: 1];
|
2001-11-20 05:00:20 +00:00
|
|
|
|
usedFonts = nil;
|
1999-03-05 15:47:22 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The classMethodTable dictionary and the list of all contexts must both
|
|
|
|
|
* be protected from other threads.
|
|
|
|
|
*/
|
|
|
|
|
[contextLock lock];
|
1999-02-25 15:41:17 +00:00
|
|
|
|
if (!(methods = [[classMethodTable objectForKey: [self class]] pointerValue]))
|
|
|
|
|
{
|
|
|
|
|
methods = [[self class] _initializeMethodTable];
|
|
|
|
|
[classMethodTable setObject: [NSValue valueWithPointer: methods]
|
|
|
|
|
forKey: [self class]];
|
|
|
|
|
}
|
1999-03-05 15:47:22 +00:00
|
|
|
|
[contextLock unlock];
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
2001-08-04 14:43:31 +00:00
|
|
|
|
- (NSDictionary *) attributes
|
|
|
|
|
{
|
|
|
|
|
return context_info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)flushGraphics
|
|
|
|
|
{
|
2002-04-01 17:34:08 +00:00
|
|
|
|
[self subclassResponsibility: _cmd];
|
2001-08-04 14:43:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void *)graphicsPort
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
- (BOOL) isDrawingToScreen
|
|
|
|
|
{
|
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) restoreGraphicsState
|
|
|
|
|
{
|
2002-04-01 17:34:08 +00:00
|
|
|
|
[self DPSgrestore];
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) saveGraphicsState
|
|
|
|
|
{
|
2002-04-01 17:34:08 +00:00
|
|
|
|
[self DPSgsave];
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void *) focusStack
|
2000-08-03 08:48:22 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
return focus_stack;
|
2000-08-03 08:48:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) setFocusStack: (void *)stack
|
1999-03-05 15:47:22 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
ASSIGN(focus_stack, stack);
|
1999-03-05 15:47:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) setImageInterpolation: (NSImageInterpolation)interpolation
|
1999-03-05 15:47:22 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
_interp = interpolation;
|
1999-03-05 15:47:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (NSImageInterpolation) imageInterpolation
|
1999-03-05 15:47:22 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
return _interp;
|
1999-03-05 15:47:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) setShouldAntialias: (BOOL)antialias
|
1999-06-15 09:23:39 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
_antialias = antialias;
|
1999-06-15 09:23:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (BOOL) shouldAntialias
|
1999-06-15 09:23:39 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
return _antialias;
|
1999-06-15 09:23:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (NSView*) focusView
|
1999-06-15 09:23:39 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
return [focus_stack lastObject];
|
1999-07-06 05:37:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) lockFocusView: (NSView*)aView inRect: (NSRect)rect
|
1999-07-29 20:58:04 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
[focus_stack addObject: aView];
|
1999-07-29 20:58:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) unlockFocusView: (NSView*)aView needsFlush: (BOOL)flush
|
2002-01-21 15:45:53 +00:00
|
|
|
|
{
|
2002-03-28 03:53:18 +00:00
|
|
|
|
[focus_stack removeLastObject];
|
2002-01-21 15:45:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-11-20 05:00:20 +00:00
|
|
|
|
- (void) useFont: (NSString*)name
|
|
|
|
|
{
|
|
|
|
|
if ([self isDrawingToScreen] == YES)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (usedFonts == nil)
|
|
|
|
|
usedFonts = RETAIN([NSMutableSet setWithCapacity: 2]);
|
|
|
|
|
|
|
|
|
|
[usedFonts addObject: name];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) resetUsedFonts
|
|
|
|
|
{
|
|
|
|
|
if (usedFonts)
|
|
|
|
|
[usedFonts removeAllObjects];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSSet *) usedFonts
|
|
|
|
|
{
|
|
|
|
|
return usedFonts;
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* Private backend methods */
|
|
|
|
|
- (void) contextDevice: (int)num
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation NSGraphicsContext (Private)
|
|
|
|
|
|
|
|
|
|
/* Build up method table for fast access to methods. Cast to (void *) to
|
|
|
|
|
avoid compiler warnings */
|
|
|
|
|
+ (gsMethodTable *) _initializeMethodTable
|
|
|
|
|
{
|
|
|
|
|
gsMethodTable methodTable;
|
|
|
|
|
gsMethodTable *mptr;
|
|
|
|
|
|
|
|
|
|
#define GET_IMP(X) ((void*) [self instanceMethodForSelector: (X)])
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Color operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPScurrentalpha_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentalpha:));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
methodTable.DPScurrentcmykcolor____ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentcmykcolor::::));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPScurrentgray_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentgray:));
|
|
|
|
|
methodTable.DPScurrenthsbcolor___ =
|
|
|
|
|
GET_IMP(@selector(DPScurrenthsbcolor:::));
|
|
|
|
|
methodTable.DPScurrentrgbcolor___ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentrgbcolor:::));
|
|
|
|
|
methodTable.DPSsetalpha_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetalpha:));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
methodTable.DPSsetcmykcolor____ =
|
|
|
|
|
GET_IMP(@selector(DPSsetcmykcolor::::));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPSsetgray_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetgray:));
|
|
|
|
|
methodTable.DPSsethsbcolor___ =
|
|
|
|
|
GET_IMP(@selector(DPSsethsbcolor:::));
|
|
|
|
|
methodTable.DPSsetrgbcolor___ =
|
|
|
|
|
GET_IMP(@selector(DPSsetrgbcolor:::));
|
|
|
|
|
|
|
|
|
|
methodTable.GSSetFillColorspace_ =
|
|
|
|
|
GET_IMP(@selector(GSSetFillColorspace:));
|
|
|
|
|
methodTable.GSSetStrokeColorspace_ =
|
|
|
|
|
GET_IMP(@selector(GSSetStrokeColorspace:));
|
|
|
|
|
methodTable.GSSetFillColor_ =
|
|
|
|
|
GET_IMP(@selector(GSSetFillColor:));
|
|
|
|
|
methodTable.GSSetStrokeColor_ =
|
|
|
|
|
GET_IMP(@selector(GSSetStrokeColor:));
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* Text operations */
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPSashow___ =
|
|
|
|
|
GET_IMP(@selector(DPSashow:::));
|
|
|
|
|
methodTable.DPSawidthshow______ =
|
|
|
|
|
GET_IMP(@selector(DPSawidthshow::::::));
|
|
|
|
|
methodTable.DPScharpath__ =
|
|
|
|
|
GET_IMP(@selector(DPScharpath::));
|
|
|
|
|
methodTable.DPSshow_ =
|
|
|
|
|
GET_IMP(@selector(DPSshow:));
|
|
|
|
|
methodTable.DPSwidthshow____ =
|
|
|
|
|
GET_IMP(@selector(DPSwidthshow::::));
|
|
|
|
|
methodTable.DPSxshow___ =
|
|
|
|
|
GET_IMP(@selector(DPSxshow:::));
|
|
|
|
|
methodTable.DPSxyshow___ =
|
|
|
|
|
GET_IMP(@selector(DPSxyshow:::));
|
|
|
|
|
methodTable.DPSyshow___ =
|
|
|
|
|
GET_IMP(@selector(DPSyshow:::));
|
|
|
|
|
|
|
|
|
|
methodTable.GSSetCharacterSpacing_ =
|
|
|
|
|
GET_IMP(@selector(GSSetCharacterSpacing:));
|
|
|
|
|
methodTable.GSSetFont_ =
|
|
|
|
|
GET_IMP(@selector(GSSetFont:));
|
|
|
|
|
methodTable.GSSetFontSize_ =
|
|
|
|
|
GET_IMP(@selector(GSSetFontSize:));
|
|
|
|
|
methodTable.GSGetTextCTM =
|
|
|
|
|
GET_IMP(@selector(GSGetTextCTM));
|
|
|
|
|
methodTable.GSGetTextPosition =
|
|
|
|
|
GET_IMP(@selector(GSGetTextPosition));
|
|
|
|
|
methodTable.GSSetTextCTM_ =
|
|
|
|
|
GET_IMP(@selector(GSSetTextCTM:));
|
|
|
|
|
methodTable.GSSetTextDrawingMode_ =
|
|
|
|
|
GET_IMP(@selector(GSSetTextDrawingMode:));
|
|
|
|
|
methodTable.GSSetTextPosition_ =
|
|
|
|
|
GET_IMP(@selector(GSSetTextPosition:));
|
|
|
|
|
methodTable.GSShowText__ =
|
|
|
|
|
GET_IMP(@selector(GSShowText::));
|
|
|
|
|
methodTable.GSShowGlyphs__ =
|
|
|
|
|
GET_IMP(@selector(GSShowGlyphs::));
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* Gstate Handling */
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPScurrentgstate_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentgstate:));
|
|
|
|
|
methodTable.DPSgrestore =
|
|
|
|
|
GET_IMP(@selector(DPSgrestore));
|
|
|
|
|
methodTable.DPSgsave =
|
|
|
|
|
GET_IMP(@selector(DPSgsave));
|
|
|
|
|
methodTable.DPSgstate =
|
|
|
|
|
GET_IMP(@selector(DPSgstate));
|
|
|
|
|
methodTable.DPSinitgraphics =
|
|
|
|
|
GET_IMP(@selector(DPSinitgraphics));
|
|
|
|
|
methodTable.DPSsetgstate_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetgstate:));
|
|
|
|
|
|
|
|
|
|
methodTable.GSDefineGState =
|
|
|
|
|
GET_IMP(@selector(GSDefineGState));
|
|
|
|
|
methodTable.GSUndefineGState_ =
|
|
|
|
|
GET_IMP(@selector(GSUndefineGState:));
|
|
|
|
|
methodTable.GSReplaceGState_ =
|
|
|
|
|
GET_IMP(@selector(GSReplaceGState:));
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Gstate operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
methodTable.DPScurrentflat_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentflat:));
|
|
|
|
|
methodTable.DPScurrentlinecap_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentlinecap:));
|
|
|
|
|
methodTable.DPScurrentlinejoin_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentlinejoin:));
|
|
|
|
|
methodTable.DPScurrentlinewidth_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentlinewidth:));
|
|
|
|
|
methodTable.DPScurrentmiterlimit_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentmiterlimit:));
|
|
|
|
|
methodTable.DPScurrentpoint__ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentpoint::));
|
|
|
|
|
methodTable.DPScurrentstrokeadjust_ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentstrokeadjust:));
|
|
|
|
|
methodTable.DPSsetdash___ =
|
|
|
|
|
GET_IMP(@selector(DPSsetdash:::));
|
|
|
|
|
methodTable.DPSsetflat_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetflat:));
|
|
|
|
|
methodTable.DPSsethalftonephase__ =
|
|
|
|
|
GET_IMP(@selector(DPSsethalftonephase::));
|
|
|
|
|
methodTable.DPSsetlinecap_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetlinecap:));
|
|
|
|
|
methodTable.DPSsetlinejoin_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetlinejoin:));
|
|
|
|
|
methodTable.DPSsetlinewidth_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetlinewidth:));
|
|
|
|
|
methodTable.DPSsetmiterlimit_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetmiterlimit:));
|
|
|
|
|
methodTable.DPSsetstrokeadjust_ =
|
|
|
|
|
GET_IMP(@selector(DPSsetstrokeadjust:));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
|
1999-05-11 15:43:10 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* Matrix operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPSconcat_ =
|
|
|
|
|
GET_IMP(@selector(DPSconcat:));
|
|
|
|
|
methodTable.DPSinitmatrix =
|
|
|
|
|
GET_IMP(@selector(DPSinitmatrix));
|
|
|
|
|
methodTable.DPSrotate_ =
|
|
|
|
|
GET_IMP(@selector(DPSrotate:));
|
|
|
|
|
methodTable.DPSscale__ =
|
|
|
|
|
GET_IMP(@selector(DPSscale::));
|
|
|
|
|
methodTable.DPStranslate__ =
|
|
|
|
|
GET_IMP(@selector(DPStranslate::));
|
|
|
|
|
|
|
|
|
|
methodTable.GSCurrentCTM =
|
|
|
|
|
GET_IMP(@selector(GSCurrentCTM));
|
|
|
|
|
methodTable.GSSetCTM_ =
|
|
|
|
|
GET_IMP(@selector(GSSetCTM:));
|
|
|
|
|
methodTable.GSConcatCTM_ =
|
|
|
|
|
GET_IMP(@selector(GSConcatCTM:));
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Paint operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
methodTable.DPSarc_____ =
|
|
|
|
|
GET_IMP(@selector(DPSarc:::::));
|
|
|
|
|
methodTable.DPSarcn_____ =
|
|
|
|
|
GET_IMP(@selector(DPSarcn:::::));
|
|
|
|
|
methodTable.DPSarct_____ =
|
|
|
|
|
GET_IMP(@selector(DPSarct:::::));
|
|
|
|
|
methodTable.DPSclip =
|
|
|
|
|
GET_IMP(@selector(DPSclip));
|
|
|
|
|
methodTable.DPSclosepath =
|
|
|
|
|
GET_IMP(@selector(DPSclosepath));
|
|
|
|
|
methodTable.DPScurveto______ =
|
|
|
|
|
GET_IMP(@selector(DPScurveto::::::));
|
|
|
|
|
methodTable.DPSeoclip =
|
|
|
|
|
GET_IMP(@selector(DPSeoclip));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPSeofill =
|
|
|
|
|
GET_IMP(@selector(DPSeofill));
|
|
|
|
|
methodTable.DPSfill =
|
|
|
|
|
GET_IMP(@selector(DPSfill));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
methodTable.DPSflattenpath =
|
|
|
|
|
GET_IMP(@selector(DPSflattenpath));
|
|
|
|
|
methodTable.DPSinitclip =
|
|
|
|
|
GET_IMP(@selector(DPSinitclip));
|
|
|
|
|
methodTable.DPSlineto__ =
|
|
|
|
|
GET_IMP(@selector(DPSlineto::));
|
|
|
|
|
methodTable.DPSmoveto__ =
|
|
|
|
|
GET_IMP(@selector(DPSmoveto::));
|
|
|
|
|
methodTable.DPSnewpath =
|
|
|
|
|
GET_IMP(@selector(DPSnewpath));
|
|
|
|
|
methodTable.DPSpathbbox____ =
|
|
|
|
|
GET_IMP(@selector(DPSpathbbox::::));
|
|
|
|
|
methodTable.DPSrcurveto______ =
|
|
|
|
|
GET_IMP(@selector(DPSrcurveto::::::));
|
|
|
|
|
methodTable.DPSrectclip____ =
|
|
|
|
|
GET_IMP(@selector(DPSrectclip::::));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPSrectfill____ =
|
|
|
|
|
GET_IMP(@selector(DPSrectfill::::));
|
|
|
|
|
methodTable.DPSrectstroke____ =
|
|
|
|
|
GET_IMP(@selector(DPSrectstroke::::));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
methodTable.DPSreversepath =
|
|
|
|
|
GET_IMP(@selector(DPSreversepath));
|
|
|
|
|
methodTable.DPSrlineto__ =
|
|
|
|
|
GET_IMP(@selector(DPSrlineto::));
|
|
|
|
|
methodTable.DPSrmoveto__ =
|
|
|
|
|
GET_IMP(@selector(DPSrmoveto::));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPSstroke =
|
|
|
|
|
GET_IMP(@selector(DPSstroke));
|
|
|
|
|
|
|
|
|
|
methodTable.GSSendBezierPath_ =
|
|
|
|
|
GET_IMP(@selector(GSSendBezierPath:));
|
|
|
|
|
methodTable.GSRectClipList__ =
|
|
|
|
|
GET_IMP(@selector(GSRectClipList::));
|
|
|
|
|
methodTable.GSRectFillList__ =
|
|
|
|
|
GET_IMP(@selector(GSRectFillList::));
|
|
|
|
|
|
2001-09-03 04:10:36 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* Window system ops */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
methodTable.DPScurrentgcdrawable____ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentgcdrawable::::));
|
|
|
|
|
methodTable.DPScurrentoffset__ =
|
|
|
|
|
GET_IMP(@selector(DPScurrentoffset::));
|
|
|
|
|
methodTable.DPSsetgcdrawable____ =
|
|
|
|
|
GET_IMP(@selector(DPSsetgcdrawable::::));
|
|
|
|
|
methodTable.DPSsetoffset__ =
|
|
|
|
|
GET_IMP(@selector(DPSsetoffset::));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
|
1999-05-18 16:49:13 +00:00
|
|
|
|
/*-------------------------------------------------------------------------*/
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* Graphics Extensions Ops */
|
1999-05-18 16:49:13 +00:00
|
|
|
|
/*-------------------------------------------------------------------------*/
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPScomposite________ =
|
1999-05-18 16:49:13 +00:00
|
|
|
|
GET_IMP(@selector(DPScomposite::::::::));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPScompositerect_____ =
|
1999-05-18 16:49:13 +00:00
|
|
|
|
GET_IMP(@selector(DPScompositerect:::::));
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.DPSdissolve________ =
|
1999-05-18 16:49:13 +00:00
|
|
|
|
GET_IMP(@selector(DPSdissolve::::::::));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.GSDrawImage__ =
|
|
|
|
|
GET_IMP(@selector(GSDrawImage::));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Postscript Client functions */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
methodTable.DPSPrintf__ =
|
|
|
|
|
GET_IMP(@selector(DPSPrintf::));
|
|
|
|
|
methodTable.DPSWriteData__ =
|
|
|
|
|
GET_IMP(@selector(DPSWriteData::));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* NSGraphics Ops */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
methodTable.NSReadPixel_ =
|
|
|
|
|
GET_IMP(@selector(NSReadPixel:));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
methodTable.NSBeep =
|
|
|
|
|
GET_IMP(@selector(NSBeep));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* Context helper wraps */
|
|
|
|
|
methodTable.GSWSetViewIsFlipped_ =
|
|
|
|
|
GET_IMP(@selector(GSWSetViewIsFlipped:));
|
|
|
|
|
methodTable.GSWViewIsFlipped =
|
|
|
|
|
GET_IMP(@selector(GSWViewIsFlipped));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/*
|
|
|
|
|
* Render Bitmap Images
|
|
|
|
|
*/
|
|
|
|
|
methodTable.NSDrawBitmap___________ =
|
|
|
|
|
GET_IMP(@selector(NSDrawBitmap:::::::::::));
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
mptr = NSZoneMalloc(_globalGSZone, sizeof(gsMethodTable));
|
|
|
|
|
memcpy(mptr, &methodTable, sizeof(gsMethodTable));
|
|
|
|
|
return mptr;
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
@end
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The 'Ops' catagory contains the methods to implement all the
|
|
|
|
|
* PostScript functions. In this abstract class, these will all
|
|
|
|
|
* raise an exception. Concrete instances of the NSGraphicsContext
|
|
|
|
|
* class should override these methods in order to implement the
|
|
|
|
|
* PostScript functions.
|
|
|
|
|
*/
|
|
|
|
|
@implementation NSGraphicsContext (Ops)
|
1999-02-25 15:41:17 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Color operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Returns the current alpha component */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentalpha: (float *)a
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Returns the current color according to the CMYK color model */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentcmykcolor: (float*)c : (float*)m : (float*)y : (float*)k
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Returns the gray-level equivalent in the current color space. The
|
|
|
|
|
value may depend on the current color space and may be 0 if the
|
|
|
|
|
current color space has no notion of a gray value */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentgray: (float*)gray
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Returns the current color according to the HSB color model. */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrenthsbcolor: (float*)h : (float*)s : (float*)b
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Returns the current color according to the RGB color model */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentrgbcolor: (float*)r : (float*)g : (float*)b
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Sets the alpha drawing component. For this and other color setting
|
|
|
|
|
commands that have no differentiation between fill and stroke colors,
|
|
|
|
|
both the fill and stroke alpha are set. */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetalpha: (float)a
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Sets the current colorspace to Device CMYK and the current color
|
|
|
|
|
based on the indicated values. For this and other color setting
|
|
|
|
|
commands that have no differentiation between fill and stroke colors,
|
|
|
|
|
both the fill and stroke colors are set. */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Sets the current colorspace to Device Gray and the current gray value */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetgray: (float)gray
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Sets the current colorspace to Device RGB and the current color based on
|
|
|
|
|
the indicated values */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsethsbcolor: (float)h : (float)s : (float)b
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Sets the current colorspace to Device RGB and the current color based on
|
|
|
|
|
the indicated values */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetrgbcolor: (float)r : (float)g : (float)b
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/**
|
|
|
|
|
<p>Sets the colorspace for fill operations based on values in the supplied
|
|
|
|
|
dictionary dict.</p>
|
|
|
|
|
<p>For device colorspaces (GSDeviceGray, GSDeviceRGB,
|
|
|
|
|
GSDeviceCMYK), only the name of the colorspace needs to be set
|
|
|
|
|
using the GSColorSpaceName key.</p>
|
|
|
|
|
<p>Other colorspaces will be documented later</p>
|
|
|
|
|
*/
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetFillColorspace: (NSDictionary *)dict
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Sets the colorspace for stroke operations based on the values in
|
|
|
|
|
the supplied dictionary. See -GSSetFillColorspace: for a
|
|
|
|
|
description of the values that need to be supplied */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetStrokeColorspace: (NSDictionary *)dict
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Sets the current color for fill operations. The values array
|
|
|
|
|
should have n components, where n corresponds to the number of
|
|
|
|
|
color components required to specify the color in the current
|
|
|
|
|
colorspace. */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetFillColor: (float *)values
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-01 17:34:08 +00:00
|
|
|
|
/** Sets the current color for fill operations. The values array
|
|
|
|
|
should have n components, where n corresponds to the number of
|
|
|
|
|
color components required to specify the color in the current
|
|
|
|
|
colorspace. */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetStrokeColor: (float *)values
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Text operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
- (void) DPSashow: (float)x : (float)y : (const char *)s
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char *)s
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScharpath: (const char *)s : (int)b
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSshow: (const char *)s
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char *)s
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSxshow: (const char *)s : (const float*)numarray : (int)size
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSxyshow: (const char *)s : (const float*)numarray : (int)size
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSyshow: (const char *)s : (const float*)numarray : (int)size
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetCharacterSpacing: (float)extra
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetFont: (NSFont*)font
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetFontSize: (float)size
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (NSAffineTransform *) GSGetTextCTM
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
2002-03-28 03:53:18 +00:00
|
|
|
|
return nil;
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (NSPoint) GSGetTextPosition
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
2002-03-28 03:53:18 +00:00
|
|
|
|
return NSMakePoint(0,0);
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetTextCTM: (NSAffineTransform *)ctm
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetTextPosition: (NSPoint)loc
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSShowText: (const char *)string : (size_t) length
|
2001-09-03 04:10:36 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length
|
2001-09-03 04:10:36 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* Gstate Handling */
|
1999-02-25 15:41:17 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentgstate: (int)gst
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSgrestore
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSgsave
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSgstate
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSinitgraphics
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetgstate: (int)gst
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (int) GSDefineGState
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
2002-03-28 03:53:18 +00:00
|
|
|
|
return 0;
|
1999-02-25 15:41:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSUndefineGState: (int)gst
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSReplaceGState: (int)gst
|
1999-02-25 15:41:17 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Gstate operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
- (void) DPScurrentflat: (float*)flatness
|
1999-05-18 16:49:13 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentlinecap: (int*)linecap
|
1999-05-18 16:49:13 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentlinejoin: (int*)linejoin
|
1999-05-18 16:49:13 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentlinewidth: (float*)width
|
1999-05-18 16:49:13 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentmiterlimit: (float*)limit
|
1999-05-18 16:49:13 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentpoint: (float*)x : (float*)y
|
1999-05-18 16:49:13 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentstrokeadjust: (int*)b
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetdash: (const float*)pat : (int)size : (float)offset
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetflat: (float)flatness
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsethalftonephase: (float)x : (float)y
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetlinecap: (int)linecap
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetlinejoin: (int)linejoin
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetlinewidth: (float)width
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetmiterlimit: (float)limit
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetstrokeadjust: (int)b
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Matrix operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
- (void) DPSconcat: (const float*)m
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSinitmatrix
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSrotate: (float)angle
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSscale: (float)x : (float)y
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPStranslate: (float)x : (float)y
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (NSAffineTransform *) GSCurrentCTM
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
2002-03-28 03:53:18 +00:00
|
|
|
|
return nil;
|
1999-10-21 18:08:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSetCTM: (NSAffineTransform *)ctm
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSConcatCTM: (NSAffineTransform *)ctm
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Paint operations */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
- (void) DPSarc: (float)x : (float)y : (float)r : (float)angle1
|
|
|
|
|
: (float)angle2
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSarcn: (float)x : (float)y : (float)r : (float)angle1
|
|
|
|
|
: (float)angle2
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r;
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSclip
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSclosepath
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2
|
|
|
|
|
: (float)x3 : (float)y3
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSeoclip
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSeofill
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSfill
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSflattenpath
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSinitclip
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSlineto: (float)x : (float)y
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSmoveto: (float)x : (float)y
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSnewpath
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSpathbbox: (float*)llx : (float*)lly : (float*)urx : (float*)ury
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2
|
|
|
|
|
: (float)x3 : (float)y3
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSrectclip: (float)x : (float)y : (float)w : (float)h
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSrectfill: (float)x : (float)y : (float)w : (float)h
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSrectstroke: (float)x : (float)y : (float)w : (float)h
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSreversepath
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSrlineto: (float)x : (float)y
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSrmoveto: (float)x : (float)y
|
1999-10-21 18:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSstroke
|
1999-10-29 18:43:48 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSSendBezierPath: (NSBezierPath *)path
|
1999-10-29 18:43:48 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSRectClipList: (const NSRect *)rects : (int) count
|
1999-10-29 18:43:48 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSRectFillList: (const NSRect *)rects : (int) count
|
1999-10-29 18:43:48 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Window system ops */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
- (void) DPScurrentgcdrawable: (void **)gc : (void **)draw : (int *)x : (int *)y
|
1999-10-29 18:43:48 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScurrentoffset: (int *)x : (int *)y
|
1999-10-29 18:43:48 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetgcdrawable: (void *)gc : (void *)draw : (int)x : (int)y
|
1999-12-04 19:44:09 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSsetoffset: (short int)x : (short int)y
|
1999-12-06 13:32:01 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
|
/* Graphics Extension Ops */
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
|
- (void) DPScomposite: (float)x : (float)y : (float)w : (float)h
|
|
|
|
|
: (int)gstateNum : (float)dx : (float)dy : (int)op
|
1999-06-09 08:54:08 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
2000-03-06 21:21:59 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPScompositerect: (float)x : (float)y : (float)w : (float)h : (int)op
|
2000-03-06 21:21:59 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
2000-04-20 22:17:42 +00:00
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h
|
|
|
|
|
: (int)gstateNum : (float)dx : (float)dy : (float)delta
|
2000-04-20 22:17:42 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-28 03:53:18 +00:00
|
|
|
|
- (void) GSDrawImage: (NSRect) rect: (void *) imageref
|
2000-04-20 22:17:42 +00:00
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2001-10-16 02:09:09 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* Client functions */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
- (void) DPSPrintf: (char *)fmt : (va_list)args
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) DPSWriteData: (char *)buf : (unsigned int)count
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2001-04-29 22:30:52 +00:00
|
|
|
|
@end
|
|
|
|
|
|
2001-04-13 20:04:04 +00:00
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
/* NSGraphics Ops */
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
2002-03-28 03:53:18 +00:00
|
|
|
|
@implementation NSGraphicsContext (NSGraphics)
|
2001-04-13 20:04:04 +00:00
|
|
|
|
/*
|
|
|
|
|
* Read the Color at a Screen Position
|
|
|
|
|
*/
|
|
|
|
|
- (NSColor *) NSReadPixel: (NSPoint) location
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
return nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Render Bitmap Images
|
|
|
|
|
*/
|
|
|
|
|
- (void) NSDrawBitmap: (NSRect) rect : (int) pixelsWide : (int) pixelsHigh
|
|
|
|
|
: (int) bitsPerSample : (int) samplesPerPixel
|
|
|
|
|
: (int) bitsPerPixel : (int) bytesPerRow : (BOOL) isPlanar
|
|
|
|
|
: (BOOL) hasAlpha : (NSString *) colorSpaceName
|
|
|
|
|
: (const unsigned char *const [5]) data
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Play the System Beep
|
|
|
|
|
*/
|
|
|
|
|
- (void) NSBeep
|
|
|
|
|
{
|
|
|
|
|
[self subclassResponsibility: _cmd];
|
|
|
|
|
}
|
|
|
|
|
|
2001-04-29 22:30:52 +00:00
|
|
|
|
- (void) GSWSetViewIsFlipped: (BOOL) flipped
|
2001-04-13 20:04:04 +00:00
|
|
|
|
{
|
2001-04-29 22:30:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) GSWViewIsFlipped
|
|
|
|
|
{
|
|
|
|
|
return [[self focusView] isFlipped];
|
2001-04-13 20:04:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-02-25 15:41:17 +00:00
|
|
|
|
@end
|