home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * (a) (C) 1990 by Adobe Systems Incorporated. All rights reserved.
- *
- * (b) If this Sample Code is distributed as part of the Display PostScript
- * System Software Development Kit from Adobe Systems Incorporated,
- * then this copy is designated as Development Software and its use is
- * subject to the terms of the License Agreement attached to such Kit.
- *
- * (c) If this Sample Code is distributed independently, then the following
- * terms apply:
- *
- * (d) This file may be freely copied and redistributed as long as:
- * 1) Parts (a), (d), (e) and (f) continue to be included in the file,
- * 2) If the file has been modified in any way, a notice of such
- * modification is conspicuously indicated.
- *
- * (e) PostScript, Display PostScript, and Adobe are registered trademarks of
- * Adobe Systems Incorporated.
- *
- * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
- * CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
- * AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
- * ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
- * OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
- * WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
- * WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
- * DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS.
- */
-
- /*
- * DrawView.h
- * Created by Ken Anderson, Ken Fromm
- *
- * The purpose of the application is to show different methods for drawing paths and
- * the times obtained for each method. Lines are used in the construction of the paths
- * but curves and arcs could be used as well.
- *
- * This file contains the class definition for DrawView, a subclass of View.
- * Instance Variable:
- * Each index for the arrays below corresponds to one line.
- * X[ ], Y[ ] - Initial points, used with moveto. Selected randomly.
- * X1[ ], Y1[ ] - End points, used with lineto. Selected randomly.
- * C[ ], W[ ] - Line color and line width. Chosen specifically/selected randomly.
- * LineColor, LineWidth - The current line color and line width as passed in by
- * the sliders.
- *
- * TotalLines - the number of lines that have been made for a draw operation.
- * PSTrace - Boolean value indicating whether to trace the PostScript.
- * Random - Boolean value indicating whether to select the line color and line
- * width at random or to use the current values of the slider controls.
- *
- * matrixDisplayTimes - id to identify to display the display time fields.
- * enableSliderColor, enableSliderWidth - id's of sliders.
- *
- * Version: 2.0
- * Author: Ken Fromm
- * History:
- * 03-07-91 Added this comment.
- */
-
- #import <appkit/appkit.h>
- #import <appkit/View.h>
-
- #define MAXARRAY 1000 /* Maximum size of line arrays */
- #define MAXWIDTH 5 /* Maximum line width */
-
- #define BGCOLOR 0.333 /* Background color */
- #define BGSTRCOLOR 0.0 /* Background stroke color */
- #define BGSTRWIDTH 2.0 /* Background stroke width */
-
- #define DRAWALL 0xf8 /* Draw with all methods */
-
- @interface DrawView : View
- {
- float X[MAXARRAY], Y[MAXARRAY], X1[MAXARRAY], Y1[MAXARRAY],
- C[MAXARRAY], W[MAXARRAY], LineColor, LineWidth;
-
- int TotalLines;
-
- BOOL PSTrace, Random;
-
- id matrixDisplayTimes, sliderColor, sliderWidth, fieldTotalLines;
-
- union {
- struct {
- unsigned char singleops:1;
- unsigned char wraps:1;
- unsigned char bind:1;
- unsigned char repeat:1;
- unsigned char optimized:1;
- unsigned char PADDING:3;
- } flags;
- unsigned char field;
- } drawFlags;
- }
-
- -initFrame:(NXRect *) frm;
-
- -free;
-
- -setMatrixDisplayTimes:anObject;
- -setSliderColor:anObject;
- -setSliderWidth:anObject;
- -setFieldTotalLines:anObject;
-
- -selectColorWidth:sender;
- -changeLineColor:sender;
- -changeLineWidth:sender;
- -psTrace:sender;
-
- -eraseTimes:sender;
- -makeLines:sender;
- -clearLines:sender;
-
- -drawViewOne:sender;
- -drawViewAll:sender;
-
- -drawSingleOps:(int) cell;
- -drawWraps:(int) cell;
- -drawWrapsBind:(int) cell;
- -drawWrapsRepeat:(int) cell;
- -drawOptimizedStroke:(int) cell;
-
- -drawSelf:(NXRect *)r :(int) count;
-
- @end
-