2002-03-27 23:44:41 +00:00
|
|
|
/* GSGState - Implements generic graphic state drawing for non-PS backends
|
|
|
|
|
|
|
|
Copyright (C) 1995 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Adam Fedor <fedor@boulder.colorado.edu>
|
|
|
|
Date: Nov 1995
|
|
|
|
Extracted from XGPS: Fred Kiefer <FredKiefer@gmx.de>
|
|
|
|
Date: March 2002
|
|
|
|
|
|
|
|
This file is part of the GNU Objective C User Interface Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-10-29 23:25:10 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2002-03-27 23:44:41 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2007-10-29 23:25:10 +00:00
|
|
|
version 3 of the License, or (at your option) any later version.
|
|
|
|
|
2002-03-27 23:44:41 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-10-29 23:25:10 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, see <http://www.gnu.org/licenses/> or write to the
|
|
|
|
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
2002-03-27 23:44:41 +00:00
|
|
|
|
|
|
|
#ifndef _GSGState_h_INCLUDE
|
|
|
|
#define _GSGState_h_INCLUDE
|
|
|
|
|
|
|
|
#include <AppKit/NSGraphicsContext.h> // needed for NSCompositingOperation
|
|
|
|
#include <Foundation/NSArray.h>
|
|
|
|
#include <Foundation/NSObject.h>
|
2002-05-10 15:06:17 +00:00
|
|
|
#include <gsc/gscolors.h>
|
2002-03-27 23:44:41 +00:00
|
|
|
|
|
|
|
@class NSAffineTransform;
|
|
|
|
@class NSBezierPath;
|
|
|
|
@class NSFont;
|
|
|
|
@class GSContext;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
path_stroke, path_fill, path_eofill, path_clip, path_eoclip
|
|
|
|
} ctxt_object_t;
|
|
|
|
|
2002-05-10 15:06:17 +00:00
|
|
|
typedef enum {
|
|
|
|
COLOR_STROKE = 1,
|
|
|
|
COLOR_FILL = 2,
|
|
|
|
COLOR_BOTH = 3 /* COLOR_BOTH = COLOR_FILL || COLOR_STROKE */
|
|
|
|
} color_state_t;
|
|
|
|
|
2006-10-03 23:29:53 +00:00
|
|
|
@interface GSGState : NSObject <NSCopying>
|
2002-03-27 23:44:41 +00:00
|
|
|
{
|
|
|
|
@public
|
|
|
|
GSContext *drawcontext;
|
|
|
|
NSAffineTransform *ctm;
|
|
|
|
NSPoint offset; /* Offset from Drawable origin */
|
2002-05-10 15:06:17 +00:00
|
|
|
NSBezierPath *path; /* Current path */
|
2002-10-09 03:01:09 +00:00
|
|
|
GSFontInfo *font; /* Current font reference */
|
2002-05-10 15:06:17 +00:00
|
|
|
NSColor *fillColorS; /* Color(space) used for fill drawing */
|
|
|
|
NSColor *strokeColorS; /* Color(space) used for stroke drawing */
|
|
|
|
device_color_t fillColor; /* fill color */
|
|
|
|
device_color_t strokeColor; /* stroke color */
|
|
|
|
color_state_t cstate; /* state last time color was set */
|
2005-07-09 00:10:08 +00:00
|
|
|
NSImage *pattern; /* If set, image to draw with */
|
2002-05-10 15:06:17 +00:00
|
|
|
|
|
|
|
float charSpacing;
|
|
|
|
NSAffineTransform *textCtm; /* Text transform - concat with ctm */
|
|
|
|
GSTextDrawingMode textMode;
|
2002-03-27 23:44:41 +00:00
|
|
|
BOOL viewIsFlipped;
|
|
|
|
}
|
|
|
|
|
|
|
|
- initWithDrawContext: (GSContext *)context;
|
|
|
|
- deepen;
|
|
|
|
|
|
|
|
- (void) setOffset: (NSPoint)theOffset;
|
|
|
|
- (NSPoint) offset;
|
|
|
|
|
2002-08-25 18:54:07 +00:00
|
|
|
- (void) setColor: (device_color_t *)color state: (color_state_t)cState;
|
2005-07-09 00:10:08 +00:00
|
|
|
- (void) GSSetPatterColor: (NSImage*)image;
|
2002-03-27 23:44:41 +00:00
|
|
|
|
|
|
|
- (void) compositeGState: (GSGState *)source
|
|
|
|
fromRect: (NSRect)aRect
|
|
|
|
toPoint: (NSPoint)aPoint
|
|
|
|
op: (NSCompositingOperation)op;
|
|
|
|
|
|
|
|
- (void) dissolveGState: (GSGState *)source
|
|
|
|
fromRect: (NSRect)aRect
|
|
|
|
toPoint: (NSPoint)aPoint
|
|
|
|
delta: (float)delta;
|
|
|
|
|
2005-07-09 00:10:08 +00:00
|
|
|
- (void) compositeGState: (GSGState *)source
|
|
|
|
fromRect: (NSRect)aRect
|
|
|
|
toPoint: (NSPoint)aPoint
|
|
|
|
op: (NSCompositingOperation)op
|
|
|
|
fraction: (float)delta;
|
|
|
|
|
2002-03-27 23:44:41 +00:00
|
|
|
- (void) compositerect: (NSRect)aRect
|
|
|
|
op: (NSCompositingOperation)op;
|
|
|
|
|
|
|
|
- (NSPoint) pointInMatrixSpace: (NSPoint)point;
|
|
|
|
- (NSPoint) deltaPointInMatrixSpace: (NSPoint)point;
|
|
|
|
- (NSRect) rectInMatrixSpace: (NSRect)rect;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#include "GSGStateOps.h"
|
|
|
|
|
|
|
|
#endif /* _GSGState_h_INCLUDE */
|
|
|
|
|